@Override protected PropertyStringImpl createTarget(XmlPullParser parser, QName name) { return new PropertyStringImpl(); } };
@Override public MutablePropertyString createPropertyStringData(String id, List<String> values) { return new PropertyStringImpl(id, values); }
@Override protected PropertyStringImpl createTarget(XMLStreamReader parser, QName name) { return new PropertyStringImpl(); } };
@Override public MutablePropertyString createPropertyStringData(String id, List<String> values) { return new PropertyStringImpl(id, values); }
@Override public MutablePropertyString createPropertyStringData(String id, String value) { return new PropertyStringImpl(id, value); }
@Override public MutablePropertyString createPropertyStringData(String id, String value) { return new PropertyStringImpl(id, value); }
/** * 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); }
/** * Adds a string property to a PropertiesImpl.<p> * * @param typeManager * @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 addPropertyString( CmsCmisTypeManager typeManager, PropertiesImpl props, String typeId, Set<String> filter, String id, String value) { if (!checkAddProperty(typeManager, props, typeId, filter, id)) { return; } PropertyStringImpl result = new PropertyStringImpl(id, value); result.setQueryName(id); props.addProperty(result); }
/** * Creates a CMIS object with properties and policy ids. */ protected ObjectDataImpl createObject(Properties properties, String changeToken, List<String> policies) { ObjectDataImpl object = new ObjectDataImpl(); if (properties == null) { properties = new PropertiesImpl(); if (changeToken != null) { ((PropertiesImpl) properties) .addProperty(new PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken)); } } else if (changeToken != null && !properties.getProperties().containsKey(PropertyIds.CHANGE_TOKEN)) { properties = new PropertiesImpl(properties); ((PropertiesImpl) properties).addProperty(new PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken)); } object.setProperties(properties); if (policies != null && !policies.isEmpty()) { PolicyIdListImpl policyIdList = new PolicyIdListImpl(); policyIdList.setPolicyIds(policies); object.setPolicyIds(policyIdList); } return object; }
@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) { String repositoryId = cmisService.getRepositoryInfos(null).get(0).getId(); String rootNodeId = cmisService.getObjectByPath(repositoryId, "/", null, true, IncludeRelationships.NONE, null, false, true, null).getId(); Collection<PropertyData<?>> propsList = new ArrayList<PropertyData<?>>(); propsList.add(new PropertyStringImpl(PropertyIds.NAME, "Folder-" + GUID.generate())); propsList.add(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, "cmis:folder")); String folderId = cmisService.createFolder(repositoryId, new PropertiesImpl(propsList), rootNodeId, null, null, null, null); propsList = new ArrayList<PropertyData<?>>(); propsList.add(new PropertyStringImpl(PropertyIds.NAME, "File-" + GUID.generate())); propsList.add(new PropertyIdImpl(PropertyIds.OBJECT_TYPE_ID, "cmis:document")); String nodeId = cmisService.createDocument(repositoryId, new PropertiesImpl(propsList), folderId, null, null, null, null, null, null); return new NodeRef(nodeId.substring(0, nodeId.indexOf(';'))); } }, CmisVersion.CMIS_1_1);
if (changeToken != null && !omitChangeToken) { ((PropertiesImpl) properties) .addProperty(new PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken)); if (changeToken != null && !properties.getProperties().containsKey(PropertyIds.CHANGE_TOKEN)) { properties = new PropertiesImpl(properties); ((PropertiesImpl) properties).addProperty(new PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken));
@Override public String execute(CmisService cmisService) { String repositoryId = cmisService.getRepositoryInfos(null).get(0).getId(); for (FileInfo fileInfo : docs) { PropertiesImpl properties = new PropertiesImpl(); properties.addProperty(new PropertyStringImpl(PropertyIds.DESCRIPTION, "description-" + GUID.generate())); cmisService.updateProperties(repositoryId, new Holder<String>(fileInfo.getNodeRef().toString()), null, properties, null); } //This extra check was added due to MNT-16641. { PropertiesImpl properties = new PropertiesImpl(); properties.addProperty(new PropertyStringImpl(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, "P:cm:lockable")); Set<QName> existingAspects = nodeService.getAspects(docs.get(0).getNodeRef()); cmisService.updateProperties(repositoryId,new Holder<String>(docs.get(0).getNodeRef().toString()), null, properties, null); Set<QName> updatedAspects = nodeService.getAspects(docs.get(0).getNodeRef()); updatedAspects.removeAll(existingAspects); assertEquals(ContentModel.ASPECT_LOCKABLE, updatedAspects.iterator().next()); } return repositoryId; } }, 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);
break; case STRING: props.addProperty(new PropertyStringImpl(propDef.getId(), (List<String>)defaultValue)); break; case URI:
@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);
return new PropertyIntegerImpl(propDef.getId(), (List<BigInteger>) defaultValue); case STRING: return new PropertyStringImpl(propDef.getId(), (List<String>) defaultValue); case URI: return new PropertyUriImpl(propDef.getId(), (List<String>) defaultValue);
properties.addProperty(new PropertyStringImpl(PropertyIds.NAME, CLIENT_NAME)); properties.addProperty(new PropertyStringImpl("sctst:clientId", "id" + GUID.generate())); properties.addProperty(new PropertyStringImpl("sctst:clientName", CLIENT_NAME)); properties.addProperty(new PropertyStringImpl(PropertyIds.SECONDARY_OBJECT_TYPE_IDS, aspects)); cmisService.updateProperties(repositoryId, new Holder<String>(contentData.getId()), null, properties, null);
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");
result = new PropertyStringImpl(property.getPropertyDefinitionId(), ((CmisPropertyString) property).getValue()); } else if (property instanceof CmisPropertyId) {