Merged DEV/SWIFT to HEAD

26373: WIP: ALF-7339: RSOLR 009: Index track and build from SOLR
          - track content, track dates, basic sorting
   26388: WIP: ALF-7339: RSOLR 009: Index track and build from SOLR
          - basic tracking of d:text and d:mltext (not dual tokenisation and identifier support)
   26527: WIP ALF-7339: RSOLR 009: Index track and build from SOLR
          - track d:content, d:mltext, d:text
          - start of cross locale search and ordering support int the index (not at query time yet)
          - no dual tokenisation support yet - currently adding all fields for tokenized BOTH
          - .sort needs additional tokenisation support to use a different separator (\u0000 used to indicate locale and split stuff - better toe use {en}woof style with \u0000 split
   26822: ALF-8166: RINF 10: treenode.get.js - tweak to use "childFileFolders"
   26825: ALF-8133: RINF 10: ScriptNode - update "childByNamePath" to use optimised NodeService.getChildByName
   26850: ALF-8133: RINF 10: ScriptNode - update "childByNamePath" to use optimised NodeService.getChildByName
          - follow-on to r26825
   26862: ALF-8110: RINF 10: doclist.get.js - update "path" filter to use DB-based queries (by default)
          - milestone check-in for review and comparison (note: sorting will be pushed down as part of paging support in lower layers)
   26872: Updated SOLR dev env
   26915: ALF-8224: part 1: encapsulate cmis dictionary for SOLR usage
   27017: Javadoc: removed uncommented param
   27018: Added 'namePattern' property to NamedObjectRegistry to enforce naming conventions where required
   27019: CannedQuery interface and related infrastructure
           - Provides basic support for query, sort, filter and page
           - CannedQueryFactory allows more complex implementations where required
           - Should be enough of a starter for tasks requiring miscellaneous queries
           - ALF-7167: Canned queries
   27037: WCM QS Needs the Web-Client, so define the dependency to Eclipse
   27041: Move WCM-QS test setup to a common base class
   27044: Start to conver the WCM QS behaviour from JS to Java
   27080: Added comment section for NodeLocator script declarations
   27081: General cleanup: Removed non-javadocs, empty javadocs, unused code, etc
   27104: Fixed ALF-7476: Typo in output from MMT
   27114: ALF-7479: RSOLR 016: Query Handler
          ALF-7480: RSOLR 017: SOLR result set
          ALF-7481: RSOLR 018: Execute query against SOLR
          - First working stack

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28286 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-06-08 15:38:14 +00:00
parent 8e6c0d9c00
commit 2f697cebb9
82 changed files with 2732 additions and 7275 deletions

View File

@@ -44,7 +44,6 @@ import org.alfresco.repo.security.permissions.impl.SimplePermissionReference;
import org.alfresco.repo.tenant.TenantService;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.AuthorityType;
import org.alfresco.service.namespace.QName;
@@ -66,20 +65,11 @@ public class AclDAOImpl implements AclDAO
{
private static Log logger = LogFactory.getLog(AclDAOImpl.class);
/** Access to QName entities */
private QNameDAO qnameDAO;
/** Access to ACL entities */
private AclCrudDAO aclCrudDAO;
/** Access to Nodes entities */
private NodeDAO nodeDAO;
private TenantService tenantService;
/** a transactionally-safe cache to be injected */
private SimpleCache<Long, AccessControlList> aclCache;
private SimpleCache<Serializable, Set<String>> readersCache;
private enum WriteMode
@@ -152,17 +142,19 @@ public class AclDAOImpl implements AclDAO
this.readersCache = readersCache;
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#createAccessControlList()
/**
* {@inheritDoc}
*/
@Override
public Long createAccessControlList()
{
return createAccessControlList(getDefaultProperties()).getId();
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#getDefaultProperties()
/**
* {@inheritDoc}
*/
@Override
public AccessControlListProperties getDefaultProperties()
{
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
@@ -172,9 +164,10 @@ public class AclDAOImpl implements AclDAO
return properties;
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#createAcl(org.alfresco.repo.security.permissions.AccessControlListProperties)
/**
* {@inheritDoc}
*/
@Override
public Acl createAccessControlList(AccessControlListProperties properties)
{
if (properties == null)
@@ -215,9 +208,10 @@ public class AclDAOImpl implements AclDAO
return createAccessControlList(properties, null, null);
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#createAcl(org.alfresco.repo.security.permissions.AccessControlListProperties, java.util.List, java.lang.Long)
/**
* {@inheritDoc}
*/
@Override
public Acl createAccessControlList(AccessControlListProperties properties, List<AccessControlEntry> aces, Long inherited)
{
if (properties == null)
@@ -347,7 +341,10 @@ public class AclDAOImpl implements AclDAO
return createdAcl;
}
private void getWritable(final Long id, final Long parent, List<? extends AccessControlEntry> exclude, List<Ace> toAdd, Long inheritsFrom, boolean cascade,
private void getWritable(
final Long id, final Long parent,
List<? extends AccessControlEntry> exclude, List<Ace> toAdd,
Long inheritsFrom, boolean cascade,
List<AclChange> changes, WriteMode mode)
{
List<Ace> inherited = null;
@@ -392,18 +389,12 @@ public class AclDAOImpl implements AclDAO
/**
* Make a whole tree of ACLs copy on write if required Includes adding and removing ACEs which can be optimised
* slightly for copy on write (no need to add and then remove)
*
* @param id
* @param parent
* @param exclude
* @param toAdd
* @param inheritsFrom
* @param cascade
* @param depth
* @param changes
*/
private void getWritable(final Long id, final Long parent, List<? extends AccessControlEntry> exclude, List<Ace> toAdd, Long inheritsFrom,
List<Ace> inherited, List<Integer> positions, boolean cascade, int depth, List<AclChange> changes, WriteMode mode, boolean requiresVersion)
private void getWritable(
final Long id, final Long parent,
List<? extends AccessControlEntry> exclude, List<Ace> toAdd, Long inheritsFrom,
List<Ace> inherited, List<Integer> positions,
boolean cascade, int depth, List<AclChange> changes, WriteMode mode, boolean requiresVersion)
{
AclChange current = getWritable(id, parent, exclude, toAdd, inheritsFrom, inherited, positions, depth, mode, requiresVersion);
changes.add(current);
@@ -430,16 +421,11 @@ public class AclDAOImpl implements AclDAO
/**
* COW for an individual ACL
*
* @param id
* @param parent
* @param exclude
* @param toAdd
* @param inheritsFrom
* @param depth
* @return - an AclChange
*/
private AclChange getWritable(final Long id, final Long parent, List<? extends AccessControlEntry> exclude, List<Ace> acesToAdd, Long inheritsFrom,
private AclChange getWritable(
final Long id, final Long parent,
List<? extends AccessControlEntry> exclude, List<Ace> acesToAdd, Long inheritsFrom,
List<Ace> inherited, List<Integer> positions, int depth, WriteMode mode, boolean requiresVersion)
{
AclUpdateEntity acl = aclCrudDAO.getAclForUpdate(id);
@@ -630,10 +616,6 @@ public class AclDAOImpl implements AclDAO
/**
* Helper to remove ACEs from an ACL
*
* @param id
* @param exclude
* @param depth
*/
private void removeAcesFromAcl(final Long id, final List<? extends AccessControlEntry> exclude, final int depth)
{
@@ -747,9 +729,10 @@ public class AclDAOImpl implements AclDAO
addInherited(acl, inherited, positions, depth);
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#deleteAccessControlEntries(java.lang.String)
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> deleteAccessControlEntries(final String authority)
{
List<AclChange> acls = new ArrayList<AclChange>();
@@ -859,9 +842,10 @@ public class AclDAOImpl implements AclDAO
return acls;
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#deleteAclForNode(long, boolean)
/**
* {@inheritDoc}
*/
@Override
public void deleteAclForNode(long aclId, boolean isAVMNode)
{
Acl dbAcl = getAcl(aclId);
@@ -901,9 +885,10 @@ public class AclDAOImpl implements AclDAO
}
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#deleteAccessControlList(java.lang.Long)
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> deleteAccessControlList(final Long id)
{
if (logger.isDebugEnabled())
@@ -1010,6 +995,7 @@ public class AclDAOImpl implements AclDAO
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> deleteLocalAccessControlEntries(Long id)
{
List<AclChange> changes = new ArrayList<AclChange>();
@@ -1023,6 +1009,7 @@ public class AclDAOImpl implements AclDAO
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> deleteInheritedAccessControlEntries(Long id)
{
List<AclChange> changes = new ArrayList<AclChange>();
@@ -1036,6 +1023,7 @@ public class AclDAOImpl implements AclDAO
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> deleteAccessControlEntries(Long id, AccessControlEntry pattern)
{
List<AclChange> changes = new ArrayList<AclChange>();
@@ -1047,6 +1035,7 @@ public class AclDAOImpl implements AclDAO
/**
* {@inheritDoc}
*/
@Override
public Acl getAcl(Long id)
{
return aclCrudDAO.getAcl(id);
@@ -1055,6 +1044,7 @@ public class AclDAOImpl implements AclDAO
/**
* {@inheritDoc}
*/
@Override
public AccessControlListProperties getAccessControlListProperties(Long id)
{
ParameterCheck.mandatory("id", id); // Prevent unboxing failures
@@ -1064,6 +1054,7 @@ public class AclDAOImpl implements AclDAO
/**
* {@inheritDoc}
*/
@Override
public AccessControlList getAccessControlList(Long id)
{
AccessControlList acl = aclCache.get(id);
@@ -1132,9 +1123,10 @@ public class AclDAOImpl implements AclDAO
return acl;
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#getInheritedAccessControlList(java.lang.Long)
/**
* {@inheritDoc}
*/
@Override
public Long getInheritedAccessControlList(Long id)
{
aclCache.remove(id);
@@ -1173,9 +1165,10 @@ public class AclDAOImpl implements AclDAO
return inheritedAclId;
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#mergeInheritedAccessControlList(java.lang.Long, java.lang.Long)
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> mergeInheritedAccessControlList(Long inherited, Long target)
{
// TODO: For now we do a replace - we could do an insert if both inherit from the same acl
@@ -1268,9 +1261,10 @@ public class AclDAOImpl implements AclDAO
return changes;
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#setAccessControlEntry(java.lang.Long, org.alfresco.repo.security.permissions.AccessControlEntry)
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> setAccessControlEntry(final Long id, final AccessControlEntry ace)
{
Acl target = aclCrudDAO.getAcl(id);
@@ -1316,9 +1310,10 @@ public class AclDAOImpl implements AclDAO
return changes;
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#enableInheritance(java.lang.Long, java.lang.Long)
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> enableInheritance(Long id, Long parent)
{
List<AclChange> changes = new ArrayList<AclChange>();
@@ -1364,9 +1359,10 @@ public class AclDAOImpl implements AclDAO
}
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#disableInheritance(java.lang.Long, boolean)
/**
* {@inheritDoc}
*/
@Override
public List<AclChange> disableInheritance(Long id, boolean setInheritedOnAcl)
{
aclCache.remove(id);
@@ -1527,9 +1523,10 @@ public class AclDAOImpl implements AclDAO
}
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#getDbAccessControlListCopy(java.lang.Long, java.lang.Long, org.alfresco.repo.security.permissions.ACLCopyMode)
/**
* {@inheritDoc}
*/
@Override
public Acl getAclCopy(Long toCopy, Long toInheritFrom, ACLCopyMode mode)
{
return getAclEntityCopy(toCopy, toInheritFrom, mode);
@@ -1545,16 +1542,28 @@ public class AclDAOImpl implements AclDAO
return aclCrudDAO.getAcl(id);
}
/**
* {@inheritDoc}
*/
@Override
public List<Long> getAVMNodesByAcl(long aclEntityId, int maxResults)
{
return aclCrudDAO.getAVMNodesByAcl(aclEntityId, maxResults);
}
/**
* {@inheritDoc}
*/
@Override
public List<Long> getADMNodesByAcl(long aclEntityId, int maxResults)
{
return aclCrudDAO.getADMNodesByAcl(aclEntityId, maxResults);
}
/**
* {@inheritDoc}
*/
@Override
public Acl createLayeredAcl(Long indirectedAcl)
{
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
@@ -1655,21 +1664,6 @@ public class AclDAOImpl implements AclDAO
logger.debug("New change set = " + changeSetId);
}
}
else
{
/*
AclChangeSetEntity changeSet = aclCrudDAO.getAclChangeSet((Long)changeSetId);
if (changeSet == null)
{
throw new AlfrescoRuntimeException("Unexpected: missing change set "+changeSetId);
}
if (logger.isDebugEnabled())
{
logger.debug("Existing change set = " + changeSetId);
}
*/
}
return changeSetId;
}
@@ -1846,39 +1840,30 @@ public class AclDAOImpl implements AclDAO
}
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#renameAuthority(java.lang.String, java.lang.String)
/**
* {@inheritDoc}
*/
@Override
public void renameAuthority(String before, String after)
{
aclCrudDAO.renameAuthority(before, after);
aclCache.clear();
}
/* (non-Javadoc)
* @see org.alfresco.repo.domain.permissions.AclDAO#fixSharedAcl(java.lang.Long, java.lang.Long)
/**
* {@inheritDoc}
*/
@Override
public void fixSharedAcl(Long shared, Long defining)
{
Acl definingAcl = null;
if (defining != null)
if (defining == null)
{
definingAcl = aclCrudDAO.getAcl(defining);
}
else
{
throw new IllegalStateException("Null defining acl");
throw new IllegalArgumentException("Null defining acl");
}
Acl sharedAcl = null;
if (shared != null)
if (shared == null)
{
sharedAcl = aclCrudDAO.getAcl(defining);
}
else
{
throw new IllegalStateException("Null shared acl");
throw new IllegalArgumentException("Null shared acl");
}
List<AclChange> changes = new ArrayList<AclChange>();
getWritable(shared, defining, null, null, defining, true, changes, WriteMode.CHANGE_INHERITED);