Table of contents
API
TOC
Collapse the table of content
Expand the table of content

ProjectCollection class

Nadin Merali|Last Updated: 5/6/2017

inherits members from ClientObjectCollection

Represents a collection of PublishedProject objects.

Syntax

CSOM

class ProjectCollection 

JSOM

PS.ProjectCollection

REST Interface

Supported.

PS.ProjectCollection

http://contoso.sharepoint.com/sites/pwa/api/ProjectServer/Projects

Members

✓ - Read Support       ✓ʷ - Write Support

Properties

Name.NETJSOMRESTTypeDescription
[Integer]PublishedProjectGets a PublishedProject from the collection at the specified index.
ItemPublishedProjectGets a PublishedProject from the collection at the specified index.

Methods

Name.NETJSOMRESTReturn TypeDescription
'{PublishedProjectId}'PublishedProjectGets a PublishedProject from the collection with the specified PublishedProjectId.
Add(ProjectCreationInformation parameters)PublishedProjectAdds the PublishedProject that is specified by the ProjectCreationInformation object to the collection.
GetByGuid(Guid uid)PublishedProjectGets a PublishedProject from the collection with the Id value.
GetById(String objectId)PublishedProjectGets a PublishedProject from the collection with the Guid value.
Remove(PublishedProject project)BooleanRemoves the specified PublishedProject from the collection.
Update()QueueJobUpdates the project collection.
Validate()voidValidates pending changes to the project and all of the entities that it contains without saving them.


Method Details

'{PublishedProjectId}'

Gets a PublishedProject from the collection with the specified PublishedProjectId.

Syntax
PublishedProject http://contoso.sharepoint.com/sites/pwa/api/ProjectServer/Projects('{PublishedProjectId}')
Parameters
NameTypeDescription
PublishedProjectIdStringthe id of the PublishedProject
Return Value

PublishedProject

Add(ProjectCreationInformation parameters)

Adds the PublishedProject that is specified by the ProjectCreationInformation object to the collection.

Syntax
PublishedProject Add(ProjectCreationInformation parameters)
Parameters
NameTypeDescription
parametersProjectCreationInformationThe properties that can be set when creating a published project.
Return Value

PublishedProject

GetByGuid(Guid uid)

Gets a PublishedProject from the collection with the Id value.

Syntax
PublishedProject GetByGuid(Guid uid)
Parameters
NameTypeDescription
uidGuidThe Guid of the PublishedProject
Return Value

PublishedProject
The PublishedProject with the specified guid.

GetById(String objectId)

Gets a PublishedProject from the collection with the Guid value.

Syntax
PublishedProject GetById(String objectId)
Parameters
NameTypeDescription
objectIdStringThe id of the PublishedProject.
Return Value

PublishedProject
The PublishedProject with the specified ID.

Remove(PublishedProject project)

Removes the specified PublishedProject from the collection.

Syntax
Boolean Remove(PublishedProject project)
Parameters
NameTypeDescription
projectPublishedProjectThe PublishedProject to remove.
Return Value

Boolean

Update()

Updates the project collection.

Syntax
QueueJob Update()
Parameters

None

Return Value

QueueJob
The QueueJob includes the JobState property that identifies the result of the update request.

QueueJob

Validate()

Validates pending changes to the project and all of the entities that it contains without saving them.

Syntax
void Validate()
Parameters

None

Return Value

void

Remarks

Project Server creates a virtual PublishedProject object for each draft project that has not yet been published. A virtual published project ensures that a draft project can be retrieved through the ProjectCollection object, whether it has been published or not.

For example, if you create a draft project, and then read all projects with the CSOM, ProjectCollection object contains the unpublished draft project.

You can determine whether a project has been published by the value of the PublishedProject.LastPublishedDate property, which is inherited from Project.LastPublishedDate. For an unpublished project, the LastPublishedDate property value is DateTime.Min (1/1/0001).

See Also

ProjectContext
ProjectCreationInformation
PublishedProject

© 2018 Microsoft