Designers > K2 Designer for SharePoint 2010 > Configuration Settings for K2 for SharePoint 2010 > SmartObject Integration > Using SmartObjects in SharePoint | Send feedback |
K2 SmartObjects can be associated with SharePoint Lists and Document Libraries.
The following K2 SmartObject methods are created when associating a SharePoint List with a K2 Process:
Method | Description | Comments |
---|---|---|
Get List | Retrieves a list of items in the list with their metadata from the SharePoint Library. | Attachments are not downloaded with this method. You will get a link to the Item as one of the returned properties of each item in the list. You may pass values into the input properties of the list method to filter the list of returned documents. |
Load | Reads one specific list item’s metadata from a list. | You will need to provide the Id (integer) of the list item. |
Create | Adds a new item to the target list. | You must provide values for the required properties of the list, and optionally all other metadata values. The Create method will return the ID of the new item in the SharePoint list and a link to the item. |
Update | Updates an existing item in the SharePoint list. | You must provide the ID of the item that will be updated, along with any required properties and optionally all other metadata values. |
Delete | Deletes an existing item in the SharePoint list. | You must provide the ID of the item that will be deleted. |
Add Attachment | Adds an attachment to a List Item. | You must provide the ID of the list item that the attachment will be added to (the list item should exist already). The document attachment must be added as a binary File property of the SmartObject method. |
List Folders | Retrieves a list of the folders for the target list. |
The following K2 SmartObject methods are created when associating a SharePoint Document Library with a K2 Process:
Method | Description | Comments |
---|---|---|
Get List | Retrieves a list of documents with metadata from the SharePoint Library. | The document content is not downloaded, but a link to the document will be available in the returned properties. You may pass values into the input properties of the list method to filter the list of returned documents. |
Load | Reads one specific document’s metadata from a library. | You will need to provide the Name of the document. The document content is not downloaded, but a link to the document will be available in the returned properties. |
Create | Adds a new document to the target library. | You must provide values for the required properties (metadata) of the library, and can also provide additional input values like the folder to save the document to (the folder must exist already). The document content must be passed in as a File (binary) data type. This method will return the ID, Name, Folder and a link to the new document. |
Update Document | Updates the content of an existing document in a SharePoint library (and optionally, folder) | You must provide the file content in binary format, and this method will overwrite the existing file with the new file. |
Update Document Meta data | Updates the metadata for an existing document in a library. | You must provide the name of the document to update as well as any required properties of the library. |
Retrieve Document | Downloads the specified document from SharePoint. | You must provide the Name (and optionally, folder) of the document to retrieve. The document content will be downloaded to a binary File property in the SmartObject. |
Delete Document | Deletes the specified document form the SharePoint Library. | You must provide the Name (and optionally, folder) of the document that will be deleted. |
Check In | Checks in a document that is checked out. | You must provide the name (and optionally, folder) of the item to be checked in. Note: This method does not upload document itself, you must use the Update Document method to do so. |
Check Out | Checks out a specific document. | You must provide the name (and optionally, folder) of the item to be checked out. Note: This method does not download the document itself, you must use the Retrieve Document method to do so. |
List Folders | Retrieves a list of the folders for the target document library. |
Content Types can be defined as a collection of meta data fields. To learn more about how Content Types work see Microsoft's documentation on Content Types http://office.microsoft.com/en-us/sharepointtechnology/HA101215701033.aspx.
When Content Types are enabled on a List , and SmartObjects are created in SharePoint a SmartObject will be created for each Content Type in that SharePoint List. If a Content Type is therefore deleted the other Content Types and SmartObjects will continue to function. The SmartObject for that specific Content Type will however not function any more.
When Content Types are not enabled on a List at the time of creating a SmartObject only one SmartObject will be created for that SharePoint List. If Content Types should be enabled at a later stage this SmartObject will no longer function and the SmartObjects will have to be recreated or refreshed for this SharePoint List.