protected String getIdProperty(ObjectData object, String name) { PropertyData<?> property = object.getProperties().getProperties().get(name); if (property instanceof PropertyId) { return ((PropertyId) property).getFirstValue(); } return null; }
protected String getIdProperty(ObjectData object, String name) { PropertyData<?> property = object.getProperties().getProperties().get(name); if (property instanceof PropertyId) { return ((PropertyId) property).getFirstValue(); } return null; }
/** * Returns the value of the given property if it exists and is of the * correct type. */ public String getIdProperty(Properties properties, String propertyId) { if ((properties == null) || (properties.getProperties() == null)) { return null; } PropertyData<?> property = properties.getProperties().get(propertyId); if (!(property instanceof PropertyId)) { return null; } return ((PropertyId) property).getFirstValue(); }
/** * Returns the Id of the object. */ public String getId() { Properties properties = getProperties(); if (properties == null) { return null; } Map<String, PropertyData<?>> propertiesMap = properties.getProperties(); if (propertiesMap == null) { return null; } PropertyData<?> property = propertiesMap.get(PropertyIds.OBJECT_ID); if (property instanceof PropertyId) { return ((PropertyId) property).getFirstValue(); } return null; }
/** * Returns the value of the given property if it exists and is of the * correct type. */ public String getIdProperty(Properties properties, String propertyId) { if ((properties == null) || (properties.getProperties() == null)) { return null; } PropertyData<?> property = properties.getProperties().get(propertyId); if (!(property instanceof PropertyId)) { return null; } return ((PropertyId) property).getFirstValue(); }
/** * Gets the type id from a set of properties. */ public static String getTypeId(Properties properties) { PropertyData<?> typeProperty = properties.getProperties().get(PropertyIds.OBJECT_TYPE_ID); if (!(typeProperty instanceof PropertyId)) { throw new CmisInvalidArgumentException("Type id must be set!"); } String typeId = ((PropertyId) typeProperty).getFirstValue(); if (typeId == null) { throw new CmisInvalidArgumentException("Type id must be set!"); } return typeId; }
@Override public TypeDefinition getTypeDefinitionForObject(String objectId) { TypeDefinition type = objectToTypeDefinitions.get(objectId); if (type == null) { ObjectData obj = service.getObject(repositoryId, objectId, "cmis:objectId,cmis:objectTypeId,cmis:baseTypeId,cmis:secondaryObjectTypeIds", false, IncludeRelationships.NONE, "cmis:none", false, false, null); if (obj != null && obj.getProperties() != null) { PropertyData<?> typeProp = obj.getProperties().getProperties().get(PropertyIds.OBJECT_TYPE_ID); if (typeProp instanceof PropertyId) { String typeId = ((PropertyId) typeProp).getFirstValue(); if (typeId != null) { type = getTypeDefinition(typeId); } } PropertyData<?> secTypeProp = obj.getProperties().getProperties() .get(PropertyIds.SECONDARY_OBJECT_TYPE_IDS); if ((secTypeProp instanceof PropertyId) && (secTypeProp.getValues() != null)) { for (String secTypeId : ((PropertyId) secTypeProp).getValues()) { if (secTypeId != null) { getTypeDefinition(secTypeId); } } } } objectToTypeDefinitions.put(objectId, type); } return type; }
PropertyData<?> typeProp = properties.getProperties().get(PropertyIds.OBJECT_TYPE_ID); if (typeProp instanceof PropertyId) { String typeId = ((PropertyId) typeProp).getFirstValue(); if (typeId != null) { type = typeCache.getTypeDefinition(typeId);
String sourceId = ((PropertyId) sourceIdProperty).getFirstValue(); if (sourceId == null) { throw new CmisInvalidArgumentException("Source Id is not set!");
String sourceId = ((PropertyId) sourceIdProperty).getFirstValue(); if (sourceId == null) { throw new CmisInvalidArgumentException("Source Id is not set!");
PropertyData<?> typeProp = properties.getProperties().get(PropertyIds.OBJECT_TYPE_ID); if (typeProp instanceof PropertyId) { String typeId = ((PropertyId) typeProp).getFirstValue(); if (typeId != null) { type = typeCache.getTypeDefinition(typeId);