ProjectData Method

Description

ProjectData returns the current state of a project in Microsoft Office Project Server 2003, including tasks, resources, and assignments. The returned data includes task and resource ID values, which enable the PDS methods ProjectTasksCreate, ProjectResourcesCreate, and ProjectAssignmentsCreate to correctly insert new tasks, resources, and assignments. ProjectCreate also supports the data returned by ProjectData to enable a developer to copy enterprise projects.

Syntax

<Request>
   <ProjectData>
      <ProjectID></ProjectID>
      <ProjectName></ProjectName>
      <ReturnUIDs></ReturnUIDs>
   </ProjectData>
</Request>

Parameters

ProjectData is valid only for projects of type 0 or 1 (regular or template, respectively).

ProjectID* or *ProjectName

Required. Return project data for the specified project ID or project name. If ProjectID is specified, ProjectName is ignored, even if given.

ProjectName is the project name as stored in the PROJ_NAME field of the MSP_PROJECTS table (the concatenation of the project identifier and the version name, separated by a period).

Note   ProjectData may return a STATUS error code 4 if ProjectName includes characters such as: & " < >. These characters should be encoded in the ProjectName value as, respectively: &amp; &quot; < >. Otherwise, use ProjectID instead of ProjectName.

ReturnUIDs

Optional. Values can be 0 (default) or 1. Return the unique ID numbers for tasks, resources, and assignments in the project.

Return Values

If the request is successful, ProjectData returns a successful HRESULT and STATUS as well as the project data requested. AdminProject is returned with a value of 1 only for an admin (non-working time) project; it is not returned for a regular project.

<Reply>
   <HRESULT></HRESULT>
   <STATUS></STATUS>
   <UserName></UserName>
   <Project>
      <AdminProject></AdminProject>
      -- Project Data --
   </Project>
</Reply>

Following is an example reply for a request where ReturnUIDs is 1, for a standard project that has one task, one resource (shows EUID assigned from the Enterprise Resource Pool), and one assignment. Notice in this example there is no <ConstraintDate> tag in the task data, since <ConstraintType> has a value of 0 (start as soon as possible). There is also no <PredecessorLink> tag here, since there is only one task.

<Reply>
   <HRESULT>0</HRESULT>
   <STATUS>0</STATUS>
   <UserName>Administrator</UserName>
   <ProjectData>
      <Project>
         <ProjectName>TestProj1.Published</ProjectName>
         <ProjectID>4</ProjectID>
         <Title>TestProj1.Published</Title>
         <Company>My Company</Company>
         <Author>MYDOMAIN\myalias</Author>
         <Manager></Manager>
         <ScheduleFromStart>1</ScheduleFromStart>
         <StartDate>20030818080000</StartDate>
         <FinishDate>20030901170000</FinishDate>
         <FYStartDate>1</FYStartDate>
         <DefaultStartTime>20030811080000</DefaultStartTime>
         <DefaultFinishTime>20030811170000</DefaultFinishTime>
         <MinutesPerDay>480</MinutesPerDay>
         <MinutesPerWeek>2400</MinutesPerWeek>
         <DaysPerMonth>20</DaysPerMonth>
         <DefaultTaskType>0</DefaultTaskType>
         <DefaultFixedCostAccrual>3</DefaultFixedCostAccrual>
         <DefaultStandardRate>0</DefaultStandardRate>
         <DefaultOvertimeRate>0</DefaultOvertimeRate>
         <DurationFormat>7</DurationFormat>
         <WorkFormat>5</WorkFormat>
         <EditableActualCosts>0</EditableActualCosts>
         <HonorConstraints>1</HonorConstraints>
         <MultipleCriticalPaths>0</MultipleCriticalPaths>
         <NewTasksEffortDriven>1</NewTasksEffortDriven>
         <NewTasksEstimated>1</NewTasksEstimated>
         <SplitsInProgressTasks>1</SplitsInProgressTasks>
         <SpreadActualCost>0</SpreadActualCost>
         <SpreadPercentComplete>0</SpreadPercentComplete>
         <TaskUpdatesResource>1</TaskUpdatesResource>
         <FiscalYearStart>0</FiscalYearStart>
         <WeekStartDay>0</WeekStartDay>
         <Tasks>
            <Task>
               <Name>T1</Name>
               <ID>1</ID>
               <Type>0</Type>
               <WBS>1</WBS>
               <OutlineLevel>1</OutlineLevel>
               <Priority>500</Priority>
               <Duration>1920</Duration>
               <EffortDriven>1</EffortDriven>
               <Estimated>1</Estimated>
               <Milestone>0</Milestone>
               <Summary>0</Summary>
               <Work>0</Work>
               <FreeSlack>0</FreeSlack>
               <PercentComplete>0</PercentComplete>
               <PercentWorkComplete>0</PercentWorkComplete>
               <ActualDuration>0</ActualDuration>
               <ActualWork>0</ActualWork>
               <ActualOvertimeWork>0</ActualOvertimeWork>
               <RemainingDuration>1920</RemainingDuration>
               <RemainingWork>0</RemainingWork>
               <RemainingOvertimeWork>0</RemainingOvertimeWork>
               <ConstraintType>0</ConstraintType>
               <CalendarUID>-1</CalendarUID>
               <LevelAssignments>1</LevelAssignments>
               <LevelingCanSplit>1</LevelingCanSplit>
               <LevelingDelay>0</LevelingDelay>
               <IgnoreResourceCalendar>0</IgnoreResourceCalendar>
               <HideBar>0</HideBar>
               <Rollup>0</Rollup>
               <PhysicalPercentComplete>0</PhysicalPercentComplete>
               <EarnedValueMethod>0</EarnedValueMethod>
               <Start>20030818080000</Start>
               <Finish>20030821170000</Finish>
               <UID>1</UID>
            </Task>
         </Tasks>
         <Resources>
            <Resource>
               <Name>Nancy Davolio</Name>
               <ID>1</ID>
               <BookingType>0</BookingType>
               <NTAccount>MYDOMAIN\ndavolio</NTAccount>
               <EmailAddress>ndavolio@mycompany.com</EmailAddress>
               <Type>1</Type>
               <IsGeneric>0</IsGeneric>
               <Initials>ND</Initials>
               <Code></Code>
               <Group></Group>
               <WorkGroup>0</WorkGroup>
               <MaxUnits>100</MaxUnits>
               <CanLevel>1</CanLevel>
               <AccrueAt>3</AccrueAt>
               <StandardRate>80</StandardRate>
               <OvertimeRate>0</OvertimeRate>
               <CostPerUse>0</CostPerUse>
               <OvertimeRateFormat>2</OvertimeRateFormat>
               <StandardRateFormat>2</StandardRateFormat>
               <EUID>3</EUID>               <UID>4</UID>
            </Resource>
         </Resources>
            <Assignments>
               <Assignment>
                <TaskID>1</TaskID>
                <ResourceID>1</ResourceID>
                <Units>100</Units>
                <Work>3360</Work>
                <ActualOvertimeWork>0</ActualOvertimeWork>
                <ActualWork>0</ActualWork>
                <CostRateTable>0</CostRateTable>
                <Delay>0</Delay>
                <OvertimeWork>0</OvertimeWork>
                <RegularWork>3360</RegularWork>
                <RemainingOvertimeWork>0</RemainingOvertimeWork>
                <RemainingWork>3360</RemainingWork>
                <PercentWorkComplete>0</PercentWorkComplete>
                <Finish>20030901170000</Finish>
                <Start>20030822080000</Start>
                <UID>7</UID>
            </Assignment>
         </Assignments>
      </Project>
   </ProjectData>
</Reply>

Remarks

The PDS checks Microsoft Office Project Server 2003 security for the currently logged-on user and determines whether the user is a valid Project Server user and whether the user has permission to read the requested project. If so, the PDS gathers the data for the requested project and returns it in XML according to the Project XML Schema.