locked
Is the project published? RRS feed

  • Question

  • How would I determine (via the PSI) if a project is published?  Don't readily see it it as a method or property.

    Thursday, October 7, 2010 8:00 PM

Answers

  • You can call the ReadProject() method which takes two parameters, projectUid and dataStore.  The dataStore parameter allows you to specify which database to read the project from (Draft, Published, Archive) using DataStoreEnum.  Basically, if you call this method using the UID of the project in question and DataStoreEnum.PublishedStore and the resulting dataset is null then the project represented by the given UID is not a published project.

    For example:

    bool _isPublished;
    
    ProjectWebService.ProjectDataSet projectDataSet = projectService.ReadProject(projectUID, ProjectWebService.DataStoreEnum.PublishedStore);
    
    _isPublished = projectDataSet != null;
    


    Project.ReadProject documentation - http://msdn.microsoft.com/en-us/library/ms480162.aspx


    Ed Snider

    Friday, October 8, 2010 4:44 AM

All replies

  • Depends what exactly you want to see? For instance you could check the queue via PSI to ensure the publish job is complete
    Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page
    Friday, October 8, 2010 4:09 AM
  • You can call the ReadProject() method which takes two parameters, projectUid and dataStore.  The dataStore parameter allows you to specify which database to read the project from (Draft, Published, Archive) using DataStoreEnum.  Basically, if you call this method using the UID of the project in question and DataStoreEnum.PublishedStore and the resulting dataset is null then the project represented by the given UID is not a published project.

    For example:

    bool _isPublished;
    
    ProjectWebService.ProjectDataSet projectDataSet = projectService.ReadProject(projectUID, ProjectWebService.DataStoreEnum.PublishedStore);
    
    _isPublished = projectDataSet != null;
    


    Project.ReadProject documentation - http://msdn.microsoft.com/en-us/library/ms480162.aspx


    Ed Snider

    Friday, October 8, 2010 4:44 AM
  • I'll try it... Thanks!
    Friday, October 8, 2010 1:20 PM