protected void addProperties(Collection<PropertyData<?>> properties) { if (properties != null) { for (PropertyData<?> prop : properties) { addProperty(prop); } } }
protected void addProperties(Collection<PropertyData<?>> properties) { if (properties != null) { for (PropertyData<?> prop : properties) { addProperty(prop); } } }
/** * Add integer property to the CMIS object represented by this instance */ protected final void addPropertyInteger(PropertiesImpl props, String typeId, Set<String> filter, String id, long value) { if (!checkAddProperty(props, typeId, filter, id)) { return; } PropertyIntegerImpl prop = new PropertyIntegerImpl(id, BigInteger.valueOf(value)); prop.setQueryName(id); props.addProperty(prop); }
/** * Add Id property to the CMIS object represented by this instance */ protected final void addPropertyId(PropertiesImpl props, String typeId, Set<String> filter, String id, String value) { if (!checkAddProperty(props, typeId, filter, id)) { return; } if (value.equals(CMISConstants.GREG_PROPERTY_NOT_SET)) { value = null; } PropertyIdImpl prop = new PropertyIdImpl(id, value); prop.setQueryName(id); props.addProperty(prop); }
/** * Adds a date/time property to a PropertiesImpl.<p> * * @param typeManager the type manager * @param props the properties * @param typeId the type id * @param filter the property filter string * @param id the property id * @param value the property value */ public static void addPropertyDateTime( CmsCmisTypeManager typeManager, PropertiesImpl props, String typeId, Set<String> filter, String id, GregorianCalendar value) { if (!checkAddProperty(typeManager, props, typeId, filter, id)) { return; } props.addProperty(new PropertyDateTimeImpl(id, value)); }
/** * Helper method for adding an id-list-valued property.<p> * * @param typeManager * @param props the properties to add to * @param typeId the type id * @param filter the property filter * @param id the property id * @param value the property value */ public static void addPropertyIdList( CmsCmisTypeManager typeManager, PropertiesImpl props, String typeId, Set<String> filter, String id, List<String> value) { if (!checkAddProperty(typeManager, props, typeId, filter, id)) { return; } props.addProperty(new PropertyIdImpl(id, value)); }
protected final void addPropertyId(PropertiesImpl props, String typeId, Set<String> filter, String id, List<String> values) { if (!checkAddProperty(props, typeId, filter, id)) { return; } PropertyIdImpl prop = new PropertyIdImpl(id, values); prop.setQueryName(id); props.addProperty(prop); }
/** * Add string property to the CMIS object represented by this instance */ protected final void addPropertyString(PropertiesImpl props, String typeId, Set<String> filter, String id, String value) { if (!checkAddProperty(props, typeId, filter, id)) { return; } PropertyStringImpl prop = new PropertyStringImpl(id, value); prop.setQueryName(id); props.addProperty(prop); }
/** * Add boolean property to the CMIS object represented by this instance */ protected final void addPropertyBoolean(PropertiesImpl props, String typeId, Set<String> filter, String id, boolean value) { if (!checkAddProperty(props, typeId, filter, id)) { return; } PropertyBooleanImpl prop = new PropertyBooleanImpl(id, value); prop.setQueryName(id); props.addProperty(prop); }
/** * Add date-time property to the CMIS object represented by this instance */ protected final void addPropertyDateTime(PropertiesImpl props, String typeId, Set<String> filter, String id, GregorianCalendar value) { if (!checkAddProperty(props, typeId, filter, id)) { return; } PropertyDateTimeImpl prop = new PropertyDateTimeImpl(id, value); prop.setQueryName(id); props.addProperty(prop); }
/** * Creates a CMIS object that only contains an ID in the property list. */ protected ObjectData createIdObject(String objectId) { ObjectDataImpl object = new ObjectDataImpl(); PropertiesImpl properties = new PropertiesImpl(); object.setProperties(properties); properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_ID, objectId)); return object; }
/** * Creates a CMIS object that only contains an id in the property list. */ protected ObjectData createIdObject(String objectId) { ObjectDataImpl object = new ObjectDataImpl(); PropertiesImpl properties = new PropertiesImpl(); object.setProperties(properties); properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_ID, objectId)); return object; }
/** * Converts a properties object. */ public static Properties convert(CmisPropertiesType properties) { if (properties == null) { return null; } PropertiesImpl result = new PropertiesImpl(); for (CmisProperty property : properties.getProperty()) { result.addProperty(convert(property)); } // handle extensions convertExtension(properties, result); return result; }
@Override public Void execute(CmisService cmisService) { final PropertiesImpl properties = new PropertiesImpl(); properties.addProperty(new PropertyStringImpl(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, Arrays.asList(aspectName))); cmisService.updateProperties(repositoryId, objectIdHolder, null, properties, null); return null; } }, CmisVersion.CMIS_1_1);
@Override public NodeRef execute(CmisService cmisService) { final PropertiesImpl properties = new PropertiesImpl(); String objectTypeId = "cmis:document"; properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, objectTypeId)); String fileName = "textFile" + GUID.generate(); properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, fileName)); final ContentStreamImpl contentStream = new ContentStreamImpl(fileName, MimetypeMap.MIMETYPE_TEXT_PLAIN, "Simple text plain document"); String nodeId = cmisService.create(repositoryId, properties, repositoryHelper.getCompanyHome().getId(), contentStream, VersioningState.NONE, null, null); return new NodeRef(nodeId.substring(0, nodeId.indexOf(';'))); } }, CmisVersion.CMIS_1_1);
public Properties getAssocProperties(CMISNodeInfo info, String filter) { PropertiesImpl result = new PropertiesImpl(); Set<String> filterSet = splitFilter(filter); for (PropertyDefinitionWrapper propDefWrap : info.getType().getProperties()) { PropertyDefinition<?> propDef = propDefWrap.getPropertyDefinition(); if ((filterSet != null) && (!filterSet.contains(propDef.getQueryName()))) { // skip properties that are not in the filter continue; } CMISPropertyAccessor cmisPropertyAccessor = propDefWrap.getPropertyAccessor(); Serializable value = cmisPropertyAccessor.getValue(info); PropertyType propType = propDef.getPropertyType(); PropertyData<?> propertyData = getProperty(propType, propDefWrap, value); result.addProperty(propertyData); } return result; }
public Properties getAssocProperties(CMISNodeInfo info, String filter) { PropertiesImpl result = new PropertiesImpl(); Set<String> filterSet = splitFilter(filter); for (PropertyDefinitionWrapper propDefWrap : info.getType().getProperties()) { PropertyDefinition<?> propDef = propDefWrap.getPropertyDefinition(); if ((filterSet != null) && (!filterSet.contains(propDef.getQueryName()))) { // skip properties that are not in the filter continue; } CMISPropertyAccessor cmisPropertyAccessor = propDefWrap.getPropertyAccessor(); Serializable value = cmisPropertyAccessor.getValue(info); PropertyType propType = propDef.getPropertyType(); PropertyData<?> propertyData = getProperty(propType, propDefWrap, value); result.addProperty(propertyData); } return result; }
public Properties getNodeProperties(CMISNodeInfo info, String filter) { PropertiesImpl result = new PropertiesImpl(); Set<String> filterSet = splitFilter(filter); for (PropertyDefinitionWrapper propDef : info.getType().getProperties()) { if (!propDef.getPropertyId().equals(PropertyIds.OBJECT_ID)) { // don't filter the object id if ((filterSet != null) && (!filterSet.contains(propDef.getPropertyDefinition().getQueryName()))) { // skip properties that are not in the filter continue; } } Serializable value = propDef.getPropertyAccessor().getValue(info); result.addProperty(getProperty(propDef.getPropertyDefinition().getPropertyType(), propDef, value)); } addAspectProperties(info, filter, result); return result; }
@Override public String execute(CmisService cmisService) { final PropertiesImpl properties = new PropertiesImpl(); String objectTypeId = "cmis:document"; properties.addProperty(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, objectTypeId)); String fileName = "textFile" + GUID.generate(); properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, fileName)); final ContentStreamImpl contentStream = new ContentStreamImpl(fileName, MimetypeMap.MIMETYPE_TEXT_PLAIN, "Simple text plain document"); String objectId = cmisService.create(repositoryId, properties, repositoryHelper.getCompanyHome().getId(), contentStream, VersioningState.MAJOR, null, null); return objectId; } }, CmisVersion.CMIS_1_1);
@Override public void reportFeedback(String feedbackId) { // Get the session, repository id and object service Session session = CmisSessionHelper.getSession(); String repoId = session.getRepositoryInfo().getId(); ObjectService objectService = session.getBinding().getObjectService(); // Create a comment flagged property with value true PropertiesImpl props = new PropertiesImpl(); props.addProperty(new PropertyBooleanImpl(PROP_COMMENT_FLAGGED, true)); // Update the comment flagged property in the repository objectService.updateProperties(repoId, new Holder<String>(feedbackId), null, props, null); }