다음을 통해 공유


SharePoint 위치 레코드에 대한 작업

 

게시 날짜: 2017년 1월

적용 대상: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Microsoft Dynamics 365 SDK를 사용하면 Microsoft SharePoint 위치 레코드에 대해 다음 작업을 수행할 수 있습니다.

  • 위치 레코드 만들기, 검색, 업데이트 및 삭제

  • 사이트 위치 레코드를 기본값으로 설정

  • 엔터티 레코드에 문서 위치 레코드 연결

  • 위치 레코드에 대해 절대 및 사이트 모음 URL 검색

위치 레코드 만들기, 검색, 업데이트 및 삭제

SharePointSiteSharePointDocumentLocation 엔터티에 대해 Microsoft Dynamics 365 SDK 메시지를 사용하면 레코드를 만들고, 검색, 업데이트 및 삭제할 수 있습니다.SharePointSite 엔터티에서 이러한 작업을 수행하려면 Microsoft Dynamics 365에서 시스템 관리자 역할이 있어야 합니다. 지원되는 메시지에 대한 목록은 SharePointSite 엔터티 메시지 및 메서드SharePointDocumentLocation 엔터티 메시지 및 메서드를 참조하십시오.

참고

SharePoint 위치 레코드에서 이러한 작업을 수행하면 Microsoft Dynamics 365의 데이터만 조작합니다.SharePoint 서버에서 위치를 만들거나, 업데이트하거나, 삭제하지 않습니다.

SharepointSite.ValidationStatus 특성은 SharePoint 사이트 URL의 유효성 검사 상태를 표시합니다. 이 특성에 사용 가능한 값은 유효성 검사 상태(sharepoint_validationstatus) 옵션 집합에 정의되어 있습니다.

SharepointSite.ValidationStatusErrorCode 특성은 SharePoint 사이트 URL의 유효성 검사 상태에 대한 설명을 표시합니다. 이 특성에 사용 가능한 값은 유효성 검사 상태 설명(sharepoint_validationstatusreason) 옵션 집합에 정의되어 있습니다.

SharePoint Server에서 저장소 위치는 SharePoint 사이트 모음이 여러 사이트를 포함할 수 있는 컨테이너이고 각 사이트에는 여러 사이트 또는 문서 라이브러리를 포함할 수 있는 계층적입니다. 각 문서 라이브러리에는 문서 폴더를 여러 개 포함할 수 있습니다.Microsoft Dynamics 365에서 위치 레코드를 만드는 동안 SharePoint Server에서 이러한 위치의 경로 또는 URL를 지정합니다.

SharePoint 위치 레코드의 절대 URL

SharePoint에서 저장소 위치의 전체 URL입니다.SharePointSite.AbsoluteURL 또는 SharePointDocumentLocation.AbsoluteURL 속성을 사용하여 절대 URL을 지정할 수 있습니다.

절대 URL을 지정하여 SharePointSite 레코드를 만들려면:


// Instantiate a SharePoint site object.
// See the Entity Metadata topic in the SDK documentation to determine 
// which attributes must be set for each entity.
SharePointSite spSite = new SharePointSite
{
    Name = "Sample SharePoint Site",
    Description = "Sample SharePoint Site Location record",

    // TODO: Change this URL to a valid SharePoint URL.                        
    AbsoluteURL = "http://www.example.com",
};

// Create a SharePoint site record named Sample SharePoint Site.
_spSiteId = _serviceProxy.Create(spSite);

' Instantiate a SharePoint site object.
' See the Entity Metadata topic in the SDK documentation to determine 
' which attributes must be set for each entity.
Dim spSite As SharePointSite =
 New SharePointSite With {
  .Name = "Sample SharePoint Site",
  .Description = "Sample SharePoint Site Location record",
  .AbsoluteURL = "http://www.example.com"
 }
' TODO: Change this URL to a valid SharePoint URL.                        

' Create a SharePoint site record named Sample SharePoint Site.
_spSiteId = _serviceProxy.Create(spSite)

마찬가지로 절대 URL을 지정하여 SharePoint 문서 위치 레코드를 만들려면:

SharePointDocumentLocation spDocLoc = new SharePointDocumentLocation
{
    Name = "Sample SharePoint Document Location",
    Description = "Sample SharePoint Document Location record",
    AbsoluteUrl = "http://www.example.com/spdocloc"   
};
_spDocLocId = _serviceProxy.Create(spDocLoc);

문서를 저장하고 관리하기 위해 다른 위치를 만들려는 곳에 컨테이너 또는 상위 개체가 있으므로 SharePoint 사이트 레코드에 대해 일반적으로 절대 URL이 제공됩니다.

참고

SharePointDocumentLocation.LocationType 특성은 SharePointDocumentLocation 레코드가 SharePoint 폴더(0) 또는 OneNote 파일(1)을 가리키는지 여부를 결정합니다.SharePointDocumentLocation 인스턴스(레코드)를 만들 때 SharePointDocumentLocation.LocationType 특성의 값은 기본적으로 0으로 설정되어 SharePoint 폴더를 가리키고 있음을 나타냅니다. OneNote 지원에 대한 자세한 내용은 Microsoft Dynamics 365과 OneNote 통합를 참조하십시오.

SharePoint 위치 레코드의 상대 URL

SharePoint 서버에서 상위 위치 레코드에 대하여 위치 레코드의 상대 위치입니다.SharePoint 위치 레코드를 위한 상대 URL을 지정할 때는 그 아래에 그것이 생성되어야 하는 상위 개체도 지정해야 합니다.Microsoft Dynamics 365은 상위 개체의 URL을 내부적으로 사용하여 하위 개체를 위한 절대 URL을 결정합니다. 예를 들어 앞의 샘플에서 만든 SharePoint 사이트에 SharePoint 문서 위치에 대한 레코드를 만들려면 다음을 지정해야 합니다.


// Instantiate a SharePoint document location object.
// See the Entity Metadata topic in the SDK documentation to determine 
// which attributes must be set for each entity.
SharePointDocumentLocation spDocLoc = new SharePointDocumentLocation
{
    Name = "Sample SharePoint Document Location",
    Description = "Sample SharePoint Document Location record",

    // Set the Sample SharePoint Site created earlier as the parent site.
    ParentSiteOrLocation = new EntityReference(SharePointSite.EntityLogicalName, _spSiteId),
    RelativeUrl = "spdocloc",

    // Associate this document location instance with the Fourth Coffee
    // sample account record.
    RegardingObjectId = new EntityReference(Account.EntityLogicalName, _account1Id)
};

// Create a SharePoint document location record named Sample SharePoint Document Location.
_spDocLocId = _serviceProxy.Create(spDocLoc);

' Instantiate a SharePoint document location object.
' See the Entity Metadata topic in the SDK documentation to determine 
' which attributes must be set for each entity.
Dim spDocLoc As SharePointDocumentLocation =
 New SharePointDocumentLocation With {
  .Name = "Sample SharePoint Document Location",
  .Description = "Sample SharePoint Document Location record",
  .ParentSiteOrLocation = New EntityReference(SharePointSite.EntityLogicalName, _spSiteId),
  .RelativeUrl = "spdocloc",
  .RegardingObjectId = New EntityReference(Account.EntityLogicalName, _account1Id)
 }
' Set the Sample SharePoint Site created earlier as the parent site.
' Associate this document location instance with the Fourth Coffee
' sample account record.

' Create a SharePoint document location record named Sample SharePoint Document Location.
_spDocLocId = _serviceProxy.Create(spDocLoc)

하위 개체의 절대 URL(이 예제에서 문서 위치)은 "Parent_URL/Relative_URL"입니다. 따라서 이 예제에서 문서 위치의 절대 URL은 http://www.example.com/spdocloc입니다.

상대 URL은 일반적으로 계층 구조에서 아래 또는 하위 레코드로 위치 레코드를 만들 때 제공됩니다.

상대 URL을 사용하는 이점은 다른 SharePoint 서버로 이동하여 문서를 저장하려고 할 경우 Microsoft Dynamics 365에서 상위 개체 위치 레코드(사이트 모음 또는 사이트 레코드)의 URL을 업데이트하기만 하면 되고, 절대 URL(Microsoft Dynamics 365에서 자동으로 결정됨)이 그대로 유지되므로 계층 구조 아래의 다른 모든 레코드는 이전처럼 계속 작동합니다. 이러한 하위 위치 레코드에 대해 절대 URL을 사용 했다면 URL을 개별적으로 수정해야 합니다.

사이트 위치 레코드를 기본값으로 설정

Microsoft Dynamics 365을 사용하여 만든 모든 문서 위치가 이 사이트 아래에 자동으로 만들어지므로 SharePoint 사이트 위치 레코드를 기본값으로 설정할 수 있습니다. 사이트 위치 레코드를 기본값으로 만들려면 SharePointSite.IsDefault 속성을 사용하고 이 속성을 true로 설정합니다. 사이트 위치 레코드를 만들거나 업데이트하는 동안 사이트 위치 레코드를 기본값으로 설정할 수 있습니다.

참고

대상 사이트가 SharePoint 2010이고 SharePoint 2013 서버와 SharePoint Server용 Microsoft Dynamics CRM 목록 구성 요소가 SharePoint 사이트 모음에 설치되어 있을 경우에만 문서 위치 레코드를 자동으로 만들 수 있습니다.Microsoft Dynamics CRM 목록 구성 요소에 대한 자세한 내용은 Microsoft Dynamics CRM list component for Microsoft SharePoint Server를 참조하십시오.

엔터티 레코드에 문서 위치 레코드 연결

문서 위치 레코드를 엔터티 레코드에 연결할 수 있습니다. 이렇게 하면 엔터티 레코드에 대한 모든 문서가 SharePoint 서버의 이 위치에 저장됩니다.SharePoint 문서 위치 레코드를 SharePointDocumentLocation.RegardingObjectId 속성을 사용하여 엔터티 레코드에 연결할 수 있습니다. 다음 샘플에서는 이를 수행할 수 있는 방법을 보여 줍니다.


// Instantiate a SharePoint document location object.
// See the Entity Metadata topic in the SDK documentation to determine 
// which attributes must be set for each entity.
SharePointDocumentLocation spDocLoc = new SharePointDocumentLocation
{
    Name = "Sample SharePoint Document Location",
    Description = "Sample SharePoint Document Location record",

    // Set the Sample SharePoint Site created earlier as the parent site.
    ParentSiteOrLocation = new EntityReference(SharePointSite.EntityLogicalName, _spSiteId),
    RelativeUrl = "spdocloc",

    // Associate this document location instance with the Fourth Coffee
    // sample account record.
    RegardingObjectId = new EntityReference(Account.EntityLogicalName, _account1Id)
};

// Create a SharePoint document location record named Sample SharePoint Document Location.
_spDocLocId = _serviceProxy.Create(spDocLoc);

' Instantiate a SharePoint document location object.
' See the Entity Metadata topic in the SDK documentation to determine 
' which attributes must be set for each entity.
Dim spDocLoc As SharePointDocumentLocation =
 New SharePointDocumentLocation With {
  .Name = "Sample SharePoint Document Location",
  .Description = "Sample SharePoint Document Location record",
  .ParentSiteOrLocation = New EntityReference(SharePointSite.EntityLogicalName, _spSiteId),
  .RelativeUrl = "spdocloc",
  .RegardingObjectId = New EntityReference(Account.EntityLogicalName, _account1Id)
 }
' Set the Sample SharePoint Site created earlier as the parent site.
' Associate this document location instance with the Fourth Coffee
' sample account record.

' Create a SharePoint document location record named Sample SharePoint Document Location.
_spDocLocId = _serviceProxy.Create(spDocLoc)

위치 레코드에 대해 절대 및 사이트 모음 URL 검색

앞에서 설명한 대로 SharePoint Server는 계층적 모델에 따라 레코드를 저장합니다. 계층 구조에서 위치 레코드의 절대(전체) URL 및 위치 레코드가 있는 그 아래 SiteCollection URL을 검색하려면 RetrieveAbsoluteAndSiteCollectionUrlRequest 메시지를 사용하여 그렇게 할 수 있습니다.

RetrieveAbsoluteAndSiteCollectionUrlRequest 메시지는 둘 다 해당할 경우에만 제대로 작동합니다.

  • SharePoint Server용 Microsoft Dynamics CRM 목록 구성 요소가 대상 SharePoint 2010 또는 SharePoint 2013 서버의 SharePoint 사이트 모음에 설치됩니다. 자세한 내용은 Microsoft Dynamics CRM list component for Microsoft SharePoint Server을 참조하십시오.

  • 상위 SharePoint 사이트 모음에 대한 위치 레코드가 Microsoft Dynamics 365에 있고 상위 위치 레코드를 만드는 동안 SharePointSite.IsGridPresent 속성이 true로 설정되었습니다.

그렇지 않으면 SiteCollectionUrl 속성에 대해 빈 값이나 잘못된 값을 받습니다.

자세한 내용은 RetrieveAbsoluteAndSiteCollectionUrlRequest을 참조하십시오.

다음 샘플에서는 RetrieveAbsoluteAndSiteCollectionUrl 메시지를 사용하는 방법을 보여 줍니다.


// Retrieve the absolute URL and the Site Collection URL
// of the SharePoint document location record.
RetrieveAbsoluteAndSiteCollectionUrlRequest retrieveRequest = new RetrieveAbsoluteAndSiteCollectionUrlRequest
{
    Target = new EntityReference(SharePointDocumentLocation.EntityLogicalName, _spDocLocId)
};
RetrieveAbsoluteAndSiteCollectionUrlResponse retriveResponse = (RetrieveAbsoluteAndSiteCollectionUrlResponse)_serviceProxy.Execute(retrieveRequest);

Console.WriteLine("Absolute URL of document location record is '{0}'.", retriveResponse.AbsoluteUrl.ToString());
Console.WriteLine("Site Collection URL of document location record is '{0}'.", retriveResponse.SiteCollectionUrl.ToString());

' Retrieve the absolute URL and the Site Collection URL
' of the SharePoint document location record.
Dim retrieveRequest As RetrieveAbsoluteAndSiteCollectionUrlRequest =
 New RetrieveAbsoluteAndSiteCollectionUrlRequest With {
  .Target = New EntityReference(SharePointDocumentLocation.EntityLogicalName, _spDocLocId)
 }
Dim retriveResponse As RetrieveAbsoluteAndSiteCollectionUrlResponse =
 CType(_serviceProxy.Execute(retrieveRequest), RetrieveAbsoluteAndSiteCollectionUrlResponse)

Console.WriteLine("Absolute URL of document location record is '{0}'.", retriveResponse.AbsoluteUrl.ToString())
Console.WriteLine("Site Collection URL of document location record is '{0}'.", retriveResponse.SiteCollectionUrl.ToString())

참고 항목

RetrieveAbsoluteAndSiteCollectionUrlRequest
RetrieveAbsoluteAndSiteCollectionUrlResponse
SharePoint와 Microsoft Dynamics 365 통합
SharePoint 통합 시작
엔터티에 대해 문서 관리 사용
SharePoint 통합 엔터티
샘플: 엔터티에 대해 문서 관리 사용
샘플: SharePoint 위치 레코드 만들기, 검색, 업데이트 및 삭제
샘플: 절대 URL 및 위치 레코드의 사이트 모음 URL 검색
Microsoft Dynamics 365과 OneNote 통합

Microsoft Dynamics 365

© 2017 Microsoft. All rights reserved. 저작권 정보