mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V4.0-BUG-FIX to HEAD
37207: BDE-69: Filter more tests for minimal build plan 37253: Fix for ALF-13634 Re-created category won't show up again on a node in Document Library. - also fixes deletion of secondary associations 37265: Merged V4.0 to V4.0-BUG-FIX 37224: ALF-14174: Part 14 for ALF-14237 Upgrades from 4.0.0.x/4..0.1.0 will not fix the timestamps on acl changesets - SOLR will skip ACLs set prior to upgrade - Fix syntax error on Oracle 37250: Fix for ALF-14174 The patch adding timestamps to acl_change_set breaks SOLR tracking - better cross DB fix 37298: ALF-14365 - added hazelcastConfig.xml.sample 37323: ALF-13247: Two nodes with the same primary path. -Fixed by initializing zone before parallel batch processing begins. 37326: ALF-13933 Alfresco needs to be able to support LibreOffice for transformations ALF-13452 Open office startup from Java not working on OSX - Added code to start LibreOffice 3.5 on Mac (requires different options to the command and ure-link is a directory rather than a file on mac) - Removes $DYLD_LIBRARY_PATH from the environment when starting either openoffice or libreoffice on mac so does not need to rely on the installer moving the soffice.bin process to .soffice.bin and then creating a soffice.bin shell script that removed $DYLD_LIBRARY_PATH - Indent TransformerDebug a bit more now we have fail over transformers at the top and lower levels (saves N.N.N.N.N.N getting mixed up with text) 37340: Merged V3.4-BUG-FIX (3.4.10) to V4.0-BUG-FIX (4.0.3) RECORD ONLY 37339: ALF-13452: Merged V4.0-BUG-FIX (4.0.3) to V3.4-BUG-FIX (3.4.10) 37326: ALF-13933 Alfresco needs to be able to support LibreOffice for transformations ALF-13452 Open office startup from Java not working on OSX - Added code to start LibreOffice 3.5 on Mac (requires different options to the command and ure-link is a directory rather than a file on mac) - Removes $DYLD_LIBRARY_PATH from the environment when starting either openoffice or libreoffice on mac so does not need to rely on the installer moving the soffice.bin process to .soffice.bin and then creating a soffice.bin shell script that removed $DYLD_LIBRARY_PATH - Indent TransformerDebug a bit more now we have fail over transformers at the top and lower levels (saves N.N.N.N.N.N getting mixed up with text) 36273: ALF-13933 Alfresco needs to be able to support LibreOffice for transformations - Return a dummy OpenOffice command even when there is no OpenOffice/LibreOffice installed or on the path. 36264: ALF-13933 Alfresco needs to be able to support LibreOffice for transformations - remove old jodconverter-core-3.0-beta-3.diff 36259: ALF-13933 Alfresco needs to be able to support LibreOffice for transformations << Developed on Windows 7. Might need more work on Linux to get LibreOffice to shut down, but should be okay with OpenOffice 3.2 which was used in the previous release. >> - Updated jodconverter to latest version jodconverter-core-3.0-SNAPSHOT-patched.jar 28/4/2012 which is newer than 3.0 beta-4 - Applied patch for http://code.google.com/p/jodconverter/issues/detail?id=103 to handle setting the env for LibreOffice 3.5 - Modified code to use partial GNU style options (not used for -env!) when using LibreOffice - Added OpenOfficeCommandLine to dynamically supply OpenOffice or LibreOffice command line args for OOoDirect - Tested to work with OpenOffice 3.4 and 3.2 on Windows 7 37353: Merged V3.4-BUG-FIX (3.4.10) to V4.0-BUG-FIX (4.0.3) 37352: ALF-13452, ALF-13933 Alfresco needs to be able to support LibreOffice for transformations - Build test failure 37359: New JUnit Rule to support automatic creation and cleanup of Share sites in test code. This is required for an imminent fix to ALF-14345, but I'm checking it in separately in order to merge this general utility. 37360: Fix for ALF-14345. Site Service list method does not recognise sub-types of st:site. 37364: Merged V3.4-BUG-FIX (3.4.10) to V4.0-BUG-FIX (4.0.3) RECORD ONLY (not needed in 4.0.x) 37363: ALF-13452, ALF-13933 Alfresco needs to be able to support LibreOffice for transformations - Build test failure x2 (reference to jodconverter*jar not needed in 4.0.x) 37370: Merged V3.4-BUG-FIX: ALF-11714: Updated WCMQS to ensure all FreeMarker variables output to HTML are protected with ?html to prevent XSS 37382: Translation (DE, IT, JA, NL) updates from Gloria, based on EN rev37081 37384: Fix for ALF-14219 SolrQueryHTTPClient unable to handle long queries (4096 bytes) 37386: Merged V4.0 to V4.0-BUG-FIX 37385: ALF-14238: Fix by Dmitry to correct iteration in ImapUnsubscribedAspectPatch git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@37387 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -52,6 +52,7 @@ import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef.Status;
|
||||
import org.alfresco.service.cmr.repository.Path;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.security.OwnableService;
|
||||
@@ -381,9 +382,40 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
return false;
|
||||
}
|
||||
|
||||
private Collection<Pair<Path, QName>> getCategoryPaths(NodeRef nodeRef, Set<QName> aspects, Map<QName, Serializable> properties)
|
||||
static class CategoryPaths
|
||||
{
|
||||
Collection<Pair<Path, QName>> paths;
|
||||
List<ChildAssociationRef> categoryParents;
|
||||
|
||||
CategoryPaths( Collection<Pair<Path, QName>> paths, List<ChildAssociationRef> categoryParents)
|
||||
{
|
||||
this.paths = paths;
|
||||
this.categoryParents = categoryParents;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the paths
|
||||
*/
|
||||
public Collection<Pair<Path, QName>> getPaths()
|
||||
{
|
||||
return paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the categoryParents
|
||||
*/
|
||||
public List<ChildAssociationRef> getCategoryParents()
|
||||
{
|
||||
return categoryParents;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private CategoryPaths getCategoryPaths(NodeRef nodeRef, Set<QName> aspects, Map<QName, Serializable> properties)
|
||||
{
|
||||
ArrayList<Pair<Path, QName>> categoryPaths = new ArrayList<Pair<Path, QName>>();
|
||||
ArrayList<ChildAssociationRef> categoryParents = new ArrayList<ChildAssociationRef>();
|
||||
|
||||
nodeDAO.setCheckNodeConsistency();
|
||||
for (QName classRef : aspects)
|
||||
@@ -439,13 +471,16 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
{
|
||||
Path.ChildAssocElement cae = (Path.ChildAssocElement) pair.getFirst().last();
|
||||
ChildAssociationRef assocRef = cae.getRef();
|
||||
pair.getFirst().append(new Path.ChildAssocElement(new ChildAssociationRef(assocRef.getTypeQName(), assocRef.getChildRef(), QName.createQName("member"), nodeRef)));
|
||||
ChildAssociationRef categoryParentRef = new ChildAssociationRef(assocRef.getTypeQName(), assocRef.getChildRef(), QName.createQName("member"), nodeRef);
|
||||
pair.getFirst().append(new Path.ChildAssocElement(categoryParentRef));
|
||||
categoryParents.add(categoryParentRef);
|
||||
}
|
||||
}
|
||||
|
||||
return categoryPaths;
|
||||
return new CategoryPaths(categoryPaths, categoryParents);
|
||||
}
|
||||
|
||||
|
||||
private List<Long> preCacheNodes(NodeMetaDataParameters nodeMetaDataParameters)
|
||||
{
|
||||
nodeDAO.setCheckNodeConsistency();
|
||||
@@ -536,26 +571,33 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
|
||||
for(Long nodeId : nodeIds)
|
||||
{
|
||||
Map<QName, Serializable> props = null;
|
||||
Set<QName> aspects = null;
|
||||
|
||||
if (!nodeDAO.exists(nodeId))
|
||||
{
|
||||
// Deleted nodes have no metadata
|
||||
continue;
|
||||
}
|
||||
|
||||
Status status = nodeDAO.getNodeIdStatus(nodeId);
|
||||
NodeRef nodeRef = status.getNodeRef();
|
||||
|
||||
NodeMetaData nodeMetaData = new NodeMetaData();
|
||||
nodeMetaData.setNodeId(nodeId);
|
||||
|
||||
Pair<Long, NodeRef> pair = nodeDAO.getNodePair(nodeId);
|
||||
nodeMetaData.setAclId(nodeDAO.getNodeAclId(nodeId));
|
||||
|
||||
|
||||
if(includeNodeRef)
|
||||
{
|
||||
nodeMetaData.setNodeRef(tenantService.getBaseName(nodeRef, true));
|
||||
}
|
||||
|
||||
if(includeTxnId)
|
||||
{
|
||||
nodeMetaData.setTxnId(nodeDAO.getNodeRefStatus(pair.getSecond()).getDbTxnId());
|
||||
nodeMetaData.setTxnId(status.getDbTxnId());
|
||||
}
|
||||
|
||||
if(status.isDeleted())
|
||||
{
|
||||
rowHandler.processResult(nodeMetaData);
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<QName, Serializable> props = null;
|
||||
Set<QName> aspects = null;
|
||||
|
||||
nodeMetaData.setAclId(nodeDAO.getNodeAclId(nodeId));
|
||||
|
||||
if(includeType)
|
||||
{
|
||||
QName nodeType = nodeDAO.getNodeType(nodeId);
|
||||
@@ -572,7 +614,10 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
|
||||
if(includeProperties)
|
||||
{
|
||||
props = getProperties(nodeId);
|
||||
if(props == null)
|
||||
{
|
||||
props = getProperties(nodeId);
|
||||
}
|
||||
nodeMetaData.setProperties(props);
|
||||
}
|
||||
else
|
||||
@@ -580,7 +625,7 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
nodeMetaData.setProperties(Collections.<QName, Serializable>emptyMap());
|
||||
}
|
||||
|
||||
if(includeAspects)
|
||||
if(includeAspects || includePaths || includeParentAssociations)
|
||||
{
|
||||
aspects = new HashSet<QName>();
|
||||
Set<QName> sourceAspects = nodeDAO.getNodeAspects(nodeId);
|
||||
@@ -595,35 +640,38 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
}
|
||||
nodeMetaData.setAspects(aspects);
|
||||
|
||||
CategoryPaths categoryPaths = new CategoryPaths(new ArrayList<Pair<Path, QName>>(), new ArrayList<ChildAssociationRef>());
|
||||
if(includePaths || includeParentAssociations)
|
||||
{
|
||||
if(props == null)
|
||||
{
|
||||
props = getProperties(nodeId);
|
||||
}
|
||||
categoryPaths = getCategoryPaths(status.getNodeRef(), aspects, props);
|
||||
}
|
||||
|
||||
if(includePaths)
|
||||
{
|
||||
if(props == null)
|
||||
{
|
||||
props = getProperties(nodeId);
|
||||
}
|
||||
Collection<Pair<Path, QName>> categoryPaths = getCategoryPaths(pair.getSecond(), aspects, props);
|
||||
List<Path> directPaths = nodeDAO.getPaths(pair, false);
|
||||
|
||||
Collection<Pair<Path, QName>> paths = new ArrayList<Pair<Path, QName>>(directPaths.size() + categoryPaths.size());
|
||||
List<Path> directPaths = nodeDAO.getPaths(new Pair<Long, NodeRef>(nodeId, status.getNodeRef()), false);
|
||||
|
||||
Collection<Pair<Path, QName>> paths = new ArrayList<Pair<Path, QName>>(directPaths.size() + categoryPaths.getPaths().size());
|
||||
for (Path path : directPaths)
|
||||
{
|
||||
paths.add(new Pair<Path, QName>(path.getBaseNamePath(tenantService), null));
|
||||
}
|
||||
for(Pair<Path, QName> catPair : categoryPaths)
|
||||
for(Pair<Path, QName> catPair : categoryPaths.getPaths())
|
||||
{
|
||||
paths.add(new Pair<Path, QName>(catPair.getFirst().getBaseNamePath(tenantService), catPair.getSecond()));
|
||||
}
|
||||
|
||||
nodeMetaData.setPaths(paths);
|
||||
}
|
||||
|
||||
NodeRef nodeRef = pair.getSecond();
|
||||
|
||||
if(includeNodeRef)
|
||||
{
|
||||
nodeMetaData.setNodeRef(tenantService.getBaseName(nodeRef, true));
|
||||
}
|
||||
|
||||
|
||||
nodeMetaData.setTenantDomain(tenantService.getDomain(nodeRef.getStoreRef().getIdentifier()));
|
||||
|
||||
if(includeChildAssociations)
|
||||
@@ -722,6 +770,10 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
{
|
||||
}
|
||||
});
|
||||
for(ChildAssociationRef ref : categoryPaths.getCategoryParents())
|
||||
{
|
||||
parentAssocs.add(tenantService.getBaseName(ref, true));
|
||||
}
|
||||
|
||||
CRC32 crc = new CRC32();
|
||||
for(ChildAssociationRef car : parentAssocs)
|
||||
@@ -747,7 +799,7 @@ public class SOLRTrackingComponentImpl implements SOLRTrackingComponent
|
||||
if(includeOwner)
|
||||
{
|
||||
// cached in OwnableService
|
||||
nodeMetaData.setOwner(ownableService.getOwner(pair.getSecond()));
|
||||
nodeMetaData.setOwner(ownableService.getOwner(status.getNodeRef()));
|
||||
}
|
||||
|
||||
rowHandler.processResult(nodeMetaData);
|
||||
|
Reference in New Issue
Block a user