protected String getIdProperty(ObjectData object, String name) { PropertyData<?> property = object.getProperties().getProperties().get(name); if (property instanceof PropertyId) { return ((PropertyId) property).getFirstValue(); } return null; }
/** * Convert a <code>PropertyId</code> to an array of GREG <code>Values</code>. */ public static List<String> toValue(PropertyId propertyData) { List<String> values = propertyData.getValues(); List<String> result = null; if (values == null) { return result; } for (String v : values) { result.add(v); } return result; }
@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; }
protected String getIdProperty(ObjectData object, String name) { PropertyData<?> property = object.getProperties().getProperties().get(name); if (property instanceof PropertyId) { return ((PropertyId) property).getFirstValue(); } return null; }
} else if (property instanceof PropertyId) { result = new CmisPropertyId(); ((CmisPropertyId) result).getValue().addAll(((PropertyId) property).getValues()); } else if (property instanceof PropertyInteger) { result = new CmisPropertyInteger();
/** * 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(); }
if (isTag(name, TAG_PROPERTY_TYPE_DEAULT_VALUE)) { PropertyId prop = PROPERTY_ID_PARSER.walk(parser); ((PropertyIdDefinitionImpl) target).setDefaultValue(prop.getValues()); return true;
/** * 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(); }
if (isTag(name, TAG_PROPERTY_TYPE_DEAULT_VALUE)) { PropertyId prop = PROPERTY_ID_PARSER.walk(parser); ((PropertyIdDefinitionImpl) target).setDefaultValue(prop.getValues()); return true;
/** * 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; }
/** * 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; }
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);