CreateDocument |
The CreateDocument Web service operation is used for creating a new document. This Web service operation is part of the Document Store Web service interface in the Repository service group.
SOAP Request
<ns:CreateDocument xmlns:ns="http://schemas.cordys.com/documentstore/default/1.0"> <!--type: string--> <ns:DocumentName>documentname</ns:DocumentName> <!--type: string--> <!-- If isUrl is true, Document Content must contain the path of the file to be stored(recommended). Else, base64 content(deprecated approach) --> <ns:DocumentContent isUrl="true"></ns:DocumentContent> <ns:Folder>Folder path in DMS</ns:Folder> <!--Optional--> <ns:Overwrite>true</ns:Overwrite> <!--Optional--> <IsMajorVersion>false</IsMajorVersion> <!--Optional--> <ns:KeepPrivateToUser>false</ns:KeepPrivateToUser> <!--Optional--> <!--Supported when used with CMIS/Archive Center. If not provided, otpp:document is considered as default type--> <CmisType>CMIS type name</CmisType> <ns:Properties> <!--Mime type of the document--> <ns:MimeType>application/pdf</ns:MimeType> <!--Zero or more repetitions--> <ns:Property> <!--type: string--> <ns:Name>property name</ns:Name> <!--type: string, repeat value tag if the property is multivalued--> <ns:Value>property value</ns:Value> <!--Optional--> <ns:CategoryId>category id in CS</ns:CategoryId> </ns:Property> </ns:Properties> </ns:CreateDocument>
Request Parameters
Parameter |
Description |
---|---|
DocumentName |
The name of the document. The document is created in the document system with the given name. |
DocumentContent |
The content of the document. If the isUrl attribute in the DocumentContent element is true, provide the path of the document. The document store connector reads the file from the given path and creates the document in the configured DMS. The default value of isUrl is true. Note: When isUrl attribute is false, you must provide the document content in a Base64 encoded format and embed it inside the DocumentContent element. However, this feature has been deprecated. The recommended approach is to set isUrl to true and provide the path of the document in the DocumentContent element. You can leverage the streaming option for optimal performance and resource consumption. |
Folder |
The folder location of the document in the document store; relative to the document root in the document store configuration. If the folder does not exist, it is created. |
Overwrite | This element is optional. It is effective only when used with OpenText Content Server. The default value is true. Assuming that there already exists a document with the same hierarchical path in the OpenText Content Server, if this element is set to true, the existing document is overwritten; otherwise a SOAP fault is thrown conveying that the document already exists. |
IsMajorVersion | This element is optional. It is effective only when used with OpenText Content Server. The default value is false.
|
KeepPrivateToUser |
This element is optional. It is effective only when used with the Content Server. The default value is false. If set to true, the document created in the Content Server is not accessible to others other than the user who created it; otherwise the document inherits the default permissions defined at the Content Server. |
CmisType |
This element is optional. It is supported only when used with Archive Center or CMIS. The default value is otpp:document. |
Properties |
The document contains the following set of properties:
|
Property | Each document can be associated with one or more properties or attributes. Each property contains the following details:
|
SOAP Response
This operation returns the URL of the document within the repository.
<ns:CreateDocumentResponse> <!--type: string--> <ns:DocumentURL>documentstoreroot/foldername/documentname</ns:DocumentURL> <!-- Version information details will be available only when document system is Content Server --> <VersionInfo> <Version> <MajorVersion>0</MajorVersion> <MinorVersion>1</MinorVersion> </Version> </VersionInfo> </ns:CreateDocumentResponse>
Response Parameters
Parameter |
Description |
---|---|
DocumentURL |
The relative path of the document within the repository. The path includes the documentstore root. |
VersionInfo | The version details of the created document. This is available only when the document system is Content Server. |
Related References