Merged V3.1 to HEAD

13265: Fix incorrect wiring of guest user name
   13266: Merged V2.1A to V3.1
      13252: Fix ADB-159: Generation of content model xml throws exception
   13267: Remove accidental addition of folders
   13280: IndexTransactionTracker logging changes
   13281: Added bean to push properties from repository properties into the VM properties
   13283: Added forgotten Hibernate diff file after JAWS-223 fix
   13291: Fix ETHREEOH-1340: Alfresco Repository Draft CMIS Implementation" link refers to localhost
   13297: Fix ETHREEOH-885: workflow mapAuthorityToName tests don't handle sub-classed objects correctly.
   13308: First part of JAWS-215 - permission migration from V2.1-A to V3.1
   13313: Build fix for 2.1-A to 3.1 ACL patch
   ___________________________________________________________________
   Modified: svn:mergeinfo
      Merged /alfresco/BRANCHES/V2.1-A:r13252
      Merged /alfresco/BRANCHES/V3.1:r13265-13267,13277-13283,13286,13289,13291,13295,13297,13308-13313


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13615 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-03-12 22:23:39 +00:00
parent 198ebe371e
commit c27b80dd53
13 changed files with 2051 additions and 1703 deletions

View File

@@ -32,6 +32,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.jscript.ScriptNode;
import org.alfresco.repo.security.authority.AuthorityDAO;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.workflow.WorkflowException;
import org.alfresco.service.namespace.QName;
import org.dom4j.Element;
@@ -50,6 +51,7 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
{
private static final long serialVersionUID = 1025667849552265719L;
private ServiceRegistry services;
private DictionaryService dictionaryService;
private AuthorityDAO authorityDAO;
private Element actor;
@@ -63,6 +65,7 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
protected void initialiseHandler(BeanFactory factory)
{
services = (ServiceRegistry)factory.getBean(ServiceRegistry.SERVICE_REGISTRY);
dictionaryService = services.getDictionaryService();
authorityDAO = (AuthorityDAO)factory.getBean("authorityDAO");
}
@@ -162,6 +165,10 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
if (node instanceof ScriptNode)
{
String actor = mapAuthorityToName((ScriptNode)node, true);
if (actor == null)
{
throw new WorkflowException("pooledactors expression does not evaluate to a collection of authorities");
}
actors.add(actor);
}
}
@@ -218,15 +225,16 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
{
String name = null;
QName type = authority.getQNameType();
if (type.equals(ContentModel.TYPE_PERSON))
if (dictionaryService.isSubClass(type, ContentModel.TYPE_PERSON))
{
name = (String)authority.getProperties().get(ContentModel.PROP_USERNAME);
}
else if (type.equals(ContentModel.TYPE_AUTHORITY))
else if (allowGroup && dictionaryService.isSubClass(type, ContentModel.TYPE_AUTHORITY_CONTAINER))
{
name = authorityDAO.getAuthorityName(authority.getNodeRef());
}
else if (allowGroup && type.equals(ContentModel.TYPE_AUTHORITY_CONTAINER))
else if (type.equals(ContentModel.TYPE_AUTHORITY))
{
name = authorityDAO.getAuthorityName(authority.getNodeRef());
}

View File

@@ -2576,7 +2576,8 @@ public class JBPMEngine extends BPMEngine
{
String name = null;
QName type = nodeService.getType(authority);
if (type.equals(ContentModel.TYPE_PERSON))
if (dictionaryService.isSubClass(type, ContentModel.TYPE_PERSON))
{
name = (String)nodeService.getProperty(authority, ContentModel.PROP_USERNAME);
}