chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Potts <jeffpott...@gmail.com>
Subject Re: Inmemory cmis instance does not support creating document with version state
Date Wed, 05 Sep 2018 16:59:29 GMT
Kar,

Did you forget to include the error you are seeing?

Jeff

On Tue, Sep 4, 2018 at 10:23 AM Kar Tech <kartech11@gmail.com> wrote:

> Hi Dev Team,
>
> I am trying to create a document against the inmemory CMIS instance that is
> locally running in my machine.
>
> I get the below error, when I try to create a document with
> VersioningState.MAJOR
>
> Does my in memory instance need to be setup with any specify operation
> context to support versioning? or is there any other setup required ?
> Based on the apache documentation, seems like versioning is automatically
> supported.
>
> Below is my createDocument method for reference
>
> Thanks
> Kar
>
> private static Document createDocument(UserSession userSession, Folder
> parentFolder, String documentName, byte[] data, String mimeType,
> Map<String, Object> metadata ) throws ActionNotEntitledException {
>     Document document;
>     if(isActionEntitled(Action.CAN_CREATE_DOCUMENT,
> parentFolder.getAllowableActions().getAllowableActions())){
>         ByteArrayInputStream stream = new ByteArrayInputStream(data);
>         ContentStream contentStream =
>
> userSession.getSession().getObjectFactory().createContentStream(documentName,
> data.length, mimeType, stream);
>
>         // prepare properties
>         Map<String, Object> documentProperties = new HashMap<>();
>         documentProperties.put(PropertyIds.NAME, documentName);
>         documentProperties.put(PropertyIds.OBJECT_TYPE_ID,
> "cmis:document");
>         document = parentFolder.createDocument(documentProperties,
> contentStream,  VersioningState.MAJOR, null, null,null, );
>         //Add secondary properties such as aspect properties
>         if(metadata != null && !metadata.isEmpty()){
>             document.updateProperties(metadata);
>         }
>     }
>     else{
>         throw new ActionNotEntitledException("User " +
> userSession.getUserName() + " not entitled to create Document");
>     }
>     return document;
> }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message