Microsoft.ProjectServer.Client 名前空間

Classes in this namespace define the client-side object model (CSOM) for Microsoft Project Server 2013.

The CSOM is accessible from both Project Online and from an on-premises Project Server installation, through the Microsoft.Project.Server.Client namespace. The Project Server CSOM is designed to be a relatively easy to use API that directly consumes or provides data by name, rather than by passing datasets or by using changeXml parameters. The CSOM implements the main functionality of the Project Server Interface (PSI) for the primary entities such as Project, Task, EnterpriseResource, and Assignment. It includes additional entities such as CustomField, LookupTable, WorkflowActivities, EventHandler, and QueueJob, which support other common Project Server functionality.

The CSOM is an API that is built on top of the PSI; it does not replace the PSI or implement all of the PSI functionality. The CSOM can be accessed in the following ways:

  • As an assembly to use with Microsoft .NET Framework 4.0: %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.ProjectServer.Client.dll

    The Microsoft.ProjectServer.Client namespace in the Class library and Web Service Reference section of the Project 2013 SDK documents the managed code for general development of .NET-based CSOM applications.

  • As an assembly to use for development with Silverlight: %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\ClientBin\Microsoft.ProjectServer.Client.Silverlight.dll

  • As an assembly to use for development of apps for Microsoft Windows Phone 8: %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\ClientBin\Microsoft.ProjectServer.Client.Phone.dll

  • As a file to use for development of web applications with JavaScript: %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\PS.js or PS.debug.js

    For the JavaScript reference to the CSOM, see JavaScript API reference for Project Server 2013.

  • A web app can also access the CSOM through REST. For example, you can use the following query to get data for all of the projects in a Project Web App instance:

    https://ServerName/ProjectServerName/_api/ProjectServer/Projects
    

    For more information, see Client-side object model (CSOM) for Project Server and Programming using the SharePoint 2013 REST service.

The Project 2013 SDK download also includes the assemblies and JavaScript files for the Project Server CSOM. If you update Project Server with a service pack, you should copy the updated assemblies and JavaScript files to your development computer.

The primary Project Server entities are generally represented in the CSOM by six classes, for example:

  • The base class, such as Assignment, contains the common properties for the draft entity and the published entity.

  • The creation information class, such as AssignmentCreationInformation, contains the properties that are used to create an entity.

  • The draft class, such as DraftAssignment, includes the read/write properties that represent the entity for editing.

  • The published class, such as PublishedAssignment, includes the read-only properties that represent the published entity.

  • The draft collection class, such as DraftAssignmentCollection, includes the Add method to add a draft entity to the collection, the GetById method to get a specific entity for editing, and the Remove method to delete an entity.

  • The published collection class, such as PublishedAssignmentCollection, generally includes the GetById method to get a specific entity for reading or for checking out to edit.

The ProjectContext class and the ProjectServer class each maintain the client-side context for application development, and contain entity collections that are globally accessible in a Project Web App instance, such as Projects, EnterpriseResources, EnterpriseProjectTypes, CustomFields, LookupTables, and Events. Because the ProjectServer class is provided for internal use by client-side objects, applications should use the ProjectContext class, which is initialized with the Project Web App path.

For a simple example of programming with the CSOM, see the Example section later on this page. For more information about development with the CSOM, see Project Server 2013 のクライアント側オブジェクト モデル (CSOM). The managed code reference in the Project 2013 SDK provides basic descriptions and remarks for the properties of entities, which are also described in the classes for namespaces in the PSI. For detailed information about the properties of entities, see Available fields reference.

The CSOM for Project Server 2013 is built on the CSOM for SharePoint Foundation 2013. For more information, see Choose the right API set in SharePoint 2013.

クラス

  クラス 説明
パブリック クラス Assignment ドラフトの割り当ておよび発行された割り当ての共通のプロパティが含まれています。
パブリック クラス AssignmentCreationInformation 割り当ての作成時に設定できるプロパティが含まれています。
パブリック クラス BaseCalendarException 基本カレンダーの例外のコレクションを表します。
パブリック クラス Calendar Project Server の予定表を表します。
パブリック クラス CalendarCollection カレンダー オブジェクトのコレクションを表します。
パブリック クラス CalendarCreationInformation 新しいカレンダーの作成に使用する情報を表します。
パブリック クラス CalendarException 異なる点は、(例外)、基本カレンダーを表します。
パブリック クラス CalendarExceptionCollection カレンダーの例外のコレクションを表します。
パブリック クラス CalendarExceptionCreationInformation カレンダーの例外の作成に関する情報を提供します。
パブリック クラス CustomField プロパティとは、エンタープライズ ユーザー設定フィールドの作成に使用するメソッドが含まれています。
パブリック クラス CustomFieldCollection CustomField オブジェクトのコレクションを表します。
パブリック クラス CustomFieldCreationInformation ユーザー設定フィールドの作成に使用される情報を提供します。
パブリック クラス DraftAssignment 割り当て、プロジェクトのドラフトの作成を有効にします。
パブリック クラス DraftAssignmentCollection DraftAssignment オブジェクトのコレクションを表します。
パブリック クラス DraftProject プロジェクトがチェック アウトされているプロジェクトの下書きバージョンを表します。
パブリック クラス DraftProjectResource チェック アウトしたプロジェクトのエンタープライズ リソースを表します。
パブリック クラス DraftProjectResourceCollection DraftProjectResource オブジェクトのコレクションを表します。
パブリック クラス DraftTask チェック アウトされているプロジェクト内のタスクを表します。
パブリック クラス DraftTaskCollection DraftTask オブジェクトのコレクションを表します。
パブリック クラス DraftTaskLink 下書きプロジェクトでタスクのリンクにアクセスするオブジェクトを作成します。
パブリック クラス DraftTaskLinkCollection DraftTaskLink オブジェクトのコレクションを表します。
パブリック クラス EnterpriseProjectType エンタープライズ プロジェクトの種類を表すオブジェクトを作成します。
パブリック クラス EnterpriseProjectTypeCollection EnterpriseProjectType (EPT) のオブジェクトのコレクションを表します。
パブリック クラス EnterpriseProjectTypeCreationInformation エンタープライズ プロジェクトの種類 (EPT) の作成についてを説明します。
パブリック クラス EnterpriseResource プロジェクトで、Project Server で管理されているリソースを表します。
パブリック クラス EnterpriseResourceCollection EnterpriseResource オブジェクトのコレクションを表します。
パブリック クラス EnterpriseResourceCreationInformation エンタープライズ リソースの作成についてを説明します。
パブリック クラス EntityType Project Server エンティティの種類を表します。
パブリック クラス EntityTypes CSOM を通じて公開される Project Server エンティティの種類を表します。
パブリック クラス Event 表し、ビジネス オブジェクトのデータに変更がある場合に、Project Server で発生する動作を識別します。
パブリック クラス EventCollection Event オブジェクトのコレクションを表します。
パブリック クラス EventHandler Project Server のイベント ハンドラーの場所と識別情報を表します。
パブリック クラス EventHandlerCollection EventHandler オブジェクトのコレクションを表します。
パブリック クラス EventHandlerCreationInformation イベント ハンドラーの作成についてを説明します。
パブリック クラス LookupCost Costの型の参照テーブルのデータ値が含まれています。
パブリック クラス LookupDate Dateの型の参照テーブルのデータ値が含まれています。
パブリック クラス LookupDuration Durationの型の参照テーブルのデータ値が含まれています。
パブリック クラス LookupEntry ルックアップ テーブルのエントリを表します。
パブリック クラス LookupEntryCollection ルックアップ テーブルのLookupEntryオブジェクトのコレクションを表します。
パブリック クラス LookupEntryCreationInformation ルックアップ テーブルのエントリを作成するための情報を提供します。
パブリック クラス LookupEntryValue ルックアップ テーブルのエントリの値を表します。
パブリック クラス LookupMask マスク、レベル、階層型参照テーブルの定義を表します。
パブリック クラス LookupNumber Numberの型の参照テーブルのデータ値が含まれています。
パブリック クラス LookupTable 参照テーブルを表します。
パブリック クラス LookupTableCollection LookupTable オブジェクトのコレクションを表します。
パブリック クラス LookupTableCreationInformation メソッドとプロパティの設定値はルックアップ テーブルの作成を提供します。
パブリック クラス LookupTables 参照テーブルの定義を表します。
パブリック クラス LookupText Textの型の参照テーブルのエントリを定義します。
パブリック クラス Phase プロジェクトのライフ サイクルの一般的な一連のアクティビティを識別するためにグループ化されているステージのコレクションを表します。
パブリック クラス PhaseCollection ワークフローのPhaseオブジェクトのコレクションを表します。
パブリック クラス PhaseCreationInformation メソッドとプロパティの設定値は、ワークフローのフェーズの作成で使用されるを提供します。
パブリック クラス PlanAssignment プロジェクト計画での割り当てに関する情報を提供します。
パブリック クラス PlanAssignmentCollection 計画の割り当てオブジェクトのコレクションを表します。
パブリック クラス PlanAssignmentCreationInformation PlanAssignmentオブジェクトの作成についてを説明します。
パブリック クラス PlanAssignmentInterval プロジェクトの計画の割り当ての間隔のコレクションを表します。
パブリック クラス PlanAssignmentIntervalCollection PlanAssignmentIntervalオブジェクトのコレクションを表します。
パブリック クラス PlanAssignmentIntervalCreationInformation PlanAssignmentIntervalオブジェクトの作成に使用される情報を提供します。
パブリック クラス Project 下書きプロジェクトと発行されたプロジェクトの共通プロパティが含まれています。
パブリック クラス ProjectCollection PublishedProject オブジェクトのコレクションを表します。
パブリック クラス ProjectContext Project Web Appのインスタンスとの開発のためのクライアント側コンテキストを保持し、 Project Web Appにある Project Server オブジェクトのエンタープライズ規模のコレクションが含まれます。
パブリック クラス ProjectCreationInformation プロジェクトの作成時に設定できるプロパティが含まれています。
パブリック クラス ProjectDetailPage Web パーツ ページの作成、表示、またはProject Web App内のプロジェクトのプロパティを管理するには、プロジェクト詳細ページ (PDP) を表します。
パブリック クラス ProjectDetailPageCollection プロジェクト詳細ページ (Pdp) のコレクションを表します。
パブリック クラス ProjectDetailPageCreationInformation エンタープライズ プロジェクトの種類のプロジェクト詳細ページ (PDP) の作成に使用する情報を提供します。
パブリック クラス ProjectResource プロジェクトのリソースに関する情報を提供します。
パブリック クラス ProjectResourceCreationInformation プロパティの設定と、プロジェクトのリソースのエンティティを作成するためのメソッドを提供します。
パブリック クラス ProjectServer クライアント側のコードでは、内部的に使用します。プロジェクトのサーバー CSOM で開発のためには、クライアント コンテキストを初期化するにはProjectContextを使用します。
パブリック クラス ProjectServerData サーバーへの接続を表します。
パブリック クラス PublishedAssignment 発行されたプロジェクトに含まれる割り当てを表します。
パブリック クラス PublishedAssignmentCollection 発行された割り当てのコレクションを表します。
パブリック クラス PublishedProject Project Server に発行されているプロジェクトを表します。
パブリック クラス PublishedProjectResource Project Server に発行されたエンタープライズ リソースを表します。
パブリック クラス PublishedProjectResourceCollection 発行済みプロジェクト内のリソースのコレクションを表します。
パブリック クラス PublishedTask 発行済みプロジェクト内のタスクを表します。
パブリック クラス PublishedTaskCollection 発行済みプロジェクト内のタスクのコレクションを表します。
パブリック クラス PublishedTaskLink 2 つのタスクの開始日と終了日の日付の間の依存関係を表します。
パブリック クラス PublishedTaskLinkCollection 発行済みプロジェクト内のタスクのリンクのコレクションを表します。
パブリック クラス QueueJob プロジェクトの発行をキューに入れます。
パブリック クラス QueueJobCollection QueueJobオブジェクトのコレクションを表します。
パブリック クラス ResourceCalendarException リソース カレンダーの例外を表します。
パブリック クラス ResourcePlan 概要を見てどのようなリソースは、プロジェクトに必要なを表します。
パブリック クラス ScriptTypeFactory このクラスとそのメンバーは内部使用のために予約済みです。ユーザーのコード内で使用されるものではありません。
パブリック クラス ServiceStatus Project Server サービスの状態に関する情報を提供します。
パブリック クラス Stage プロジェクト ワークフローのステージを表します。
パブリック クラス StageCollection ワークフローのStageオブジェクトのコレクションを表します。
パブリック クラス StageCreationInformation プロジェクト ワークフロー ステージの作成に使用するメソッドとプロパティを提供します。
パブリック クラス StageCustomField プロジェクト ステージのカスタム フィールドを表します。
パブリック クラス StageCustomFieldCollection ユーザー設定フィールドをワークフロー ステージには、 StageCustomFieldオブジェクトのコレクションを表します。
パブリック クラス StageCustomFieldCreationInformation プロパティの設定」および「カスタム フィールド プロジェクト段階情報を追加するのに使用されるメソッドを提供します。
パブリック クラス StageDetailPage ワークフロー ステージには、プロジェクト詳細ページ (PDP) を表します。
パブリック クラス StageDetailPageCollection ワークフロー ステージに表示されるプロジェクト詳細ページ (Pdp) のコレクションを表します。
パブリック クラス StageDetailPageCreationInformation プロパティの設定値とワークフロー ステージのプロジェクト詳細ページ (PDP) の作成に使用するメソッドを提供します。
パブリック クラス StatusAssignment オブジェクトが割り当ての進捗状況の更新を提供します。
パブリック クラス StatusAssignmentCollection 割り当ての状態を更新するには、 StatusAssignmentオブジェクトのコレクションを表します。
パブリック クラス StatusAssignmentCreationInformation プロパティの設定およびステータスの割り当てオブジェクトの作成方法を説明します。
パブリック クラス StatusTask タスクの進行状況を追跡するオブジェクトを提供します。
パブリック クラス StatusTaskCreationInformation プロパティの設定と状態の task オブジェクトを作成するためのメソッドを提供します。
パブリック クラス Task 方法およびタスクの詳細情報にアクセスするために使用するプロパティが含まれています。
パブリック クラス TaskCreationInformation プロパティの設定、およびタスクを作成するのに使用されるメソッドを提供します。
パブリック クラス TaskLink 2 つのタスクの開始日と終了日の日付の間の依存関係を表します。
パブリック クラス TaskLinkCreationInformation プロパティの設定」および「タスクのリンクの作成に使用するメソッドを提供します。
パブリック クラス TimePhase 時間経過に沿って配分されている割り当ての進捗状況の情報を表します。
パブリック クラス TimeSheet タイムシートを管理するためのプロパティとメソッドが含まれています。
パブリック クラス TimeSheetLine タイムシートの行を表します。
パブリック クラス TimeSheetLineCollection タイムシート行のコレクションを表します。
パブリック クラス TimeSheetLineCreationInformation プロパティの設定とタイムシート行の作成に使用するメソッドを提供します。
パブリック クラス TimeSheetPeriod タイムシートに定義された期間を表します。
パブリック クラス TimeSheetPeriodCollection TimeSheetPeriodオブジェクトのコレクションを表します。
パブリック クラス TimeSheetWork タイムシートでの作業の種類を表します。
パブリック クラス TimeSheetWorkCollection タイムシートの実績作業時間エントリのコレクションを提供します。
パブリック クラス TimeSheetWorkCreationInformation プロパティの設定とタイムシートの作業オブジェクトを作成するのに使用するメソッドを提供します。
パブリック クラス WorkflowActivities Project Server ワークフロー アクティビティをカプセル化する方法と、 Windows Workflow Foundation (WF4) のバージョン 4 で使用するためのメソッドが含まれています。
パブリック クラス WorkflowDesigner ワークフローを設計するのに使用できるオブジェクトを作成します。
パブリック クラス WorkflowDesignerField ワークフロー デザイナーで作成されるフィールドを表します。
パブリック クラス WorkflowDesignerFieldCollection ワークフロー デザイナーで使用できるエンタープライズ プロジェクトのユーザー設定フィールドのフィルター処理されたコレクションを表します。

列挙体

  列挙体 説明
パブリック列挙体 AccrueAt コスト計上の時期] モードでは、リソースのコストをタスク コストに課金する方法とタイミングを指定します。
パブリック列挙体 BookingType リソースの割り当ての予約の方法を指定します。
パブリック列挙体 CalendarRecurrenceDays 定期的な予定の例外の曜日を表します。
パブリック列挙体 CalendarRecurrenceType カレンダーの例外の定期的なアイテムの種類を指定します。
パブリック列挙体 CalendarRecurrenceWeek スケジュールのセットアップに使用される月の 1 週を指定します。
パブリック列挙体 CommittedDecisionResult アイテムはプロジェクト ポートフォリオ分析のため、オプティマイザーの関数またはプランナーに含まれているかどうかを指定します。
パブリック列挙体 ConstraintType タスクの制約タイプを指定します。
パブリック列挙体 CurrencySymbolPosition 通貨記号の配置を指定します。
パブリック列挙体 CustomFieldRollupType ユーザー設定フィールドの要約のロールアップの種類を指定します。
パブリック列挙体 CustomFieldType エンタープライズ ユーザー設定フィールドの種類を指定します。
パブリック列挙体 DependencyType 2 つのタスクの間に確立するには、依存関係の種類を指定します。
パブリック列挙体 EnterpriseResourceType エンタープライズ リソースの種類を表します。
パブリック列挙体 FixedCostAccrual 固定コストをタスク コストに課金する方法とタイミングを指定します。
パブリック列挙体 JobState Project Server のキュー ジョブの状態は、キューのジョブの状態を指定します。
パブリック列挙体 LookupTableConstants 最大値と最小値のルックアップ テーブルのエンティティを指定します。
パブリック列挙体 LookupTableMaskSequence ルックアップ テーブルのデータの種類は、マスクのシーケンスを指定します。
パブリック列挙体 LookupTableSortOrder 参照テーブルの並べ替え順序を指定します。
パブリック列挙体 OvertimeRateFormat 時間単位のリソースの超過単価。ドル 1 時間あたりなど、時間の単位あたりの率は。
パブリック列挙体 ProjectDetailPageType プロジェクト詳細ページ (PDP) の種類を指定します。
パブリック列挙体 ProjectType プロジェクトの種類を指定します。
パブリック列挙体 QueueMsgType プロジェクト サーバーのキュー システムにジョブを送信するためには、キューのメッセージの種類を指定します。
パブリック列挙体 ReadyToLeaveProjectStageValue ワークフローはステージのままにする準備がかどうかを確認するのには、Project Server ワークフロー ステージのプロジェクトの要件を指定します。
パブリック列挙体 ResourceType リソースの種類を指定します。
パブリック列挙体 StandardRateFormat リソース率; の時間単位を指定します。ドル 1 時間あたりなど、時間の単位あたりの率は。
パブリック列挙体 StrategicImpactBehavior どのように戦略的な影響の値は、Project Server ワークフロー ステージで動作を指定します。
パブリック列挙体 TaskType プロジェクト内のタスクの種類が単位数、作業時間を固定または固定期間を固定するかどうかを指定します。
パブリック列挙体 TimeScale タイム スケール領域のデータのスケールを指定します。
パブリック列挙体 TimeSheetEntryMode タイムシート エントリ モードが含まれています。
パブリック列挙体 TimeSheetLineClass タイムシート行のさまざまな使用を定義するクラスを表します。
パブリック列挙体 TimeSheetLineStatus タイムシート行に適用することができますステータスの設定を表します。
パブリック列挙体 TimeSheetStatus タイムシートに適用することができますステータスの設定を表します。
パブリック列挙体 TimeSheetValidationType タイムシート行の種類の入力規則のセットを指定します。
パブリック列挙体 TrackingMode タスクの進行状況を追跡するためのモードを指定します。
パブリック列挙体 UpdateProjectStageStatusFieldValue Project Server ワークフロー プロジェクト ステージの状態を指定します。
パブリック列挙体 UtilizationType 現在のリソース計画のリソースの使用の種類を指定します。
パブリック列挙体 WorkFormat 作業の形式を表す値が含まれています。

Following are the steps to create a simple console application named ReadProjectList that uses classes in the Microsoft.ProjectServer.Client namespace to read the collection of published projects.

  1. If you are developing on a remote computer, copy the following assemblies from the Project 2013 SDK download or from %ProgramFiles%\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI on the Project Server computer to a convenient folder on the development computer:

    • Microsoft.ProjectServer.Client.dll

    • Microsoft.SharePoint.Client.dll

    • Microsoft.SharePoint.Client.Runtime.dll

  2. In Visual Studio 2012, create a console application. For this example, name the application ReadProjectList. In the New Project dialog box, set the target framework to .NET Framework 4.5. You could also use Visual Studio 2010 with .NET Framework 4 (do not use .NET Framework 4 Client Profile).

  3. Set references to the assemblies that are specified in step 1.

  4. Replace the code in the Program.cs file with the following code.

    注意

    You should set the CSOM context by using the ProjectContext object, not by using the ProjectServer object.

  5. Press F5 to run the application.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ProjectServer.Client;

namespace ReadProjectList
{
    class Program
    {
        private const string pwaPath = "https://ServerName/PwaName/";    // Change the path for Project Web App.
        
        // Set the context for the Project Server CSOM.
        private static ProjectContext projContext;

        static void Main(string[] args)
        {
            projContext = new ProjectContext(pwaPath); 

            // Get the list of published projects in Project Web App.
            projContext.Load(projContext.Projects);
            projContext.ExecuteQuery();

            Console.WriteLine("\nProject ID : Project name : Created date");

            foreach (PublishedProject pubProj in projContext.Projects)
            {
                Console.WriteLine("\n\t{0}\n\t{1} : {2}", pubProj.Id.ToString(), pubProj.Name, 
                    pubProj.CreatedDate.ToString());
            }

            Console.Write("\nPress any key to exit: ");
            Console.ReadKey(false);
        }
    }
}

関連項目

参照先

その他の技術情報

Client-side object model (CSOM) for Project Server

JavaScript API reference