Lists.GetListItemChanges method
Retorna as alterações feitas na lista desde a data e hora especificada.
Namespace: WebSvcLists
Assembly: STSSOAP (in STSSOAP.dll)
Syntax
'Declaração
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetListItemChanges", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetListItemChanges ( _
listName As String, _
viewFields As XmlNode, _
since As String, _
contains As XmlNode _
) As XmlNode
'Uso
Dim instance As Lists
Dim listName As String
Dim viewFields As XmlNode
Dim since As String
Dim contains As XmlNode
Dim returnValue As XmlNode
returnValue = instance.GetListItemChanges(listName, _
viewFields, since, contains)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetListItemChanges", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetListItemChanges(
string listName,
XmlNode viewFields,
string since,
XmlNode contains
)
Parâmetros
listName
Type: System.StringUma cadeia de caracteres que contém o título ou o GUID da lista. Ao consultar a tabela UserInfo, a cadeia de caracteres contém "UserInfo".
viewFields
Type: System.Xml.XmlNodeUm elemento ViewFields que especifica quais campos para retornar na consulta e em qual ordem, e que podem ser atribuídas a um objeto System.Xml.XmlNode , como no exemplo a seguir.
since
Type: System.StringUma cadeia de caracteres que contém a data e hora em formato Tempo Universal Coordenado (UTC) ISO8601 início Recuperando alterações na lista. O valor desse parâmetro normalmente é recuperado de uma resposta SOAP anterior. Se esse valor for a null reference (Nothing in Visual Basic), a consulta retorna todos os itens na lista.
contains
Type: System.Xml.XmlNodeUm elemento Contains que define a filtragem personalizada para a consulta e que podem ser atribuídas a um objeto System.Xml.XmlNode , como no exemplo a seguir.
Valor retornado
Type: System.Xml.XmlNode
Um fragmento XML no seguinte formato que contém as alterações e que podem ser atribuídas a um objeto System.Xml.XmlNode :
<listitems 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"
TimeStamp="2007-03-23T22:23:18Z"
xmlns="https://schemas.microsoft.com/sharepoint/soap/">
<rs:data ItemCount="2">
<z:row ows_Attachments="0"
ows_LinkTitle="Title1"
ows_Modified="2007-03-08T23:01:48Z"
ows_MetaInfo="24;#"
ows__ModerationStatus="0"
ows__Level="1"
ows_Title="Title1"
ows_ID="24"
ows_owshiddenversion="1"
ows_UniqueId="24;#{1C6F4446-9D98-49F5-9A1C-17B0FDEA8558}"
ows_FSObjType="24;#0"
ows_Created_x0020_Date="24;#2007-03-08T23:01:48Z"
ows_Created="2007-03-08T23:01:48Z"
ows_FileLeafRef="24;#24_.000"
ows_FileRef="24;#Lists/Announcements/24_.000" />
<z:row ows_Attachments="0"
ows_LinkTitle="Title2"
ows_Modified="2007-03-23T22:24:40Z"
ows_MetaInfo="27;#"
ows__ModerationStatus="0"
ows__Level="1"
ows_Title="Title2"
ows_ID="27"
ows_owshiddenversion="1"
ows_UniqueId="27;#{D589D857-391B-43BD-A1E9-2C36D718BB82}"
ows_FSObjType="27;#0"
ows_Created_x0020_Date="27;#2007-03-23T22:24:40Z"
ows_Created="2007-03-23T22:24:40Z"
ows_FileLeafRef="27;#27_.000"
ows_FileRef="27;#Lists/Announcements/27_.000" />
...
</rs:data>
</listitems>
Examples
O exemplo de código a seguir exibe informações sobre os itens em uma lista que foram alterados após uma data especificada. O exemplo usa um objeto XmlDocument para criar objetos XmlNode para os parâmetros.
Este exemplo exige que um using (Visual c#) ou a ser incluído no espaço para nome System.Xml de diretiva de Imports (Visual Basic).
Dim listService As New Web_Reference_Folder.Lists()
listService.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim xmlDoc = New System.Xml.XmlDocument()
Dim ndViewFields As XmlNode =
xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "")
Dim ndContains As XmlNode =
xmlDoc.CreateNode(XmlNodeType.Element, "Contains", "")
ndViewFields.InnerXml = "<FieldRef Name='Field1'/>" + _
"<FieldRef Name='Field2'/><FieldRef Name='Field3' />"
ndContains.InnerXml = "<FieldRef Name='Field'/>" + _
"<Value Type='Number'>Number</Value>"
Try
Dim ndListChanges As XmlNode =
listService.GetListItemChanges("List_Name", _
ndViewFields, "2003-06-18T00:00:00Z", ndContains)
MessageBox.Show(ndListChanges.OuterXml)
Catch ex As System.Web.Services.Protocols.SoapException
MessageBox.Show("Message:" + ControlChars.Lf + ex.Message +
ControlChars.Lf + _
"Detail:" + ControlChars.Lf + ex.Detail.InnerText +
ControlChars.Lf + _
"StackTrace:" + ControlChars.Lf + ex.StackTrace)
End Try
Web_Reference_Folder.Lists listService = new Web_Reference_Folder.Lists();
listService.Credentials= System.Net.CredentialCache.DefaultCredentials;
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element,"ViewFields","");
XmlNode ndContains = xmlDoc.CreateNode(XmlNodeType.Element,"Contains","");
ndViewFields.InnerXml = "<FieldRef Name='Field1'/>" +
"<FieldRef Name='Field2'/><FieldRef Name='Field3' />";
ndContains.InnerXml = "<FieldRef Name='Field'/>" +
"<Value Type='Number'>Number</Value>";
try
{
XmlNode ndListChanges = listService.GetListItemChanges("List_Name",
ndViewFields, "2003-06-18T00:00:00Z", ndContains);
MessageBox.Show(ndListChanges.OuterXml);
}
catch (System.Web.Services.Protocols.SoapException ex)
{
MessageBox.Show("Message:\n" + ex.Message + "\nDetail:\n" +
ex.Detail.InnerText +
"\nStackTrace:\n" + ex.StackTrace);
}