Search code examples
javaalfrescoalfresco-sharealfresco-webscriptscmis-workbench

How to Update Document properties using CMIS


I have one external web application through that i connected to alfresco repository using CMIS.

I am already able to upload document in to repository or able to download n view document.

Now my requirement is, I have to Update Specific Documents Properties.

So can any one please provide sample code or steps to update document properties Using CMIS.

Thanks in Advance...


Solution

  • try this worked fine for me

    Session session = getSession(serverUrl, username, password);
    Document targetFile = (Document) session.getObject(path);
    Map<String, Object> properties = new HashMap<>();
    properties.put(PropertyIds.NAME, name);
    targetFile.updateProperties(properties);
    

    In my example you only have to replace name with whatever you want

    Hope that helped you