Class Copy
- java.lang.Object
-
- com.avoka.component.sharepoint.AbstractService
-
- com.avoka.component.sharepoint.service.Copy
-
public class Copy extends AbstractService
Provides a Copy SharePoint web service class.Copy SharePoint Example
The Groovy script example below illustrates using the
Copy
service to copy aDocument
to the SharePoint server. In this examples configuration Service Parameters are accessed via theserviceParameters
map object.import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.Copy // Create a SharePoint client using the Service Parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a Copy web service def copyService = spClient.getCopy() def path = "http://test-sharepoint/form/" + submission.receiptNumber + ".pdf" def displayName = submission.formName + " " + submission.receiptNumber def internalName = displayName def sourcePath = "http://null" // Copy document to location copyService.copyIntoItems(path, displayName, internalName, sourcePath, receiptPDF)
- Since:
- 3.5.0
-
-
Constructor Summary
Constructors Constructor Description Copy(SPConnection sharePointConnection)
Instantiate the Copy Interface wrapper with SharePoint Connection context
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CopyResult
copyIntoItems(String path, String displayName, String internalName, String sourcePath, byte[] data)
Copies a document to a location on the SharePoint Server.byte[]
getItem(String path)
Get a byte[] representation of a document by URL.String
getServiceName()
Return the web service name.-
Methods inherited from class com.avoka.component.sharepoint.AbstractService
buildAttributeMap, getByteStream, getDocumentElement, getDocumentTagValue, getRequestMessage, getSPConnection, getWsdlUrl, loadProperty, postMessage, postMessage
-
-
-
-
Constructor Detail
-
Copy
public Copy(SPConnection sharePointConnection)
Instantiate the Copy Interface wrapper with SharePoint Connection context- Parameters:
sharePointConnection
- SharePoint connection context
-
-
Method Detail
-
getServiceName
public String getServiceName()
Return the web service name.- Specified by:
getServiceName
in classAbstractService
- Returns:
- the web service name
-
copyIntoItems
public CopyResult copyIntoItems(String path, String displayName, String internalName, String sourcePath, byte[] data) throws SPException
Copies a document to a location on the SharePoint Server. The method returns aCopyResult
object which contains a result of the copy operation.Groovy Example
The Groovy script example below illustrates using the
Copy
service to copy aDocument
to the SharePoint server.The example below is perform a submission delivery using the
SPClient(Map)
constructor, where the server connection details are configured as Service Parameters. The service parameters must include:username
- the SharePoint server login usernamepassword
- the SharePoint server login passwordurl
- the SharePoint server URLdomain
- the SharePoint server Domain
// Provides a Groovy script based submission delivery process. // // Script parameters include: // submission : com.avoka.fc.core.entity.Submission // submissionXml : String // receiptPDF : byte[] // attachmentsMap : Map
// deliveryCheckpoint : com.avoka.fc.core.service.submission.DeliveryCheckpointService // serviceDefinition : com.avoka.fc.core.entity.ServiceDefinition // serviceParameters : Map import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.Copy // Create a SharePoint client using the service parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a Copy web service def copyService = spClient.getCopy() // Copy the PDF receipt to location def path = "http://test-sharepoint/form/" + submission.receiptNumber + ".pdf" def displayName = submission.formName + " " + submission.receiptNumber def internalName = displayName def sourcePath = "http://null" def copyResult = copyService.copyIntoItems(path, displayName, internalName, sourcePath, receiptPDF) Web Service Method
The Microsoft SharePoint Web Service SOAP Method:
http://schemas.microsoft.com/sharepoint/soap/CopyIntoItems
The MSDN Method Reference:
http://msdn.microsoft.com/en-us/library/copy.copy.copyintoitems.aspx
- Parameters:
path
- Destination url location of the copied itemdisplayName
- Item's display name field informationinternalName
- Item's internal name field informationsourcePath
- Absolute source URL of the copied itemdata
- Array of Base64 bytes containing the item- Returns:
- CopyResult result of the copy item operation
- Throws:
SPException
- in case of SharePoint error response
-
getItem
public byte[] getItem(String path) throws SPException
Get a byte[] representation of a document by URL.Groovy Example
The Groovy script example below illustrates using the
Copy
object to retrieve anByte
array item object. In this examples configuration Service Parameters are accessed via theserviceParameters
map object.import com.avoka.component.sharepoint.SPClient import com.avoka.component.sharepoint.service.Copy // Create a SharePoint client using the service parameters map with the configured connection details def spClient = new SPClient(serviceParameters) // Create a Copy web service def copyService = spClient.getCopy() // Get an item byte array def itemData = copyService.getItem(serviceParameters.path)
Web Service Method
The Microsoft SharePoint Web Service SOAP Method:
http://schemas.microsoft.com/sharepoint/soap/GetItem
The MSDN Method Reference:
http://msdn.microsoft.com/en-us/library/copy.copy.getitem.aspx
- Parameters:
path
- Absolute server source URL of the item to be retrieved.- Returns:
- byte[] Base64 Byte Array representing the item
- Throws:
SPException
- in case of SharePoint error response
-
-