1

The Project API allows you to list projects using

ProjectDataSet data = client.ReadProjectList();
foreach (ProjectDataSet.ProjectRow projectRow in data.Project){...}

This API call is deficient due to the fact that it returns all projects from the working store and not the published store. It seems like your expected to check every project GUID against the published store which is incredibly slow.

int i = projectRow.PROJ_TYPE;
if (i == 0){
    ProjectDataSet publishedProjectDataSet = client.ReadProject(projectRow.PROJ_UID, DataStoreEnum.PublishedStore);
    if (publishedProjectDataSet == null) { continue; }
}

Does anyone know of anyway to quickly list only the published projects?

BigBadOwl
  • 669
  • 2
  • 9
  • 22
  • We use database query for that. I know that Microsoft does not recommend to access their DBs directly, but it is faster and easier to write a simple select statement than do all the overkill with API calls. – melan Mar 25 '14 at 04:03

1 Answers1

2

projectClient.ReadProjectStatus should work . E.g.

 // Get list of all projects.
 SvcProject.ProjectDataSet projectDs = projectClient.ReadProjectStatus(
 Guid.Empty, SvcProject.DataStoreEnum.PublishedStore,
 string.Empty, (int)PSLibrary.Project.ProjectType.Project);

Documentation is located at here.

Appleman1234
  • 15,946
  • 45
  • 67