MT Share - initial checkpoint

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13459 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-03-03 22:25:50 +00:00
parent 8f1fe3f3df
commit b5dbd53461
26 changed files with 6240 additions and 4935 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
* Copyright (C) 2005-2009 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -40,6 +40,7 @@ import org.alfresco.repo.dictionary.RepositoryLocation;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.tenant.TenantAdminService;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
@@ -85,6 +86,7 @@ public class WorkflowDeployer extends AbstractLifecycleBean
private List<Properties> workflowDefinitions;
private List<String> models = new ArrayList<String>();
private List<String> resourceBundles = new ArrayList<String>();
private TenantAdminService tenantAdminService;
private TenantService tenantService;
private NodeService nodeService;
@@ -145,6 +147,16 @@ public class WorkflowDeployer extends AbstractLifecycleBean
this.dictionaryDAO = dictionaryDAO;
}
/**
* Sets the tenant admin service
*
* @param tenantService the tenant admin service
*/
public void setTenantAdminService(TenantAdminService tenantAdminService)
{
this.tenantAdminService = tenantAdminService;
}
/**
* Sets the tenant service
*
@@ -432,6 +444,8 @@ public class WorkflowDeployer extends AbstractLifecycleBean
return null;
}
}, AuthenticationUtil.getSystemUserName());
tenantAdminService.register(this);
}
@Override

View File

@@ -1261,6 +1261,12 @@ public class JBPMEngine extends BPMEngine
public List<WorkflowTask> doInJbpm(JbpmContext context)
{
Session session = context.getSession();
if ((query.getProcessName() != null) && (tenantService.isEnabled()))
{
query.setProcessName(tenantService.getName(query.getProcessName()));
}
Criteria criteria = createTaskQueryCriteria(session, query);
List<TaskInstance> tasks = criteria.list();
@@ -1505,7 +1511,19 @@ public class JBPMEngine extends BPMEngine
{
process = (process == null) ? root.createCriteria("processInstance") : process;
Criteria processDef = process.createCriteria("processDefinition");
processDef.add(Restrictions.eq("name", query.getProcessName().toPrefixString(namespaceService)));
String processName = null;
if (tenantService.isEnabled())
{
QName baseProcessName = tenantService.getBaseName(query.getProcessName(), true);
processName = tenantService.getName(baseProcessName.toPrefixString(namespaceService));
}
else
{
processName = query.getProcessName().toPrefixString(namespaceService);
}
processDef.add(Restrictions.eq("name", processName));
}
return process;