mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Refactor CMIS Dictionary part 2
- further simplification of CMISDictionaryService and fixup fallout - added logging - consolidate & fix property definition handling (only one definition per property) - include support for aspect properties - fix property.isInherited - open up the door for types outside of CMIS doc, folder, rel & policy Dictionary Service - add isOverride() to PropertyDefinition Invite Workflows - ensure they create their own namespace for new types/props - NOTE: the previous way uses a hole in the DictinaryService which has been there unnoticed for over 4 years, till now. At some point, the hole will be filled in. Tests pass for CMIS REST / Web Services and Query. Tests pass for Invitation Service. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13786 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -33,6 +33,7 @@ import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.alfresco.cmis.CMISDataTypeEnum;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||
import org.alfresco.repo.dictionary.DictionaryListener;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
@@ -48,10 +49,10 @@ import org.springframework.context.ApplicationEvent;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBean implements CMISDictionaryService, DictionaryListener
|
||||
public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBean implements CMISDictionaryService, DictionaryListener
|
||||
{
|
||||
// Logger
|
||||
protected static final Log logger = LogFactory.getLog(AbstractCMISDictionaryService.class);
|
||||
protected static final Log logger = LogFactory.getLog(CMISAbstractDictionaryService.class);
|
||||
|
||||
// service dependencies
|
||||
private DictionaryDAO dictionaryDAO;
|
||||
@@ -102,9 +103,9 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
/*package*/ class DictionaryRegistry
|
||||
{
|
||||
// Type Definitions Index
|
||||
Map<QName, CMISObjectTypeDefinition> typeDefsByQName = new HashMap<QName, CMISObjectTypeDefinition>();
|
||||
Map<QName, CMISObjectTypeDefinition> assocDefsByQName = new HashMap<QName, CMISObjectTypeDefinition>();
|
||||
Map<CMISTypeId, CMISObjectTypeDefinition> objectDefsByTypeId = new HashMap<CMISTypeId, CMISObjectTypeDefinition>();
|
||||
Map<QName, CMISAbstractTypeDefinition> typeDefsByQName = new HashMap<QName, CMISAbstractTypeDefinition>();
|
||||
Map<QName, CMISAbstractTypeDefinition> assocDefsByQName = new HashMap<QName, CMISAbstractTypeDefinition>();
|
||||
Map<CMISTypeId, CMISAbstractTypeDefinition> objectDefsByTypeId = new HashMap<CMISTypeId, CMISAbstractTypeDefinition>();
|
||||
Map<CMISTypeId, CMISTypeDefinition> typeDefsByTypeId = new HashMap<CMISTypeId, CMISTypeDefinition>();
|
||||
Map<String, CMISTypeDefinition> typeDefsByTable = new HashMap<String, CMISTypeDefinition>();
|
||||
|
||||
@@ -116,25 +117,41 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
/**
|
||||
* Register Type Definition
|
||||
*
|
||||
* @param typeDefinition
|
||||
* @param typeDef
|
||||
*/
|
||||
public void registerTypeDefinition(CMISObjectTypeDefinition typeDefinition)
|
||||
public void registerTypeDefinition(CMISAbstractTypeDefinition typeDef)
|
||||
{
|
||||
QName typeQName = typeDefinition.getTypeId().getQName();
|
||||
if (typeQName != null)
|
||||
CMISTypeDefinition existingTypeDef = objectDefsByTypeId.get(typeDef.getTypeId());
|
||||
if (existingTypeDef != null)
|
||||
{
|
||||
if (typeDefinition instanceof CMISRelationshipTypeDefinition)
|
||||
{
|
||||
assocDefsByQName.put(typeQName, typeDefinition);
|
||||
}
|
||||
else
|
||||
{
|
||||
typeDefsByQName.put(typeQName, typeDefinition);
|
||||
}
|
||||
throw new AlfrescoRuntimeException("Type " + typeDef.getTypeId() + " already registered");
|
||||
}
|
||||
|
||||
objectDefsByTypeId.put(typeDef.getTypeId(), typeDef);
|
||||
if (typeDef.isPublic())
|
||||
{
|
||||
QName typeQName = typeDef.getTypeId().getQName();
|
||||
if (typeQName != null)
|
||||
{
|
||||
if (typeDef instanceof CMISRelationshipTypeDefinition)
|
||||
{
|
||||
assocDefsByQName.put(typeQName, typeDef);
|
||||
}
|
||||
else
|
||||
{
|
||||
typeDefsByQName.put(typeQName, typeDef);
|
||||
}
|
||||
}
|
||||
typeDefsByTypeId.put(typeDef.getTypeId(), typeDef);
|
||||
typeDefsByTable.put(typeDef.getQueryName().toLowerCase(), typeDef);
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Registered type " + typeDef.getTypeId() + " (scope=" + typeDef.getTypeId().getScope() + ", public=" + typeDef.isPublic() + ")");
|
||||
logger.debug(" QName: " + typeDef.getTypeId().getQName());
|
||||
logger.debug(" Table: " + typeDef.getQueryName());
|
||||
}
|
||||
objectDefsByTypeId.put(typeDefinition.getTypeId(), typeDefinition);
|
||||
typeDefsByTypeId.put(typeDefinition.getTypeId(), typeDefinition);
|
||||
typeDefsByTable.put(typeDefinition.getQueryName().toLowerCase(), typeDefinition);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,11 +161,25 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
*/
|
||||
public void registerPropertyDefinition(CMISPropertyDefinition propDef)
|
||||
{
|
||||
CMISPropertyDefinition existingPropDef = propDefsByPropId.get(propDef.getPropertyId());
|
||||
if (existingPropDef != null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Property " + propDef.getPropertyId() + " of " + propDef.getOwningType().getTypeId() + " already registered by type " + existingPropDef.getOwningType().getTypeId());
|
||||
}
|
||||
|
||||
propDefsByPropId.put(propDef.getPropertyId(), propDef);
|
||||
propDefsByQName.put(propDef.getPropertyId().getQName(), propDef);
|
||||
propDefsByName.put(propDef.getPropertyId().getName().toLowerCase(), propDef);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
{
|
||||
logger.debug("Registered property " + propDef.getPropertyId().getId());
|
||||
logger.debug(" QName: " + propDef.getPropertyId().getQName());
|
||||
logger.debug(" Name: " + propDef.getPropertyId().getName());
|
||||
logger.debug(" Owning Type: " + propDef.getOwningType().getTypeId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
@@ -165,24 +196,45 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getTypeId(java.lang.String)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#findType(org.alfresco.cmis.dictionary.CMISTypeId)
|
||||
*/
|
||||
public CMISTypeId getTypeId(String typeId)
|
||||
public CMISTypeDefinition findType(CMISTypeId typeId)
|
||||
{
|
||||
return cmisMapping.getCmisTypeId(typeId);
|
||||
return registry.objectDefsByTypeId.get(typeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getTypeId(org.alfresco.service.namespace.QName, org.alfresco.cmis.dictionary.CMISScope)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#findType(java.lang.String)
|
||||
*/
|
||||
public CMISTypeId getTypeId(QName clazz, CMISScope matchingScope)
|
||||
public CMISTypeDefinition findType(String typeId)
|
||||
{
|
||||
CMISTypeId cmisTypeId = cmisMapping.getCmisTypeId(typeId);
|
||||
return findType(cmisTypeId);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#findTypeForClass(org.alfresco.service.namespace.QName, org.alfresco.cmis.dictionary.CMISScope[])
|
||||
*/
|
||||
public CMISTypeDefinition findTypeForClass(QName clazz, CMISScope... matchingScopes)
|
||||
{
|
||||
// searching for relationship
|
||||
boolean scopeByRelationship = false;
|
||||
for (CMISScope scope : matchingScopes)
|
||||
{
|
||||
if (scope == CMISScope.RELATIONSHIP)
|
||||
{
|
||||
scopeByRelationship = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// locate type in registry
|
||||
CMISTypeDefinition typeDef = null;
|
||||
if (matchingScope != null && matchingScope == CMISScope.RELATIONSHIP)
|
||||
if (scopeByRelationship)
|
||||
{
|
||||
typeDef = registry.assocDefsByQName.get(clazz);
|
||||
}
|
||||
@@ -191,40 +243,33 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
typeDef = registry.typeDefsByQName.get(clazz);
|
||||
}
|
||||
|
||||
CMISTypeDefinition matchingTypeDef = null;
|
||||
if (matchingScope == null)
|
||||
// ensure matches one of provided matching scopes
|
||||
CMISTypeDefinition matchingTypeDef = (matchingScopes.length == 0) ? typeDef : null;
|
||||
if (typeDef != null)
|
||||
{
|
||||
matchingTypeDef = typeDef;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeDef != null && typeDef.getTypeId().getScope() == matchingScope)
|
||||
for (CMISScope scope : matchingScopes)
|
||||
{
|
||||
matchingTypeDef = typeDef;
|
||||
if (typeDef.getTypeId().getScope() == scope)
|
||||
{
|
||||
matchingTypeDef = typeDef;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return matchingTypeDef == null ? null : matchingTypeDef.getTypeId();
|
||||
|
||||
return matchingTypeDef;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getTypeIdFromTable(java.lang.String)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#findTypeForTable(java.lang.String)
|
||||
*/
|
||||
public CMISTypeId getTypeIdFromTable(String table)
|
||||
public CMISTypeDefinition findTypeForTable(String tableName)
|
||||
{
|
||||
CMISTypeDefinition typeDef = registry.typeDefsByTable.get(table.toLowerCase());
|
||||
return (typeDef == null) ? null : typeDef.getTypeId();
|
||||
CMISTypeDefinition typeDef = registry.typeDefsByTable.get(tableName.toLowerCase());
|
||||
return typeDef;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getType(org.alfresco.cmis.dictionary.CMISTypeId)
|
||||
*/
|
||||
public CMISTypeDefinition getType(CMISTypeId typeId)
|
||||
{
|
||||
return registry.objectDefsByTypeId.get(typeId);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getAllTypes()
|
||||
@@ -233,46 +278,58 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
{
|
||||
return Collections.unmodifiableCollection(registry.typeDefsByTypeId.values());
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getProperty(org.alfresco.cmis.dictionary.CMISPropertyId)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getProperty(org.alfresco.service.namespace.QName, org.alfresco.cmis.dictionary.CMISTypeDefinition)
|
||||
*/
|
||||
public CMISPropertyDefinition getProperty(CMISPropertyId propertyId)
|
||||
{
|
||||
return registry.propDefsByPropId.get(propertyId);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getPropertyId(java.lang.String)
|
||||
*/
|
||||
public CMISPropertyId getPropertyId(String property)
|
||||
{
|
||||
CMISPropertyDefinition propDef = registry.propDefsByName.get(property.toLowerCase());
|
||||
return (propDef == null) ? null : propDef.getPropertyId();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getPropertyId(org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public CMISPropertyId getPropertyId(QName property)
|
||||
public CMISPropertyDefinition findProperty(QName property, CMISTypeDefinition matchingType)
|
||||
{
|
||||
CMISPropertyDefinition propDef = registry.propDefsByQName.get(property);
|
||||
return (propDef == null) ? null : propDef.getPropertyId();
|
||||
return getProperty(propDef, matchingType);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getProperty(java.lang.String, org.alfresco.cmis.dictionary.CMISTypeDefinition)
|
||||
*/
|
||||
public CMISPropertyDefinition findProperty(String property, CMISTypeDefinition matchingType)
|
||||
{
|
||||
CMISPropertyDefinition propDef = registry.propDefsByName.get(property.toLowerCase());
|
||||
return getProperty(propDef, matchingType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property definition if part of specified type definition
|
||||
*
|
||||
* @param property
|
||||
* @param matchingType
|
||||
* @return property definition (if matches), or null (if not matches)
|
||||
*/
|
||||
private CMISPropertyDefinition getProperty(CMISPropertyDefinition property, CMISTypeDefinition matchingType)
|
||||
{
|
||||
boolean isMatchingType = (matchingType == null);
|
||||
if (property != null && matchingType != null)
|
||||
{
|
||||
Map<CMISPropertyId, CMISPropertyDefinition> props = matchingType.getPropertyDefinitions();
|
||||
if (props.containsKey(property.getPropertyId()))
|
||||
{
|
||||
isMatchingType = true;
|
||||
}
|
||||
}
|
||||
return isMatchingType ? property : null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getDataType(org.alfresco.service.namespace.QName)
|
||||
*/
|
||||
public CMISDataTypeEnum getDataType(QName dataType)
|
||||
public CMISDataTypeEnum findDataType(QName dataType)
|
||||
{
|
||||
return cmisMapping.getDataType(dataType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Factory for creating CMIS Definitions
|
||||
*
|
||||
@@ -288,9 +345,12 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
{
|
||||
DictionaryRegistry registry = new DictionaryRegistry();
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Creating type definitions...");
|
||||
|
||||
// phase 1: construct type definitions
|
||||
createDefinitions(registry);
|
||||
for (CMISObjectTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
|
||||
for (CMISAbstractTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
|
||||
{
|
||||
Map<CMISPropertyId, CMISPropertyDefinition> propDefs = objectTypeDef.createProperties(cmisMapping, dictionaryService);
|
||||
for (CMISPropertyDefinition propDef : propDefs.values())
|
||||
@@ -300,37 +360,43 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
objectTypeDef.createSubTypes(cmisMapping, dictionaryService);
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Linking type definitions...");
|
||||
|
||||
// phase 2: link together
|
||||
for (CMISObjectTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
|
||||
for (CMISAbstractTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
|
||||
{
|
||||
objectTypeDef.resolveDependencies(registry);
|
||||
}
|
||||
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Resolving type inheritance...");
|
||||
|
||||
// phase 3: resolve inheritance
|
||||
Map<Integer,List<CMISObjectTypeDefinition>> order = new TreeMap<Integer, List<CMISObjectTypeDefinition>>();
|
||||
for (CMISObjectTypeDefinition typeDef : registry.objectDefsByTypeId.values())
|
||||
Map<Integer,List<CMISAbstractTypeDefinition>> order = new TreeMap<Integer, List<CMISAbstractTypeDefinition>>();
|
||||
for (CMISAbstractTypeDefinition typeDef : registry.objectDefsByTypeId.values())
|
||||
{
|
||||
// calculate class depth in hierarchy
|
||||
int depth = 0;
|
||||
CMISTypeDefinition parent = typeDef.getParentType();
|
||||
CMISAbstractTypeDefinition parent = typeDef.getInternalParentType();
|
||||
while (parent != null)
|
||||
{
|
||||
depth = depth +1;
|
||||
parent = parent.getParentType();
|
||||
parent = parent.getInternalParentType();
|
||||
}
|
||||
|
||||
// map class to depth
|
||||
List<CMISObjectTypeDefinition> classes = order.get(depth);
|
||||
List<CMISAbstractTypeDefinition> classes = order.get(depth);
|
||||
if (classes == null)
|
||||
{
|
||||
classes = new ArrayList<CMISObjectTypeDefinition>();
|
||||
classes = new ArrayList<CMISAbstractTypeDefinition>();
|
||||
order.put(depth, classes);
|
||||
}
|
||||
classes.add(typeDef);
|
||||
}
|
||||
for (int depth = 0; depth < order.size(); depth++)
|
||||
{
|
||||
for (CMISObjectTypeDefinition typeDef : order.get(depth))
|
||||
for (CMISAbstractTypeDefinition typeDef : order.get(depth))
|
||||
{
|
||||
typeDef.resolveInheritance(registry);
|
||||
}
|
||||
@@ -339,8 +405,8 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
|
||||
// publish new registry
|
||||
this.registry = registry;
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Initialized CMIS Dictionary. Types:" + registry.typeDefsByTypeId.size() + ", Properties:" + registry.propDefsByPropId.size());
|
||||
if (logger.isInfoEnabled())
|
||||
logger.info("Initialized CMIS Dictionary. Types:" + registry.typeDefsByTypeId.size() + ", Properties:" + registry.propDefsByPropId.size());
|
||||
}
|
||||
|
||||
/*
|
@@ -33,13 +33,15 @@ import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.cmis.CMISContentStreamAllowedEnum;
|
||||
import org.alfresco.cmis.dictionary.AbstractCMISDictionaryService.DictionaryRegistry;
|
||||
import org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.DictionaryRegistry;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
||||
/**
|
||||
@@ -47,17 +49,22 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializable
|
||||
public class CMISAbstractTypeDefinition implements CMISTypeDefinition, Serializable
|
||||
{
|
||||
// Logger
|
||||
protected static final Log logger = LogFactory.getLog(CMISAbstractTypeDefinition.class);
|
||||
|
||||
private static final long serialVersionUID = -3131505923356013430L;
|
||||
|
||||
// Object type properties
|
||||
protected boolean isPublic;
|
||||
protected ClassDefinition cmisClassDef;
|
||||
protected CMISTypeId objectTypeId;
|
||||
protected String objectTypeQueryName;
|
||||
protected String displayName;
|
||||
protected CMISTypeId parentTypeId;
|
||||
protected CMISTypeDefinition parentType;
|
||||
protected CMISAbstractTypeDefinition internalParentType;
|
||||
protected CMISTypeDefinition rootType;
|
||||
protected String description;
|
||||
protected boolean creatable;
|
||||
@@ -68,6 +75,8 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
|
||||
protected Collection<CMISTypeDefinition> subTypes = new ArrayList<CMISTypeDefinition>();
|
||||
protected Map<CMISPropertyId, CMISPropertyDefinition> properties = new HashMap<CMISPropertyId, CMISPropertyDefinition>();
|
||||
protected Map<CMISPropertyId, CMISPropertyDefinition> inheritedProperties = new HashMap<CMISPropertyId, CMISPropertyDefinition>();
|
||||
protected Map<CMISPropertyId, CMISPropertyDefinition> ownedProperties = new HashMap<CMISPropertyId, CMISPropertyDefinition>();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,20 +91,7 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
|
||||
// map properties directly defined on this type
|
||||
for (PropertyDefinition propDef : cmisClassDef.getProperties().values())
|
||||
{
|
||||
if (propDef.getContainerClass().equals(cmisClassDef))
|
||||
{
|
||||
if (cmisMapping.getDataType(propDef.getDataType()) != null)
|
||||
{
|
||||
CMISPropertyDefinition cmisPropDef = createProperty(cmisMapping, propDef);
|
||||
properties.put(cmisPropDef.getPropertyId(), cmisPropDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// map properties directly defined on default aspects
|
||||
for (AspectDefinition aspectDef : cmisClassDef.getDefaultAspects(false))
|
||||
{
|
||||
for (PropertyDefinition propDef : aspectDef.getProperties().values())
|
||||
if (propDef.getContainerClass().equals(cmisClassDef) && !propDef.isOverride())
|
||||
{
|
||||
if (cmisMapping.getDataType(propDef.getDataType()) != null)
|
||||
{
|
||||
@@ -155,29 +151,48 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
|
||||
{
|
||||
if (parentTypeId != null)
|
||||
{
|
||||
parentType = registry.typeDefsByTypeId.get(parentTypeId);
|
||||
if (parentType == null)
|
||||
internalParentType = registry.objectDefsByTypeId.get(parentTypeId);
|
||||
if (internalParentType == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to retrieve parent type for type id " + parentTypeId);
|
||||
}
|
||||
if (internalParentType.isPublic() == isPublic)
|
||||
{
|
||||
parentType = internalParentType;
|
||||
}
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Type " + objectTypeId + ": parent=" + (parentType == null ? "<none>" : parentType.getTypeId()) +
|
||||
", internal parent=" + (internalParentType == null ? "<none>" : internalParentType.getTypeId()));
|
||||
|
||||
CMISTypeId rootTypeId = objectTypeId.getRootTypeId();
|
||||
if (rootTypeId != null)
|
||||
{
|
||||
rootType = registry.typeDefsByTypeId.get(rootTypeId);
|
||||
rootType = registry.objectDefsByTypeId.get(rootTypeId);
|
||||
if (rootType == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to retrieve root type for type id " + rootTypeId);
|
||||
}
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Type " + objectTypeId + ": root=" + rootType.getTypeId());
|
||||
|
||||
for (CMISTypeId subTypeId : subTypeIds)
|
||||
{
|
||||
CMISTypeDefinition subType = registry.typeDefsByTypeId.get(subTypeId);
|
||||
CMISTypeDefinition subType = registry.objectDefsByTypeId.get(subTypeId);
|
||||
if (subType == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to retrieve sub type for type id " + subTypeId + " for parent type " + objectTypeId);
|
||||
}
|
||||
subTypes.add(subType);
|
||||
if (subType.isPublic() == isPublic)
|
||||
{
|
||||
subTypes.add(subType);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Type " + objectTypeId + ": subtype=" + subType.getTypeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,70 +204,92 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
|
||||
/*package*/ void resolveInheritance(DictionaryRegistry registry)
|
||||
{
|
||||
inheritedProperties.putAll(properties);
|
||||
if (parentType != null)
|
||||
ownedProperties.putAll(properties);
|
||||
if (internalParentType != null)
|
||||
{
|
||||
inheritedProperties.putAll(parentType.getPropertyDefinitions());
|
||||
}
|
||||
}
|
||||
|
||||
inheritedProperties.putAll(internalParentType.getPropertyDefinitions());
|
||||
|
||||
// collapse all internal inherited properties into owned properties
|
||||
if (internalParentType.isPublic != isPublic)
|
||||
{
|
||||
ownedProperties.putAll(internalParentType.getPropertyDefinitions());
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Type " + objectTypeId + " inheriting properties: " + internalParentType.getPropertyDefinitions().size() + " from " + internalParentType.getTypeId());
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Type " + objectTypeId + " properties: " + inheritedProperties.size() + ", owned: " + ownedProperties.size());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the unique identifier for the type
|
||||
* Get internal parent type
|
||||
*
|
||||
* @return - the type id
|
||||
* @return
|
||||
*/
|
||||
public CMISAbstractTypeDefinition getInternalParentType()
|
||||
{
|
||||
return internalParentType;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isPublic()
|
||||
*/
|
||||
public boolean isPublic()
|
||||
{
|
||||
return isPublic;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getTypeId()
|
||||
*/
|
||||
public CMISTypeId getTypeId()
|
||||
{
|
||||
return objectTypeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the table name used for queries against the type. This is also a unique identifier for the type. The string
|
||||
* conforms to SQL table naming conventions. TODO: Should we impose a maximum length and if so how do we avoid
|
||||
* collisions from truncations?
|
||||
*
|
||||
* @return the sql table name
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getQueryName()
|
||||
*/
|
||||
public String getQueryName()
|
||||
{
|
||||
return objectTypeQueryName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the display name for the type.
|
||||
*
|
||||
* @return - the display name
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getDisplayName()
|
||||
*/
|
||||
public String getDisplayName()
|
||||
{
|
||||
return displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parent type
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getParentType()
|
||||
*/
|
||||
public CMISTypeDefinition getParentType()
|
||||
{
|
||||
return parentType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the root type
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getRootType()
|
||||
*/
|
||||
public CMISTypeDefinition getRootType()
|
||||
{
|
||||
return rootType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sub types
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getSubTypes(boolean)
|
||||
*/
|
||||
public Collection<CMISTypeDefinition> getSubTypes(boolean includeDescendants)
|
||||
{
|
||||
@@ -281,121 +318,117 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
|
||||
}
|
||||
return descendants;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the description for the type
|
||||
*
|
||||
* @return - the description
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getDescription()
|
||||
*/
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can objects of this type be created?
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isCreatable()
|
||||
*/
|
||||
public boolean isCreatable()
|
||||
{
|
||||
return creatable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this type queryable? If not, the type may not appear in the FROM clause of a query. This property of the type
|
||||
* is not inherited in the type hierarchy. It is set on each type.
|
||||
*
|
||||
* @return true if queryable
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isQueryable()
|
||||
*/
|
||||
public boolean isQueryable()
|
||||
{
|
||||
return queryable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Are objects of this type controllable.
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isControllable()
|
||||
*/
|
||||
public boolean isControllable()
|
||||
{
|
||||
return controllable;
|
||||
}
|
||||
|
||||
/**
|
||||
* Are objects of this type included in super type queries
|
||||
*
|
||||
* @return
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isIncludeInSuperTypeQuery()
|
||||
*/
|
||||
public boolean isIncludeInSuperTypeQuery()
|
||||
{
|
||||
return includeInSuperTypeQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the property definitions for this type
|
||||
*
|
||||
* @return property definitions
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getPropertyDefinitions()
|
||||
*/
|
||||
public Map<CMISPropertyId, CMISPropertyDefinition> getPropertyDefinitions()
|
||||
{
|
||||
return inheritedProperties;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getOwnedPropertyDefinitions()
|
||||
*/
|
||||
public Map<CMISPropertyId, CMISPropertyDefinition> getOwnedPropertyDefinitions()
|
||||
{
|
||||
return ownedProperties;
|
||||
}
|
||||
|
||||
//
|
||||
// Document Type specific
|
||||
//
|
||||
|
||||
/**
|
||||
* Is Fileable?
|
||||
*
|
||||
* @return
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isFileable()
|
||||
*/
|
||||
public boolean isFileable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is Versionable?
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isVersionable()
|
||||
*/
|
||||
public boolean isVersionable()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is Content Stream Allowed?
|
||||
*
|
||||
* @return
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getContentStreamAllowed()
|
||||
*/
|
||||
public CMISContentStreamAllowedEnum getContentStreamAllowed()
|
||||
{
|
||||
return CMISContentStreamAllowedEnum.NOT_ALLOWED;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Relationship Type specific
|
||||
//
|
||||
|
||||
/**
|
||||
* Get allowed source types
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getAllowedSourceTypes()
|
||||
*/
|
||||
public Collection<CMISTypeDefinition> getAllowedSourceTypes()
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get allowed target types
|
||||
*
|
||||
* @return
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getAllowedTargetTypes()
|
||||
*/
|
||||
public Collection<CMISTypeDefinition> getAllowedTargetTypes()
|
||||
{
|
@@ -37,85 +37,68 @@ import org.alfresco.service.namespace.QName;
|
||||
public interface CMISDictionaryService
|
||||
{
|
||||
/**
|
||||
* Get Type Id
|
||||
* Find type for type id
|
||||
* @param typeId
|
||||
* @return
|
||||
*/
|
||||
public CMISTypeDefinition findType(CMISTypeId typeId);
|
||||
|
||||
/**
|
||||
* Find type for type id
|
||||
*
|
||||
* @param typeId
|
||||
* @return
|
||||
*/
|
||||
public CMISTypeId getTypeId(String typeId);
|
||||
public CMISTypeDefinition findType(String typeId);
|
||||
|
||||
/**
|
||||
* Get Type Id from Table Name
|
||||
*
|
||||
* @param table
|
||||
* @return
|
||||
*/
|
||||
public CMISTypeId getTypeIdFromTable(String table);
|
||||
|
||||
/**
|
||||
* Get Type Id from Alfresco Class Name
|
||||
* Find type for Alfresco class name. Optionally, constrain match to one of specified CMIS scopes
|
||||
*
|
||||
* @param clazz
|
||||
* @param matchingScope if provided, only return type id matching scope
|
||||
* @param matchingScopes
|
||||
* @return
|
||||
*/
|
||||
public CMISTypeId getTypeId(QName clazz, CMISScope matchingScope);
|
||||
|
||||
/**
|
||||
* Get Type Definition
|
||||
*
|
||||
* @param typeId
|
||||
* @return
|
||||
*/
|
||||
public CMISTypeDefinition getType(CMISTypeId typeId);
|
||||
public CMISTypeDefinition findTypeForClass(QName clazz, CMISScope... matchingScopes);
|
||||
|
||||
/**
|
||||
* Get All Type Definitions
|
||||
* Find type for table
|
||||
*
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
public CMISTypeDefinition findTypeForTable(String tableName);
|
||||
|
||||
/**
|
||||
* Get all Types
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Collection<CMISTypeDefinition> getAllTypes();
|
||||
|
||||
|
||||
/**
|
||||
* Get Property Id for Alfresco property name
|
||||
* Find property. Optionally constrain match to specified type.
|
||||
*
|
||||
* @param property
|
||||
* @param matchingType
|
||||
* @return
|
||||
*/
|
||||
public CMISPropertyId getPropertyId(QName property);
|
||||
public CMISPropertyDefinition findProperty(QName property, CMISTypeDefinition matchingType);
|
||||
|
||||
/**
|
||||
* Get Property Id
|
||||
* Find property. Optionally constrain match to specified type.
|
||||
*
|
||||
* @param propertyId
|
||||
* @param property
|
||||
* @param matchingType
|
||||
* @return
|
||||
*/
|
||||
public CMISPropertyId getPropertyId(String propertyId);
|
||||
|
||||
public CMISPropertyDefinition findProperty(String property, CMISTypeDefinition matchingType);
|
||||
|
||||
/**
|
||||
* Get Property
|
||||
*
|
||||
* @param propertyId
|
||||
* @return
|
||||
*/
|
||||
public CMISPropertyDefinition getProperty(CMISPropertyId propertyId);
|
||||
|
||||
/**
|
||||
* Get Data Type
|
||||
* Find data type
|
||||
*
|
||||
* @param dataType
|
||||
* @return
|
||||
*/
|
||||
public CMISDataTypeEnum getDataType(QName dataType);
|
||||
|
||||
|
||||
// public CMISTypeDef findType(CMISTypeId typeId)
|
||||
// public CMISTypeDef findType(String typeId)
|
||||
// public CMISTypeDef findTypeForClass(QName clazz, CMISScope matchingScope, ...)
|
||||
// public CMISTypeDef findTypeForTable(String tableName)
|
||||
// public CMISTypeDef getAllTypes();
|
||||
// public CMISPropertyDefinition getProperty(QName property)
|
||||
// public CMISPropertyDefinition getProperty(CMISTypeDef typeDef, String property)
|
||||
// public CMISDataTypeEnum getDataType(QName dataType)
|
||||
public CMISDataTypeEnum findDataType(QName dataType);
|
||||
|
||||
}
|
||||
|
@@ -55,8 +55,7 @@ public class CMISDictionaryTest extends BaseCMISTest
|
||||
{
|
||||
for (CMISTypeDefinition typeDef : cmisDictionaryService.getAllTypes())
|
||||
{
|
||||
CMISTypeId typeId = typeDef.getTypeId();
|
||||
CMISTypeDefinition typeDefLookup = cmisDictionaryService.getType(typeId);
|
||||
CMISTypeDefinition typeDefLookup = cmisDictionaryService.findType(typeDef.getTypeId());
|
||||
assertNotNull(typeDefLookup);
|
||||
assertEquals(typeDef, typeDefLookup);
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class CMISDocumentTypeDefinition extends CMISObjectTypeDefinition
|
||||
public class CMISDocumentTypeDefinition extends CMISAbstractTypeDefinition
|
||||
{
|
||||
private static final long serialVersionUID = -7209732754962781522L;
|
||||
|
||||
@@ -57,17 +57,32 @@ public class CMISDocumentTypeDefinition extends CMISObjectTypeDefinition
|
||||
*/
|
||||
public CMISDocumentTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef)
|
||||
{
|
||||
isPublic = true;
|
||||
|
||||
// Object type properties
|
||||
this.cmisClassDef = cmisClassDef;
|
||||
objectTypeId = typeId;
|
||||
objectTypeQueryName = (typeId == CMISDictionaryModel.DOCUMENT_TYPE_ID) ? typeId.getId() : cmisMapping.buildPrefixEncodedString(typeId.getQName(), false);
|
||||
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
|
||||
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
|
||||
if (cmisMapping.isValidCmisDocument(parentQName))
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.DOCUMENT, parentQName);
|
||||
}
|
||||
description = cmisClassDef.getDescription();
|
||||
|
||||
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
|
||||
if (typeId == CMISDictionaryModel.DOCUMENT_TYPE_ID)
|
||||
{
|
||||
objectTypeQueryName = typeId.getId();
|
||||
if (parentQName != null)
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
objectTypeQueryName = cmisMapping.buildPrefixEncodedString(typeId.getQName(), false);
|
||||
if (cmisMapping.isValidCmisDocument(parentQName))
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.DOCUMENT, parentQName);
|
||||
}
|
||||
}
|
||||
|
||||
creatable = true;
|
||||
queryable = true;
|
||||
controllable = false;
|
||||
|
@@ -33,7 +33,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class CMISFolderTypeDefinition extends CMISObjectTypeDefinition
|
||||
public class CMISFolderTypeDefinition extends CMISAbstractTypeDefinition
|
||||
{
|
||||
private static final long serialVersionUID = 7526155195125799106L;
|
||||
|
||||
@@ -45,17 +45,32 @@ public class CMISFolderTypeDefinition extends CMISObjectTypeDefinition
|
||||
*/
|
||||
public CMISFolderTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef)
|
||||
{
|
||||
isPublic = true;
|
||||
|
||||
// Object type properties
|
||||
this.cmisClassDef = cmisClassDef;
|
||||
objectTypeId = typeId;
|
||||
objectTypeQueryName = (typeId == CMISDictionaryModel.FOLDER_TYPE_ID) ? typeId.getId() : cmisMapping.buildPrefixEncodedString(typeId.getQName(), false);
|
||||
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
|
||||
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
|
||||
if (cmisMapping.isValidCmisFolder(parentQName))
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.FOLDER, parentQName);
|
||||
}
|
||||
description = cmisClassDef.getDescription();
|
||||
|
||||
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
|
||||
if (typeId == CMISDictionaryModel.FOLDER_TYPE_ID)
|
||||
{
|
||||
objectTypeQueryName = typeId.getId();
|
||||
if (parentQName != null)
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
objectTypeQueryName = cmisMapping.buildPrefixEncodedString(typeId.getQName(), false);
|
||||
if (cmisMapping.isValidCmisFolder(parentQName))
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.FOLDER, parentQName);
|
||||
}
|
||||
}
|
||||
|
||||
creatable = true;
|
||||
queryable = true;
|
||||
controllable = false;
|
||||
|
@@ -59,7 +59,10 @@ public class CMISMapping
|
||||
* The QName for the Alfresco CMIS Model.
|
||||
*/
|
||||
public static QName CMIS_MODEL_QNAME = QName.createQName(CMIS_MODEL_URI, CMIS_MODEL_NAME);
|
||||
|
||||
|
||||
// CMIS Internal Types
|
||||
public static String OBJECT_OBJECT_TYPE = "Object";
|
||||
public static String FILESYSTEM_OBJECT_TYPE ="FileSystemObject";
|
||||
|
||||
// CMIS Data Types
|
||||
public static QName CMIS_DATATYPE_ID = QName.createQName(CMIS_MODEL_URI, "id");
|
||||
@@ -68,11 +71,17 @@ public class CMISMapping
|
||||
public static QName CMIS_DATATYPE_HTML = QName.createQName(CMIS_MODEL_URI, "html");
|
||||
|
||||
// CMIS Types
|
||||
public static QName OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, OBJECT_OBJECT_TYPE);
|
||||
public static QName FILESYSTEM_OBJECT_QNAME = QName.createQName(CMIS_MODEL_URI, FILESYSTEM_OBJECT_TYPE);
|
||||
public static QName DOCUMENT_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.DOCUMENT_OBJECT_TYPE);
|
||||
public static QName FOLDER_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.FOLDER_OBJECT_TYPE);
|
||||
public static QName RELATIONSHIP_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.RELATIONSHIP_OBJECT_TYPE);
|
||||
public static QName POLICY_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.POLICY_OBJECT_TYPE);
|
||||
|
||||
// CMIS Internal Type Ids
|
||||
public static CMISTypeId OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, OBJECT_OBJECT_TYPE.toLowerCase(), OBJECT_QNAME);
|
||||
public static CMISTypeId FILESYSTEM_OBJECT_TYPE_ID = new CMISTypeId(CMISScope.OBJECT, FILESYSTEM_OBJECT_TYPE.toLowerCase(), FILESYSTEM_OBJECT_QNAME);
|
||||
|
||||
// Properties
|
||||
public static QName PROP_OBJECT_ID_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.PROP_OBJECT_ID);
|
||||
|
||||
@@ -90,6 +99,8 @@ public class CMISMapping
|
||||
*/
|
||||
static
|
||||
{
|
||||
qNameToCmisTypeId.put(OBJECT_QNAME, OBJECT_TYPE_ID);
|
||||
qNameToCmisTypeId.put(FILESYSTEM_OBJECT_QNAME, FILESYSTEM_OBJECT_TYPE_ID);
|
||||
qNameToCmisTypeId.put(DOCUMENT_QNAME, CMISDictionaryModel.DOCUMENT_TYPE_ID);
|
||||
qNameToCmisTypeId.put(FOLDER_QNAME, CMISDictionaryModel.FOLDER_TYPE_ID);
|
||||
qNameToCmisTypeId.put(RELATIONSHIP_QNAME, CMISDictionaryModel.RELATIONSHIP_TYPE_ID);
|
||||
@@ -195,6 +206,14 @@ public class CMISMapping
|
||||
{
|
||||
return CMISDictionaryModel.POLICY_TYPE_ID;
|
||||
}
|
||||
else if (typeId.equalsIgnoreCase(OBJECT_TYPE_ID.getId()))
|
||||
{
|
||||
return OBJECT_TYPE_ID;
|
||||
}
|
||||
else if (typeId.equalsIgnoreCase(FILESYSTEM_OBJECT_TYPE_ID.getId()))
|
||||
{
|
||||
return FILESYSTEM_OBJECT_TYPE_ID;
|
||||
}
|
||||
|
||||
// Is it an Alfresco type id?
|
||||
if (typeId.length() < 4 || typeId.charAt(1) != '/')
|
||||
@@ -255,6 +274,14 @@ public class CMISMapping
|
||||
{
|
||||
return getCmisTypeId(CMISScope.POLICY, classQName);
|
||||
}
|
||||
if (classQName.equals(CMISMapping.OBJECT_QNAME))
|
||||
{
|
||||
return getCmisTypeId(CMISScope.OBJECT, classQName);
|
||||
}
|
||||
if (classQName.equals(CMISMapping.FILESYSTEM_OBJECT_QNAME))
|
||||
{
|
||||
return getCmisTypeId(CMISScope.OBJECT, classQName);
|
||||
}
|
||||
if (isValidCmisDocument(classQName))
|
||||
{
|
||||
return getCmisTypeId(CMISScope.DOCUMENT, classQName);
|
||||
@@ -398,7 +425,8 @@ public class CMISMapping
|
||||
}
|
||||
|
||||
if (aspectDef.getName().equals(ContentModel.ASPECT_VERSIONABLE) ||
|
||||
aspectDef.getName().equals(ContentModel.ASPECT_AUDITABLE))
|
||||
aspectDef.getName().equals(ContentModel.ASPECT_AUDITABLE) ||
|
||||
aspectDef.getName().equals(ContentModel.ASPECT_REFERENCEABLE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ package org.alfresco.cmis.dictionary;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.alfresco.cmis.dictionary.AbstractCMISDictionaryService.DictionaryRegistry;
|
||||
import org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.DictionaryRegistry;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
@@ -37,7 +37,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class CMISPolicyTypeDefinition extends CMISObjectTypeDefinition
|
||||
public class CMISPolicyTypeDefinition extends CMISAbstractTypeDefinition
|
||||
{
|
||||
private static final long serialVersionUID = 1621538303752395828L;
|
||||
|
||||
@@ -50,12 +50,20 @@ public class CMISPolicyTypeDefinition extends CMISObjectTypeDefinition
|
||||
*/
|
||||
public CMISPolicyTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef)
|
||||
{
|
||||
isPublic = true;
|
||||
|
||||
// Object Type definitions
|
||||
this.cmisClassDef = cmisClassDef;
|
||||
objectTypeId = typeId;
|
||||
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
|
||||
if (typeId == CMISDictionaryModel.POLICY_TYPE_ID)
|
||||
{
|
||||
objectTypeQueryName = typeId.getId();
|
||||
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
|
||||
if (parentQName != null)
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -98,6 +106,10 @@ public class CMISPolicyTypeDefinition extends CMISObjectTypeDefinition
|
||||
{
|
||||
// NOTE: Force no inheritance of base Policy type
|
||||
inheritedProperties.putAll(properties);
|
||||
ownedProperties.putAll(properties);
|
||||
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Type " + objectTypeId + " properties: " + inheritedProperties.size() + ", owned: " + ownedProperties.size());
|
||||
}
|
||||
|
||||
/*
|
||||
|
@@ -29,7 +29,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.cmis.dictionary.AbstractCMISDictionaryService.DictionaryRegistry;
|
||||
import org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.DictionaryRegistry;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ClassDefinition;
|
||||
@@ -42,7 +42,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
|
||||
public class CMISRelationshipTypeDefinition extends CMISAbstractTypeDefinition
|
||||
{
|
||||
private static final long serialVersionUID = 5291428171784061346L;
|
||||
|
||||
@@ -65,6 +65,7 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
|
||||
*/
|
||||
public CMISRelationshipTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef, AssociationDefinition assocDef)
|
||||
{
|
||||
isPublic = true;
|
||||
this.cmisClassDef = cmisClassDef;
|
||||
objectTypeId = typeId;
|
||||
creatable = false;
|
||||
@@ -76,7 +77,11 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
|
||||
// TODO: Add CMIS Association mapping??
|
||||
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
|
||||
objectTypeQueryName = typeId.getId();
|
||||
parentTypeId = null;
|
||||
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
|
||||
if (parentQName != null)
|
||||
{
|
||||
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
|
||||
}
|
||||
description = cmisClassDef.getDescription();
|
||||
}
|
||||
else
|
||||
@@ -87,13 +92,13 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
|
||||
description = assocDef.getDescription();
|
||||
|
||||
CMISTypeId sourceTypeId = cmisMapping.getCmisTypeId(cmisMapping.getCmisType(assocDef.getSourceClass().getName()));
|
||||
if (sourceTypeId != null && (sourceTypeId.getScope() == CMISScope.DOCUMENT || sourceTypeId.getScope() == CMISScope.FOLDER))
|
||||
if (sourceTypeId != null)
|
||||
{
|
||||
allowedSourceTypeIds.add(sourceTypeId);
|
||||
}
|
||||
|
||||
CMISTypeId targetTypeId = cmisMapping.getCmisTypeId(cmisMapping.getCmisType(assocDef.getTargetClass().getName()));
|
||||
if (targetTypeId != null && (targetTypeId.getScope() == CMISScope.DOCUMENT || targetTypeId.getScope() == CMISScope.FOLDER))
|
||||
if (targetTypeId != null)
|
||||
{
|
||||
allowedTargetTypeIds.add(targetTypeId);
|
||||
}
|
||||
@@ -145,21 +150,27 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
|
||||
super.resolveDependencies(registry);
|
||||
for (CMISTypeId sourceTypeId : allowedSourceTypeIds)
|
||||
{
|
||||
CMISTypeDefinition type = registry.typeDefsByTypeId.get(sourceTypeId);
|
||||
CMISTypeDefinition type = registry.objectDefsByTypeId.get(sourceTypeId);
|
||||
if (type == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to retrieve allowed source type for type id " + sourceTypeId);
|
||||
}
|
||||
allowedSourceTypes.add(type);
|
||||
if (type.isPublic() == isPublic)
|
||||
{
|
||||
allowedSourceTypes.add(type);
|
||||
}
|
||||
}
|
||||
for (CMISTypeId targetTypeId : allowedTargetTypeIds)
|
||||
{
|
||||
CMISTypeDefinition type = registry.typeDefsByTypeId.get(targetTypeId);
|
||||
CMISTypeDefinition type = registry.objectDefsByTypeId.get(targetTypeId);
|
||||
if (type == null)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to retrieve allowed target type for type id " + targetTypeId);
|
||||
}
|
||||
allowedTargetTypes.add(registry.typeDefsByTypeId.get(targetTypeId));
|
||||
if (type.isPublic() == isPublic)
|
||||
{
|
||||
allowedTargetTypes.add(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,10 +184,10 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
|
||||
super.resolveInheritance(registry);
|
||||
inheritedAllowedSourceTypes.addAll(allowedSourceTypes);
|
||||
inheritedAllowedTargetTypes.addAll(allowedTargetTypes);
|
||||
if (parentType != null)
|
||||
if (internalParentType != null)
|
||||
{
|
||||
inheritedAllowedSourceTypes.addAll(parentType.getAllowedSourceTypes());
|
||||
inheritedAllowedTargetTypes.addAll(parentType.getAllowedTargetTypes());
|
||||
inheritedAllowedSourceTypes.addAll(internalParentType.getAllowedSourceTypes());
|
||||
inheritedAllowedTargetTypes.addAll(internalParentType.getAllowedTargetTypes());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @author davidc
|
||||
*/
|
||||
public class CMISStrictDictionaryService extends AbstractCMISDictionaryService
|
||||
public class CMISStrictDictionaryService extends CMISAbstractDictionaryService
|
||||
{
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -73,7 +73,7 @@ public class CMISStrictDictionaryService extends AbstractCMISDictionaryService
|
||||
|
||||
// create appropriate kind of type definition
|
||||
ClassDefinition classDef = dictionaryService.getClass(cmisMapping.getCmisType(typeId.getQName()));
|
||||
CMISObjectTypeDefinition objectTypeDef = null;
|
||||
CMISAbstractTypeDefinition objectTypeDef = null;
|
||||
if (typeId.getScope() == CMISScope.DOCUMENT)
|
||||
{
|
||||
objectTypeDef = new CMISDocumentTypeDefinition(cmisMapping, typeId, classDef);
|
||||
@@ -91,6 +91,10 @@ public class CMISStrictDictionaryService extends AbstractCMISDictionaryService
|
||||
{
|
||||
objectTypeDef = new CMISPolicyTypeDefinition(cmisMapping, typeId, classDef);
|
||||
}
|
||||
else if (typeId.getScope() == CMISScope.OBJECT)
|
||||
{
|
||||
objectTypeDef = new CMISObjectTypeDefinition(cmisMapping, typeId, classDef, false);
|
||||
}
|
||||
|
||||
registry.registerTypeDefinition(objectTypeDef);
|
||||
}
|
||||
@@ -112,7 +116,7 @@ public class CMISStrictDictionaryService extends AbstractCMISDictionaryService
|
||||
// create appropriate kind of type definition
|
||||
CMISTypeId typeId = cmisMapping.getCmisTypeId(CMISScope.RELATIONSHIP, classQName);
|
||||
AssociationDefinition assocDef = dictionaryService.getAssociation(classQName);
|
||||
CMISObjectTypeDefinition objectTypeDef = new CMISRelationshipTypeDefinition(cmisMapping, typeId, null, assocDef);
|
||||
CMISAbstractTypeDefinition objectTypeDef = new CMISRelationshipTypeDefinition(cmisMapping, typeId, null, assocDef);
|
||||
|
||||
registry.registerTypeDefinition(objectTypeDef);
|
||||
}
|
||||
|
@@ -36,6 +36,11 @@ import org.alfresco.cmis.CMISContentStreamAllowedEnum;
|
||||
*/
|
||||
public interface CMISTypeDefinition
|
||||
{
|
||||
/**
|
||||
* @return true => type definition is for public consumption
|
||||
*/
|
||||
public boolean isPublic();
|
||||
|
||||
/**
|
||||
* Get the unique identifier for the type
|
||||
*
|
||||
@@ -60,17 +65,24 @@ public interface CMISTypeDefinition
|
||||
public String getDisplayName();
|
||||
|
||||
/**
|
||||
* Get the type id for the parent
|
||||
* Get the type for the parent
|
||||
*
|
||||
* @return - the parent type id
|
||||
*/
|
||||
public CMISTypeDefinition getParentType();
|
||||
|
||||
/**
|
||||
* Get the sub-types
|
||||
*
|
||||
* @param descendants
|
||||
* @return
|
||||
*/
|
||||
public Collection<CMISTypeDefinition> getSubTypes(boolean descendants);
|
||||
|
||||
/**
|
||||
* Get the root type id
|
||||
* @return - the root type id
|
||||
* Get the root type
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CMISTypeDefinition getRootType();
|
||||
|
||||
@@ -146,10 +158,17 @@ public interface CMISTypeDefinition
|
||||
public Collection<CMISTypeDefinition> getAllowedTargetTypes();
|
||||
|
||||
/**
|
||||
* Gets the property definitions for this type
|
||||
* Gets the property definitions for this type (owned and inherited)
|
||||
*
|
||||
* @return property definitions
|
||||
*/
|
||||
public Map<CMISPropertyId, CMISPropertyDefinition> getPropertyDefinitions();
|
||||
|
||||
/**
|
||||
* Gets the property definitions owned by this type
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<CMISPropertyId, CMISPropertyDefinition> getOwnedPropertyDefinitions();
|
||||
|
||||
}
|
||||
|
@@ -100,6 +100,8 @@ public class CMISTypeId implements Serializable
|
||||
return CMISDictionaryModel.RELATIONSHIP_TYPE_ID;
|
||||
case POLICY:
|
||||
return CMISDictionaryModel.POLICY_TYPE_ID;
|
||||
case OBJECT:
|
||||
return CMISMapping.OBJECT_TYPE_ID;
|
||||
case UNKNOWN:
|
||||
default:
|
||||
return null;
|
||||
|
@@ -25,15 +25,12 @@
|
||||
package org.alfresco.cmis.search;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.cmis.CMISDataTypeEnum;
|
||||
import org.alfresco.cmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.cmis.dictionary.CMISPropertyDefinition;
|
||||
import org.alfresco.cmis.dictionary.CMISPropertyId;
|
||||
import org.alfresco.cmis.dictionary.CMISTypeDefinition;
|
||||
import org.alfresco.cmis.dictionary.CMISTypeId;
|
||||
import org.alfresco.repo.search.impl.querymodel.Column;
|
||||
import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
|
||||
import org.alfresco.repo.search.impl.querymodel.Query;
|
||||
@@ -48,33 +45,24 @@ public class CMISResultSetMetaDataImpl implements CMISResultSetMetaData
|
||||
{
|
||||
private CMISQueryOptions options;
|
||||
|
||||
private Query query;
|
||||
|
||||
private Map<String, CMISResultSetColumn> columnMetaData;
|
||||
|
||||
private Map<String, CMISResultSetSelector> selectorMetaData;
|
||||
|
||||
private CMISDictionaryService cmisDictionaryService;
|
||||
|
||||
public CMISResultSetMetaDataImpl(CMISQueryOptions options, Query query, CMISDictionaryService cmisDictionaryService)
|
||||
{
|
||||
this.options = options;
|
||||
this.query = query;
|
||||
|
||||
Map<String, Selector> selectors = query.getSource().getSelectors();
|
||||
selectorMetaData = new LinkedHashMap<String, CMISResultSetSelector>();
|
||||
for(Selector selector : selectors.values())
|
||||
{
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null);
|
||||
CMISTypeDefinition type = cmisDictionaryService.getType(typeId);
|
||||
CMISTypeDefinition type = cmisDictionaryService.findTypeForClass(selector.getType());
|
||||
CMISResultSetSelector smd = new CMISResultSetSelectorImpl(selector.getAlias(), type);
|
||||
selectorMetaData.put(smd.getName(), smd);
|
||||
}
|
||||
|
||||
List<Column> columns = query.getColumns();
|
||||
columnMetaData = new LinkedHashMap<String, CMISResultSetColumn>();
|
||||
|
||||
int i = 0;
|
||||
for (Column column : query.getColumns())
|
||||
{
|
||||
CMISPropertyDefinition propertyDefinition = null;
|
||||
@@ -83,13 +71,12 @@ public class CMISResultSetMetaDataImpl implements CMISResultSetMetaData
|
||||
{
|
||||
PropertyArgument arg = (PropertyArgument) column.getFunctionArguments().get(PropertyAccessor.ARG_PROPERTY);
|
||||
QName propertyQName = arg.getPropertyName();
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
propertyDefinition = cmisDictionaryService.getProperty(propertyId);
|
||||
propertyDefinition = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
type = propertyDefinition.getDataType();
|
||||
}
|
||||
if (type == null)
|
||||
{
|
||||
type = cmisDictionaryService.getDataType(column.getFunction().getReturnType());
|
||||
type = cmisDictionaryService.findDataType(column.getFunction().getReturnType());
|
||||
}
|
||||
CMISResultSetColumn cmd = new CMISResultSetColumnImpl(column.getAlias(), propertyDefinition, type);
|
||||
columnMetaData.put(cmd.getName(), cmd);
|
||||
|
@@ -29,7 +29,7 @@ import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.cmis.dictionary.CMISDictionaryService;
|
||||
import org.alfresco.cmis.dictionary.CMISPropertyId;
|
||||
import org.alfresco.cmis.dictionary.CMISPropertyDefinition;
|
||||
import org.alfresco.cmis.property.CMISPropertyService;
|
||||
import org.alfresco.cmis.property.CMISPropertyServiceImpl;
|
||||
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
|
||||
@@ -131,8 +131,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
*/
|
||||
public Serializable getProperty(NodeRef nodeRef, QName propertyQName)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
return cmisPropertyService.getProperty(nodeRef, propertyId.getName());
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
return cmisPropertyService.getProperty(nodeRef, propertyDef.getPropertyId().getName());
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -166,9 +166,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneEquality(lqp, propertyId.getName(), value, mode);
|
||||
return impl.buildLuceneEquality(lqp, propertyDef.getPropertyId().getName(), value, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -186,9 +186,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneExists(lqp, propertyId.getName(), not);
|
||||
return impl.buildLuceneExists(lqp, propertyDef.getPropertyId().getName(), not);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -207,9 +207,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneGreaterThan(lqp, propertyId.getName(), value, mode);
|
||||
return impl.buildLuceneGreaterThan(lqp, propertyDef.getPropertyId().getName(), value, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -228,9 +228,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneGreaterThanOrEquals(lqp, propertyId.getName(), value, mode);
|
||||
return impl.buildLuceneGreaterThanOrEquals(lqp, propertyDef.getPropertyId().getName(), value, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -249,9 +249,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneIn(lqp, propertyId.getName(), values, not, mode);
|
||||
return impl.buildLuceneIn(lqp, propertyDef.getPropertyId().getName(), values, not, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -270,9 +270,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneInequality(lqp, propertyId.getName(), value, mode);
|
||||
return impl.buildLuceneInequality(lqp, propertyDef.getPropertyId().getName(), value, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -291,9 +291,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneLessThan(lqp, propertyId.getName(), value, mode);
|
||||
return impl.buildLuceneLessThan(lqp, propertyDef.getPropertyId().getName(), value, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -312,9 +312,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneLessThanOrEquals(lqp, propertyId.getName(), value, mode);
|
||||
return impl.buildLuceneLessThanOrEquals(lqp, propertyDef.getPropertyId().getName(), value, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -332,9 +332,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.buildLuceneLike(lqp, propertyId.getName(), value, not);
|
||||
return impl.buildLuceneLike(lqp, propertyDef.getPropertyId().getName(), value, not);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -349,9 +349,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
|
||||
{
|
||||
if (cmisPropertyService instanceof CMISPropertyServiceImpl)
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName);
|
||||
CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
|
||||
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
|
||||
return impl.getLuceneSortField(propertyId.getName());
|
||||
return impl.getLuceneSortField(propertyDef.getPropertyId().getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -1539,7 +1539,7 @@ public class QueryTest extends BaseCMISTest
|
||||
CMISResultSet rs = cmisQueryService.query(options);
|
||||
CMISResultSetMetaData md = rs.getMetaData();
|
||||
assertNotNull(md.getQueryOptions());
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.getType(CMISDictionaryModel.DOCUMENT_TYPE_ID);
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findType(CMISDictionaryModel.DOCUMENT_TYPE_ID);
|
||||
assertEquals(typeDef.getPropertyDefinitions().size(), md.getColumnNames().length);
|
||||
assertNotNull(md.getColumn(CMISDictionaryModel.PROP_OBJECT_ID));
|
||||
assertEquals(1, md.getSelectors().length);
|
||||
|
@@ -39,9 +39,9 @@ import org.alfresco.cmis.dictionary.CMISPropertyDefinition;
|
||||
import org.alfresco.cmis.dictionary.CMISPropertyId;
|
||||
import org.alfresco.cmis.dictionary.CMISScope;
|
||||
import org.alfresco.cmis.dictionary.CMISTypeDefinition;
|
||||
import org.alfresco.cmis.dictionary.CMISTypeId;
|
||||
import org.alfresco.cmis.search.CMISQueryException;
|
||||
import org.alfresco.cmis.search.CMISQueryOptions;
|
||||
import org.alfresco.cmis.search.CMISQueryOptions.CMISQueryMode;
|
||||
import org.alfresco.repo.search.impl.parsers.CMISLexer;
|
||||
import org.alfresco.repo.search.impl.parsers.CMISParser;
|
||||
import org.alfresco.repo.search.impl.parsers.FTSLexer;
|
||||
@@ -101,12 +101,19 @@ public class CMISQueryParser
|
||||
private CMISDictionaryService cmisDictionaryService;
|
||||
|
||||
private CMISJoinEnum joinSupport;
|
||||
|
||||
private CMISScope[] validScopes;
|
||||
|
||||
private static CMISScope[] STRICT_SCOPES = new CMISScope[] {CMISScope.DOCUMENT, CMISScope.FOLDER};
|
||||
private static CMISScope[] ALFRESCO_SCOPES = new CMISScope[] {CMISScope.DOCUMENT, CMISScope.FOLDER, CMISScope.POLICY};
|
||||
|
||||
|
||||
public CMISQueryParser(CMISQueryOptions options, CMISDictionaryService cmisDictionaryService, CMISJoinEnum joinSupport)
|
||||
{
|
||||
this.options = options;
|
||||
this.cmisDictionaryService = cmisDictionaryService;
|
||||
this.joinSupport = joinSupport;
|
||||
this.validScopes = (options.getQueryMode() == CMISQueryMode.CMS_STRICT) ? STRICT_SCOPES : ALFRESCO_SCOPES;
|
||||
}
|
||||
|
||||
public Query parse(QueryModelFactory factory)
|
||||
@@ -597,19 +604,12 @@ public class CMISQueryParser
|
||||
throw new CMISQueryException("No selector for " + qualifier);
|
||||
}
|
||||
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null);
|
||||
if (typeId == null || (typeId.getScope() != CMISScope.DOCUMENT && typeId.getScope() != CMISScope.FOLDER))
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), CMISScope.DOCUMENT, CMISScope.FOLDER);
|
||||
if (typeDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
|
||||
}
|
||||
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
|
||||
CMISPropertyDefinition propDef = null;
|
||||
CMISPropertyId propId = cmisDictionaryService.getPropertyId(columnName);
|
||||
if (propId != null)
|
||||
{
|
||||
propDef = typeDef.getPropertyDefinitions().get(propId);
|
||||
}
|
||||
CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(columnName, typeDef);
|
||||
if (propDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName);
|
||||
@@ -636,19 +636,12 @@ public class CMISQueryParser
|
||||
throw new CMISQueryException("No selector for " + qualifier);
|
||||
}
|
||||
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null);
|
||||
if (typeId == null || (typeId.getScope() != CMISScope.DOCUMENT && typeId.getScope() != CMISScope.FOLDER))
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), CMISScope.DOCUMENT, CMISScope.FOLDER);
|
||||
if (typeDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
|
||||
}
|
||||
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
|
||||
CMISPropertyDefinition propDef = null;
|
||||
CMISPropertyId propId = cmisDictionaryService.getPropertyId(columnName);
|
||||
if (propId != null)
|
||||
{
|
||||
propDef = typeDef.getPropertyDefinitions().get(propId);
|
||||
}
|
||||
CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(columnName, typeDef);
|
||||
if (propDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName + " selector alias " + selector.getAlias());
|
||||
@@ -688,12 +681,11 @@ public class CMISQueryParser
|
||||
{
|
||||
for (Selector selector : selectors.values())
|
||||
{
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null);
|
||||
if (typeId == null || (typeId.getScope() == CMISScope.RELATIONSHIP))
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), validScopes);
|
||||
if (typeDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
|
||||
}
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
|
||||
Map<CMISPropertyId, CMISPropertyDefinition> propDefs = typeDef.getPropertyDefinitions();
|
||||
for (CMISPropertyDefinition definition : propDefs.values())
|
||||
{
|
||||
@@ -726,12 +718,11 @@ public class CMISQueryParser
|
||||
throw new CMISQueryException("No selector for " + qualifier + " in " + qualifier + ".*");
|
||||
}
|
||||
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null);
|
||||
if (typeId == null || (typeId.getScope() == CMISScope.RELATIONSHIP))
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), validScopes);
|
||||
if (typeDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
|
||||
}
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
|
||||
Map<CMISPropertyId, CMISPropertyDefinition> propDefs = typeDef.getPropertyDefinitions();
|
||||
for (CMISPropertyDefinition definition : propDefs.values())
|
||||
{
|
||||
@@ -766,18 +757,12 @@ public class CMISQueryParser
|
||||
throw new CMISQueryException("No selector for " + qualifier);
|
||||
}
|
||||
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null);
|
||||
if (typeId == null || (typeId.getScope() == CMISScope.RELATIONSHIP))
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), validScopes);
|
||||
if (typeDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
|
||||
}
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
|
||||
CMISPropertyDefinition propDef = null;
|
||||
CMISPropertyId propId = cmisDictionaryService.getPropertyId(columnName);
|
||||
if (propId != null)
|
||||
{
|
||||
propDef = typeDef.getPropertyDefinitions().get(propId);
|
||||
}
|
||||
CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(columnName, typeDef);
|
||||
if (propDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName);
|
||||
@@ -908,13 +893,12 @@ public class CMISQueryParser
|
||||
}
|
||||
else
|
||||
{
|
||||
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(id);
|
||||
CMISPropertyDefinition propDef = cmisDictionaryService.getProperty(propertyId);
|
||||
PropertyArgument arg = factory.createPropertyArgument(definition.getName(), propDef.isQueryable(), propDef.isOrderable(), "", propDef.getPropertyId().getQName());
|
||||
if(!arg.isQueryable())
|
||||
CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(id, null);
|
||||
if (propDef == null || !propDef.isQueryable())
|
||||
{
|
||||
throw new CMISQueryException("Column refers to unqueryable property " + arg.getPropertyName());
|
||||
throw new CMISQueryException("Column refers to unqueryable property " + definition.getName());
|
||||
}
|
||||
PropertyArgument arg = factory.createPropertyArgument(definition.getName(), propDef.isQueryable(), propDef.isOrderable(), "", propDef.getPropertyId().getQName());
|
||||
return arg;
|
||||
}
|
||||
}
|
||||
@@ -1062,20 +1046,19 @@ public class CMISQueryParser
|
||||
alias = singleTableNode.getChild(1).getText();
|
||||
}
|
||||
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeIdFromTable(tableName);
|
||||
if (typeId == null)
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForTable(tableName);
|
||||
if (typeDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Type is unsupported in query " + tableName);
|
||||
}
|
||||
if (typeId.getScope() != CMISScope.POLICY)
|
||||
if (typeDef.getTypeId().getScope() != CMISScope.POLICY)
|
||||
{
|
||||
CMISTypeDefinition cmisType = cmisDictionaryService.getType(typeId);
|
||||
if (!cmisType.isQueryable())
|
||||
if (!typeDef.isQueryable())
|
||||
{
|
||||
throw new CMISQueryException("Type is not queryable " + tableName + " -> " + cmisType);
|
||||
throw new CMISQueryException("Type is not queryable " + tableName + " -> " + typeDef.getTypeId());
|
||||
}
|
||||
}
|
||||
return factory.createSelector(typeId.getQName(), alias);
|
||||
return factory.createSelector(typeDef.getTypeId().getQName(), alias);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1094,20 +1077,19 @@ public class CMISQueryParser
|
||||
{
|
||||
alias = singleTableNode.getChild(1).getText();
|
||||
}
|
||||
CMISTypeId typeId = cmisDictionaryService.getTypeIdFromTable(tableName);
|
||||
if (typeId == null)
|
||||
CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForTable(tableName);
|
||||
if (typeDef == null)
|
||||
{
|
||||
throw new CMISQueryException("Type is unsupported in query " + tableName);
|
||||
}
|
||||
if (typeId.getScope() != CMISScope.POLICY)
|
||||
if (typeDef.getTypeId().getScope() != CMISScope.POLICY)
|
||||
{
|
||||
CMISTypeDefinition cmisType = cmisDictionaryService.getType(typeId);
|
||||
if (!cmisType.isQueryable())
|
||||
if (!typeDef.isQueryable())
|
||||
{
|
||||
throw new CMISQueryException("Type is not queryable " + tableName + " -> " + cmisType);
|
||||
throw new CMISQueryException("Type is not queryable " + tableName + " -> " + typeDef.getTypeId());
|
||||
}
|
||||
}
|
||||
Source lhs = factory.createSelector(typeId.getQName(), alias);
|
||||
Source lhs = factory.createSelector(typeDef.getTypeId().getQName(), alias);
|
||||
|
||||
List<CommonTree> list = (List<CommonTree>) (source.getChildren());
|
||||
for (CommonTree joinNode : list)
|
||||
@@ -1169,8 +1151,7 @@ public class CMISQueryParser
|
||||
{
|
||||
qualifer = columnReferenceNode.getChild(1).getText();
|
||||
}
|
||||
CMISPropertyId propId = cmisDictionaryService.getPropertyId(cmisPropertyName);
|
||||
CMISPropertyDefinition propDef = cmisDictionaryService.getProperty(propId);
|
||||
CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(cmisPropertyName, null);
|
||||
return factory.createPropertyArgument(argumentName, propDef.isQueryable(), propDef.isOrderable(), qualifer, propDef.getPropertyId().getQName());
|
||||
}
|
||||
|
||||
|
@@ -27,8 +27,6 @@ package org.alfresco.repo.dictionary;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
|
||||
|
||||
|
||||
/**
|
||||
* Property Definition
|
||||
@@ -38,6 +36,7 @@ import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
|
||||
*/
|
||||
public class M2Property
|
||||
{
|
||||
private boolean isOverride = false;
|
||||
private String name = null;
|
||||
private String title = null;
|
||||
private String description = null;
|
||||
@@ -63,6 +62,15 @@ public class M2Property
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean isOverride()
|
||||
{
|
||||
return isOverride;
|
||||
}
|
||||
|
||||
public void setOverride(boolean isOverride)
|
||||
{
|
||||
this.isOverride = isOverride;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
|
@@ -163,6 +163,7 @@ import org.alfresco.service.namespace.QName;
|
||||
Map<QName, ConstraintDefinition> modelConstraints)
|
||||
{
|
||||
M2Property property = new M2Property();
|
||||
property.setOverride(true);
|
||||
|
||||
// Process Default Value
|
||||
String defaultValue = override.getDefaultValue();
|
||||
@@ -315,8 +316,16 @@ import org.alfresco.service.namespace.QName;
|
||||
{
|
||||
return classDef;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.dictionary.PropertyDefinition#isOverride()
|
||||
*/
|
||||
public boolean isOverride()
|
||||
{
|
||||
return m2Property.isOverride();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.dictionary.PropertyDefinition#isMultiValued()
|
||||
*/
|
||||
|
@@ -31,17 +31,21 @@ import org.alfresco.service.namespace.QName;
|
||||
/**
|
||||
* Workflow Model for a Moderated Invitation
|
||||
*/
|
||||
public interface WorkflowModelModeratedInvitation {
|
||||
public interface WorkflowModelModeratedInvitation
|
||||
{
|
||||
|
||||
// namespace
|
||||
public static final String NAMESPACE_URI = "http://www.alfresco.org/model/workflow/invite/moderated/1.0";
|
||||
|
||||
// process name
|
||||
public static final QName WF_PROCESS_INVITATION_MODERATED = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "invitation-moderated");
|
||||
public static final QName WF_PROCESS_INVITATION_MODERATED = QName.createQName(NAMESPACE_URI, "invitation-moderated");
|
||||
|
||||
// workflow definition name
|
||||
public static final String WORKFLOW_DEFINITION_NAME = "jbpm$wf:invitation-moderated";
|
||||
public static final String WORKFLOW_DEFINITION_NAME = "jbpm$imwf:invitation-moderated";
|
||||
|
||||
// tasks
|
||||
public static final QName WF_START_TASK = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "moderatedInvitationSubmitTask");
|
||||
public static final QName WF_REVIEW_TASK = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI,"moderatedInvitationReviewTask");
|
||||
public static final QName WF_START_TASK = QName.createQName(NAMESPACE_URI, "moderatedInvitationSubmitTask");
|
||||
public static final QName WF_REVIEW_TASK = QName.createQName(NAMESPACE_URI,"moderatedInvitationReviewTask");
|
||||
|
||||
// associations
|
||||
static final QName ASSOC_GROUP_ASSIGNEE = QName.createQName(NamespaceService.BPM_MODEL_1_0_URI, "groupAssignee");
|
||||
@@ -54,20 +58,20 @@ public interface WorkflowModelModeratedInvitation {
|
||||
public static final String WF_TRANSITION_END = "end";
|
||||
|
||||
// workflow properties
|
||||
public static final QName WF_PROP_INVITEE_USER_NAME = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeUserName");
|
||||
public static final QName WF_PROP_INVITEE_ROLE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeRole");
|
||||
public static final QName WF_PROP_INVITEE_COMMENTS = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeComments");
|
||||
public static final QName WF_PROP_RESOURCE_NAME = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "resourceName");
|
||||
public static final QName WF_PROP_RESOURCE_TYPE= QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "resourceType");
|
||||
public static final QName WF_PROP_REVIEW_COMMENTS= QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "reviewComments");
|
||||
public static final QName WF_PROP_REVIEWER= QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "reviewer");
|
||||
public static final QName WF_PROP_INVITEE_USER_NAME = QName.createQName(NAMESPACE_URI, "inviteeUserName");
|
||||
public static final QName WF_PROP_INVITEE_ROLE = QName.createQName(NAMESPACE_URI, "inviteeRole");
|
||||
public static final QName WF_PROP_INVITEE_COMMENTS = QName.createQName(NAMESPACE_URI, "inviteeComments");
|
||||
public static final QName WF_PROP_RESOURCE_NAME = QName.createQName(NAMESPACE_URI, "resourceName");
|
||||
public static final QName WF_PROP_RESOURCE_TYPE= QName.createQName(NAMESPACE_URI, "resourceType");
|
||||
public static final QName WF_PROP_REVIEW_COMMENTS= QName.createQName(NAMESPACE_URI, "reviewComments");
|
||||
public static final QName WF_PROP_REVIEWER= QName.createQName(NAMESPACE_URI, "reviewer");
|
||||
|
||||
// workflow execution context variable names
|
||||
public static final String wfVarInviteeUserName = "wf_inviteeUserName";
|
||||
public static final String wfVarInviteeRole = "wf_inviteeRole";
|
||||
public static final String wfVarInviteeUserName = "imwf_inviteeUserName";
|
||||
public static final String wfVarInviteeRole = "imwf_inviteeRole";
|
||||
public static final String wfVarWorkflowInstanceId = "workflowinstanceid";
|
||||
public static final String wfVarResourceName = "wf_resourceName";
|
||||
public static final String wfVarResourceType = "wf_resourceType";
|
||||
public static final String wfVarReviewer = "wf_reviewer";
|
||||
public static final String wfVarReviewComments = "wf_reviewComments";
|
||||
}
|
||||
public static final String wfVarResourceName = "imwf_resourceName";
|
||||
public static final String wfVarResourceType = "imwf_resourceType";
|
||||
public static final String wfVarReviewer = "imwf_reviewer";
|
||||
public static final String wfVarReviewComments = "imwf_reviewComments";
|
||||
}
|
||||
|
@@ -25,25 +25,27 @@
|
||||
|
||||
package org.alfresco.repo.invitation;
|
||||
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Workflow Model for a Nominated Invitation
|
||||
*/
|
||||
public interface WorkflowModelNominatedInvitation {
|
||||
public interface WorkflowModelNominatedInvitation
|
||||
{
|
||||
// namespace
|
||||
public static final String NAMESPACE_URI = "http://www.alfresco.org/model/workflow/invite/nominated/1.0";
|
||||
|
||||
// process name
|
||||
public static final QName WF_PROCESS_INVITE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "invitation-nominated");
|
||||
public static final QName WF_PROCESS_INVITE = QName.createQName(NAMESPACE_URI, "invitation-nominated");
|
||||
|
||||
// workflow definition name
|
||||
public static final String WORKFLOW_DEFINITION_NAME = "jbpm$wf:invitation-nominated";
|
||||
public static final String WORKFLOW_DEFINITION_NAME = "jbpm$inwf:invitation-nominated";
|
||||
|
||||
// tasks
|
||||
public static final QName WF_INVITE_TASK_INVITE_TO_SITE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteToSiteTask");
|
||||
public static final QName WF_INVITE_TASK_INVITE_PENDING = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "invitePendingTask");
|
||||
public static final QName WF_TASK_ACCEPT_INVITE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "acceptInviteTask");
|
||||
public static final QName WF_TASK_REJECT_INVITE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "rejectInviteTask");
|
||||
public static final QName WF_INVITE_TASK_INVITE_TO_SITE = QName.createQName(NAMESPACE_URI, "inviteToSiteTask");
|
||||
public static final QName WF_INVITE_TASK_INVITE_PENDING = QName.createQName(NAMESPACE_URI, "invitePendingTask");
|
||||
public static final QName WF_TASK_ACCEPT_INVITE = QName.createQName(NAMESPACE_URI, "acceptInviteTask");
|
||||
public static final QName WF_TASK_REJECT_INVITE = QName.createQName(NAMESPACE_URI, "rejectInviteTask");
|
||||
|
||||
// transition names
|
||||
public static final String WF_TRANSITION_SEND_INVITE = "sendInvite";
|
||||
@@ -54,26 +56,26 @@ public interface WorkflowModelNominatedInvitation {
|
||||
public static final String WF_TRANSITION_REJECT_INVITE_END = "end";
|
||||
|
||||
// workflow properties
|
||||
public static final QName WF_PROP_SERVER_PATH = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "serverPath");
|
||||
public static final QName WF_PROP_ACCEPT_URL = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "acceptUrl");
|
||||
public static final QName WF_PROP_REJECT_URL = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "rejectUrl");
|
||||
public static final QName WF_PROP_INVITE_TICKET = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteTicket");
|
||||
public static final QName WF_PROP_INVITER_USER_NAME = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviterUserName");
|
||||
public static final QName WF_PROP_INVITEE_USER_NAME = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeUserName");
|
||||
public static final QName WF_PROP_INVITEE_EMAIL = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeEmail");
|
||||
public static final QName WF_PROP_INVITEE_FIRSTNAME = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeFirstName");
|
||||
public static final QName WF_PROP_INVITEE_LASTNAME = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeLastName");
|
||||
public static final QName WF_PROP_RESOURCE_TYPE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "resourceType");
|
||||
public static final QName WF_PROP_RESOURCE_NAME = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "resourceName");
|
||||
public static final QName WF_PROP_INVITEE_ROLE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeRole");
|
||||
public static final QName WF_PROP_INVITEE_GEN_PASSWORD = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "inviteeGenPassword");
|
||||
public static final QName WF_PROP_SERVER_PATH = QName.createQName(NAMESPACE_URI, "serverPath");
|
||||
public static final QName WF_PROP_ACCEPT_URL = QName.createQName(NAMESPACE_URI, "acceptUrl");
|
||||
public static final QName WF_PROP_REJECT_URL = QName.createQName(NAMESPACE_URI, "rejectUrl");
|
||||
public static final QName WF_PROP_INVITE_TICKET = QName.createQName(NAMESPACE_URI, "inviteTicket");
|
||||
public static final QName WF_PROP_INVITER_USER_NAME = QName.createQName(NAMESPACE_URI, "inviterUserName");
|
||||
public static final QName WF_PROP_INVITEE_USER_NAME = QName.createQName(NAMESPACE_URI, "inviteeUserName");
|
||||
public static final QName WF_PROP_INVITEE_EMAIL = QName.createQName(NAMESPACE_URI, "inviteeEmail");
|
||||
public static final QName WF_PROP_INVITEE_FIRSTNAME = QName.createQName(NAMESPACE_URI, "inviteeFirstName");
|
||||
public static final QName WF_PROP_INVITEE_LASTNAME = QName.createQName(NAMESPACE_URI, "inviteeLastName");
|
||||
public static final QName WF_PROP_RESOURCE_TYPE = QName.createQName(NAMESPACE_URI, "resourceType");
|
||||
public static final QName WF_PROP_RESOURCE_NAME = QName.createQName(NAMESPACE_URI, "resourceName");
|
||||
public static final QName WF_PROP_INVITEE_ROLE = QName.createQName(NAMESPACE_URI, "inviteeRole");
|
||||
public static final QName WF_PROP_INVITEE_GEN_PASSWORD = QName.createQName(NAMESPACE_URI, "inviteeGenPassword");
|
||||
|
||||
// workflow execution context variable names
|
||||
public static final String wfVarInviteeUserName = "wf_inviteeUserName";
|
||||
public static final String wfVarInviterUserName = "wf_inviterUserName";
|
||||
public static final String wfVarResourceName = "wf_resourceName";
|
||||
public static final String wfVarResourceType = "wf_resourceType";
|
||||
public static final String wfVarInviteeUserName = "inwf_inviteeUserName";
|
||||
public static final String wfVarInviterUserName = "inwf_inviterUserName";
|
||||
public static final String wfVarResourceName = "inwf_resourceName";
|
||||
public static final String wfVarResourceType = "inwf_resourceType";
|
||||
public static final String wfVarWorkflowInstanceId = "workflowinstanceid";
|
||||
public static final String wfVarRole = "wf_inviteeRole";
|
||||
public static final String wfVarRole = "inwf_inviteeRole";
|
||||
|
||||
}
|
||||
|
@@ -71,6 +71,8 @@ public interface PropertyDefinition
|
||||
*/
|
||||
public ClassDefinition getContainerClass();
|
||||
|
||||
public boolean isOverride();
|
||||
|
||||
/**
|
||||
* @return true => multi-valued, false => single-valued
|
||||
*/
|
||||
|
Reference in New Issue
Block a user