使用jquery SPServices的Sharepoint:如何从GetListItems响应中排除“编辑器”字段

时间:2016-12-05 18:26:21

标签: jquery sharepoint soap sharepoint-2013 spservices

我正在尝试获取sharepoint列表项,同时排除某些字段(出于安全目的) 请求SOAP XML如下

<soap:Envelope
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
<soap:Body>
    <GetListItems
        xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
        <listName>{037A8C92-8A2C-4DC6-9B39-0916997A8ECC}</listName>
        <viewName></viewName>
        <query>
            <Query>
                <OrderBy Override="false"></OrderBy>
            </Query>
        </query>
        <viewFields>
            <ViewFields>
                <FieldRef Name="ContentTypeId"/>
                <FieldRef Name="_ModerationComments"/>
                <FieldRef Name="FileLeafRef"/>
                <FieldRef Name="Modified_x0020_By"/>
                <FieldRef Name="Created_x0020_By"/>
                <FieldRef Name="File_x0020_Type"/>
                <FieldRef Name="HTML_x0020_File_x0020_Type"/>
                <FieldRef Name="_SourceUrl"/>
                <FieldRef Name="_SharedFileIndex"/>
                <FieldRef Name="Title"/>
                <FieldRef Name="TemplateUrl"/>
                <FieldRef Name="xd_ProgID"/>
                <FieldRef Name="xd_Signature"/>
                <FieldRef Name="_dlc_DocId"/>
                <FieldRef Name="_dlc_DocIdUrl"/>
                <FieldRef Name="_dlc_DocIdPersistId"/>
                <FieldRef Name="ID"/>
                <FieldRef Name="ContentType"/>
                <FieldRef Name="Created"/>
                <FieldRef Name="Modified"/>
                <FieldRef Name="_HasCopyDestinations"/>
                <FieldRef Name="_CopySource"/>
                <FieldRef Name="_ModerationStatus"/>
                <FieldRef Name="FileRef"/>
                <FieldRef Name="FileDirRef"/>
                <FieldRef Name="Last_x0020_Modified"/>
                <FieldRef Name="Created_x0020_Date"/>
                <FieldRef Name="File_x0020_Size"/>
                <FieldRef Name="FSObjType"/>
                <FieldRef Name="SortBehavior"/>
                <FieldRef Name="PermMask"/>
                <FieldRef Name="CheckedOutUserId"/>
                <FieldRef Name="IsCheckedoutToLocal"/>
                <FieldRef Name="CheckoutUser"/>
                <FieldRef Name="UniqueId"/>
                <FieldRef Name="SyncClientId"/>
                <FieldRef Name="ProgId"/>
                <FieldRef Name="ScopeId"/>
                <FieldRef Name="VirusStatus"/>
                <FieldRef Name="CheckedOutTitle"/>
                <FieldRef Name="_CheckinComment"/>
                <FieldRef Name="LinkCheckedOutTitle"/>
                <FieldRef Name="_EditMenuTableStart"/>
                <FieldRef Name="_EditMenuTableStart2"/>
                <FieldRef Name="_EditMenuTableEnd"/>
                <FieldRef Name="LinkFilenameNoMenu"/>
                <FieldRef Name="LinkFilename"/>
                <FieldRef Name="LinkFilename2"/>
                <FieldRef Name="DocIcon"/>
                <FieldRef Name="ServerUrl"/>
                <FieldRef Name="EncodedAbsUrl"/>
                <FieldRef Name="BaseName"/>
                <FieldRef Name="FileSizeDisplay"/>
                <FieldRef Name="MetaInfo"/>
                <FieldRef Name="_Level"/>
                <FieldRef Name="_IsCurrentVersion"/>
                <FieldRef Name="ItemChildCount"/>
                <FieldRef Name="FolderChildCount"/>
                <FieldRef Name="SelectTitle"/>
                <FieldRef Name="SelectFilename"/>
                <FieldRef Name="Edit"/>
                <FieldRef Name="owshiddenversion"/>
                <FieldRef Name="_UIVersion"/>
                <FieldRef Name="_UIVersionString"/>
                <FieldRef Name="InstanceID"/>
                <FieldRef Name="Order"/>
                <FieldRef Name="GUID"/>
                <FieldRef Name="WorkflowVersion"/>
                <FieldRef Name="WorkflowInstanceID"/>
                <FieldRef Name="ParentVersionString"/>
                <FieldRef Name="ParentLeafName"/>
                <FieldRef Name="DocConcurrencyNumber"/>
                <FieldRef Name="Combine"/>
                <FieldRef Name="RepairDocument"/>
            </ViewFields>
        </viewFields>
        <rowLimit>0</rowLimit>
        <queryOptions>
            <QueryOptions>
                <ViewFieldsOnly>TRUE</ViewFieldsOnly>
                <IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
                <IncludeAttachmentUrls>TRUE</IncludeAttachmentUrls>
                <ExpandUserField>TRUE</ExpandUserField>
                <ViewAttributes Scope="Default"/>
            </QueryOptions>
        </queryOptions>
    </GetListItems>
</soap:Body>

ViewFields部分不包含Editor字段,无论答案中是否存在! 以这种方式发送请求成功排除了其他字段。但Editor不符合此解决方案。 我的问题是为什么这个领域如此特别?以及如何排除它?

1 个答案:

答案 0 :(得分:0)

字段:

<FieldRef Name="Modified_x0020_By"/>

Editor

是一样的

尝试从<ViewFields>中删除此字段,但不应再次显示。