/** * Retrieve a string value. * * @param properties * @param name the name of the value to retrieve * @return the first value of the given <code>name</code> or <code>null</code> if either * these are no string properties or no property of <code>name</code> exists. */ public static String getStringProperty(Properties properties, String name) { PropertyData<?> property = properties.getProperties().get(name); if (!(property instanceof PropertyString)) { return null; } return ((PropertyString) property).getFirstValue(); }
/** * Gets the change token from a property set. */ private String extractChangeToken(Properties properties) { if (properties == null) { return null; } Map<String, PropertyData<?>> propertiesMap = properties.getProperties(); if (propertiesMap == null) { return null; } PropertyData<?> changeTokenProperty = propertiesMap.get(PropertyIds.CHANGE_TOKEN); if (!(changeTokenProperty instanceof PropertyString)) { return null; } return ((PropertyString) changeTokenProperty).getFirstValue(); } }
protected String getStringProperty(ObjectData object, String name) { PropertyData<?> property = object.getProperties().getProperties().get(name); if (property instanceof PropertyString) { return ((PropertyString) property).getFirstValue(); } return null; }
protected String getStringProperty(ObjectData object, String name) { PropertyData<?> property = object.getProperties().getProperties().get(name); if (property instanceof PropertyString) { return ((PropertyString) property).getFirstValue(); } return null; }
/** * Returns the value of the given property if it exists and is of the * correct type. */ public String getStringProperty(Properties properties, String propertyId) { if ((properties == null) || (properties.getProperties() == null)) { return null; } PropertyData<?> property = properties.getProperties().get(propertyId); if (!(property instanceof PropertyString)) { return null; } return ((PropertyString) property).getFirstValue(); }
/** * Returns the value of the given property if it exists and is of the * correct type. */ public String getStringProperty(Properties properties, String propertyId) { if ((properties == null) || (properties.getProperties() == null)) { return null; } PropertyData<?> property = properties.getProperties().get(propertyId); if (!(property instanceof PropertyString)) { return null; } return ((PropertyString) property).getFirstValue(); }
private String getTitle() { String result = ""; if (object != null) { PropertyData<?> nameProperty = object.getProperties().getProperties().get(PropertyIds.NAME); if (nameProperty instanceof PropertyString) { result = ((PropertyString) nameProperty).getFirstValue(); } } if (typeDef != null) { if (typeDef.getDisplayName() != null) { result = typeDef.getDisplayName(); } } if (bulkUpdate != null) { result = "Bulk Update Properties"; } return result; }
private String getTitle() { String result = ""; if (object != null) { PropertyData<?> nameProperty = object.getProperties().getProperties().get(PropertyIds.NAME); if (nameProperty instanceof PropertyString) { result = ((PropertyString) nameProperty).getFirstValue(); } } if (typeDef != null) { if (typeDef.getDisplayName() != null) { result = typeDef.getDisplayName(); } } if (bulkUpdate != null) { result = "Bulk Update Properties"; } return result; }
protected void setChangeToken(Holder<String> changeToken, ObjectData obj) { if (changeToken == null) { return; } changeToken.setValue(null); if (obj == null || obj.getProperties() == null || obj.getProperties().getProperties() == null) { return; } PropertyData<?> ct = obj.getProperties().getProperties().get(PropertyIds.CHANGE_TOKEN); if (ct instanceof PropertyString) { changeToken.setValue(((PropertyString) ct).getFirstValue()); } }
protected void setChangeToken(Holder<String> changeToken, ObjectData obj) { if (changeToken == null) { return; } changeToken.setValue(null); if (obj == null || obj.getProperties() == null || obj.getProperties().getProperties() == null) { return; } PropertyData<?> ct = obj.getProperties().getProperties().get(PropertyIds.CHANGE_TOKEN); if (ct instanceof PropertyString) { changeToken.setValue(((PropertyString) ct).getFirstValue()); } }
.get(PropertyIds.CHANGE_TOKEN); if (changeTokenProp instanceof PropertyString) { changeToken = ((PropertyString) changeTokenProp).getFirstValue();
.get(PropertyIds.CHANGE_TOKEN); if (changeTokenProp instanceof PropertyString) { changeToken = ((PropertyString) changeTokenProp).getFirstValue();
@Override public String getPath() { String path; readLock(); try { // get the path property path = getPropertyValue(PropertyIds.PATH); // if the path property isn't set, get it if (path == null) { String objectId = getObjectId(); ObjectData objectData = getBinding().getObjectService().getObject(getRepositoryId(), objectId, getPropertyQueryName(PropertyIds.PATH), false, IncludeRelationships.NONE, "cmis:none", false, false, null); if (objectData.getProperties() != null && objectData.getProperties().getProperties() != null) { PropertyData<?> pathProperty = objectData.getProperties().getProperties().get(PropertyIds.PATH); if (pathProperty instanceof PropertyString) { path = ((PropertyString) pathProperty).getFirstValue(); } } } } finally { readUnlock(); } // we still don't know the path ... it's not a CMIS compliant repository if (path == null) { throw new CmisRuntimeException("Repository didn't return " + PropertyIds.PATH + "!"); } return path; }
@Override public String getPath() { String path; readLock(); try { // get the path property path = getPropertyValue(PropertyIds.PATH); // if the path property isn't set, get it if (path == null) { String objectId = getObjectId(); ObjectData objectData = getBinding().getObjectService().getObject(getRepositoryId(), objectId, getPropertyQueryName(PropertyIds.PATH), false, IncludeRelationships.NONE, "cmis:none", false, false, null); if (objectData.getProperties() != null && objectData.getProperties().getProperties() != null) { PropertyData<?> pathProperty = objectData.getProperties().getProperties().get(PropertyIds.PATH); if (pathProperty instanceof PropertyString) { path = ((PropertyString) pathProperty).getFirstValue(); } } } } finally { readUnlock(); } // we still don't know the path ... it's not a CMIS compliant repository if (path == null) { throw new CmisRuntimeException("Repository didn't return " + PropertyIds.PATH + "!"); } return path; }
.get(PropertyIds.CHANGE_TOKEN); if (changeTokenStr instanceof PropertyString) { changeToken.setValue(((PropertyString) changeTokenStr).getFirstValue());
.get(PropertyIds.CHANGE_TOKEN); if (changeTokenStr instanceof PropertyString) { changeToken.setValue(((PropertyString) changeTokenStr).getFirstValue());