本文整理汇总了Java中org.apache.chemistry.opencmis.commons.enums.Updatability类的典型用法代码示例。如果您正苦于以下问题:Java Updatability类的具体用法?Java Updatability怎么用?Java Updatability使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Updatability类属于org.apache.chemistry.opencmis.commons.enums包,在下文中一共展示了Updatability类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: isUpdatable
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Verify if a property is updatable.
* @param updatability
* @param isOnWorkingCopy
* @return
*/
private boolean isUpdatable(Updatability updatability, Boolean isOnWorkingCopy)
{
if ((updatability == Updatability.READONLY)
|| (updatability == Updatability.WHENCHECKEDOUT && !isOnWorkingCopy))
{
return false;
}
else
{
return true;
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:CMISConnector.java
示例2: checkTypeProperties
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Checks if the property belong to the type and are settable.
*/
private void checkTypeProperties(Properties properties, String typeId, boolean isCreate) {
// check type
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
}
// check if all required properties are there
for (PropertyData<?> prop : properties.getProperties().values()) {
PropertyDefinition<?> propType = type.getPropertyDefinitions().get(prop.getId());
// do we know that property?
if (propType == null) {
throw new CmisConstraintException("Property '" + prop.getId() + "' is unknown!");
}
// can it be set?
if (propType.getUpdatability() == Updatability.READONLY) {
throw new CmisConstraintException("Property '" + prop.getId() + "' is readonly!");
}
if (!isCreate) {
// can it be set?
if (propType.getUpdatability() == Updatability.ONCREATE) {
throw new CmisConstraintException("Property '" + prop.getId() + "' cannot be updated!");
}
}
}
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:33,代码来源:FileBridgeRepository.java
示例3: addBasePropertyDefinitions
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
public static void addBasePropertyDefinitions(AbstractTypeDefinition type) {
type.addPropertyDefinition(createPropDef(PropertyIds.BASE_TYPE_ID, CMISConstants.BASE_TYPE_ID_VALUE, CMISConstants.BASE_TYPE_ID_VALUE,
PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.OBJECT_ID, CMISConstants.OBJECT_ID_VALUE, CMISConstants.OBJECT_ID_VALUE, PropertyType.ID,
Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.OBJECT_TYPE_ID, CMISConstants.TYPE_ID_VALUE, CMISConstants.TYPE_ID_VALUE, PropertyType.ID,
Cardinality.SINGLE, Updatability.ONCREATE, false, true));
type.addPropertyDefinition(createPropDef(PropertyIds.NAME, CMISConstants.NAME_VALUE, CMISConstants.NAME_VALUE, PropertyType.STRING,
Cardinality.SINGLE, Updatability.READWRITE, false, true));
type.addPropertyDefinition(createPropDef(PropertyIds.CREATED_BY, CMISConstants.CREATED_BY_VALUE, CMISConstants.CREATED_BY_VALUE,
PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.CREATION_DATE, CMISConstants.CREATION_DATE_VALUE, CMISConstants.CREATION_DATE_VALUE,
PropertyType.DATETIME, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.LAST_MODIFIED_BY, CMISConstants.LAST_MODIFIED_BY_VALUE, CMISConstants.LAST_MODIFIED_BY_VALUE,
PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.LAST_MODIFICATION_DATE, CMISConstants.LAST_MODIFIED_DATE_VALUE,
CMISConstants.LAST_MODIFIED_DATE_VALUE, PropertyType.DATETIME, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.CHANGE_TOKEN, CMISConstants.CHANGE_TOKEN_VALUE, CMISConstants.CHANGE_TOKEN_VALUE,
PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:29,代码来源:RegistryTypeManager.java
示例4: addFolderPropertyDefinitions
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
public static void addFolderPropertyDefinitions(FolderTypeDefinitionImpl type) {
type.addPropertyDefinition(createPropDef(PropertyIds.PARENT_ID, CMISConstants.PARENT_ID_VALUE, CMISConstants.PARENT_ID_VALUE, PropertyType.ID,
Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS,
CMISConstants.ALLOWED_CHILD_TYPE_VALUE, CMISConstants.ALLOWED_CHILD_TYPE_VALUE, PropertyType.ID, Cardinality.MULTI,
Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.PATH, CMISConstants.PATH_VALUE, CMISConstants.PATH_VALUE, PropertyType.STRING,
Cardinality.SINGLE, Updatability.READONLY, false, false));
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:12,代码来源:RegistryTypeManager.java
示例5: checkTypeProperties
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Checks if the property belong to the type and are settable.
*/
private void checkTypeProperties(Properties properties, String typeId,
boolean isCreate) {
// check type
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId
+ "' is unknown!");
}
// check if all required properties are there
for (PropertyData<?> prop : properties.getProperties().values()) {
PropertyDefinition<?> propType = type.getPropertyDefinitions().get(
prop.getId());
// do we know that property?
if (propType == null) {
throw new CmisConstraintException("Property '" + prop.getId()
+ "' is unknown!");
}
// can it be set?
if (propType.getUpdatability() == Updatability.READONLY) {
throw new CmisConstraintException("Property '" + prop.getId()
+ "' is readonly!");
}
if (!isCreate) {
// can it be set?
if (propType.getUpdatability() == Updatability.ONCREATE) {
throw new CmisConstraintException("Property '"
+ prop.getId() + "' cannot be updated!");
}
}
}
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuide,代码行数:39,代码来源:FileBridgeRepository.java
示例6: checkNewProperties
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Checks a property set for a new object.
*/
private void checkNewProperties(Properties properties, BaseTypeId baseTypeId) {
// check properties
if (properties == null || properties.getProperties() == null) {
throw new CmisInvalidArgumentException("Properties must be set!");
}
// check the name
String name = FileBridgeUtils.getStringProperty(properties, PropertyIds.NAME);
if (!isValidName(name)) {
throw new CmisNameConstraintViolationException("Name is not valid!");
}
// check the type
String typeId = FileBridgeUtils.getObjectTypeId(properties);
if (typeId == null) {
throw new CmisInvalidArgumentException("Type Id is not set!");
}
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
}
if (type.getBaseTypeId() != baseTypeId) {
if (baseTypeId == BaseTypeId.CMIS_DOCUMENT) {
throw new CmisInvalidArgumentException("Type is not a document type!");
} else if (baseTypeId == BaseTypeId.CMIS_DOCUMENT) {
throw new CmisInvalidArgumentException("Type is not a folder type!");
} else {
throw new CmisRuntimeException("A file system does not support a " + baseTypeId.value() + " type!");
}
}
// check type properties
checkTypeProperties(properties, typeId, true);
// check if required properties are missing
for (PropertyDefinition<?> propDef : type.getPropertyDefinitions().values()) {
if (propDef.isRequired() && !properties.getProperties().containsKey(propDef.getId())
&& propDef.getUpdatability() != Updatability.READONLY) {
throw new CmisConstraintException("Property '" + propDef.getId() + "' is required!");
}
}
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:48,代码来源:FileBridgeRepository.java
示例7: checkCopyProperties
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Checks a property set for a copied document.
*/
private void checkCopyProperties(Properties properties, String sourceTypeId) {
// check properties
if (properties == null || properties.getProperties() == null) {
return;
}
String typeId = sourceTypeId;
// check the name
String name = FileBridgeUtils.getStringProperty(properties, PropertyIds.NAME);
if (name != null) {
if (!isValidName(name)) {
throw new CmisNameConstraintViolationException("Name is not valid!");
}
}
// check the type
typeId = FileBridgeUtils.getObjectTypeId(properties);
if (typeId == null) {
typeId = sourceTypeId;
}
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
}
if (type.getBaseTypeId() != BaseTypeId.CMIS_DOCUMENT) {
throw new CmisInvalidArgumentException("Target type must be a document type!");
}
// check type properties
checkTypeProperties(properties, typeId, true);
// check if required properties are missing
for (PropertyDefinition<?> propDef : type.getPropertyDefinitions().values()) {
if (propDef.isRequired() && !properties.getProperties().containsKey(propDef.getId())
&& propDef.getUpdatability() != Updatability.READONLY) {
throw new CmisConstraintException("Property '" + propDef.getId() + "' is required!");
}
}
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:46,代码来源:FileBridgeRepository.java
示例8: create
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
public static PropertyUpdater create(RegistryTypeManager typeManager, String typeId, Properties properties) {
if (properties == null) {
throw new CmisConstraintException("No properties!");
}
// get the property definitions
TypeDefinition type = typeManager.getType(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!");
}
PropertyUpdater propertyUpdater = new PropertyUpdater();
// update properties
for (PropertyData<?> prop : properties.getProperties().values()) {
PropertyDefinition<?> propDef = type.getPropertyDefinitions().get(prop.getId());
// do we know that property?
if (propDef == null) {
throw new CmisInvalidArgumentException("Property '" + prop.getId() + "' is unknown!");
}
// skip content stream file name
if (propDef.getId().equals(PropertyIds.CONTENT_STREAM_FILE_NAME)) {
log.warn("Cannot set " + PropertyIds.CONTENT_STREAM_FILE_NAME + ". Ignoring");
continue;
}
// silently skip name
if (propDef.getId().equals(PropertyIds.NAME)) {
continue;
}
// can it be set?
if (propDef.getUpdatability() == Updatability.READONLY) {
throw new CmisConstraintException("Property '" + prop.getId() + "' is readonly!");
}
if (propDef.getUpdatability() == Updatability.ONCREATE) {
throw new CmisConstraintException("Property '" + prop.getId() + "' can only be set on create!");
}
// default or value
PropertyData<?> newProp;
newProp = PropertyHelper.isPropertyEmpty(prop)
? PropertyHelper.getDefaultValue(propDef)
: prop;
// Schedule for remove or update
if (newProp == null) {
propertyUpdater.removeProperties.add(prop);
} else {
propertyUpdater.updateProperties.add(newProp);
}
}
return propertyUpdater;
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:58,代码来源:RegistryObject.java
示例9: addDocumentPropertyDefinitions
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
public static void addDocumentPropertyDefinitions(DocumentTypeDefinitionImpl type) {
type.addPropertyDefinition(createPropDef(PropertyIds.IS_IMMUTABLE, CMISConstants.IS_IMMUTABLE_VALUE, CMISConstants.IS_IMMUTABLE_VALUE,
PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.IS_LATEST_VERSION, CMISConstants.IS_LATEST_VERSION_VALUE,
CMISConstants.IS_LATEST_VERSION_VALUE, PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.IS_MAJOR_VERSION, CMISConstants.IS_MAJOR_VERSION_VALUE, CMISConstants.IS_MAJOR_VERSION_VALUE,
PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.IS_LATEST_MAJOR_VERSION, CMISConstants.IS_LATEST_MAJOR_VERSION_VALUE,
CMISConstants.IS_LATEST_MAJOR_VERSION_VALUE, PropertyType.BOOLEAN, Cardinality.SINGLE, Updatability.READONLY, false,
false));
type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_LABEL, CMISConstants.VERSION_LABEL_VALUE, CMISConstants.VERSION_LABEL_VALUE,
PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_SERIES_ID, CMISConstants.VERSION_SERIES_ID_VALUE,
CMISConstants.VERSION_SERIES_ID_VALUE, PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT,
CMISConstants.IS_VERSION_CHECKED_OUT_VALUE, CMISConstants.IS_VERSION_CHECKED_OUT_VALUE, PropertyType.BOOLEAN,
Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID,
CMISConstants.VERSION_CHECKED_OUT_ID_VALUE, CMISConstants.VERSION_CHECKED_OUT_ID_VALUE, PropertyType.ID, Cardinality.SINGLE,
Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY,
CMISConstants.VERSION_CHECKED_OUT_BY_VALUE, CMISConstants.VERSION_CHECKED_OUT_BY_VALUE, PropertyType.STRING, Cardinality.SINGLE,
Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.CHECKIN_COMMENT, CMISConstants.CHECKIN_COMMENT_VALUE, CMISConstants.CHECKIN_COMMENT_VALUE,
PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.CONTENT_STREAM_LENGTH, CMISConstants.CONTENT_STREAM_LENGTH_VALUE,
CMISConstants.CONTENT_STREAM_LENGTH_VALUE, PropertyType.INTEGER, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.CONTENT_STREAM_MIME_TYPE, CMISConstants.MIME_TYPE_VALUE, CMISConstants.MIME_TYPE_VALUE,
PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.CONTENT_STREAM_FILE_NAME, CMISConstants.FILE_NAME_VALUE, CMISConstants.FILE_NAME_VALUE,
PropertyType.STRING, Cardinality.SINGLE, Updatability.READONLY, false, false));
type.addPropertyDefinition(createPropDef(PropertyIds.CONTENT_STREAM_ID, CMISConstants.CONTENT_STREAM_ID_VALUE,
CMISConstants.CONTENT_STREAM_ID_VALUE, PropertyType.ID, Cardinality.SINGLE, Updatability.READONLY, false, false));
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:48,代码来源:RegistryTypeManager.java
示例10: createPropDef
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Creates a property definition object.
*/
public static PropertyDefinition<?> createPropDef(String id, String displayName, String description,
PropertyType datatype, Cardinality cardinality, Updatability updateability, boolean inherited,
boolean required) {
AbstractPropertyDefinition<?> result;
switch (datatype) {
case BOOLEAN:
result = new PropertyBooleanDefinitionImpl();
break;
case DATETIME:
result = new PropertyDateTimeDefinitionImpl();
break;
case DECIMAL:
result = new PropertyDecimalDefinitionImpl();
break;
case HTML:
result = new PropertyHtmlDefinitionImpl();
break;
case ID:
result = new PropertyIdDefinitionImpl();
break;
case INTEGER:
result = new PropertyIntegerDefinitionImpl();
break;
case STRING:
result = new PropertyStringDefinitionImpl();
break;
case URI:
result = new PropertyUriDefinitionImpl();
break;
default:
throw new RuntimeException("Unknown datatype! Spec change?");
}
result.setId(id);
result.setLocalName(id);
result.setDisplayName(displayName);
result.setDescription(description);
result.setPropertyType(datatype);
result.setCardinality(cardinality);
result.setUpdatability(updateability);
result.setIsInherited(inherited);
result.setIsRequired(required);
result.setIsQueryable(true);
result.setQueryName(id);
result.setIsOrderable(true);
return result;
}
开发者ID:wso2,项目名称:carbon-registry,代码行数:54,代码来源:RegistryTypeManager.java
示例11: checkNewProperties
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Checks a property set for a new object.
*/
private void checkNewProperties(Properties properties) {
// check properties
if (properties == null || properties.getProperties() == null) {
throw new CmisInvalidArgumentException("Properties must be set!");
}
// check the name
String name = FileBridgeUtils.getStringProperty(properties,
PropertyIds.NAME);
if (!isValidName(name)) {
throw new CmisNameConstraintViolationException("Name is not valid!");
}
// check the type
String typeId = FileBridgeUtils.getObjectTypeId(properties);
if (typeId == null) {
throw new CmisNameConstraintViolationException(
"Type Id is not set!");
}
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId
+ "' is unknown!");
}
// check type properties
checkTypeProperties(properties, typeId, true);
// check if required properties are missing
for (PropertyDefinition<?> propDef : type.getPropertyDefinitions()
.values()) {
if (propDef.isRequired()
&& !properties.getProperties().containsKey(propDef.getId())
&& propDef.getUpdatability() != Updatability.READONLY) {
throw new CmisConstraintException("Property '"
+ propDef.getId() + "' is required!");
}
}
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuide,代码行数:44,代码来源:FileBridgeRepository.java
示例12: checkCopyProperties
import org.apache.chemistry.opencmis.commons.enums.Updatability; //导入依赖的package包/类
/**
* Checks a property set for a copied document.
*/
private void checkCopyProperties(Properties properties, String sourceTypeId) {
// check properties
if (properties == null || properties.getProperties() == null) {
return;
}
String typeId = sourceTypeId;
// check the name
String name = FileBridgeUtils.getStringProperty(properties,
PropertyIds.NAME);
if (name != null) {
if (!isValidName(name)) {
throw new CmisNameConstraintViolationException(
"Name is not valid!");
}
}
// check the type
typeId = FileBridgeUtils.getObjectTypeId(properties);
if (typeId == null) {
typeId = sourceTypeId;
}
TypeDefinition type = typeManager.getInternalTypeDefinition(typeId);
if (type == null) {
throw new CmisObjectNotFoundException("Type '" + typeId
+ "' is unknown!");
}
if (type.getBaseTypeId() != BaseTypeId.CMIS_DOCUMENT) {
throw new CmisInvalidArgumentException(
"Target type must be a document type!");
}
// check type properties
checkTypeProperties(properties, typeId, true);
// check if required properties are missing
for (PropertyDefinition<?> propDef : type.getPropertyDefinitions()
.values()) {
if (propDef.isRequired()
&& !properties.getProperties().containsKey(propDef.getId())
&& propDef.getUpdatability() != Updatability.READONLY) {
throw new CmisConstraintException("Property '"
+ propDef.getId() + "' is required!");
}
}
}
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuide,代码行数:53,代码来源:FileBridgeRepository.java
注:本文中的org.apache.chemistry.opencmis.commons.enums.Updatability类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论