mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
17363: Fix to DbNodeServiceImple to allow restored nodes. 17384: Minor comments 17451: Fix ETHREEOH-2751 / ETWOONE-340 - specialising a node through an action doesn't set default values from model 17459: ETHREEOH-2391 - Invite pending task now has lots of properties 17465: Repo side fix for ETHREEOH-3010: Inbound and outbound Mltext multiple property are not converted correctly 17478: Fix ETHREEOH-3340 - WCM - Revert to snapshot failure (fix AVM getListing -> AVNSync compare -> WCM revertSnapshot) 17483: (record only) Merged V3.1 to V3.2 (record-only) 17482: (record-only) due to earlier back-merge 17493: Fix for ETHREEOH-3342: index.recovery.mode example is incorrect 17494: Fix for ETHREEOH-3027: missingFullTextReindexTrigger (from index-recovery-context.xml) job does not work. 17510: Fix for ETHREEOH-1147: Indexing large indices can lead to Java Heap space. 17511: Fix for ETHREEOH-1271: It is possible to add one category more than one time to the same content or space 17513: ETHREEOH_3366: Altered DictionaryDAOImpl so that passing a null QName into getType and getAspect does not result in an NPE 17531: ETHREEOH-1186: Corrected rssfeed.get.js so a user can configure a RSS Feed dashlet that has been placed on their own dashboard 17550: ETHREEOH-2317: Rule not fired when document has no content 17556: Fixed ETHREEOH-1229: Can't delete space that contains "translation without content" 17558: Fix for ETHREEOH-3356: Forms fail to persist if property or association name has an _ (underscore) in it 17572: Changed caching of person NodeRefs so that duplicates are detected better 17573: Fixed UTF-8 for file with encoded chars 17576: LockAcquisitionException message specific to failed release of taken-over lock ___________________________________________________________________ Modified: svn:mergeinfo Merged /alfresco/BRANCHES/V3.2:r17363,17384,17451,17459,17465,17478,17483,17493-17494,17510-17511,17513,17531,17550,17556,17558,17572-17573,17576 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18140 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,19 +31,19 @@ import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.cache.SimpleCache;
|
||||
import org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor;
|
||||
import org.alfresco.repo.node.NodeServicePolicies;
|
||||
import org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy;
|
||||
import org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy;
|
||||
import org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy;
|
||||
import org.alfresco.repo.policy.JavaBehaviour;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||
@@ -141,7 +141,7 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
private PermissionsManager permissionsManager;
|
||||
|
||||
/** a transactionally-safe cache to be injected */
|
||||
private SimpleCache<String, Map<String, NodeRef>> personCache;
|
||||
private SimpleCache<String, Set<NodeRef>> personCache;
|
||||
|
||||
/** People Container ref cache (Tennant aware) */
|
||||
private Map<String, NodeRef> peopleContainerRefs = new ConcurrentHashMap<String, NodeRef>(4);
|
||||
@@ -190,12 +190,18 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
PropertyCheck.mandatory(this, "aclDao", aclDao);
|
||||
PropertyCheck.mandatory(this, "homeFolderManager", homeFolderManager);
|
||||
|
||||
this.policyComponent
|
||||
.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onCreateNode"), ContentModel.TYPE_PERSON, new JavaBehaviour(this, "onCreateNode"));
|
||||
this.policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "beforeDeleteNode"), ContentModel.TYPE_PERSON, new JavaBehaviour(this,
|
||||
"beforeDeleteNode"));
|
||||
this.policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"), ContentModel.TYPE_PERSON, new JavaBehaviour(this,
|
||||
"onUpdateProperties"));
|
||||
this.policyComponent.bindClassBehaviour(
|
||||
OnCreateNodePolicy.QNAME,
|
||||
ContentModel.TYPE_PERSON,
|
||||
new JavaBehaviour(this, "onCreateNode"));
|
||||
this.policyComponent.bindClassBehaviour(
|
||||
BeforeDeleteNodePolicy.QNAME,
|
||||
ContentModel.TYPE_PERSON,
|
||||
new JavaBehaviour(this, "beforeDeleteNode"));
|
||||
this.policyComponent.bindClassBehaviour(
|
||||
OnUpdatePropertiesPolicy.QNAME,
|
||||
ContentModel.TYPE_PERSON,
|
||||
new JavaBehaviour(this, "onUpdateProperties"));
|
||||
}
|
||||
|
||||
public UserNameMatcher getUserNameMatcher()
|
||||
@@ -254,7 +260,7 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
* @param personCache
|
||||
* a transactionally safe cache
|
||||
*/
|
||||
public void setPersonCache(SimpleCache<String, Map<String, NodeRef>> personCache)
|
||||
public void setPersonCache(SimpleCache<String, Set<NodeRef>> personCache)
|
||||
{
|
||||
this.personCache = personCache;
|
||||
}
|
||||
@@ -346,30 +352,32 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
private NodeRef getPersonOrNull(String searchUserName)
|
||||
{
|
||||
String cacheKey = searchUserName.toLowerCase();
|
||||
Map<String, NodeRef> allRefs = this.personCache.get(cacheKey);
|
||||
Set<NodeRef> allRefs = this.personCache.get(cacheKey);
|
||||
if (allRefs == null)
|
||||
{
|
||||
List<ChildAssociationRef> childRefs = nodeService.getChildAssocs(getPeopleContainer(),
|
||||
ContentModel.ASSOC_CHILDREN, QName.createQName("cm", searchUserName.toLowerCase(),
|
||||
namespacePrefixResolver), false);
|
||||
allRefs = new LinkedHashMap<String, NodeRef>(childRefs.size() * 2);
|
||||
List<ChildAssociationRef> childRefs = nodeService.getChildAssocs(
|
||||
getPeopleContainer(),
|
||||
ContentModel.ASSOC_CHILDREN,
|
||||
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, searchUserName.toLowerCase()),
|
||||
false);
|
||||
allRefs = new LinkedHashSet<NodeRef>(childRefs.size() * 2);
|
||||
// add to cache
|
||||
personCache.put(cacheKey, allRefs);
|
||||
|
||||
for (ChildAssociationRef childRef : childRefs)
|
||||
{
|
||||
NodeRef nodeRef = childRef.getChildRef();
|
||||
Serializable value = nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
||||
String realUserName = DefaultTypeConverter.INSTANCE.convert(String.class, value);
|
||||
allRefs.put(realUserName, nodeRef);
|
||||
allRefs.add(nodeRef);
|
||||
}
|
||||
}
|
||||
List<NodeRef> refs = new ArrayList<NodeRef>(allRefs.size());
|
||||
for (Entry<String, NodeRef> entry : allRefs.entrySet())
|
||||
for (NodeRef nodeRef : allRefs)
|
||||
{
|
||||
if (userNameMatcher.matches(searchUserName, entry.getKey()))
|
||||
Serializable value = nodeService.getProperty(nodeRef, ContentModel.PROP_USERNAME);
|
||||
String realUserName = DefaultTypeConverter.INSTANCE.convert(String.class, value);
|
||||
if (userNameMatcher.matches(searchUserName, realUserName))
|
||||
{
|
||||
refs.add(entry.getValue());
|
||||
refs.add(nodeRef);
|
||||
}
|
||||
}
|
||||
NodeRef returnRef = null;
|
||||
@@ -836,10 +844,8 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
|
||||
// Policies
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void onCreateNode(ChildAssociationRef childAssocRef)
|
||||
{
|
||||
@@ -854,10 +860,8 @@ public class PersonServiceImpl extends TransactionListenerAdapter implements Per
|
||||
homeFolderManager.onCreateNode(childAssocRef);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy#beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef)
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void beforeDeleteNode(NodeRef nodeRef)
|
||||
{
|
||||
|
Reference in New Issue
Block a user