As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
String categoryName = "yourCategoryName"; ParentReference categoryParentRef = new ParentReference(); categoryParentRef.setStore(WORKSPACE_STORE); categoryParentRef.setPath("/cm:categoryRoot/cm:generalclassifiable"); categoryParentRef.setChildName(Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, categoryName)); categoryParentRef.setAssociationType(Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, "subcategories")); NamedValue[] categoryProperties = new NamedValue[] { Utils.createNamedValue(Constants.PROP_NAME, categoryName) }; CMLCreate createCategory = new CMLCreate("addCategory", categoryParentRef, null, Constants.ASSOC_CONTAINS, null, Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL, "category"), categoryProperties); CML cml = new CML(); cml.setCreate(new CMLCreate[]{ createCategory }); UpdateResult[] updateResult = getRepositoryService().update(cml); Reference categoryReference = updateResult[0].getDestination();
And how can I create a new Classification?