for (PropertyData pd : prop) map.put(pd.getId(), pd);
@Override public void addProperty(PropertyData<?> property) { if (property == null) { return; } propertyList.add(property); properties.put(property.getId(), property); }
@Override public void addProperty(PropertyData<?> property) { if (property == null) { return; } propertyList.add(property); properties.put(property.getId(), property); }
@Override public void removeProperty(String id) { if (id == null) { return; } Iterator<PropertyData<?>> iterator = propertyList.iterator(); while (iterator.hasNext()) { PropertyData<?> property = iterator.next(); if (id.equals(property.getId())) { iterator.remove(); break; } } properties.remove(id); }
@Override public void removeProperty(String id) { if (id == null) { return; } Iterator<PropertyData<?>> iterator = propertyList.iterator(); while (iterator.hasNext()) { PropertyData<?> property = iterator.next(); if (id.equals(property.getId())) { iterator.remove(); break; } } properties.remove(id); }
/** * Remove a property from a GREG node */ public static void removeProperty(Registry repository,Resource resource, PropertyData<?> propertyData) throws RegistryException { String id = propertyData.getId(); if(resource.getPropertyValues(id) != null ){ //has property resource.removeProperty(id); repository.put(resource.getPath(), resource); } }
assert property.getId() != null; propDef = typeCache.getPropertyDefinition(property.getId()); propDef = type.getPropertyDefinitions().get(property.getId()); propDef = typeCache.getPropertyDefinition(property.getId()); String propId = (propertyMode == PropertyMode.QUERY ? property.getQueryName() : property.getId()); if (propId == null) { throw new CmisRuntimeException("No query name or alias for property '" + property.getId() + "'!");
propertiesById.put(property.getId(), property); propertiesByQueryName.put(property.getQueryName(), property);
propertiesById.put(property.getId(), property); propertiesByQueryName.put(property.getQueryName(), property);
private PropertyData<?> getPropIsLatestMajorVersion(ObjectData objectData) { List<PropertyData<?>> properties = objectData.getProperties().getPropertyList(); boolean found = false; PropertyData<?> propIsLatestMajorVersion = null; for (PropertyData<?> property : properties) { if (property.getId().equals(PropertyIds.IS_LATEST_MAJOR_VERSION)) { found = true; propIsLatestMajorVersion = property; break; } } //properties..contains(PropertyIds.IS_LATEST_MAJOR_VERSION); assertTrue("The PropertyIds.IS_LATEST_MAJOR_VERSION property was not found", found); if (found) { return propIsLatestMajorVersion; } return null; }
String propertyId = prop.getId(); if (null == propertyId) { throw new CmisInvalidArgumentException("Property id cannot be null");
properties.put(property.getId(), property.getValues());
properties.put(property.getId(), property.getValues());
public void addPropertiesParameters(Properties properties, DateTimeFormat dateTimeFormat) { if (properties == null) { return; } int idx = 0; for (PropertyData<?> prop : properties.getPropertyList()) { if (prop == null) { continue; } String idxStr = "[" + idx + "]"; addParameter(Constants.CONTROL_PROP_ID + idxStr, prop.getId()); if (isNotEmpty(prop.getValues())) { if (prop.getValues().size() == 1) { addParameter(Constants.CONTROL_PROP_VALUE + idxStr, convertPropertyValue(prop.getFirstValue(), dateTimeFormat)); } else { int vidx = 0; for (Object obj : prop.getValues()) { String vidxStr = "[" + vidx + "]"; addParameter(Constants.CONTROL_PROP_VALUE + idxStr + vidxStr, convertPropertyValue(obj, dateTimeFormat)); vidx++; } } } idx++; } }
public void addPropertiesParameters(Properties properties, DateTimeFormat dateTimeFormat) { if (properties == null) { return; } int idx = 0; for (PropertyData<?> prop : properties.getPropertyList()) { if (prop == null) { continue; } String idxStr = "[" + idx + "]"; addParameter(Constants.CONTROL_PROP_ID + idxStr, prop.getId()); if (isNotEmpty(prop.getValues())) { if (prop.getValues().size() == 1) { addParameter(Constants.CONTROL_PROP_VALUE + idxStr, convertPropertyValue(prop.getFirstValue(), dateTimeFormat)); } else { int vidx = 0; for (Object obj : prop.getValues()) { String vidxStr = "[" + vidx + "]"; addParameter(Constants.CONTROL_PROP_VALUE + idxStr + vidxStr, convertPropertyValue(obj, dateTimeFormat)); vidx++; } } } idx++; } }
public static void setProperty(Registry repository,Resource resource, PropertyData<?> propertyData) throws RegistryException { List<String> values; String propertyName = propertyData.getId();
result.setPropertyDefinitionId(property.getId()); result.setLocalName(property.getLocalName()); result.setQueryName(property.getQueryName());
@Override public String execute(CmisService cmisService) { List<RepositoryInfo> repositories = cmisService.getRepositoryInfos(null); assertTrue(repositories.size() > 0); RepositoryInfo repo = repositories.get(0); String repositoryId = repo.getId(); String objectId = cmisService.create(repositoryId, properties, repositoryHelper.getCompanyHome().getId(), contentStream, VersioningState.MINOR, null, null); ObjectData cmidDoc = cmisService.getObject(repositoryId, objectId, null, true, IncludeRelationships.NONE, null, false, false, null); List<PropertyData<?>> properties = cmidDoc.getProperties().getPropertyList(); boolean found = false; PropertyData<?> propIsLatestMajorVersion = null; for (PropertyData<?> property : properties) { if (property.getId().equals(PropertyIds.IS_LATEST_MAJOR_VERSION)) { found = true; propIsLatestMajorVersion = property; break; } } //properties..contains(CMISDictionaryModel.PROP_IS_LATEST_MAJOR_VERSION); assertTrue("The CMISDictionaryModel.PROP_IS_LATEST_MAJOR_VERSION property was not found", found); if (found) { assertFalse("The CMISDictionaryModel.PROP_IS_LATEST_MAJOR_VERSION should be false as minor version was created", (Boolean) propIsLatestMajorVersion.getValues().get(0)); } return objectId; } });