org.apache.chemistry.opencmis.commons.enums.Cardinality Java Examples
The following examples show how to use
org.apache.chemistry.opencmis.commons.enums.Cardinality.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TypeManager.java From document-management-software with GNU Lesser General Public License v3.0 | 6 votes |
private static void addFolderPropertyDefinitions(FolderTypeDefinitionImpl type) { type.addPropertyDefinition(createPropDef(PropertyIds.PARENT_ID, "Parent Id", "Parent Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS, "Allowed Child Object Type Ids", "Allowed Child Object Type Ids", PropertyType.ID, Cardinality.MULTI, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.PATH, "Path", "Path", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); /* * Properties of the LogicalDOC folder */ type.addPropertyDefinition(createPropDef(PROP_DESCRIPTION, "Description", "Description", PropertyType.STRING, Cardinality.SINGLE, Updatability.READWRITE, false, false)); type.addPropertyDefinition(createPropDef(PROP_TYPE, "Type", "Type", PropertyType.INTEGER, Cardinality.SINGLE, Updatability.READONLY, false, false)); }
Example #2
Source File: CmisUtils.java From iaf with Apache License 2.0 | 6 votes |
private static <T> AbstractPropertyDefinition<T> addStandardDefinitions(AbstractPropertyDefinition<T> propertyDefinition, Element propertyElement, PropertyType propertyType) { String nameAttr = propertyElement.getAttribute("name"); String displayNameAttr = propertyElement.getAttribute("displayName"); String localNameAttr = propertyElement.getAttribute("localName"); String queryNameAttr = propertyElement.getAttribute("queryName"); propertyDefinition.setId(nameAttr); propertyDefinition.setDisplayName(displayNameAttr); propertyDefinition.setLocalName(localNameAttr); propertyDefinition.setQueryName(queryNameAttr); propertyDefinition.setCardinality(Cardinality.SINGLE); propertyDefinition.setPropertyType(propertyType); return propertyDefinition; }
Example #3
Source File: TypeManager.java From document-management-software with GNU Lesser General Public License v3.0 | 5 votes |
private static void addBasePropertyDefinitions(AbstractTypeDefinition type) { type.addPropertyDefinition(createPropDef(PropertyIds.BASE_TYPE_ID, "Base Type Id", "Base Type Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.OBJECT_ID, "Object Id", "Object Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.OBJECT_TYPE_ID, "Type Id", "Type Id", PropertyType.ID, Cardinality.SINGLE, Updatability.ONCREATE, false, true)); type.addPropertyDefinition(createPropDef(PropertyIds.NAME, "Name", "Name", PropertyType.STRING, Cardinality.SINGLE, Updatability.READWRITE, false, true)); type.addPropertyDefinition(createPropDef(PropertyIds.CREATED_BY, "Created By", "Created By", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.CREATION_DATE, "Creation Date", "Creation Date", PropertyType.DATETIME, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.LAST_MODIFIED_BY, "Last Modified By", "Last Modified By", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition( createPropDef(PropertyIds.LAST_MODIFICATION_DATE, "Last Modification Date", "Last Modification Date", PropertyType.DATETIME, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.CHANGE_TOKEN, "Change Token", "Change Token", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); }
Example #4
Source File: CmisFunctionEvaluationContext.java From alfresco-data-model with GNU Lesser General Public License v3.0 | 5 votes |
public boolean isMultiValued(String propertyName) { PropertyDefinitionWrapper propDef = cmisDictionaryService.findPropertyByQueryName(propertyName); if (propDef == null) { throw new CmisInvalidArgumentException("Unknown column/property " + propertyName); } return propDef.getPropertyDefinition().getCardinality() == Cardinality.MULTI; }
Example #5
Source File: CmisTypeDefinitionFactoryBean.java From spring-content with Apache License 2.0 | 5 votes |
protected void addDocumentPropertyDefinitions(MutableDocumentTypeDefinition type, Class<?> repoClazz, Class<?> storeClazz, CmisVersion cmisVersion, boolean inherited) { if (storeClass != null) { type.addPropertyDefinition(this .createPropertyDefinition("cmis:contentStreamLength", "Content Stream Length", "Content Stream Length", PropertyType.INTEGER, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:contentStreamMimeType", "MIME Type", "MIME Type", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:contentStreamFileName", "Filename", "Filename", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:contentStreamId", "Content Stream Id", "Content Stream Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); } if (isVersionable(repoClass)) { type.addPropertyDefinition(this .createPropertyDefinition("cmis:isImmutable", "Is Immutable", "Is Immutable", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:isLatestVersion", "Is Latest Version", "Is Latest Version", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:isMajorVersion", "Is Major Version", "Is Major Version", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:isLatestMajorVersion", "Is Latest Major Version", "Is Latest Major Version", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); if (cmisVersion != CmisVersion.CMIS_1_0) { type.addPropertyDefinition(this .createPropertyDefinition("cmis:isPrivateWorkingCopy", "Is Private Working Copy", "Is Private Working Copy", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, inherited, false, true, false)); } type.addPropertyDefinition(this .createPropertyDefinition("cmis:versionLabel", "Version Label", "Version Label", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, inherited, false, true, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:versionSeriesId", "Version Series Id", "Version Series Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, inherited, false, true, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:isVersionSeriesCheckedOut", "Is Version Series Checked Out", "Is Verison Series Checked Out", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, inherited, false, true, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:versionSeriesCheckedOutBy", "Version Series Checked Out By", "Version Series Checked Out By", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:versionSeriesCheckedOutId", "Version Series Checked Out Id", "Version Series Checked Out Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:checkinComment", "Checkin Comment", "Checkin Comment", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); } }
Example #6
Source File: CmisTypeDefinitionFactoryBean.java From spring-content with Apache License 2.0 | 5 votes |
protected void addFolderPropertyDefinitions(MutableFolderTypeDefinition type, CmisVersion cmisVersion, boolean inherited) { if (true /* is fileable */) { type.addPropertyDefinition(this .createPropertyDefinition("cmis:parentId", "Parent Id", "Parent Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:path", "Path", "Path", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this .createPropertyDefinition("cmis:allowedChildObjectTypeIds", "Allowed Child Object Type Ids", "Allowed Child Object Type Ids", PropertyType.ID, Cardinality.MULTI, Updatability.READONLY, inherited, false, false, false)); } }
Example #7
Source File: TypeManager.java From document-management-software with GNU Lesser General Public License v3.0 | 4 votes |
private static void addDocumentPropertyDefinitions(DocumentTypeDefinitionImpl type) { type.addPropertyDefinition(createPropDef(PropertyIds.IS_IMMUTABLE, "Is Immutable", "Is Immutable", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.IS_LATEST_VERSION, "Is Latest Version", "Is Latest Version", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.IS_MAJOR_VERSION, "Is Major Version", "Is Major Version", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition( createPropDef(PropertyIds.IS_LATEST_MAJOR_VERSION, "Is Latest Major Version", "Is Latest Major Version", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_LABEL, "Version Label", "Version Label", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, true)); type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_SERIES_ID, "Version Series Id", "Version Series Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, true)); type.addPropertyDefinition(createPropDef(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT, "Is Verison Series Checked Out", "Is Verison Series Checked Out", PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID, "Version Series Checked Out Id", "Version Series Checked Out Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY, "Version Series Checked Out By", "Version Series Checked Out By", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.CHECKIN_COMMENT, "Checkin Comment", "Checkin Comment", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition( createPropDef(PropertyIds.CONTENT_STREAM_LENGTH, "Content Stream Length", "Content Stream Length", PropertyType.INTEGER, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.CONTENT_STREAM_MIME_TYPE, "MIME Type", "MIME Type", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.CONTENT_STREAM_FILE_NAME, "Filename", "Filename", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PropertyIds.CONTENT_STREAM_ID, "Content Stream Id", "Content Stream Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false)); /* * Properties of all LogicalDOC documents */ type.addPropertyDefinition(createPropDef(PROP_FILEVERSION, "File Version", "File Version", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PROP_VERSION, "Version", "Version", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PROP_LANGUAGE, "Language", "Language", PropertyType.STRING, Cardinality.SINGLE, Updatability.READWRITE, false, false)); type.addPropertyDefinition(createPropDef(PROP_WORKFLOW_STATUS, "Workflow Status", "Workflow Status", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PROP_CUSTOMID, "Custom ID", "Custom Identifier", PropertyType.STRING, Cardinality.SINGLE, Updatability.READWRITE, false, false)); type.addPropertyDefinition(createPropDef(PROP_RATING, "Rating", "Rating", PropertyType.INTEGER, Cardinality.SINGLE, Updatability.READONLY, false, false)); type.addPropertyDefinition(createPropDef(PROP_TAGS, "Tags", "Tags", PropertyType.STRING, Cardinality.SINGLE, Updatability.READWRITE, false, false)); type.addPropertyDefinition(createPropDef(PROP_TEMPLATE, "Template", "Template", PropertyType.STRING, Cardinality.SINGLE, Updatability.READWRITE, false, false)); /* * Extended properties */ AttributeSetDAO dao = (AttributeSetDAO) Context.get().getBean(AttributeSetDAO.class); List<AttributeSet> sets = dao.findAll(); for (AttributeSet set : sets) { dao.initialize(set); Map<String, Attribute> attributes = set.getAttributes(); for (String name : attributes.keySet()) { type.addPropertyDefinition(createPropDef(PROP_EXT + name, name, name, PropertyType.STRING, Cardinality.SINGLE, Updatability.READWRITE, false, false)); } } }
Example #8
Source File: CmisTypeDefinitionFactoryBean.java From spring-content with Apache License 2.0 | 4 votes |
protected void addBasePropertyDefinitions(MutableTypeDefinition type, Class<?> entityClazz, CmisVersion cmisVersion, boolean inherited) { Field cmisNameField = BeanUtils.findFieldWithAnnotation(entityClazz, CmisName.class); if (cmisNameField != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:name", "Name", "Name", propertyType(cmisNameField), cardinality(cmisNameField), updatability(entityClazz, cmisNameField), inherited, true, false, false)); } if (cmisVersion != CmisVersion.CMIS_1_0) { Field cmisDescField = BeanUtils.findFieldWithAnnotation(entityClazz, CmisDescription.class); if (cmisDescField != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:description", "Description", "Description", propertyType(cmisDescField), cardinality(cmisDescField), updatability(entityClazz, cmisDescField), inherited, false, false, false)); } } Field idField = BeanUtils.findFieldWithAnnotation(entityClazz, Id.class); if (idField == null) { idField = BeanUtils.findFieldWithAnnotation(entityClazz, org.springframework.data.annotation.Id.class); } if (idField != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:objectId", "Object Id", "Object Id", PropertyType.ID, cardinality(idField), Updatability.READONLY, inherited, false, false, false)); } type.addPropertyDefinition(this.createPropertyDefinition("cmis:baseTypeId", "Base Type Id", "Base Type Id", PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); type.addPropertyDefinition(this.createPropertyDefinition("cmis:objectTypeId", "Object Type Id", "Object Type Id", PropertyType.ID, Cardinality.SINGLE, Updatability.ONCREATE, inherited, true, false, false)); if (cmisVersion != CmisVersion.CMIS_1_0) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:secondaryObjectTypeIds", "Secondary Type Ids", "Secondary Type Ids", PropertyType.ID, Cardinality.MULTI, Updatability.READONLY, inherited, false, false, false)); } Field field = BeanUtils.findFieldWithAnnotation(entityClazz, CreatedBy.class); if (field != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:createdBy", "Created By", "Created By", propertyType(field), cardinality(field), Updatability.READONLY, inherited, false, false, false)); } field = BeanUtils.findFieldWithAnnotation(entityClazz, CreatedDate.class); if (field != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:creationDate", "Creation Date", "Creation Date", propertyType(field), cardinality(field), Updatability.READONLY, inherited, false, false, false)); } field = BeanUtils.findFieldWithAnnotation(entityClazz, LastModifiedBy.class); if (field != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:lastModifiedBy", "Last Modified By", "Last Modified By", propertyType(field), cardinality(field), Updatability.READONLY, inherited, false, false, false)); } field = BeanUtils.findFieldWithAnnotation(entityClazz, LastModifiedDate.class); if (field != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:lastModificationDate", "Last Modification Date", "Last Modification Date", propertyType(field), cardinality(field), Updatability.READONLY, inherited, false, false, false)); } field = BeanUtils.findFieldWithAnnotation(entityClazz, Version.class); if (field != null) { type.addPropertyDefinition(this.createPropertyDefinition("cmis:changeToken", "Change Token", "Change Token", PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, inherited, false, false, false)); } }
Example #9
Source File: CmisTypeDefinitionFactoryBean.java From spring-content with Apache License 2.0 | 2 votes |
Cardinality cardinality(Field field) { return (org.springframework.beans.BeanUtils.isSimpleValueType(field.getType())) ? Cardinality.SINGLE : Cardinality.MULTI; }