Monday 29 April 2019

CMIS: Set extensions to an object


By getting the ObjectData, we can set the extensions to an object.

Below method is used to set the extensions to an object.

         private static void setExtensions(ObjectData objData) {
                  CmisExtensionElement leafExtension1 = new CmisExtensionElementImpl("", "confidentialLevel", null,
                                    "confidential");
                  CmisExtensionElement leafExtension2 = new CmisExtensionElementImpl("", "rootFolderId", null, "folder_1234");
                  CmisExtensionElement leafExtension3 = new CmisExtensionElementImpl("", "classification", null, "public");

                  List<CmisExtensionElement> list = new ArrayList<>();
                  list.add(leafExtension1);
                  list.add(leafExtension2);
                  list.add(leafExtension3);

                  CmisExtensionElement parentExtension = new CmisExtensionElementImpl("", "parentExtension", null, list);

                  List<CmisExtensionElement> extensions = Collections.singletonList(parentExtension);

                  objData.setExtensions(extensions);
         }



Previous                                                 Next                                                 Home

No comments:

Post a Comment