/** * Utility method for renaming CMIS object * @param object CMIS object to rename * @param name new name */ private void rename(CmisObject object, String name){ Map<String, Object> newName = new HashMap<String, Object>(); newName.put("cmis:name", name); object.updateProperties(newName); }
public CmisObject updateObjectProperties(CmisObject cmisObject, String objectId, Map<String, Object> properties) { CmisObject returnObj = null; validateObjectOrId(cmisObject, objectId); validateRedundantIdentifier(cmisObject, objectId); Validate.notNull(properties, "properties is null"); CmisObject target = getCmisObject(cmisObject, objectId); if (target != null) { returnObj = target.updateProperties(properties); } else { logger.error("Unable to obtain the object reference in order to update the properties of the object."); } return returnObj; // End updateObjectProperties }
@Override public void updateProperties(final Path path, final Map<String, String> properties) throws IOException{ sessionExistsPreCondition(); // throws illegalStateException if no session String pathAsString = path2absoluteSlashSeparatedString(path); CmisObject cmisobject = getCmisObject(pathAsString); // transform the map into a list, // http://stackoverflow.com/questions/4895376/how-to-transfom-mapstring-string-to-liststring-using-google-collections List<String> tags = Lists.newArrayList( Iterables.transform( properties.entrySet(), new Function<Map.Entry<String, String>, String>(){ @Override public String apply(final Map.Entry<String, String> input){ return JOINER.skipNulls().join(input.getKey(), input.getValue()); } } ) ); // then store the list under the key 'sap:tags' Map<String, Object> sapTags = new HashMap<String, Object>(); sapTags.put("sap:tags", tags); cmisobject.updateProperties(sapTags); }
cmisObject.updateProperties(updateProperties);
cmisObject.updateProperties(updateProperties);
Map<String, Object> map = new HashMap<String, Object>(); map.put(PropertyIds.NAME, name); co.updateProperties(map, true); } else if (name.contains("__POPUP_ALWAYS__")) { popup = true;