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:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user