OpenText Cordys 10.6 documentation : CreateDocument

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-->
    <ns:KeepPrivateToUser>false</ns:KeepPrivateToUser>	
    <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, one has to 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, one has to provide the document content in a Base64 encoded format and embed it inside the DocumentContent element. 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. Consumers must leverage 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 is not existing, it will be created.

Overwrite

This element is optional. It is effective only when used with the Content Server. The default value is true.

Assuming that there already exists a document with the same hierarchical path in the Content Server, if this element is set to true, the existing document will be overwritten; otherwise a SOAP fault is thrown conveying that the document already exists.

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 will not be accessible to others other than the user who created it; otherwise the document inherits the default permissions defined at the Content Server.

Properties

The document contains the following set of properties:

  • MimeType - The content of the document can be of any Mime type.
  • LastModified - The date when the document was last modified. This is deprecated and it is recommended not to pass values into this.
 Property

 Each document can be associated with one or more properties or attributes. Each property contains the following details:

  • Name - Name of the property
  • Value - Value to be stored in the property. If the property allows multiple values, then provide multiple value node with value.
  • CategoryId - Optional Category ID, specific to the Content Server. Conveys the Category ID to which this property belongs to.

SOAP Response

This operation returns the URL of the document within the repository.

<ns:CreateDocumentResponse>
    <!--type: string-->
    <ns:DocumentURL>documentstoreroot/foldername/documentname</ns:DocumentURL>
</ns:CreateDocumentResponse>
Request Parameters

Parameter

Description

DocumentURL

The relative path of the document within the repository. The path includes the documentstore root.

 

 

Related information

Document Store