none
SiteData.GetContent Return XML

    Question

  • Hi,

    I am using the SharePoint WebServices to gain all of my information concerning specific SharePoint sites. I have just found that the "GetContent" function of the "SiteData" webservice which I will be using to retrieve the permissions of a specific folder, as I don't see any alternative web service classes/functions that can get the specific permissions of a folder.

    I am using the function as follows to retrieve the permissions of a subfolder "Test" which is within the folder "SubTest", which is within the List "Shared Documents" (Shared Documents is the parameter "{CA2AEB37-1E82-4030-A819-2566DDC49A07}"):


    String result = site.GetContent(
    WindowsApplication1.SiteDataService.ObjectType.Folder, 
    "{CA2AEB37-1E82-4030-A819-2566DDC49A07}" , "Test\\SubTest" ,
    "" , false ,
    true
    , ref refString);


    This seems to do the job, kinda! It returns an xml document, where the information that concerns me is at the end, as follows under the scopes tag:

    <scopes>
    <scope id='{ae3ab3cc-e77d-448b-8d76-9984152da7f3}' >
    <permission memberid='4' mask='206292717568' />
    <permission memberid='24' mask='9223372036854775807' />
    <permission memberid='27' mask='756052856929' />
    </scope>
    <scope id='{d9f46d01-baa2-4c10-bf3d-604ce22fe17f}' >
    <permission memberid='4' mask='9223372036854775807' />
    <permission memberid='24' mask='9223372036854775807' />
    <permission memberid='27' mask='9223372036854775807' />
    </scope>
    <scope id='{d92e5434-45b2-4ecf-8fbf-aa4208ff0b3a}' >
    <permission memberid='24' mask='9223372036854775807' />
    </scope>
    </scopes>


    Now, this gives me three "scopes" which from the looks of things is the scopes of the list, the parent folder, and the actual folder that I am looking for the permissions on (In the xml file above this is the last scope element).

    My question is this; how do I determine which scope element corresponds to the folder I am looking for?

    I would assume that the scope id variable is the way of doing it, but this id number does not relate to the unique id number that I have manually retrieved from SharePoint (using funtions like "GetListItems", etc).

    Any help would be most appeciated!

    Thought: I suppose I could always assume that it will always be the last scope element? I wouldn't want to do this though unless it is confirmed that the last scope element is always the element we are searching for.
    Friday, October 23, 2009 3:25 PM

Answers

  • When I call SiteData.GetContent(SiteDataService.ListItem, "01cb06c0-e02d-4988-a179-0d06d60f2efa","tester4\newfolder", "115", false, true, out null)

    Where 01cb06c0-e02d-4988-a179-0d06d60f2efa represents the guid of the folder
    Where "tester4\newfolder" represents the url to the folder
    Where 115 represents the ID of the folder in the document library

    Then it returns the following:

    <Item>
    - <Metadata>
    - <scope id="{95cea0fc-def4-46a3-8d51-c40aeb6cbcca}">
    - <permissions>
      <permission memberid="1" mask="206292717568" /> 
      <permission memberid="3" mask="756052856897" /> 
      <permission memberid="4" mask="9223372036854775807" /> 
      <permission memberid="5" mask="756052856929" /> 
      <permission memberid="6" mask="1856436900591" /> 
      <permission memberid="10" mask="206292717568" /> 
      <permission memberid="11" mask="1856438737919" /> 
      <permission memberid="12" mask="4611688150860241903" /> 
      <permission memberid="13" mask="1856436900863" /> 
      <permission memberid="14" mask="206292848673" /> 
      <permission memberid="15" mask="206292717568" /> 
      <permission memberid="18" mask="1856438737919" /> 
      <permission memberid="1073741823" mask="206292717568" /> 
      </permissions>
      </scope>
      </Metadata>
    + <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    - <s:Schema id="RowsetSchema">
    - <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">
    - <s:AttributeType name="ows_ID" rs:name="ID" rs:number="1">
      <s:datatype dt:type="i4" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_MetaInfo" rs:name="Property Bag" rs:number="2">
      <s:datatype dt:type="int" dt:lookup="true" dt:maxLength="2147483646" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows__ModerationStatus" rs:name="Approval Status" rs:number="3">
      <s:datatype dt:type="i4" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows__Level" rs:name="Level" rs:number="4">
      <s:datatype dt:type="ui1" dt:maxLength="1" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Last_x0020_Modified" rs:name="Modified" rs:number="5">
      <s:datatype dt:type="datetime" dt:lookup="true" dt:maxLength="8" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_owshiddenversion" rs:name="owshiddenversion" rs:number="6">
      <s:datatype dt:type="i4" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_UniqueId" rs:name="Unique Id" rs:number="7">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="38" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_FSObjType" rs:name="Item Type" rs:number="8">
      <s:datatype dt:type="ui1" dt:lookup="true" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Created_x0020_Date" rs:name="Created" rs:number="9">
      <s:datatype dt:type="datetime" dt:lookup="true" dt:maxLength="8" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_ProgId" rs:name="ProgId" rs:number="10">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_FileLeafRef" rs:name="Name" rs:number="11">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_HTML_x0020_File_x0020_Type" rs:name="HTML File Type" rs:number="12">
      <s:datatype dt:type="string" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Modified" rs:name="Modified" rs:number="13">
      <s:datatype dt:type="datetime" dt:maxLength="8" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_CheckoutUser" rs:name="Checked Out To" rs:number="14">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_FileRef" rs:name="URL Path" rs:number="15">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_DocIcon" rs:name="Type" rs:number="16">
      <s:datatype dt:type="string" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Editor" rs:name="Modified By" rs:number="17">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
      </s:ElementType>
      </s:Schema>
      <scopes /> 
    - <rs:data ItemCount="1">
      <z:row ows_ID="115" ows_MetaInfo="115;#vti_rtag:SW|rt:2A0BA3EE-F291-498D-A40D-93AF2FD15940@00000000000 vti_etag:SW|"{2A0BA3EE-F291-498D-A40D-93AF2FD15940},0" vti_modifiedby:SR|BASESMCDEV2\\steve.curran vti_title:SW|newfolder ContentTypeId:SW|0x012000CF003E70A9742F42BE1EBE4543497EA3 ContentType:SW|Folder vti_replid:SR|rid:{2A0BA3EE-F291-498D-A40D-93AF2FD15940}" ows__ModerationStatus="0" ows__Level="1" ows_Last_x0020_Modified="115;#2009-10-26T17:08:45Z" ows_owshiddenversion="0" ows_UniqueId="115;#{916228D8-A862-4CAD-A888-40B7D4DD75FC}" ows_FSObjType="115;#1" ows_Created_x0020_Date="115;#2009-06-04T16:29:35Z" ows_ProgId="115;#" ows_FileLeafRef="115;#newfolder" ows_Modified="2009-10-26T17:08:45Z" ows_FileRef="115;#sites/tester1/tester4/newfolder" ows_Editor="1;#steve.curran" ows_ServerRedirected="0" /> 
      </rs:data>
      </xml>
      </Item>
    The scope id represents the guid to the RoleAssignment collection for the permissions of the folder. I don't know why you are getting multiple scopes, but try calling the method as I have listed above.

    The supporting documentation for the sitedata web service can be obtained here:

    http://download.microsoft.com/download/8/5/8/858F2155-D48D-4C68-9205-29460FD7698F/%5BMS-SITEDATS%5D.pdf

    You can read page 74 for more information.
    certdev.com
    • Marked as answer by Chengyi Wu Tuesday, October 27, 2009 12:47 AM
    Monday, October 26, 2009 6:45 PM

All replies

  • When I call SiteData.GetContent(SiteDataService.ListItem, "01cb06c0-e02d-4988-a179-0d06d60f2efa","tester4\newfolder", "115", false, true, out null)

    Where 01cb06c0-e02d-4988-a179-0d06d60f2efa represents the guid of the folder
    Where "tester4\newfolder" represents the url to the folder
    Where 115 represents the ID of the folder in the document library

    Then it returns the following:

    <Item>
    - <Metadata>
    - <scope id="{95cea0fc-def4-46a3-8d51-c40aeb6cbcca}">
    - <permissions>
      <permission memberid="1" mask="206292717568" /> 
      <permission memberid="3" mask="756052856897" /> 
      <permission memberid="4" mask="9223372036854775807" /> 
      <permission memberid="5" mask="756052856929" /> 
      <permission memberid="6" mask="1856436900591" /> 
      <permission memberid="10" mask="206292717568" /> 
      <permission memberid="11" mask="1856438737919" /> 
      <permission memberid="12" mask="4611688150860241903" /> 
      <permission memberid="13" mask="1856436900863" /> 
      <permission memberid="14" mask="206292848673" /> 
      <permission memberid="15" mask="206292717568" /> 
      <permission memberid="18" mask="1856438737919" /> 
      <permission memberid="1073741823" mask="206292717568" /> 
      </permissions>
      </scope>
      </Metadata>
    + <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    - <s:Schema id="RowsetSchema">
    - <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">
    - <s:AttributeType name="ows_ID" rs:name="ID" rs:number="1">
      <s:datatype dt:type="i4" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_MetaInfo" rs:name="Property Bag" rs:number="2">
      <s:datatype dt:type="int" dt:lookup="true" dt:maxLength="2147483646" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows__ModerationStatus" rs:name="Approval Status" rs:number="3">
      <s:datatype dt:type="i4" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows__Level" rs:name="Level" rs:number="4">
      <s:datatype dt:type="ui1" dt:maxLength="1" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Last_x0020_Modified" rs:name="Modified" rs:number="5">
      <s:datatype dt:type="datetime" dt:lookup="true" dt:maxLength="8" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_owshiddenversion" rs:name="owshiddenversion" rs:number="6">
      <s:datatype dt:type="i4" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_UniqueId" rs:name="Unique Id" rs:number="7">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="38" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_FSObjType" rs:name="Item Type" rs:number="8">
      <s:datatype dt:type="ui1" dt:lookup="true" dt:maxLength="4" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Created_x0020_Date" rs:name="Created" rs:number="9">
      <s:datatype dt:type="datetime" dt:lookup="true" dt:maxLength="8" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_ProgId" rs:name="ProgId" rs:number="10">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_FileLeafRef" rs:name="Name" rs:number="11">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_HTML_x0020_File_x0020_Type" rs:name="HTML File Type" rs:number="12">
      <s:datatype dt:type="string" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Modified" rs:name="Modified" rs:number="13">
      <s:datatype dt:type="datetime" dt:maxLength="8" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_CheckoutUser" rs:name="Checked Out To" rs:number="14">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_FileRef" rs:name="URL Path" rs:number="15">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_DocIcon" rs:name="Type" rs:number="16">
      <s:datatype dt:type="string" dt:maxLength="512" /> 
      </s:AttributeType>
    - <s:AttributeType name="ows_Editor" rs:name="Modified By" rs:number="17">
      <s:datatype dt:type="string" dt:lookup="true" dt:maxLength="512" /> 
      </s:AttributeType>
      </s:ElementType>
      </s:Schema>
      <scopes /> 
    - <rs:data ItemCount="1">
      <z:row ows_ID="115" ows_MetaInfo="115;#vti_rtag:SW|rt:2A0BA3EE-F291-498D-A40D-93AF2FD15940@00000000000 vti_etag:SW|"{2A0BA3EE-F291-498D-A40D-93AF2FD15940},0" vti_modifiedby:SR|BASESMCDEV2\\steve.curran vti_title:SW|newfolder ContentTypeId:SW|0x012000CF003E70A9742F42BE1EBE4543497EA3 ContentType:SW|Folder vti_replid:SR|rid:{2A0BA3EE-F291-498D-A40D-93AF2FD15940}" ows__ModerationStatus="0" ows__Level="1" ows_Last_x0020_Modified="115;#2009-10-26T17:08:45Z" ows_owshiddenversion="0" ows_UniqueId="115;#{916228D8-A862-4CAD-A888-40B7D4DD75FC}" ows_FSObjType="115;#1" ows_Created_x0020_Date="115;#2009-06-04T16:29:35Z" ows_ProgId="115;#" ows_FileLeafRef="115;#newfolder" ows_Modified="2009-10-26T17:08:45Z" ows_FileRef="115;#sites/tester1/tester4/newfolder" ows_Editor="1;#steve.curran" ows_ServerRedirected="0" /> 
      </rs:data>
      </xml>
      </Item>
    The scope id represents the guid to the RoleAssignment collection for the permissions of the folder. I don't know why you are getting multiple scopes, but try calling the method as I have listed above.

    The supporting documentation for the sitedata web service can be obtained here:

    http://download.microsoft.com/download/8/5/8/858F2155-D48D-4C68-9205-29460FD7698F/%5BMS-SITEDATS%5D.pdf

    You can read page 74 for more information.
    certdev.com
    • Marked as answer by Chengyi Wu Tuesday, October 27, 2009 12:47 AM
    Monday, October 26, 2009 6:45 PM
  • I had the same issue.

    It happens when you break inheritance on a folder or Item.

    Then, GetContent returns the RoleAssignments of the parent and of the (item or folder). 
    But I don't know the best solution to know what is the good scope.

    One solution would be to retreive the list (using GetContent). There is on "Metadata" XML element the attribute "ScopeId". So you know that this ScopeId is not the good one ?


    Sylvain Reverdy
    Consultant / Formateur Winwise à Tahiti
    Mon blog
    Twitter : @sreverdy

    Thursday, March 08, 2012 8:39 PM