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:
David Caruana
2009-03-31 17:48:28 +00:00
parent 8581c334f9
commit 4e9c3a3d3a
29 changed files with 1130 additions and 935 deletions

View File

@@ -259,3 +259,5 @@ patch.webSiteAddModerated.result=Changed Web Site visibility.
patch.mtShareExistingTenants.description=Update existing tenants for MT Share. patch.mtShareExistingTenants.description=Update existing tenants for MT Share.
patch.mtShareExistingTenants.result=Update existing tenants for MT Share. patch.mtShareExistingTenants.result=Update existing tenants for MT Share.
patch.mtShareExistingTenants.result.not_applicable=Patch applied, although no changes made since MT is not enabled. patch.mtShareExistingTenants.result.not_applicable=Patch applied, although no changes made since MT is not enabled.
patch.redeployInvitationProcess.description=Re-deploy Invitation Process Definitions.

View File

@@ -15,22 +15,26 @@
<data-types> <data-types>
<data-type name="cmis:id"> <data-type name="cmis:id">
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class> <analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
</analyser-class>
<java-class>java.lang.String</java-class> <java-class>java.lang.String</java-class>
</data-type> </data-type>
<data-type name="cmis:uri"> <data-type name="cmis:uri">
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class> <analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
</analyser-class>
<java-class>java.lang.String</java-class> <java-class>java.lang.String</java-class>
</data-type> </data-type>
<data-type name="cmis:xml"> <data-type name="cmis:xml">
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class> <analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
</analyser-class>
<java-class>java.lang.String</java-class> <java-class>java.lang.String</java-class>
</data-type> </data-type>
<data-type name="cmis:html"> <data-type name="cmis:html">
<analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser</analyser-class> <analyser-class>org.alfresco.repo.search.impl.lucene.analysis.AlfrescoStandardAnalyser
</analyser-class>
<java-class>java.lang.String</java-class> <java-class>java.lang.String</java-class>
</data-type> </data-type>
@@ -52,9 +56,117 @@
<types> <types>
<type name="cmis:Object">
<properties>
<property name="cmis:ObjectId">
<title>Object Id</title>
<description>The unique object id (a node ref)</description>
<type>cmis:id</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:Uri">
<title>URI</title>
<description>URI</description>
<type>cmis:uri</type>
<protected>true</protected>
<mandatory enforced="false">false</mandatory>
<multiple>false</multiple>
<index enabled="false" />
</property>
<property name="cmis:ObjectTypeId">
<title>Object Type Id</title>
<description>The object type id</description>
<type>cmis:id</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:CreatedBy">
<title>Created by</title>
<description>The authority who created this object</description>
<type>d:text</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:CreationDate">
<title>Creation Date</title>
<description>The object creation date</description>
<type>d:datetime</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:LastModifiedBy">
<title>Last Modified By</title>
<description>The authority who last modified this object</description>
<type>d:text</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:LastModificationDate">
<title>Last Modified Date</title>
<description>The date this object was last modified</description>
<type>d:datetime</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:ChangeToken">
<title>Change token</title>
<description>Change Token</description>
<type>d:text</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="false" />
</property>
</properties>
</type>
<!-- TODO: mark as abstract -->
<type name="cmis:FileSystemObject">
<parent>cmis:Object</parent>
<properties>
<property name="cmis:Name">
<title>Name</title>
<description>Name</description>
<type>d:text</type>
<protected>false</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>both</tokenised>
</index>
</property>
</properties>
</type>
<type name="cmis:Document"> <type name="cmis:Document">
<title>Document</title> <title>Document</title>
<description>Document Type</description> <description>Document Type</description>
<parent>cmis:FileSystemObject</parent>
<properties> <properties>
<property name="cmis:IsImmutable"> <property name="cmis:IsImmutable">
<title>Is Immutable</title> <title>Is Immutable</title>
@@ -205,15 +317,12 @@
<index enabled="false" /> <index enabled="false" />
</property> </property>
</properties> </properties>
<mandatory-aspects>
<aspect>cmis:Core</aspect>
<aspect>cmis:Named</aspect>
</mandatory-aspects>
</type> </type>
<type name="cmis:Folder"> <type name="cmis:Folder">
<title>Folder</title> <title>Folder</title>
<description>Folder Type</description> <description>Folder Type</description>
<parent>cmis:FileSystemObject</parent>
<properties> <properties>
<property name="cmis:ParentId"> <property name="cmis:ParentId">
<title>Parent Id</title> <title>Parent Id</title>
@@ -236,15 +345,12 @@
<index enabled="false" /> <index enabled="false" />
</property> </property>
</properties> </properties>
<mandatory-aspects>
<aspect>cmis:Core</aspect>
<aspect>cmis:Named</aspect>
</mandatory-aspects>
</type> </type>
<type name="cmis:Relationship"> <type name="cmis:Relationship">
<title>Relationship</title> <title>Relationship</title>
<description>Relationship Type</description> <description>Relationship Type</description>
<parent>cmis:Object</parent>
<properties> <properties>
<property name="cmis:SourceId"> <property name="cmis:SourceId">
<title>Source Id</title> <title>Source Id</title>
@@ -265,14 +371,12 @@
<index enabled="false" /> <index enabled="false" />
</property> </property>
</properties> </properties>
<mandatory-aspects>
<aspect>cmis:Core</aspect>
</mandatory-aspects>
</type> </type>
<type name="cmis:Policy"> <type name="cmis:Policy">
<title>Policy</title> <title>Policy</title>
<description>Policy Type</description> <description>Policy Type</description>
<parent>cmis:Object</parent>
<properties> <properties>
<property name="cmis:PolicyName"> <property name="cmis:PolicyName">
<title>Policy Name</title> <title>Policy Name</title>
@@ -293,126 +397,8 @@
<index enabled="false" /> <index enabled="false" />
</property> </property>
</properties> </properties>
<mandatory-aspects>
<aspect>cmis:Core</aspect>
</mandatory-aspects>
</type> </type>
<type name="cmis:AspectPolicy">
<title>Aspect Policy</title>
<description>Aspect Policy Type</description>
<parent>cmis:Policy</parent>
</type>
</types> </types>
<aspects>
<aspect name="cmis:Core">
<properties>
<property name="cmis:ObjectId">
<title>Object Id</title>
<description>The unique object id (a node ref)</description>
<type>cmis:id</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:Uri">
<title>URI</title>
<description>URI</description>
<type>cmis:uri</type>
<protected>true</protected>
<mandatory enforced="false">false</mandatory>
<multiple>false</multiple>
<index enabled="false" />
</property>
<property name="cmis:ObjectTypeId">
<title>Object Type Id</title>
<description>The object type id</description>
<type>cmis:id</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:CreatedBy">
<title>Created by</title>
<description>The authority who created this object</description>
<type>d:text</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:CreationDate">
<title>Creation Date</title>
<description>The object creation date</description>
<type>d:datetime</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:LastModifiedBy">
<title>Last Modified By</title>
<description>The authority who last modified this object</description>
<type>d:text</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:LastModificationDate">
<title>Last Modified Date</title>
<description>The date this object was last modified</description>
<type>d:datetime</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>false</tokenised>
</index>
</property>
<property name="cmis:ChangeToken">
<title>Change token</title>
<description>Change Token</description>
<type>d:text</type>
<protected>true</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="false" />
</property>
</properties>
</aspect>
<aspect name="cmis:Named">
<properties>
<property name="cmis:Name">
<title>Name</title>
<description>Name</description>
<type>d:text</type>
<protected>false</protected>
<mandatory enforced="true">true</mandatory>
<multiple>false</multiple>
<index enabled="true">
<tokenised>both</tokenised>
</index>
</property>
</properties>
</aspect>
</aspects>
</model> </model>

View File

@@ -1804,4 +1804,26 @@
</property> </property>
</bean> </bean>
<bean id="patch.redeployInvitationProcess" class="org.alfresco.repo.admin.patch.impl.GenericWorkflowPatch" parent="basePatch" >
<property name="id"><value>patch.redeployInvitationProcess</value></property>
<property name="description"><value>patch.redeployInvitationProcess.description</value></property>
<property name="fixesFromSchema"><value>0</value></property>
<property name="fixesToSchema"><value>2009</value></property>
<property name="targetSchema"><value>2010</value></property>
<property name="workflowDefinitions">
<list>
<props>
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/workflow/invitation-moderated_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
</props>
<props>
<prop key="engineId">jbpm</prop>
<prop key="location">alfresco/workflow/invitation-nominated_processdefinition.xml</prop>
<prop key="mimetype">text/xml</prop>
</props>
</list>
</property>
</bean>
</beans> </beans>

View File

@@ -19,4 +19,4 @@ version.build=@build-number@
# Schema number # Schema number
version.schema=2009 version.schema=2010

View File

@@ -2,7 +2,7 @@
<!-- Moderated invitation workflow --> <!-- Moderated invitation workflow -->
<model name="wf:invitation-moderated-workflow-model" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <model name="imwf:invitation-moderated-workflow-model" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<imports> <imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" /> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
@@ -11,23 +11,24 @@
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" /> <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
</imports> </imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/workflow/invite/moderated/1.0" prefix="imwf" />
</namespaces>
<types> <types>
<type name="wf:moderatedInvitationSubmitTask"> <type name="imwf:moderatedInvitationSubmitTask">
<parent>bpm:startTask</parent> <parent>bpm:startTask</parent>
<mandatory-aspects> <mandatory-aspects>
<aspect>bpm:assignee</aspect> <aspect>bpm:assignee</aspect>
<aspect>bpm:groupAssignee</aspect> <aspect>bpm:groupAssignee</aspect>
<aspect>wf:moderatedInvitationStats</aspect> <aspect>imwf:moderatedInvitationStats</aspect>
</mandatory-aspects> </mandatory-aspects>
</type> </type>
<type name="wf:moderatedInvitationReviewTask"> <type name="imwf:moderatedInvitationReviewTask">
<parent>bpm:workflowTask</parent> <parent>bpm:workflowTask</parent>
<properties> <properties>
<property name="wf:reviewComments"> <property name="imwf:reviewComments">
<type>d:text</type>
</property>
<property name="cm:owner">
<type>d:text</type> <type>d:text</type>
</property> </property>
</properties> </properties>
@@ -35,7 +36,7 @@
<mandatory-aspects> <mandatory-aspects>
<aspect>bpm:groupAssignee</aspect> <aspect>bpm:groupAssignee</aspect>
<aspect>cm:ownable</aspect> <aspect>cm:ownable</aspect>
<aspect>wf:moderatedInvitationStats</aspect> <aspect>imwf:moderatedInvitationStats</aspect>
</mandatory-aspects> </mandatory-aspects>
</type> </type>
@@ -43,22 +44,22 @@
</types> </types>
<aspects> <aspects>
<aspect name="wf:moderatedInvitationStats"> <aspect name="imwf:moderatedInvitationStats">
<properties> <properties>
<property name="wf:inviteeUserName"> <property name="imwf:inviteeUserName">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:resourceType"> <property name="imwf:resourceType">
<type>d:text</type> <type>d:text</type>
<default>WEB_SITE</default> <default>WEB_SITE</default>
</property> </property>
<property name="wf:resourceName"> <property name="imwf:resourceName">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeRole"> <property name="imwf:inviteeRole">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeComments"> <property name="imwf:inviteeComments">
<type>d:text</type> <type>d:text</type>
</property> </property>
</properties> </properties>

View File

@@ -3,7 +3,7 @@
<!-- Moderated Invitation Workflow --> <!-- Moderated Invitation Workflow -->
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" <process-definition xmlns="urn:jbpm.org:jpdl-3.1"
name="wf:invitation-moderated"> name="imwf:invitation-moderated">
<swimlane name="initiator"> <swimlane name="initiator">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
@@ -12,7 +12,7 @@
</swimlane> </swimlane>
<start-state name="start"> <start-state name="start">
<task name="wf:moderatedInvitationSubmitTask" swimlane="initiator" /> <task name="imwf:moderatedInvitationSubmitTask" swimlane="initiator" />
<transition to="review" name=""></transition> <transition to="review" name=""></transition>
</start-state> </start-state>
@@ -23,11 +23,11 @@
</swimlane> </swimlane>
<task-node name="review"> <task-node name="review">
<task name="wf:moderatedInvitationReviewTask" swimlane="approver" /> <task name="imwf:moderatedInvitationReviewTask" swimlane="approver" />
<transition name="reject" to="rejected"> <transition name="reject" to="rejected">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script> <script>
<variable name="wf_reviewer" access="write" /> <variable name="imwf_reviewer" access="write" />
<expression>person.properties.userName</expression> <expression>person.properties.userName</expression>
</script> </script>
</action> </action>
@@ -36,7 +36,7 @@
<transition name="approve" to="approved"> <transition name="approve" to="approved">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script> <script>
<variable name="wf_reviewer" access="write" /> <variable name="imwf_reviewer" access="write" />
<expression>person.properties.userName</expression> <expression>person.properties.userName</expression>
</script> </script>
</action> </action>

View File

@@ -2,7 +2,7 @@
<!-- Nominated Invitation Workflow Model --> <!-- Nominated Invitation Workflow Model -->
<model name="wf:invite-workflow-model" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <model name="inwf:invite-workflow-model" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<imports> <imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" /> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
@@ -10,49 +10,53 @@
<import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf" /> <import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf" />
</imports> </imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/workflow/invite/nominated/1.0" prefix="inwf" />
</namespaces>
<types> <types>
<!-- Custom Tasks --> <!-- Custom Tasks -->
<type name="wf:inviteToSiteTask"> <type name="inwf:inviteToSiteTask">
<parent>bpm:startTask</parent> <parent>bpm:startTask</parent>
<properties> <properties>
<property name="wf:serverPath"> <property name="inwf:serverPath">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:acceptUrl"> <property name="inwf:acceptUrl">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:rejectUrl"> <property name="inwf:rejectUrl">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteTicket"> <property name="inwf:inviteTicket">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviterUserName"> <property name="inwf:inviterUserName">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeUserName"> <property name="inwf:inviteeUserName">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeEmail"> <property name="inwf:inviteeEmail">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeFirstName"> <property name="inwf:inviteeFirstName">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeLastName"> <property name="inwf:inviteeLastName">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeGenPassword"> <property name="inwf:inviteeGenPassword">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:resourceType"> <property name="inwf:resourceType">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:resourceName"> <property name="inwf:resourceName">
<type>d:text</type> <type>d:text</type>
</property> </property>
<property name="wf:inviteeRole"> <property name="inwf:inviteeRole">
<type>d:text</type> <type>d:text</type>
</property> </property>
</properties> </properties>
@@ -61,15 +65,15 @@
</mandatory-aspects> </mandatory-aspects>
</type> </type>
<type name="wf:invitePendingTask"> <type name="inwf:invitePendingTask">
<parent>bpm:workflowTask</parent> <parent>bpm:workflowTask</parent>
</type> </type>
<type name="wf:acceptInviteTask"> <type name="inwf:acceptInviteTask">
<parent>bpm:workflowTask</parent> <parent>bpm:workflowTask</parent>
</type> </type>
<type name="wf:rejectInviteTask"> <type name="inwf:rejectInviteTask">
<parent>bpm:workflowTask</parent> <parent>bpm:workflowTask</parent>
</type> </type>

View File

@@ -3,32 +3,32 @@
<!-- Nominated invitation --> <!-- Nominated invitation -->
<process-definition xmlns="urn:jbpm.org:jpdl-3.1" <process-definition xmlns="urn:jbpm.org:jpdl-3.1"
name="wf:invitation-nominated"> name="inwf:invitation-nominated">
<swimlane name="initiator"/> <swimlane name="initiator"/>
<start-state name="start"> <start-state name="start">
<task name="wf:inviteToSiteTask" swimlane="initiator" /> <task name="inwf:inviteToSiteTask" swimlane="initiator" />
<transition name="sendInvite" to="invitePending"> <transition name="sendInvite" to="invitePending">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript"> <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script> <script>
var workflowId = workflowinstanceid; var workflowId = workflowinstanceid;
var inviterPerson = people.getPerson(wf_inviterUserName); var inviterPerson = people.getPerson(inwf_inviterUserName);
var inviteePerson = people.getPerson(wf_inviteeUserName); var inviteePerson = people.getPerson(inwf_inviteeUserName);
var site = siteService.getSite(wf_resourceName); var site = siteService.getSite(inwf_resourceName);
var siteName = site.shortName; var siteName = site.shortName;
if (site.title.length() > 0) if (site.title.length() > 0)
{ {
siteName = site.title; siteName = site.title;
} }
var params = "?inviteId=" + workflowId + var params = "?inviteId=" + workflowId +
"&amp;inviteeUserName=" + wf_inviteeUserName + "&amp;inviteeUserName=" + inwf_inviteeUserName +
"&amp;siteShortName=" + wf_resourceName + "&amp;siteShortName=" + inwf_resourceName +
"&amp;inviteTicket=" + wf_inviteTicket; "&amp;inviteTicket=" + inwf_inviteTicket;
var acceptLink = wf_serverPath + wf_acceptUrl + params; var acceptLink = inwf_serverPath + inwf_acceptUrl + params;
var rejectLink = wf_serverPath + wf_rejectUrl + params; var rejectLink = inwf_serverPath + inwf_rejectUrl + params;
var mail = actions.create("mail"); var mail = actions.create("mail");
mail.parameters.from = inviterPerson.properties["cm:email"]; mail.parameters.from = inviterPerson.properties["cm:email"];
mail.parameters.to = inviteePerson.properties["cm:email"]; mail.parameters.to = inviteePerson.properties["cm:email"];
@@ -41,9 +41,9 @@
args["inviteePersonRef"] = inviteePerson.nodeRef.toString(); args["inviteePersonRef"] = inviteePerson.nodeRef.toString();
args["inviterPersonRef"] = inviterPerson.nodeRef.toString(); args["inviterPersonRef"] = inviterPerson.nodeRef.toString();
args["siteName"] = siteName; args["siteName"] = siteName;
args["inviteeSiteRole"] = wf_inviteeRole; args["inviteeSiteRole"] = inwf_inviteeRole;
args["inviteeUserName"] = wf_inviteeUserName; args["inviteeUserName"] = inwf_inviteeUserName;
args["inviteeGenPassword"] = wf_inviteeGenPassword; args["inviteeGenPassword"] = inwf_inviteeGenPassword;
args["acceptLink"] = acceptLink; args["acceptLink"] = acceptLink;
args["rejectLink"] = rejectLink; args["rejectLink"] = rejectLink;
var mail_text = inviteePerson.processTemplate(template, args); var mail_text = inviteePerson.processTemplate(template, args);
@@ -62,7 +62,7 @@
</swimlane> </swimlane>
<task-node name="invitePending"> <task-node name="invitePending">
<task name="wf:invitePendingTask" swimlane="assignee" /> <task name="inwf:invitePendingTask" swimlane="assignee" />
<transition name="accept" to="inviteAccepted"> <transition name="accept" to="inviteAccepted">
<action class="org.alfresco.repo.invitation.site.AcceptInviteAction"/> <action class="org.alfresco.repo.invitation.site.AcceptInviteAction"/>
</transition> </transition>
@@ -75,12 +75,12 @@
</task-node> </task-node>
<task-node name="inviteAccepted"> <task-node name="inviteAccepted">
<task name="wf:acceptInviteTask" swimlane="initiator" /> <task name="inwf:acceptInviteTask" swimlane="initiator" />
<transition name="end" to="end"/> <transition name="end" to="end"/>
</task-node> </task-node>
<task-node name="inviteRejected"> <task-node name="inviteRejected">
<task name="wf:rejectInviteTask" swimlane="initiator" /> <task name="inwf:rejectInviteTask" swimlane="initiator" />
<transition name="end" to="end"/> <transition name="end" to="end"/>
</task-node> </task-node>

View File

@@ -33,6 +33,7 @@ import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import org.alfresco.cmis.CMISDataTypeEnum; import org.alfresco.cmis.CMISDataTypeEnum;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.repo.dictionary.DictionaryDAO; import org.alfresco.repo.dictionary.DictionaryDAO;
import org.alfresco.repo.dictionary.DictionaryListener; import org.alfresco.repo.dictionary.DictionaryListener;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
@@ -48,10 +49,10 @@ import org.springframework.context.ApplicationEvent;
* *
* @author davidc * @author davidc
*/ */
public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBean implements CMISDictionaryService, DictionaryListener public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBean implements CMISDictionaryService, DictionaryListener
{ {
// Logger // Logger
protected static final Log logger = LogFactory.getLog(AbstractCMISDictionaryService.class); protected static final Log logger = LogFactory.getLog(CMISAbstractDictionaryService.class);
// service dependencies // service dependencies
private DictionaryDAO dictionaryDAO; private DictionaryDAO dictionaryDAO;
@@ -102,9 +103,9 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
/*package*/ class DictionaryRegistry /*package*/ class DictionaryRegistry
{ {
// Type Definitions Index // Type Definitions Index
Map<QName, CMISObjectTypeDefinition> typeDefsByQName = new HashMap<QName, CMISObjectTypeDefinition>(); Map<QName, CMISAbstractTypeDefinition> typeDefsByQName = new HashMap<QName, CMISAbstractTypeDefinition>();
Map<QName, CMISObjectTypeDefinition> assocDefsByQName = new HashMap<QName, CMISObjectTypeDefinition>(); Map<QName, CMISAbstractTypeDefinition> assocDefsByQName = new HashMap<QName, CMISAbstractTypeDefinition>();
Map<CMISTypeId, CMISObjectTypeDefinition> objectDefsByTypeId = new HashMap<CMISTypeId, CMISObjectTypeDefinition>(); Map<CMISTypeId, CMISAbstractTypeDefinition> objectDefsByTypeId = new HashMap<CMISTypeId, CMISAbstractTypeDefinition>();
Map<CMISTypeId, CMISTypeDefinition> typeDefsByTypeId = new HashMap<CMISTypeId, CMISTypeDefinition>(); Map<CMISTypeId, CMISTypeDefinition> typeDefsByTypeId = new HashMap<CMISTypeId, CMISTypeDefinition>();
Map<String, CMISTypeDefinition> typeDefsByTable = new HashMap<String, CMISTypeDefinition>(); Map<String, CMISTypeDefinition> typeDefsByTable = new HashMap<String, CMISTypeDefinition>();
@@ -116,25 +117,41 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
/** /**
* Register Type Definition * Register Type Definition
* *
* @param typeDefinition * @param typeDef
*/ */
public void registerTypeDefinition(CMISObjectTypeDefinition typeDefinition) public void registerTypeDefinition(CMISAbstractTypeDefinition typeDef)
{ {
QName typeQName = typeDefinition.getTypeId().getQName(); CMISTypeDefinition existingTypeDef = objectDefsByTypeId.get(typeDef.getTypeId());
if (existingTypeDef != null)
{
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 (typeQName != null)
{ {
if (typeDefinition instanceof CMISRelationshipTypeDefinition) if (typeDef instanceof CMISRelationshipTypeDefinition)
{ {
assocDefsByQName.put(typeQName, typeDefinition); assocDefsByQName.put(typeQName, typeDef);
} }
else else
{ {
typeDefsByQName.put(typeQName, typeDefinition); typeDefsByQName.put(typeQName, typeDef);
} }
} }
objectDefsByTypeId.put(typeDefinition.getTypeId(), typeDefinition); typeDefsByTypeId.put(typeDef.getTypeId(), typeDef);
typeDefsByTypeId.put(typeDefinition.getTypeId(), typeDefinition); typeDefsByTable.put(typeDef.getQueryName().toLowerCase(), typeDef);
typeDefsByTable.put(typeDefinition.getQueryName().toLowerCase(), typeDefinition); }
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());
}
} }
/** /**
@@ -144,9 +161,23 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
*/ */
public void registerPropertyDefinition(CMISPropertyDefinition propDef) 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); propDefsByPropId.put(propDef.getPropertyId(), propDef);
propDefsByQName.put(propDef.getPropertyId().getQName(), propDef); propDefsByQName.put(propDef.getPropertyId().getQName(), propDef);
propDefsByName.put(propDef.getPropertyId().getName().toLowerCase(), 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());
}
} }
/* /*
@@ -165,24 +196,45 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
} }
} }
/* /*
* (non-Javadoc) * (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) * (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; CMISTypeDefinition typeDef = null;
if (matchingScope != null && matchingScope == CMISScope.RELATIONSHIP) if (scopeByRelationship)
{ {
typeDef = registry.assocDefsByQName.get(clazz); typeDef = registry.assocDefsByQName.get(clazz);
} }
@@ -191,38 +243,31 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
typeDef = registry.typeDefsByQName.get(clazz); typeDef = registry.typeDefsByQName.get(clazz);
} }
CMISTypeDefinition matchingTypeDef = null; // ensure matches one of provided matching scopes
if (matchingScope == null) CMISTypeDefinition matchingTypeDef = (matchingScopes.length == 0) ? typeDef : null;
{ if (typeDef != null)
matchingTypeDef = typeDef; {
} for (CMISScope scope : matchingScopes)
else {
{ if (typeDef.getTypeId().getScope() == scope)
if (typeDef != null && typeDef.getTypeId().getScope() == matchingScope)
{ {
matchingTypeDef = typeDef; matchingTypeDef = typeDef;
break;
} }
} }
return matchingTypeDef == null ? null : matchingTypeDef.getTypeId(); }
return matchingTypeDef;
} }
/* /*
* (non-Javadoc) * (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()); CMISTypeDefinition typeDef = registry.typeDefsByTable.get(tableName.toLowerCase());
return (typeDef == null) ? null : typeDef.getTypeId(); 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);
} }
/* /*
@@ -236,38 +281,50 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
/* /*
* (non-Javadoc) * (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) public CMISPropertyDefinition findProperty(QName property, CMISTypeDefinition matchingType)
{
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)
{ {
CMISPropertyDefinition propDef = registry.propDefsByQName.get(property); 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) * (non-Javadoc)
* @see org.alfresco.cmis.dictionary.CMISDictionaryService#getDataType(org.alfresco.service.namespace.QName) * @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); return cmisMapping.getDataType(dataType);
} }
@@ -288,9 +345,12 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
{ {
DictionaryRegistry registry = new DictionaryRegistry(); DictionaryRegistry registry = new DictionaryRegistry();
if (logger.isDebugEnabled())
logger.debug("Creating type definitions...");
// phase 1: construct type definitions // phase 1: construct type definitions
createDefinitions(registry); createDefinitions(registry);
for (CMISObjectTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values()) for (CMISAbstractTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
{ {
Map<CMISPropertyId, CMISPropertyDefinition> propDefs = objectTypeDef.createProperties(cmisMapping, dictionaryService); Map<CMISPropertyId, CMISPropertyDefinition> propDefs = objectTypeDef.createProperties(cmisMapping, dictionaryService);
for (CMISPropertyDefinition propDef : propDefs.values()) for (CMISPropertyDefinition propDef : propDefs.values())
@@ -300,37 +360,43 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
objectTypeDef.createSubTypes(cmisMapping, dictionaryService); objectTypeDef.createSubTypes(cmisMapping, dictionaryService);
} }
if (logger.isDebugEnabled())
logger.debug("Linking type definitions...");
// phase 2: link together // phase 2: link together
for (CMISObjectTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values()) for (CMISAbstractTypeDefinition objectTypeDef : registry.objectDefsByTypeId.values())
{ {
objectTypeDef.resolveDependencies(registry); objectTypeDef.resolveDependencies(registry);
} }
if (logger.isDebugEnabled())
logger.debug("Resolving type inheritance...");
// phase 3: resolve inheritance // phase 3: resolve inheritance
Map<Integer,List<CMISObjectTypeDefinition>> order = new TreeMap<Integer, List<CMISObjectTypeDefinition>>(); Map<Integer,List<CMISAbstractTypeDefinition>> order = new TreeMap<Integer, List<CMISAbstractTypeDefinition>>();
for (CMISObjectTypeDefinition typeDef : registry.objectDefsByTypeId.values()) for (CMISAbstractTypeDefinition typeDef : registry.objectDefsByTypeId.values())
{ {
// calculate class depth in hierarchy // calculate class depth in hierarchy
int depth = 0; int depth = 0;
CMISTypeDefinition parent = typeDef.getParentType(); CMISAbstractTypeDefinition parent = typeDef.getInternalParentType();
while (parent != null) while (parent != null)
{ {
depth = depth +1; depth = depth +1;
parent = parent.getParentType(); parent = parent.getInternalParentType();
} }
// map class to depth // map class to depth
List<CMISObjectTypeDefinition> classes = order.get(depth); List<CMISAbstractTypeDefinition> classes = order.get(depth);
if (classes == null) if (classes == null)
{ {
classes = new ArrayList<CMISObjectTypeDefinition>(); classes = new ArrayList<CMISAbstractTypeDefinition>();
order.put(depth, classes); order.put(depth, classes);
} }
classes.add(typeDef); classes.add(typeDef);
} }
for (int depth = 0; depth < order.size(); depth++) for (int depth = 0; depth < order.size(); depth++)
{ {
for (CMISObjectTypeDefinition typeDef : order.get(depth)) for (CMISAbstractTypeDefinition typeDef : order.get(depth))
{ {
typeDef.resolveInheritance(registry); typeDef.resolveInheritance(registry);
} }
@@ -339,8 +405,8 @@ public abstract class AbstractCMISDictionaryService extends AbstractLifecycleBea
// publish new registry // publish new registry
this.registry = registry; this.registry = registry;
if (logger.isDebugEnabled()) if (logger.isInfoEnabled())
logger.debug("Initialized CMIS Dictionary. Types:" + registry.typeDefsByTypeId.size() + ", Properties:" + registry.propDefsByPropId.size()); logger.info("Initialized CMIS Dictionary. Types:" + registry.typeDefsByTypeId.size() + ", Properties:" + registry.propDefsByPropId.size());
} }
/* /*

View File

@@ -33,13 +33,15 @@ import java.util.LinkedList;
import java.util.Map; import java.util.Map;
import org.alfresco.cmis.CMISContentStreamAllowedEnum; 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.error.AlfrescoRuntimeException;
import org.alfresco.service.cmr.dictionary.AspectDefinition; import org.alfresco.service.cmr.dictionary.AspectDefinition;
import org.alfresco.service.cmr.dictionary.ClassDefinition; import org.alfresco.service.cmr.dictionary.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition; import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.namespace.QName; 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 * @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; private static final long serialVersionUID = -3131505923356013430L;
// Object type properties // Object type properties
protected boolean isPublic;
protected ClassDefinition cmisClassDef; protected ClassDefinition cmisClassDef;
protected CMISTypeId objectTypeId; protected CMISTypeId objectTypeId;
protected String objectTypeQueryName; protected String objectTypeQueryName;
protected String displayName; protected String displayName;
protected CMISTypeId parentTypeId; protected CMISTypeId parentTypeId;
protected CMISTypeDefinition parentType; protected CMISTypeDefinition parentType;
protected CMISAbstractTypeDefinition internalParentType;
protected CMISTypeDefinition rootType; protected CMISTypeDefinition rootType;
protected String description; protected String description;
protected boolean creatable; protected boolean creatable;
@@ -68,6 +75,8 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
protected Collection<CMISTypeDefinition> subTypes = new ArrayList<CMISTypeDefinition>(); protected Collection<CMISTypeDefinition> subTypes = new ArrayList<CMISTypeDefinition>();
protected Map<CMISPropertyId, CMISPropertyDefinition> properties = new HashMap<CMISPropertyId, CMISPropertyDefinition>(); protected Map<CMISPropertyId, CMISPropertyDefinition> properties = new HashMap<CMISPropertyId, CMISPropertyDefinition>();
protected Map<CMISPropertyId, CMISPropertyDefinition> inheritedProperties = 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 // map properties directly defined on this type
for (PropertyDefinition propDef : cmisClassDef.getProperties().values()) for (PropertyDefinition propDef : cmisClassDef.getProperties().values())
{ {
if (propDef.getContainerClass().equals(cmisClassDef)) if (propDef.getContainerClass().equals(cmisClassDef) && !propDef.isOverride())
{
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 (cmisMapping.getDataType(propDef.getDataType()) != null) if (cmisMapping.getDataType(propDef.getDataType()) != null)
{ {
@@ -155,29 +151,48 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
{ {
if (parentTypeId != null) if (parentTypeId != null)
{ {
parentType = registry.typeDefsByTypeId.get(parentTypeId); internalParentType = registry.objectDefsByTypeId.get(parentTypeId);
if (parentType == null) if (internalParentType == null)
{ {
throw new AlfrescoRuntimeException("Failed to retrieve parent type for type id " + parentTypeId); 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(); CMISTypeId rootTypeId = objectTypeId.getRootTypeId();
if (rootTypeId != null) if (rootTypeId != null)
{ {
rootType = registry.typeDefsByTypeId.get(rootTypeId); rootType = registry.objectDefsByTypeId.get(rootTypeId);
if (rootType == null) if (rootType == null)
{ {
throw new AlfrescoRuntimeException("Failed to retrieve root type for type id " + rootTypeId); 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) for (CMISTypeId subTypeId : subTypeIds)
{ {
CMISTypeDefinition subType = registry.typeDefsByTypeId.get(subTypeId); CMISTypeDefinition subType = registry.objectDefsByTypeId.get(subTypeId);
if (subType == null) if (subType == null)
{ {
throw new AlfrescoRuntimeException("Failed to retrieve sub type for type id " + subTypeId + " for parent type " + objectTypeId); throw new AlfrescoRuntimeException("Failed to retrieve sub type for type id " + subTypeId + " for parent type " + objectTypeId);
} }
if (subType.isPublic() == isPublic)
{
subTypes.add(subType); 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) /*package*/ void resolveInheritance(DictionaryRegistry registry)
{ {
inheritedProperties.putAll(properties); 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() public CMISTypeId getTypeId()
{ {
return objectTypeId; return objectTypeId;
} }
/** /*
* Get the table name used for queries against the type. This is also a unique identifier for the type. The string * (non-Javadoc)
* conforms to SQL table naming conventions. TODO: Should we impose a maximum length and if so how do we avoid * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getQueryName()
* collisions from truncations?
*
* @return the sql table name
*/ */
public String getQueryName() public String getQueryName()
{ {
return objectTypeQueryName; return objectTypeQueryName;
} }
/** /*
* Get the display name for the type. * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getDisplayName()
* @return - the display name
*/ */
public String getDisplayName() public String getDisplayName()
{ {
return displayName; return displayName;
} }
/** /*
* Get parent type * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getParentType()
* @return
*/ */
public CMISTypeDefinition getParentType() public CMISTypeDefinition getParentType()
{ {
return parentType; return parentType;
} }
/** /*
* Get the root type * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getRootType()
* @return
*/ */
public CMISTypeDefinition getRootType() public CMISTypeDefinition getRootType()
{ {
return rootType; return rootType;
} }
/** /*
* Get sub types * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getSubTypes(boolean)
* @return
*/ */
public Collection<CMISTypeDefinition> getSubTypes(boolean includeDescendants) public Collection<CMISTypeDefinition> getSubTypes(boolean includeDescendants)
{ {
@@ -282,96 +319,94 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
return descendants; return descendants;
} }
/** /*
* Get the description for the type * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getDescription()
* @return - the description
*/ */
public String getDescription() public String getDescription()
{ {
return description; return description;
} }
/** /*
* Can objects of this type be created? * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isCreatable()
* @return
*/ */
public boolean isCreatable() public boolean isCreatable()
{ {
return creatable; 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 * (non-Javadoc)
* is not inherited in the type hierarchy. It is set on each type. * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isQueryable()
*
* @return true if queryable
*/ */
public boolean isQueryable() public boolean isQueryable()
{ {
return queryable; return queryable;
} }
/** /*
* Are objects of this type controllable. * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isControllable()
* @return
*/ */
public boolean isControllable() public boolean isControllable()
{ {
return controllable; return controllable;
} }
/** /*
* Are objects of this type included in super type queries * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isIncludeInSuperTypeQuery()
* @return
*/ */
public boolean isIncludeInSuperTypeQuery() public boolean isIncludeInSuperTypeQuery()
{ {
return includeInSuperTypeQuery; return includeInSuperTypeQuery;
} }
/** /*
* Gets the property definitions for this type * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getPropertyDefinitions()
* @return property definitions
*/ */
public Map<CMISPropertyId, CMISPropertyDefinition> getPropertyDefinitions() public Map<CMISPropertyId, CMISPropertyDefinition> getPropertyDefinitions()
{ {
return inheritedProperties; return inheritedProperties;
} }
/*
* (non-Javadoc)
* @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getOwnedPropertyDefinitions()
*/
public Map<CMISPropertyId, CMISPropertyDefinition> getOwnedPropertyDefinitions()
{
return ownedProperties;
}
// //
// Document Type specific // Document Type specific
// //
/** /*
* Is Fileable? * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isFileable()
* @return
*/ */
public boolean isFileable() public boolean isFileable()
{ {
return false; return false;
} }
/** /*
* Is Versionable? * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#isVersionable()
* @return
*/ */
public boolean isVersionable() public boolean isVersionable()
{ {
return false; return false;
} }
/** /*
* Is Content Stream Allowed? * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getContentStreamAllowed()
* @return
*/ */
public CMISContentStreamAllowedEnum getContentStreamAllowed() public CMISContentStreamAllowedEnum getContentStreamAllowed()
{ {
@@ -382,20 +417,18 @@ public class CMISObjectTypeDefinition implements CMISTypeDefinition, Serializabl
// Relationship Type specific // Relationship Type specific
// //
/** /*
* Get allowed source types * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getAllowedSourceTypes()
* @return
*/ */
public Collection<CMISTypeDefinition> getAllowedSourceTypes() public Collection<CMISTypeDefinition> getAllowedSourceTypes()
{ {
return Collections.emptyList(); return Collections.emptyList();
} }
/** /*
* Get allowed target types * (non-Javadoc)
* * @see org.alfresco.cmis.dictionary.CMISTypeDefinition#getAllowedTargetTypes()
* @return
*/ */
public Collection<CMISTypeDefinition> getAllowedTargetTypes() public Collection<CMISTypeDefinition> getAllowedTargetTypes()
{ {

View File

@@ -37,85 +37,68 @@ import org.alfresco.service.namespace.QName;
public interface CMISDictionaryService 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 * @param typeId
* @return * @return
*/ */
public CMISTypeId getTypeId(String typeId); public CMISTypeDefinition findType(String typeId);
/** /**
* Get Type Id from Table Name * Find type for Alfresco class name. Optionally, constrain match to one of specified CMIS scopes
*
* @param table
* @return
*/
public CMISTypeId getTypeIdFromTable(String table);
/**
* Get Type Id from Alfresco Class Name
* *
* @param clazz * @param clazz
* @param matchingScope if provided, only return type id matching scope * @param matchingScopes
* @return * @return
*/ */
public CMISTypeId getTypeId(QName clazz, CMISScope matchingScope); public CMISTypeDefinition findTypeForClass(QName clazz, CMISScope... matchingScopes);
/** /**
* Get Type Definition * Find type for table
* *
* @param typeId * @param tableName
* @return * @return
*/ */
public CMISTypeDefinition getType(CMISTypeId typeId); public CMISTypeDefinition findTypeForTable(String tableName);
/** /**
* Get All Type Definitions * Get all Types
* *
* @return * @return
*/ */
public Collection<CMISTypeDefinition> getAllTypes(); public Collection<CMISTypeDefinition> getAllTypes();
/** /**
* Get Property Id for Alfresco property name * Find property. Optionally constrain match to specified type.
* *
* @param property * @param property
* @param matchingType
* @return * @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 * @return
*/ */
public CMISPropertyId getPropertyId(String propertyId); public CMISPropertyDefinition findProperty(String property, CMISTypeDefinition matchingType);
/** /**
* Get Property * Find data type
*
* @param propertyId
* @return
*/
public CMISPropertyDefinition getProperty(CMISPropertyId propertyId);
/**
* Get Data Type
* *
* @param dataType * @param dataType
* @return * @return
*/ */
public CMISDataTypeEnum getDataType(QName dataType); public CMISDataTypeEnum findDataType(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)
} }

View File

@@ -55,8 +55,7 @@ public class CMISDictionaryTest extends BaseCMISTest
{ {
for (CMISTypeDefinition typeDef : cmisDictionaryService.getAllTypes()) for (CMISTypeDefinition typeDef : cmisDictionaryService.getAllTypes())
{ {
CMISTypeId typeId = typeDef.getTypeId(); CMISTypeDefinition typeDefLookup = cmisDictionaryService.findType(typeDef.getTypeId());
CMISTypeDefinition typeDefLookup = cmisDictionaryService.getType(typeId);
assertNotNull(typeDefLookup); assertNotNull(typeDefLookup);
assertEquals(typeDef, typeDefLookup); assertEquals(typeDef, typeDefLookup);
} }

View File

@@ -38,7 +38,7 @@ import org.alfresco.service.namespace.QName;
* *
* @author davidc * @author davidc
*/ */
public class CMISDocumentTypeDefinition extends CMISObjectTypeDefinition public class CMISDocumentTypeDefinition extends CMISAbstractTypeDefinition
{ {
private static final long serialVersionUID = -7209732754962781522L; private static final long serialVersionUID = -7209732754962781522L;
@@ -57,17 +57,32 @@ public class CMISDocumentTypeDefinition extends CMISObjectTypeDefinition
*/ */
public CMISDocumentTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef) public CMISDocumentTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef)
{ {
isPublic = true;
// Object type properties // Object type properties
this.cmisClassDef = cmisClassDef; this.cmisClassDef = cmisClassDef;
objectTypeId = typeId; objectTypeId = typeId;
objectTypeQueryName = (typeId == CMISDictionaryModel.DOCUMENT_TYPE_ID) ? typeId.getId() : cmisMapping.buildPrefixEncodedString(typeId.getQName(), false);
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId(); displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
description = cmisClassDef.getDescription();
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName()); 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)) if (cmisMapping.isValidCmisDocument(parentQName))
{ {
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.DOCUMENT, parentQName); parentTypeId = cmisMapping.getCmisTypeId(CMISScope.DOCUMENT, parentQName);
} }
description = cmisClassDef.getDescription(); }
creatable = true; creatable = true;
queryable = true; queryable = true;
controllable = false; controllable = false;

View File

@@ -33,7 +33,7 @@ import org.alfresco.service.namespace.QName;
* *
* @author davidc * @author davidc
*/ */
public class CMISFolderTypeDefinition extends CMISObjectTypeDefinition public class CMISFolderTypeDefinition extends CMISAbstractTypeDefinition
{ {
private static final long serialVersionUID = 7526155195125799106L; private static final long serialVersionUID = 7526155195125799106L;
@@ -45,17 +45,32 @@ public class CMISFolderTypeDefinition extends CMISObjectTypeDefinition
*/ */
public CMISFolderTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef) public CMISFolderTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef)
{ {
isPublic = true;
// Object type properties // Object type properties
this.cmisClassDef = cmisClassDef; this.cmisClassDef = cmisClassDef;
objectTypeId = typeId; objectTypeId = typeId;
objectTypeQueryName = (typeId == CMISDictionaryModel.FOLDER_TYPE_ID) ? typeId.getId() : cmisMapping.buildPrefixEncodedString(typeId.getQName(), false);
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId(); displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
description = cmisClassDef.getDescription();
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName()); 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)) if (cmisMapping.isValidCmisFolder(parentQName))
{ {
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.FOLDER, parentQName); parentTypeId = cmisMapping.getCmisTypeId(CMISScope.FOLDER, parentQName);
} }
description = cmisClassDef.getDescription(); }
creatable = true; creatable = true;
queryable = true; queryable = true;
controllable = false; controllable = false;

View File

@@ -60,6 +60,9 @@ public class CMISMapping
*/ */
public static QName CMIS_MODEL_QNAME = QName.createQName(CMIS_MODEL_URI, CMIS_MODEL_NAME); 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 // CMIS Data Types
public static QName CMIS_DATATYPE_ID = QName.createQName(CMIS_MODEL_URI, "id"); 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"); public static QName CMIS_DATATYPE_HTML = QName.createQName(CMIS_MODEL_URI, "html");
// CMIS Types // 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 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 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 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); 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 // Properties
public static QName PROP_OBJECT_ID_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.PROP_OBJECT_ID); public static QName PROP_OBJECT_ID_QNAME = QName.createQName(CMIS_MODEL_URI, CMISDictionaryModel.PROP_OBJECT_ID);
@@ -90,6 +99,8 @@ public class CMISMapping
*/ */
static 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(DOCUMENT_QNAME, CMISDictionaryModel.DOCUMENT_TYPE_ID);
qNameToCmisTypeId.put(FOLDER_QNAME, CMISDictionaryModel.FOLDER_TYPE_ID); qNameToCmisTypeId.put(FOLDER_QNAME, CMISDictionaryModel.FOLDER_TYPE_ID);
qNameToCmisTypeId.put(RELATIONSHIP_QNAME, CMISDictionaryModel.RELATIONSHIP_TYPE_ID); qNameToCmisTypeId.put(RELATIONSHIP_QNAME, CMISDictionaryModel.RELATIONSHIP_TYPE_ID);
@@ -195,6 +206,14 @@ public class CMISMapping
{ {
return CMISDictionaryModel.POLICY_TYPE_ID; 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? // Is it an Alfresco type id?
if (typeId.length() < 4 || typeId.charAt(1) != '/') if (typeId.length() < 4 || typeId.charAt(1) != '/')
@@ -255,6 +274,14 @@ public class CMISMapping
{ {
return getCmisTypeId(CMISScope.POLICY, classQName); 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)) if (isValidCmisDocument(classQName))
{ {
return getCmisTypeId(CMISScope.DOCUMENT, classQName); return getCmisTypeId(CMISScope.DOCUMENT, classQName);
@@ -398,7 +425,8 @@ public class CMISMapping
} }
if (aspectDef.getName().equals(ContentModel.ASPECT_VERSIONABLE) || 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; return false;
} }

View File

@@ -26,7 +26,7 @@ package org.alfresco.cmis.dictionary;
import java.util.Collection; 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.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
@@ -37,7 +37,7 @@ import org.alfresco.service.namespace.QName;
* *
* @author davidc * @author davidc
*/ */
public class CMISPolicyTypeDefinition extends CMISObjectTypeDefinition public class CMISPolicyTypeDefinition extends CMISAbstractTypeDefinition
{ {
private static final long serialVersionUID = 1621538303752395828L; private static final long serialVersionUID = 1621538303752395828L;
@@ -50,12 +50,20 @@ public class CMISPolicyTypeDefinition extends CMISObjectTypeDefinition
*/ */
public CMISPolicyTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef) public CMISPolicyTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef)
{ {
isPublic = true;
// Object Type definitions
this.cmisClassDef = cmisClassDef; this.cmisClassDef = cmisClassDef;
objectTypeId = typeId; objectTypeId = typeId;
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId(); displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
if (typeId == CMISDictionaryModel.POLICY_TYPE_ID) if (typeId == CMISDictionaryModel.POLICY_TYPE_ID)
{ {
objectTypeQueryName = typeId.getId(); objectTypeQueryName = typeId.getId();
QName parentQName = cmisMapping.getCmisType(cmisClassDef.getParentName());
if (parentQName != null)
{
parentTypeId = cmisMapping.getCmisTypeId(CMISScope.OBJECT, parentQName);
}
} }
else else
{ {
@@ -98,6 +106,10 @@ public class CMISPolicyTypeDefinition extends CMISObjectTypeDefinition
{ {
// NOTE: Force no inheritance of base Policy type // NOTE: Force no inheritance of base Policy type
inheritedProperties.putAll(properties); inheritedProperties.putAll(properties);
ownedProperties.putAll(properties);
if (logger.isDebugEnabled())
logger.debug("Type " + objectTypeId + " properties: " + inheritedProperties.size() + ", owned: " + ownedProperties.size());
} }
/* /*

View File

@@ -29,7 +29,7 @@ import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; 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.error.AlfrescoRuntimeException;
import org.alfresco.service.cmr.dictionary.AssociationDefinition; import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ClassDefinition; import org.alfresco.service.cmr.dictionary.ClassDefinition;
@@ -42,7 +42,7 @@ import org.alfresco.service.namespace.QName;
* *
* @author davidc * @author davidc
*/ */
public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition public class CMISRelationshipTypeDefinition extends CMISAbstractTypeDefinition
{ {
private static final long serialVersionUID = 5291428171784061346L; 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) public CMISRelationshipTypeDefinition(CMISMapping cmisMapping, CMISTypeId typeId, ClassDefinition cmisClassDef, AssociationDefinition assocDef)
{ {
isPublic = true;
this.cmisClassDef = cmisClassDef; this.cmisClassDef = cmisClassDef;
objectTypeId = typeId; objectTypeId = typeId;
creatable = false; creatable = false;
@@ -76,7 +77,11 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
// TODO: Add CMIS Association mapping?? // TODO: Add CMIS Association mapping??
displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId(); displayName = (cmisClassDef.getTitle() != null) ? cmisClassDef.getTitle() : typeId.getId();
objectTypeQueryName = 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(); description = cmisClassDef.getDescription();
} }
else else
@@ -87,13 +92,13 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
description = assocDef.getDescription(); description = assocDef.getDescription();
CMISTypeId sourceTypeId = cmisMapping.getCmisTypeId(cmisMapping.getCmisType(assocDef.getSourceClass().getName())); 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); allowedSourceTypeIds.add(sourceTypeId);
} }
CMISTypeId targetTypeId = cmisMapping.getCmisTypeId(cmisMapping.getCmisType(assocDef.getTargetClass().getName())); 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); allowedTargetTypeIds.add(targetTypeId);
} }
@@ -145,21 +150,27 @@ public class CMISRelationshipTypeDefinition extends CMISObjectTypeDefinition
super.resolveDependencies(registry); super.resolveDependencies(registry);
for (CMISTypeId sourceTypeId : allowedSourceTypeIds) for (CMISTypeId sourceTypeId : allowedSourceTypeIds)
{ {
CMISTypeDefinition type = registry.typeDefsByTypeId.get(sourceTypeId); CMISTypeDefinition type = registry.objectDefsByTypeId.get(sourceTypeId);
if (type == null) if (type == null)
{ {
throw new AlfrescoRuntimeException("Failed to retrieve allowed source type for type id " + sourceTypeId); throw new AlfrescoRuntimeException("Failed to retrieve allowed source type for type id " + sourceTypeId);
} }
if (type.isPublic() == isPublic)
{
allowedSourceTypes.add(type); allowedSourceTypes.add(type);
} }
}
for (CMISTypeId targetTypeId : allowedTargetTypeIds) for (CMISTypeId targetTypeId : allowedTargetTypeIds)
{ {
CMISTypeDefinition type = registry.typeDefsByTypeId.get(targetTypeId); CMISTypeDefinition type = registry.objectDefsByTypeId.get(targetTypeId);
if (type == null) if (type == null)
{ {
throw new AlfrescoRuntimeException("Failed to retrieve allowed target type for type id " + targetTypeId); 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); super.resolveInheritance(registry);
inheritedAllowedSourceTypes.addAll(allowedSourceTypes); inheritedAllowedSourceTypes.addAll(allowedSourceTypes);
inheritedAllowedTargetTypes.addAll(allowedTargetTypes); inheritedAllowedTargetTypes.addAll(allowedTargetTypes);
if (parentType != null) if (internalParentType != null)
{ {
inheritedAllowedSourceTypes.addAll(parentType.getAllowedSourceTypes()); inheritedAllowedSourceTypes.addAll(internalParentType.getAllowedSourceTypes());
inheritedAllowedTargetTypes.addAll(parentType.getAllowedTargetTypes()); inheritedAllowedTargetTypes.addAll(internalParentType.getAllowedTargetTypes());
} }
} }

View File

@@ -38,7 +38,7 @@ import org.alfresco.service.namespace.QName;
* *
* @author davidc * @author davidc
*/ */
public class CMISStrictDictionaryService extends AbstractCMISDictionaryService public class CMISStrictDictionaryService extends CMISAbstractDictionaryService
{ {
/* /*
* (non-Javadoc) * (non-Javadoc)
@@ -73,7 +73,7 @@ public class CMISStrictDictionaryService extends AbstractCMISDictionaryService
// create appropriate kind of type definition // create appropriate kind of type definition
ClassDefinition classDef = dictionaryService.getClass(cmisMapping.getCmisType(typeId.getQName())); ClassDefinition classDef = dictionaryService.getClass(cmisMapping.getCmisType(typeId.getQName()));
CMISObjectTypeDefinition objectTypeDef = null; CMISAbstractTypeDefinition objectTypeDef = null;
if (typeId.getScope() == CMISScope.DOCUMENT) if (typeId.getScope() == CMISScope.DOCUMENT)
{ {
objectTypeDef = new CMISDocumentTypeDefinition(cmisMapping, typeId, classDef); objectTypeDef = new CMISDocumentTypeDefinition(cmisMapping, typeId, classDef);
@@ -91,6 +91,10 @@ public class CMISStrictDictionaryService extends AbstractCMISDictionaryService
{ {
objectTypeDef = new CMISPolicyTypeDefinition(cmisMapping, typeId, classDef); objectTypeDef = new CMISPolicyTypeDefinition(cmisMapping, typeId, classDef);
} }
else if (typeId.getScope() == CMISScope.OBJECT)
{
objectTypeDef = new CMISObjectTypeDefinition(cmisMapping, typeId, classDef, false);
}
registry.registerTypeDefinition(objectTypeDef); registry.registerTypeDefinition(objectTypeDef);
} }
@@ -112,7 +116,7 @@ public class CMISStrictDictionaryService extends AbstractCMISDictionaryService
// create appropriate kind of type definition // create appropriate kind of type definition
CMISTypeId typeId = cmisMapping.getCmisTypeId(CMISScope.RELATIONSHIP, classQName); CMISTypeId typeId = cmisMapping.getCmisTypeId(CMISScope.RELATIONSHIP, classQName);
AssociationDefinition assocDef = dictionaryService.getAssociation(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); registry.registerTypeDefinition(objectTypeDef);
} }

View File

@@ -36,6 +36,11 @@ import org.alfresco.cmis.CMISContentStreamAllowedEnum;
*/ */
public interface CMISTypeDefinition public interface CMISTypeDefinition
{ {
/**
* @return true => type definition is for public consumption
*/
public boolean isPublic();
/** /**
* Get the unique identifier for the type * Get the unique identifier for the type
* *
@@ -60,17 +65,24 @@ public interface CMISTypeDefinition
public String getDisplayName(); public String getDisplayName();
/** /**
* Get the type id for the parent * Get the type for the parent
* *
* @return - the parent type id * @return - the parent type id
*/ */
public CMISTypeDefinition getParentType(); public CMISTypeDefinition getParentType();
/**
* Get the sub-types
*
* @param descendants
* @return
*/
public Collection<CMISTypeDefinition> getSubTypes(boolean descendants); public Collection<CMISTypeDefinition> getSubTypes(boolean descendants);
/** /**
* Get the root type id * Get the root type
* @return - the root type id *
* @return
*/ */
public CMISTypeDefinition getRootType(); public CMISTypeDefinition getRootType();
@@ -146,10 +158,17 @@ public interface CMISTypeDefinition
public Collection<CMISTypeDefinition> getAllowedTargetTypes(); public Collection<CMISTypeDefinition> getAllowedTargetTypes();
/** /**
* Gets the property definitions for this type * Gets the property definitions for this type (owned and inherited)
* *
* @return property definitions * @return property definitions
*/ */
public Map<CMISPropertyId, CMISPropertyDefinition> getPropertyDefinitions(); public Map<CMISPropertyId, CMISPropertyDefinition> getPropertyDefinitions();
/**
* Gets the property definitions owned by this type
*
* @return
*/
public Map<CMISPropertyId, CMISPropertyDefinition> getOwnedPropertyDefinitions();
} }

View File

@@ -100,6 +100,8 @@ public class CMISTypeId implements Serializable
return CMISDictionaryModel.RELATIONSHIP_TYPE_ID; return CMISDictionaryModel.RELATIONSHIP_TYPE_ID;
case POLICY: case POLICY:
return CMISDictionaryModel.POLICY_TYPE_ID; return CMISDictionaryModel.POLICY_TYPE_ID;
case OBJECT:
return CMISMapping.OBJECT_TYPE_ID;
case UNKNOWN: case UNKNOWN:
default: default:
return null; return null;

View File

@@ -25,15 +25,12 @@
package org.alfresco.cmis.search; package org.alfresco.cmis.search;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.alfresco.cmis.CMISDataTypeEnum; import org.alfresco.cmis.CMISDataTypeEnum;
import org.alfresco.cmis.dictionary.CMISDictionaryService; import org.alfresco.cmis.dictionary.CMISDictionaryService;
import org.alfresco.cmis.dictionary.CMISPropertyDefinition; import org.alfresco.cmis.dictionary.CMISPropertyDefinition;
import org.alfresco.cmis.dictionary.CMISPropertyId;
import org.alfresco.cmis.dictionary.CMISTypeDefinition; 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.Column;
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; import org.alfresco.repo.search.impl.querymodel.PropertyArgument;
import org.alfresco.repo.search.impl.querymodel.Query; import org.alfresco.repo.search.impl.querymodel.Query;
@@ -48,33 +45,24 @@ public class CMISResultSetMetaDataImpl implements CMISResultSetMetaData
{ {
private CMISQueryOptions options; private CMISQueryOptions options;
private Query query;
private Map<String, CMISResultSetColumn> columnMetaData; private Map<String, CMISResultSetColumn> columnMetaData;
private Map<String, CMISResultSetSelector> selectorMetaData; private Map<String, CMISResultSetSelector> selectorMetaData;
private CMISDictionaryService cmisDictionaryService;
public CMISResultSetMetaDataImpl(CMISQueryOptions options, Query query, CMISDictionaryService cmisDictionaryService) public CMISResultSetMetaDataImpl(CMISQueryOptions options, Query query, CMISDictionaryService cmisDictionaryService)
{ {
this.options = options; this.options = options;
this.query = query;
Map<String, Selector> selectors = query.getSource().getSelectors(); Map<String, Selector> selectors = query.getSource().getSelectors();
selectorMetaData = new LinkedHashMap<String, CMISResultSetSelector>(); selectorMetaData = new LinkedHashMap<String, CMISResultSetSelector>();
for(Selector selector : selectors.values()) for(Selector selector : selectors.values())
{ {
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null); CMISTypeDefinition type = cmisDictionaryService.findTypeForClass(selector.getType());
CMISTypeDefinition type = cmisDictionaryService.getType(typeId);
CMISResultSetSelector smd = new CMISResultSetSelectorImpl(selector.getAlias(), type); CMISResultSetSelector smd = new CMISResultSetSelectorImpl(selector.getAlias(), type);
selectorMetaData.put(smd.getName(), smd); selectorMetaData.put(smd.getName(), smd);
} }
List<Column> columns = query.getColumns();
columnMetaData = new LinkedHashMap<String, CMISResultSetColumn>(); columnMetaData = new LinkedHashMap<String, CMISResultSetColumn>();
int i = 0;
for (Column column : query.getColumns()) for (Column column : query.getColumns())
{ {
CMISPropertyDefinition propertyDefinition = null; CMISPropertyDefinition propertyDefinition = null;
@@ -83,13 +71,12 @@ public class CMISResultSetMetaDataImpl implements CMISResultSetMetaData
{ {
PropertyArgument arg = (PropertyArgument) column.getFunctionArguments().get(PropertyAccessor.ARG_PROPERTY); PropertyArgument arg = (PropertyArgument) column.getFunctionArguments().get(PropertyAccessor.ARG_PROPERTY);
QName propertyQName = arg.getPropertyName(); QName propertyQName = arg.getPropertyName();
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); propertyDefinition = cmisDictionaryService.findProperty(propertyQName, null);
propertyDefinition = cmisDictionaryService.getProperty(propertyId);
type = propertyDefinition.getDataType(); type = propertyDefinition.getDataType();
} }
if (type == null) if (type == null)
{ {
type = cmisDictionaryService.getDataType(column.getFunction().getReturnType()); type = cmisDictionaryService.findDataType(column.getFunction().getReturnType());
} }
CMISResultSetColumn cmd = new CMISResultSetColumnImpl(column.getAlias(), propertyDefinition, type); CMISResultSetColumn cmd = new CMISResultSetColumnImpl(column.getAlias(), propertyDefinition, type);
columnMetaData.put(cmd.getName(), cmd); columnMetaData.put(cmd.getName(), cmd);

View File

@@ -29,7 +29,7 @@ import java.util.Collection;
import java.util.Map; import java.util.Map;
import org.alfresco.cmis.dictionary.CMISDictionaryService; 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.CMISPropertyService;
import org.alfresco.cmis.property.CMISPropertyServiceImpl; import org.alfresco.cmis.property.CMISPropertyServiceImpl;
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser; import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
@@ -131,8 +131,8 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
*/ */
public Serializable getProperty(NodeRef nodeRef, QName propertyQName) public Serializable getProperty(NodeRef nodeRef, QName propertyQName)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
return cmisPropertyService.getProperty(nodeRef, propertyId.getName()); return cmisPropertyService.getProperty(nodeRef, propertyDef.getPropertyId().getName());
} }
/* /*
@@ -166,9 +166,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneEquality(lqp, propertyId.getName(), value, mode); return impl.buildLuceneEquality(lqp, propertyDef.getPropertyId().getName(), value, mode);
} }
else else
{ {
@@ -186,9 +186,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneExists(lqp, propertyId.getName(), not); return impl.buildLuceneExists(lqp, propertyDef.getPropertyId().getName(), not);
} }
else else
{ {
@@ -207,9 +207,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneGreaterThan(lqp, propertyId.getName(), value, mode); return impl.buildLuceneGreaterThan(lqp, propertyDef.getPropertyId().getName(), value, mode);
} }
else else
{ {
@@ -228,9 +228,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneGreaterThanOrEquals(lqp, propertyId.getName(), value, mode); return impl.buildLuceneGreaterThanOrEquals(lqp, propertyDef.getPropertyId().getName(), value, mode);
} }
else else
{ {
@@ -249,9 +249,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneIn(lqp, propertyId.getName(), values, not, mode); return impl.buildLuceneIn(lqp, propertyDef.getPropertyId().getName(), values, not, mode);
} }
else else
{ {
@@ -270,9 +270,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneInequality(lqp, propertyId.getName(), value, mode); return impl.buildLuceneInequality(lqp, propertyDef.getPropertyId().getName(), value, mode);
} }
else else
{ {
@@ -291,9 +291,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneLessThan(lqp, propertyId.getName(), value, mode); return impl.buildLuceneLessThan(lqp, propertyDef.getPropertyId().getName(), value, mode);
} }
else else
{ {
@@ -312,9 +312,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneLessThanOrEquals(lqp, propertyId.getName(), value, mode); return impl.buildLuceneLessThanOrEquals(lqp, propertyDef.getPropertyId().getName(), value, mode);
} }
else else
{ {
@@ -332,9 +332,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.buildLuceneLike(lqp, propertyId.getName(), value, not); return impl.buildLuceneLike(lqp, propertyDef.getPropertyId().getName(), value, not);
} }
else else
{ {
@@ -349,9 +349,9 @@ public class CmisFunctionEvaluationContext implements FunctionEvaluationContext
{ {
if (cmisPropertyService instanceof CMISPropertyServiceImpl) if (cmisPropertyService instanceof CMISPropertyServiceImpl)
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(propertyQName); CMISPropertyDefinition propertyDef = cmisDictionaryService.findProperty(propertyQName, null);
CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService; CMISPropertyServiceImpl impl = (CMISPropertyServiceImpl) cmisPropertyService;
return impl.getLuceneSortField(propertyId.getName()); return impl.getLuceneSortField(propertyDef.getPropertyId().getName());
} }
else else
{ {

View File

@@ -1539,7 +1539,7 @@ public class QueryTest extends BaseCMISTest
CMISResultSet rs = cmisQueryService.query(options); CMISResultSet rs = cmisQueryService.query(options);
CMISResultSetMetaData md = rs.getMetaData(); CMISResultSetMetaData md = rs.getMetaData();
assertNotNull(md.getQueryOptions()); 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); assertEquals(typeDef.getPropertyDefinitions().size(), md.getColumnNames().length);
assertNotNull(md.getColumn(CMISDictionaryModel.PROP_OBJECT_ID)); assertNotNull(md.getColumn(CMISDictionaryModel.PROP_OBJECT_ID));
assertEquals(1, md.getSelectors().length); assertEquals(1, md.getSelectors().length);

View File

@@ -39,9 +39,9 @@ import org.alfresco.cmis.dictionary.CMISPropertyDefinition;
import org.alfresco.cmis.dictionary.CMISPropertyId; import org.alfresco.cmis.dictionary.CMISPropertyId;
import org.alfresco.cmis.dictionary.CMISScope; import org.alfresco.cmis.dictionary.CMISScope;
import org.alfresco.cmis.dictionary.CMISTypeDefinition; import org.alfresco.cmis.dictionary.CMISTypeDefinition;
import org.alfresco.cmis.dictionary.CMISTypeId;
import org.alfresco.cmis.search.CMISQueryException; import org.alfresco.cmis.search.CMISQueryException;
import org.alfresco.cmis.search.CMISQueryOptions; 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.CMISLexer;
import org.alfresco.repo.search.impl.parsers.CMISParser; import org.alfresco.repo.search.impl.parsers.CMISParser;
import org.alfresco.repo.search.impl.parsers.FTSLexer; import org.alfresco.repo.search.impl.parsers.FTSLexer;
@@ -102,11 +102,18 @@ public class CMISQueryParser
private CMISJoinEnum joinSupport; 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) public CMISQueryParser(CMISQueryOptions options, CMISDictionaryService cmisDictionaryService, CMISJoinEnum joinSupport)
{ {
this.options = options; this.options = options;
this.cmisDictionaryService = cmisDictionaryService; this.cmisDictionaryService = cmisDictionaryService;
this.joinSupport = joinSupport; this.joinSupport = joinSupport;
this.validScopes = (options.getQueryMode() == CMISQueryMode.CMS_STRICT) ? STRICT_SCOPES : ALFRESCO_SCOPES;
} }
public Query parse(QueryModelFactory factory) public Query parse(QueryModelFactory factory)
@@ -597,19 +604,12 @@ public class CMISQueryParser
throw new CMISQueryException("No selector for " + qualifier); throw new CMISQueryException("No selector for " + qualifier);
} }
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null); CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), CMISScope.DOCUMENT, CMISScope.FOLDER);
if (typeId == null || (typeId.getScope() != CMISScope.DOCUMENT && typeId.getScope() != CMISScope.FOLDER)) if (typeDef == null)
{ {
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias()); throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
} }
CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(columnName, typeDef);
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
CMISPropertyDefinition propDef = null;
CMISPropertyId propId = cmisDictionaryService.getPropertyId(columnName);
if (propId != null)
{
propDef = typeDef.getPropertyDefinitions().get(propId);
}
if (propDef == null) if (propDef == null)
{ {
throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName); throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName);
@@ -636,19 +636,12 @@ public class CMISQueryParser
throw new CMISQueryException("No selector for " + qualifier); throw new CMISQueryException("No selector for " + qualifier);
} }
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null); CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), CMISScope.DOCUMENT, CMISScope.FOLDER);
if (typeId == null || (typeId.getScope() != CMISScope.DOCUMENT && typeId.getScope() != CMISScope.FOLDER)) if (typeDef == null)
{ {
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias()); throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
} }
CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(columnName, typeDef);
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
CMISPropertyDefinition propDef = null;
CMISPropertyId propId = cmisDictionaryService.getPropertyId(columnName);
if (propId != null)
{
propDef = typeDef.getPropertyDefinitions().get(propId);
}
if (propDef == null) if (propDef == null)
{ {
throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName + " selector alias " + selector.getAlias()); 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()) for (Selector selector : selectors.values())
{ {
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null); CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), validScopes);
if (typeId == null || (typeId.getScope() == CMISScope.RELATIONSHIP)) if (typeDef == null)
{ {
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias()); throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
} }
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
Map<CMISPropertyId, CMISPropertyDefinition> propDefs = typeDef.getPropertyDefinitions(); Map<CMISPropertyId, CMISPropertyDefinition> propDefs = typeDef.getPropertyDefinitions();
for (CMISPropertyDefinition definition : propDefs.values()) for (CMISPropertyDefinition definition : propDefs.values())
{ {
@@ -726,12 +718,11 @@ public class CMISQueryParser
throw new CMISQueryException("No selector for " + qualifier + " in " + qualifier + ".*"); throw new CMISQueryException("No selector for " + qualifier + " in " + qualifier + ".*");
} }
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null); CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), validScopes);
if (typeId == null || (typeId.getScope() == CMISScope.RELATIONSHIP)) if (typeDef == null)
{ {
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias()); throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
} }
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId);
Map<CMISPropertyId, CMISPropertyDefinition> propDefs = typeDef.getPropertyDefinitions(); Map<CMISPropertyId, CMISPropertyDefinition> propDefs = typeDef.getPropertyDefinitions();
for (CMISPropertyDefinition definition : propDefs.values()) for (CMISPropertyDefinition definition : propDefs.values())
{ {
@@ -766,18 +757,12 @@ public class CMISQueryParser
throw new CMISQueryException("No selector for " + qualifier); throw new CMISQueryException("No selector for " + qualifier);
} }
CMISTypeId typeId = cmisDictionaryService.getTypeId(selector.getType(), null); CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForClass(selector.getType(), validScopes);
if (typeId == null || (typeId.getScope() == CMISScope.RELATIONSHIP)) if (typeDef == null)
{ {
throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias()); throw new CMISQueryException("Type unsupported in CMIS queries: " + selector.getAlias());
} }
CMISTypeDefinition typeDef = cmisDictionaryService.getType(typeId); CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(columnName, typeDef);
CMISPropertyDefinition propDef = null;
CMISPropertyId propId = cmisDictionaryService.getPropertyId(columnName);
if (propId != null)
{
propDef = typeDef.getPropertyDefinitions().get(propId);
}
if (propDef == null) if (propDef == null)
{ {
throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName); throw new CMISQueryException("Invalid column for " + typeDef.getQueryName() + "." + columnName);
@@ -908,13 +893,12 @@ public class CMISQueryParser
} }
else else
{ {
CMISPropertyId propertyId = cmisDictionaryService.getPropertyId(id); CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(id, null);
CMISPropertyDefinition propDef = cmisDictionaryService.getProperty(propertyId); if (propDef == null || !propDef.isQueryable())
PropertyArgument arg = factory.createPropertyArgument(definition.getName(), propDef.isQueryable(), propDef.isOrderable(), "", propDef.getPropertyId().getQName());
if(!arg.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; return arg;
} }
} }
@@ -1062,20 +1046,19 @@ public class CMISQueryParser
alias = singleTableNode.getChild(1).getText(); alias = singleTableNode.getChild(1).getText();
} }
CMISTypeId typeId = cmisDictionaryService.getTypeIdFromTable(tableName); CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForTable(tableName);
if (typeId == null) if (typeDef == null)
{ {
throw new CMISQueryException("Type is unsupported in query " + tableName); 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 (!typeDef.isQueryable())
if (!cmisType.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 else
{ {
@@ -1094,20 +1077,19 @@ public class CMISQueryParser
{ {
alias = singleTableNode.getChild(1).getText(); alias = singleTableNode.getChild(1).getText();
} }
CMISTypeId typeId = cmisDictionaryService.getTypeIdFromTable(tableName); CMISTypeDefinition typeDef = cmisDictionaryService.findTypeForTable(tableName);
if (typeId == null) if (typeDef == null)
{ {
throw new CMISQueryException("Type is unsupported in query " + tableName); 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 (!typeDef.isQueryable())
if (!cmisType.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()); List<CommonTree> list = (List<CommonTree>) (source.getChildren());
for (CommonTree joinNode : list) for (CommonTree joinNode : list)
@@ -1169,8 +1151,7 @@ public class CMISQueryParser
{ {
qualifer = columnReferenceNode.getChild(1).getText(); qualifer = columnReferenceNode.getChild(1).getText();
} }
CMISPropertyId propId = cmisDictionaryService.getPropertyId(cmisPropertyName); CMISPropertyDefinition propDef = cmisDictionaryService.findProperty(cmisPropertyName, null);
CMISPropertyDefinition propDef = cmisDictionaryService.getProperty(propId);
return factory.createPropertyArgument(argumentName, propDef.isQueryable(), propDef.isOrderable(), qualifer, propDef.getPropertyId().getQName()); return factory.createPropertyArgument(argumentName, propDef.isQueryable(), propDef.isOrderable(), qualifer, propDef.getPropertyId().getQName());
} }

View File

@@ -27,8 +27,6 @@ package org.alfresco.repo.dictionary;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
/** /**
* Property Definition * Property Definition
@@ -38,6 +36,7 @@ import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
*/ */
public class M2Property public class M2Property
{ {
private boolean isOverride = false;
private String name = null; private String name = null;
private String title = null; private String title = null;
private String description = null; private String description = null;
@@ -63,6 +62,15 @@ public class M2Property
this.name = name; this.name = name;
} }
public boolean isOverride()
{
return isOverride;
}
public void setOverride(boolean isOverride)
{
this.isOverride = isOverride;
}
public String getName() public String getName()
{ {

View File

@@ -163,6 +163,7 @@ import org.alfresco.service.namespace.QName;
Map<QName, ConstraintDefinition> modelConstraints) Map<QName, ConstraintDefinition> modelConstraints)
{ {
M2Property property = new M2Property(); M2Property property = new M2Property();
property.setOverride(true);
// Process Default Value // Process Default Value
String defaultValue = override.getDefaultValue(); String defaultValue = override.getDefaultValue();
@@ -316,6 +317,14 @@ import org.alfresco.service.namespace.QName;
return classDef; return classDef;
} }
/*
* (non-Javadoc)
* @see org.alfresco.service.cmr.dictionary.PropertyDefinition#isOverride()
*/
public boolean isOverride()
{
return m2Property.isOverride();
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.repo.dictionary.PropertyDefinition#isMultiValued() * @see org.alfresco.repo.dictionary.PropertyDefinition#isMultiValued()

View File

@@ -31,17 +31,21 @@ import org.alfresco.service.namespace.QName;
/** /**
* Workflow Model for a Moderated Invitation * 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 // 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 // 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 // tasks
public static final QName WF_START_TASK = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "moderatedInvitationSubmitTask"); public static final QName WF_START_TASK = QName.createQName(NAMESPACE_URI, "moderatedInvitationSubmitTask");
public static final QName WF_REVIEW_TASK = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI,"moderatedInvitationReviewTask"); public static final QName WF_REVIEW_TASK = QName.createQName(NAMESPACE_URI,"moderatedInvitationReviewTask");
// associations // associations
static final QName ASSOC_GROUP_ASSIGNEE = QName.createQName(NamespaceService.BPM_MODEL_1_0_URI, "groupAssignee"); 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"; public static final String WF_TRANSITION_END = "end";
// workflow properties // 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_USER_NAME = QName.createQName(NAMESPACE_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_ROLE = QName.createQName(NAMESPACE_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_INVITEE_COMMENTS = QName.createQName(NAMESPACE_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_NAME = QName.createQName(NAMESPACE_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_RESOURCE_TYPE= QName.createQName(NAMESPACE_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_REVIEW_COMMENTS= QName.createQName(NAMESPACE_URI, "reviewComments");
public static final QName WF_PROP_REVIEWER= QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "reviewer"); public static final QName WF_PROP_REVIEWER= QName.createQName(NAMESPACE_URI, "reviewer");
// workflow execution context variable names // workflow execution context variable names
public static final String wfVarInviteeUserName = "wf_inviteeUserName"; public static final String wfVarInviteeUserName = "imwf_inviteeUserName";
public static final String wfVarInviteeRole = "wf_inviteeRole"; public static final String wfVarInviteeRole = "imwf_inviteeRole";
public static final String wfVarWorkflowInstanceId = "workflowinstanceid"; public static final String wfVarWorkflowInstanceId = "workflowinstanceid";
public static final String wfVarResourceName = "wf_resourceName"; public static final String wfVarResourceName = "imwf_resourceName";
public static final String wfVarResourceType = "wf_resourceType"; public static final String wfVarResourceType = "imwf_resourceType";
public static final String wfVarReviewer = "wf_reviewer"; public static final String wfVarReviewer = "imwf_reviewer";
public static final String wfVarReviewComments = "wf_reviewComments"; public static final String wfVarReviewComments = "imwf_reviewComments";
} }

View File

@@ -25,25 +25,27 @@
package org.alfresco.repo.invitation; package org.alfresco.repo.invitation;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
/** /**
* Workflow Model for a Nominated Invitation * 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 // 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 // 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 // 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_TO_SITE = QName.createQName(NAMESPACE_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_INVITE_TASK_INVITE_PENDING = QName.createQName(NAMESPACE_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_ACCEPT_INVITE = QName.createQName(NAMESPACE_URI, "acceptInviteTask");
public static final QName WF_TASK_REJECT_INVITE = QName.createQName(NamespaceService.WORKFLOW_MODEL_1_0_URI, "rejectInviteTask"); public static final QName WF_TASK_REJECT_INVITE = QName.createQName(NAMESPACE_URI, "rejectInviteTask");
// transition names // transition names
public static final String WF_TRANSITION_SEND_INVITE = "sendInvite"; 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"; public static final String WF_TRANSITION_REJECT_INVITE_END = "end";
// workflow properties // 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_SERVER_PATH = QName.createQName(NAMESPACE_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_ACCEPT_URL = QName.createQName(NAMESPACE_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_REJECT_URL = QName.createQName(NAMESPACE_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_INVITE_TICKET = QName.createQName(NAMESPACE_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_INVITER_USER_NAME = QName.createQName(NAMESPACE_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_USER_NAME = QName.createQName(NAMESPACE_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_EMAIL = QName.createQName(NAMESPACE_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_FIRSTNAME = QName.createQName(NAMESPACE_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_INVITEE_LASTNAME = QName.createQName(NAMESPACE_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_TYPE = QName.createQName(NAMESPACE_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_RESOURCE_NAME = QName.createQName(NAMESPACE_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_ROLE = QName.createQName(NAMESPACE_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_INVITEE_GEN_PASSWORD = QName.createQName(NAMESPACE_URI, "inviteeGenPassword");
// workflow execution context variable names // workflow execution context variable names
public static final String wfVarInviteeUserName = "wf_inviteeUserName"; public static final String wfVarInviteeUserName = "inwf_inviteeUserName";
public static final String wfVarInviterUserName = "wf_inviterUserName"; public static final String wfVarInviterUserName = "inwf_inviterUserName";
public static final String wfVarResourceName = "wf_resourceName"; public static final String wfVarResourceName = "inwf_resourceName";
public static final String wfVarResourceType = "wf_resourceType"; public static final String wfVarResourceType = "inwf_resourceType";
public static final String wfVarWorkflowInstanceId = "workflowinstanceid"; public static final String wfVarWorkflowInstanceId = "workflowinstanceid";
public static final String wfVarRole = "wf_inviteeRole"; public static final String wfVarRole = "inwf_inviteeRole";
} }

View File

@@ -71,6 +71,8 @@ public interface PropertyDefinition
*/ */
public ClassDefinition getContainerClass(); public ClassDefinition getContainerClass();
public boolean isOverride();
/** /**
* @return true => multi-valued, false => single-valued * @return true => multi-valued, false => single-valued
*/ */