@Override public List<PropertyData<?>> convertQueryProperties(Properties properties) { // check input if ((properties == null) || (properties.getProperties() == null)) { throw new IllegalArgumentException("Properties must be set!"); } return new ArrayList<PropertyData<?>>(properties.getPropertyList()); }
@Override public List<PropertyData<?>> convertQueryProperties(Properties properties) { // check input if ((properties == null) || (properties.getProperties() == null)) { throw new IllegalArgumentException("Properties must be set!"); } return new ArrayList<PropertyData<?>>(properties.getPropertyList()); }
/** * Shallow copy constructor. * * Creates a new collection of properties but references the original * property and extension objects. */ public PropertiesImpl(Properties properties) { if (properties == null) { throw new IllegalArgumentException("Properties not set!"); } addProperties(properties.getPropertyList()); setExtensions(properties.getExtensions()); }
/** * Shallow copy constructor. * * Creates a new collection of properties but references the original * property and extension objects. */ public PropertiesImpl(Properties properties) { if (properties == null) { throw new IllegalArgumentException("Properties not set!"); } addProperties(properties.getPropertyList()); setExtensions(properties.getExtensions()); }
/** * Converts a properties object. */ public static CmisPropertiesType convert(Properties properties) { if (properties == null) { return null; } CmisPropertiesType result = new CmisPropertiesType(); if (properties.getProperties() != null) { for (PropertyData<?> property : properties.getPropertyList()) { result.getProperty().add(convert(property)); } } // handle extensions convertExtension(properties, result); return result; }
if ((objectData.getProperties() != null) && (objectData.getProperties().getPropertyList() != null)) { properties = new HashMap<String, List<?>>(objectData.getProperties().getPropertyList().size()); for (PropertyData<?> property : objectData.getProperties().getPropertyList()) { properties.put(property.getId(), property.getValues());
if ((objectData.getProperties() != null) && (objectData.getProperties().getPropertyList() != null)) { properties = new HashMap<String, List<?>>(objectData.getProperties().getPropertyList().size()); for (PropertyData<?> property : objectData.getProperties().getPropertyList()) { properties.put(property.getId(), property.getValues());
writer.writeStartElement(PREFIX_CMIS, TAG_BULK_UPDATE_PROPERTIES, NAMESPACE_CMIS); if (properties.getPropertyList() != null) { for (PropertyData<?> property : properties.getPropertyList()) { writeProperty(writer, property, false);
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; }
/** * See CMIS 1.0 section 2.2.7.3 checkedIn * * @throws CmisRuntimeException */ public RegistryVersion checkin(Properties properties, ContentStream contentStream, String checkinComment) { Resource node = getNode(); try { if (!isCheckedOut(node)) { throw new CmisStorageException("Not checked out: " + node.getId()); } if (properties != null && !properties.getPropertyList().isEmpty()) { updateProperties(properties); } if (contentStream != null) { setContentStream(contentStream, true); } // todo handle checkinComment Resource resource = checkin(); String pathOfLatestVersion = getRepository().getVersions(resource.getPath())[0]; return new RegistryVersion(getRepository(), resource, pathOfLatestVersion, typeManager, pathManager); } catch (RegistryException e) { String msg = "Failed checkin"; log.error(msg, e); throw new CmisRuntimeException(msg, e); } }
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++; } }
if (properties.getPropertyList() != null) { for (PropertyData<?> property : properties.getPropertyList()) { writeProperty(writer, property, false);
@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; } });
for (PropertyData<?> property : properties.getPropertyList()) { assert property != null; assert property.getId() != null;
for (PropertyData<?> property : properties.getPropertyList()) { assert property != null; assert property.getId() != null;
writer.startTag(NAMESPACE_CMIS, TAG_BULK_UPDATE_PROPERTIES); if (properties.getPropertyList() != null) { for (PropertyData<?> property : properties.getPropertyList()) { writeProperty(writer, property, false);
assertEquals(events.get(0).getProperties().getPropertyList().get(0).getValues().get(0), folderInfo.getNodeRef().getId()); assertEquals(events.get(0).getChangeEventInfo().getChangeType(), ChangeType.CREATED); assertTrue(((String) events.get(1).getProperties().getPropertyList().get(0).getValues().get(0)).contains(document.getNodeRef().getId())); assertEquals(events.get(1).getChangeEventInfo().getChangeType(), ChangeType.CREATED); assertTrue(((String) events.get(2).getProperties().getPropertyList().get(0).getValues().get(0)).contains(document.getNodeRef().getId())); assertEquals(events.get(2).getChangeEventInfo().getChangeType(), ChangeType.UPDATED);
if (properties == null || properties.getPropertyList().isEmpty()) { properties = new PropertiesImpl();
if (properties.getPropertyList() != null) { for (PropertyData<?> property : properties.getPropertyList()) { writeProperty(writer, property, false);