SharepointListItemProcessor
The following class diagram details the SharepointListItemProcessor object.
Public Methods
The SharePointListItemProcessor supports the following operations:
ExecuteCreate
Overrides base Operation Sequence Component method. This example creates a single entry into a SharePoint list:
CommerceCreate<spAnnouncement> create = new CommerceCreate<spAnnouncement>();
create.Model.Properties.Add("Title", "This is my list title2");
create.Model.Properties.Add("Body", "This is the list Body2!");
create.Model.Properties.Add("Expires", System.Convert.ToDateTime("12/01/2008 10:52AM"));
CreateOperationResponse response = OperationService.ProcessRequest(base.GetCurrentRequestContext(), create.ToRequest()).OperationResponses[0] as CreateOperationResponse;
ExecuteDelete
Overrides base Operation Sequence Component method. This example deletes a single entry from a SharePoint list.
CommerceDelete<spAnnouncement> deleteRequest = new CommerceDelete<spAnnouncement>();
deleteRequest.Model.Properties.Add("ListItemGuid", ListItemGuid);
CommerceDeleteOperationResponse responseDelete = OperationService.ProcessRequest(base.GetCurrentRequestContext(),deleteRequest.ToRequest()).OperationResponses[0] as CommerceDeleteOperationResponse;
ExecuteQuery
Overrides base Operation Sequence Component method. This example retries 0 or more list entries from a SharePoint list.
CommerceQuery<spAnnouncement> queryRequest = new CommerceQuery<spAnnouncement>();
queryRequest.SearchCriteria.WhereClause=@"<Where><Eq><FieldRef Name='ID' /><Value Type='Counter'>" + ListItemGuid + "</Value></Eq></Where>";
queryRequest.SearchCriteria.NumberOfItemsToReturn = 1;
//Specify fields to return
queryRequest.Model.Properties.Add("Title");
queryRequest.Model.Properties.Add("Body");
CommerceQueryOperationResponse responseQuery = OperationService.ProcessRequest(base.GetCurrentRequestContext(), queryRequest.ToRequest()).OperationResponses[0] as CommerceQueryOperationResponse;
ExecuteUpdate
Overrides base Operation Sequence Component method. This example updates a single list entry in SharePoint.
CommerceUpdate<spAnnouncement> updateRequest = new CommerceUpdate<spAnnouncement>();
updateRequest.Model.Properties.Add("ID", ListItemGuid);
updateRequest.Model.Properties.Add("Title", "This is the new Title");
CommerceUpdateOperationResponse responseUpdate =
OperationService.ProcessRequest(base.GetCurrentRequestContext(), updateRequest.ToRequest()).OperationResponses[0] as UpdateOperationResponse;
Exceptions
A ConfigurationErrorsException will be thrown if any of the following metadata properties are missing or empty:
server
site
port
listName