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
36604: ALF-13745: Merged V3.4-BUG-FIX (3.4.10) to V4.0-BUG-FIX (4.0.3) 36602: ALF-13667 Additional OpenOffice mimetypes to be added to the mime-type maps - xls to pdf limit had been commented out - failover.transformer.PdfRenderer.PdfToImage and failover.transformer.PdfBox.PdfToImage should not have been been registered. Introduced an unregisteredBaseContentTransformer. In the case of these two transforms this would not have been a problem, as they were disable anyway due to EXPLICIT setting elsewhere. 36608: First part of ALF-14209 SOLR - does not support query for all stores - dynamic SOLR cores to track a store - NEW, DELETE, and change properties and reload 36635: ALF-13404 for documentlibrary-v2 APIs 36669: Fix issue with rendering multi-valued properties in JSON from server-side JS (from DaveD) 36676: Fix for ALF-14216 Solr Exception when you try to sort folders or files by size. 36692: Fix ALF-12966 - Comments doesn't work on iOS Safari. Anywhere TinyMCE is present does not work correctly e.g. comments, blogs, wiki, HTML content creation. 36693: ALF-14138: Prevent default Surf CMIS content WebScript clashing with Alfreco version (updated Surf libs r1081) 36714: ALF-14224: WorkflowTaskDefinition form-key fetching fixed for multi-instance UserTasks 36721: Fix for ALF-8374 - Simple view: incorrect file type icon for *.page and *.eps files 36726: Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.0-BUG-FIX 36724: Fix for ALF-14207 - cm:link not correctly handled in Share's doclist when users don't have permission 36728: Fix for ALF-14002: "No dashlets listed when customizing Site dashboard for the "Web Site Design Project" sample Share Site " 36732: Merged V3.4-BUG-FIX to V4.0-BUG-FIX 36637: ALF-6162 Thumbnail is not produced for PDFs encoded with JBIG2Decode << Reported problem still exists, but have made improvements see https://issues.alfresco.com/jira/browse/ALF-6162?focusedCommentId=162936&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-162936 >> - PDFRenderer now fails with an exception in more cases, rather than just silently continuing. Specific case was not handling JBig2 images. previously just resulted in a black box) - Handle the font family CIDFontType0 which includes HiddenHorzOCR 36640: ALF-13769: Merged BELARUS/DEV/V3.4-BUG-FIX-2012_05_04 to V3.4-BUG-FIX (3.4.10) 36440: ALF-11956: WCM accessibility Assignment of TinyMCE accessibility hotkeys only to activated RTE between multiple instances is added. Headings and some other related labels within the context of 'Create Web Content Wizard' were shortened and clarified. Fixed some issues related to hidden text for accessibility support in context of IE, which doesn't calculate styles and dimensions that are applied to elements before adding to DOM 36443: ALF-11956: WCM accessibility Added some changes missed in r36440 36645: ALF-13769: Merged DEV/V3.4-BUG-FIX-2012_01_10 to V3.4-BUG-FIX (3.4.10) 33381: ALF-10162: Web Form validation can be bypassed 1. New method was introduced to XFormsBean which allows it to validate the last inserted values. 2. CreateWebContentWizard finds XFormsBean in session and invokes isXformValid. If any validation errors exist it goes back and show the JSF error. 3. xform.js - contains code that removes JSF error as well as the XForms error. This is necessary because we need to clear the JSF error on the Javascript actions 4. container.jsp - includes a div wrapper with the id to be able unambiguously find the JSF error block. 36700: Merged DEV to V3.4-BUG-FIX (Reviewed by Erik) 36450: ALF-12261 : IE8 Specific: It's impossible add relationship type "Parent/Child" The type of the submit button should be set to 'button' in 'new-rmreference.get.html.ftl'. 36702: Merged DEV to V3.4-BUG-FIX (Reviewed by Erik) 36670: ALF-12825: Impossible choose the "Publication Date", the calendar isn't displayed The DatePicker component register a validation handler for the date entry field so that the submit button disables when an invalid date is entered. This handler register with the forms runtime instance. We should create this instance in FormUI_consructor, not is onReady method (form.js), because constructors always in order will be invoked. 36703: Fix for Mac Office 2011 Powerpoint save fails on CIFS. ALF-13615. 36733: Merged V4.0 to V4.0-BUG-FIX 36628: Added ${NOW} variable option for schema bootstrap scripts (see ALF-14174) 36632: Fix last part of ALF-14174: The patch adding timestamps to acl_change_set breaks SOLR tracking - Added ${NOW} to ACL change set timestamp when upgrading: commit_time_ms = ${NOW} 36647: ALF-14190: FSTR is not working - Due to someone updating dependencies without updating the build scripts! 36734: Merged V4.0 to V4.0-BUG-FIX (RECORD ONLY) 36605: ALF-13745: Merged V4.0-BUG-FIX (4.0.3) to V4.0 (4.0.2) 36604: ALF-13745: Merged V3.4-BUG-FIX (3.4.10) to V4.0-BUG-FIX (4.0.3) 36602: ALF-13667 Additional OpenOffice mimetypes to be added to the mime-type maps 36678: Merged BRANCHES/DEV/V4.0-BUG-FIX to BRANCHES/V4.0 36675: Fix for ALF-14216 Solr Exception when you try to sort folders or files by size. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@36737 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,11 +17,12 @@ import org.alfresco.query.PagingResults;
|
||||
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
|
||||
import org.alfresco.service.cmr.model.FileFolderService;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.Path;
|
||||
import org.alfresco.service.cmr.repository.Path.Element;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.repository.Path.Element;
|
||||
import org.alfresco.service.cmr.search.ResultSet;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
@@ -117,7 +118,7 @@ public class HiddenAspect
|
||||
{
|
||||
for(HiddenFileFilter filter : filters)
|
||||
{
|
||||
this.filters.add(new HiddenFileInfoImpl(filter.getFilter(), filter.getVisibility(), filter.getHiddenAttribute()));
|
||||
this.filters.add(new HiddenFileInfoImpl(filter.getFilter(), filter.getVisibility(), filter.getHiddenAttribute(), filter.cascadeHiddenAspect(), filter.cascadeIndexControlAspect()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,29 +142,6 @@ public class HiddenAspect
|
||||
return searchService.query(sp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for nodes in the given store that should be hidden (i.e. match the hidden pattern)
|
||||
* and hides them if they are not already hidden.
|
||||
*
|
||||
* @param storeRef
|
||||
*/
|
||||
public void checkHidden(StoreRef storeRef)
|
||||
{
|
||||
for(HiddenFileInfo filter : filters)
|
||||
{
|
||||
String pattern = filter.getFilter();
|
||||
|
||||
ResultSet rs = searchForName(storeRef, pattern);
|
||||
for(NodeRef nodeRef : rs.getNodeRefs())
|
||||
{
|
||||
if(!hasHiddenAspect(nodeRef))
|
||||
{
|
||||
hideNode(nodeRef, filter.getVisibilityMask());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Integer getClientIndex(Client client)
|
||||
{
|
||||
return client.ordinal();
|
||||
@@ -234,14 +212,14 @@ public class HiddenAspect
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
private HiddenFileInfo isHidden(String path)
|
||||
private HiddenFileInfo isHidden(String name)
|
||||
{
|
||||
// check against all the filters
|
||||
HiddenFileInfo matched = null;
|
||||
|
||||
for(HiddenFileInfo filter : filters)
|
||||
{
|
||||
if(filter.isHidden(path))
|
||||
if(filter.isHidden(name))
|
||||
{
|
||||
matched = filter;
|
||||
break;
|
||||
@@ -255,6 +233,116 @@ public class HiddenAspect
|
||||
{
|
||||
return nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN);
|
||||
}
|
||||
|
||||
private boolean hasIndexControlAspect(NodeRef nodeRef)
|
||||
{
|
||||
return nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INDEX_CONTROL);
|
||||
}
|
||||
|
||||
private void applyHidden(NodeRef nodeRef, HiddenFileInfo filter, int visibilityMask)
|
||||
{
|
||||
if(!filter.cascadeHiddenAspect() && !filter.cascadeIndexControlAspect())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
PagingRequest pagingRequest = new PagingRequest(0, Integer.MAX_VALUE, null);
|
||||
PagingResults<FileInfo> results = fileFolderService.list(nodeRef, true, true, null, null, pagingRequest);
|
||||
List<FileInfo> files = results.getPage();
|
||||
|
||||
// apply the hidden aspect to all folders and folders and then recursively to all sub-folders, unless the sub-folder
|
||||
// already has the hidden aspect applied (it may have been applied for a different pattern).
|
||||
for(FileInfo file : files)
|
||||
{
|
||||
NodeRef childNodeRef = file.getNodeRef();
|
||||
if(filter.cascadeHiddenAspect() && !hasHiddenAspect(childNodeRef))
|
||||
{
|
||||
addHiddenAspect(childNodeRef, visibilityMask);
|
||||
}
|
||||
|
||||
if(filter.cascadeIndexControlAspect() && !hasIndexControlAspect(childNodeRef))
|
||||
{
|
||||
addIndexControlAspect(childNodeRef);
|
||||
}
|
||||
|
||||
if(file.isFolder())
|
||||
{
|
||||
applyHidden(file.getNodeRef(), filter, visibilityMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removeHidden(NodeRef nodeRef)
|
||||
{
|
||||
PagingRequest pagingRequest = new PagingRequest(0, Integer.MAX_VALUE, null);
|
||||
PagingResults<FileInfo> results = fileFolderService.list(nodeRef, true, true, null, null, pagingRequest);
|
||||
List<FileInfo> files = results.getPage();
|
||||
|
||||
for(FileInfo file : files)
|
||||
{
|
||||
String name = (String)nodeService.getProperty(file.getNodeRef(), ContentModel.PROP_NAME);
|
||||
// remove hidden aspect only if it doesn't match a hidden pattern
|
||||
if(isHidden(name) == null)
|
||||
{
|
||||
removeHiddenAspect(file.getNodeRef());
|
||||
removeIndexControlAspect(file.getNodeRef());
|
||||
|
||||
if(file.isFolder())
|
||||
{
|
||||
removeHidden(file.getNodeRef());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private HiddenFileInfo findMatch(NodeRef nodeRef)
|
||||
{
|
||||
HiddenFileInfo ret = null;
|
||||
Path path = null;
|
||||
String name = null;
|
||||
|
||||
OUTER: for(HiddenFileInfo filter : filters)
|
||||
{
|
||||
if(filter.cascadeHiddenAspect() || filter.cascadeIndexControlAspect())
|
||||
{
|
||||
if(path == null)
|
||||
{
|
||||
path = nodeService.getPath(nodeRef);
|
||||
}
|
||||
|
||||
// TODO would be nice to check each part of the path in turn, bailing out if a match is found
|
||||
Iterator<Element> it = path.iterator();
|
||||
while(it.hasNext())
|
||||
{
|
||||
Path.ChildAssocElement elem = (Path.ChildAssocElement)it.next();
|
||||
QName qname = elem.getRef().getQName();
|
||||
if(qname != null)
|
||||
{
|
||||
if(filter.isHidden(qname.getLocalName()))
|
||||
{
|
||||
ret = filter;
|
||||
break OUTER;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(name == null)
|
||||
{
|
||||
name = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
}
|
||||
|
||||
if(filter.isHidden(name))
|
||||
{
|
||||
ret = filter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int getClientVisibilityMask(Client client, Visibility visibility)
|
||||
{
|
||||
@@ -272,6 +360,7 @@ public class HiddenAspect
|
||||
HiddenFileInfo ret = null;
|
||||
// TODO would be nice to check each part of the path in turn, bailing out if a match is found
|
||||
Path path = nodeService.getPath(nodeRef);
|
||||
nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||
|
||||
Iterator<Element> it = path.iterator();
|
||||
while(it.hasNext())
|
||||
@@ -304,6 +393,20 @@ public class HiddenAspect
|
||||
addIndexControlAspect(nodeRef);
|
||||
}
|
||||
|
||||
public void showNode(NodeRef nodeRef, boolean cascade)
|
||||
{
|
||||
removeHiddenAspect(nodeRef);
|
||||
removeIndexControlAspect(nodeRef);
|
||||
|
||||
if(cascade)
|
||||
{
|
||||
for(ChildAssociationRef childRef : nodeService.getChildAssocs(nodeRef))
|
||||
{
|
||||
showNode(childRef.getChildRef(), cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hides the node by applying the hidden and not indexed aspects. The node will be hidden from clients
|
||||
* according to the visibility mask.
|
||||
@@ -318,16 +421,41 @@ public class HiddenAspect
|
||||
addIndexControlAspect(nodeRef);
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches for nodes in the given store that should be hidden (i.e. match the hidden pattern)
|
||||
* and hides them if they are not already hidden.
|
||||
*
|
||||
* @param storeRef
|
||||
*/
|
||||
public void checkHidden(StoreRef storeRef)
|
||||
{
|
||||
for(HiddenFileInfo filter : filters)
|
||||
{
|
||||
String pattern = filter.getFilter();
|
||||
|
||||
ResultSet rs = searchForName(storeRef, pattern);
|
||||
for(NodeRef nodeRef : rs.getNodeRefs())
|
||||
{
|
||||
if(!hasHiddenAspect(nodeRef))
|
||||
{
|
||||
hideNode(nodeRef, filter.getVisibilityMask());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.
|
||||
*
|
||||
* @param fileInfo
|
||||
* @param both if true, will check if the node should not be hidden and remove hidden and index control
|
||||
* aspects if they are present
|
||||
* @return
|
||||
*/
|
||||
public void checkHidden(FileInfoImpl fileInfo, boolean cascade)
|
||||
public void checkHidden(FileInfoImpl fileInfo, boolean both)
|
||||
{
|
||||
NodeRef nodeRef = fileInfo.getNodeRef();
|
||||
HiddenFileInfo hiddenFileInfo = checkHidden(nodeRef, cascade);
|
||||
HiddenFileInfo hiddenFileInfo = checkHidden(nodeRef, both);
|
||||
if(hiddenFileInfo != null)
|
||||
{
|
||||
fileInfo.setHidden(true);
|
||||
@@ -348,97 +476,49 @@ public class HiddenAspect
|
||||
fileInfo.setHidden(true);
|
||||
}
|
||||
|
||||
private void applyHidden(NodeRef nodeRef, int visibilityMask)
|
||||
{
|
||||
PagingRequest pagingRequest = new PagingRequest(0, Integer.MAX_VALUE, null);
|
||||
PagingResults<FileInfo> results = fileFolderService.list(nodeRef, true, true, null, null, pagingRequest);
|
||||
List<FileInfo> files = results.getPage();
|
||||
|
||||
// apply the hidden aspect to all folders and folders and then recursively to all sub-folders, unless the sub-folder
|
||||
// already has the hidden aspect applied (it may have been applied for a different pattern).
|
||||
for(FileInfo file : files)
|
||||
{
|
||||
if(!hasHiddenAspect(file.getNodeRef()))
|
||||
{
|
||||
hideNode(file.getNodeRef(), visibilityMask);
|
||||
}
|
||||
|
||||
if(file.isFolder())
|
||||
{
|
||||
applyHidden(file.getNodeRef(), visibilityMask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removeHidden(NodeRef nodeRef)
|
||||
{
|
||||
PagingRequest pagingRequest = new PagingRequest(0, Integer.MAX_VALUE, null);
|
||||
PagingResults<FileInfo> results = fileFolderService.list(nodeRef, true, true, null, null, pagingRequest);
|
||||
List<FileInfo> files = results.getPage();
|
||||
|
||||
for(FileInfo file : files)
|
||||
{
|
||||
String name = (String)nodeService.getProperty(file.getNodeRef(), ContentModel.PROP_NAME);
|
||||
// remove hidden aspect only if it doesn't match a hidden pattern
|
||||
if(isHidden(name) == null)
|
||||
{
|
||||
removeHiddenAspect(file.getNodeRef());
|
||||
removeIndexControlAspect(file.getNodeRef());
|
||||
|
||||
if(file.isFolder())
|
||||
{
|
||||
removeHidden(file.getNodeRef());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.
|
||||
*
|
||||
* @param fileInfo
|
||||
* @param nodeRef
|
||||
* @param both if true, will check both if the node should not be hidden and remove hidden and index control
|
||||
* aspects if they are present, and if the node should be hidden and add hidden and index control
|
||||
* aspects if they are not present.
|
||||
* @return
|
||||
*/
|
||||
public HiddenFileInfo checkHidden(NodeRef nodeRef, boolean cascade)
|
||||
public HiddenFileInfo checkHidden(NodeRef nodeRef, boolean both)
|
||||
{
|
||||
HiddenFileInfo filter = onHiddenPath(nodeRef);
|
||||
HiddenFileInfo filter = findMatch(nodeRef);
|
||||
if(filter != null)
|
||||
{
|
||||
if(!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN))
|
||||
int visibilityMask = filter.getVisibilityMask();
|
||||
|
||||
if(!hasHiddenAspect(nodeRef))
|
||||
{
|
||||
int visibilityMask = filter.getVisibilityMask();
|
||||
|
||||
// the file matches a pattern, apply the hidden and aspect control aspects
|
||||
addHiddenAspect(nodeRef, visibilityMask);
|
||||
|
||||
if(!nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INDEX_CONTROL))
|
||||
{
|
||||
addIndexControlAspect(nodeRef);
|
||||
}
|
||||
|
||||
if(cascade)
|
||||
{
|
||||
applyHidden(nodeRef, visibilityMask);
|
||||
}
|
||||
}
|
||||
|
||||
if(!hasIndexControlAspect(nodeRef))
|
||||
{
|
||||
addIndexControlAspect(nodeRef);
|
||||
}
|
||||
|
||||
applyHidden(nodeRef, filter, visibilityMask);
|
||||
}
|
||||
else
|
||||
else if(both)
|
||||
{
|
||||
// the file does not match the pattern, ensure that the hidden and index control aspects are not present
|
||||
if(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_HIDDEN))
|
||||
if(hasHiddenAspect(nodeRef))
|
||||
{
|
||||
removeHiddenAspect(nodeRef);
|
||||
}
|
||||
|
||||
if(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_INDEX_CONTROL))
|
||||
if(hasIndexControlAspect(nodeRef))
|
||||
{
|
||||
removeIndexControlAspect(nodeRef);
|
||||
}
|
||||
|
||||
if(cascade)
|
||||
{
|
||||
removeHidden(nodeRef);
|
||||
}
|
||||
removeHidden(nodeRef);
|
||||
}
|
||||
|
||||
return filter;
|
||||
@@ -501,10 +581,14 @@ public class HiddenAspect
|
||||
private Set<Client> clientVisibility = new HashSet<Client>(10);
|
||||
private Set<Client> hiddenAttribute = new HashSet<Client>(10);
|
||||
private int visibilityMask;
|
||||
private boolean cascadeHiddenAspect;
|
||||
private boolean cascadeIndexControlAspect;
|
||||
|
||||
public HiddenFileInfoImpl(String regexp, String visibility, String hiddenAttribute)
|
||||
public HiddenFileInfoImpl(String regexp, String visibility, String hiddenAttribute, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect)
|
||||
{
|
||||
this.filter = Pattern.compile(regexp);
|
||||
this.cascadeHiddenAspect = cascadeHiddenAspect;
|
||||
this.cascadeIndexControlAspect = cascadeIndexControlAspect;
|
||||
setVisibility(visibility);
|
||||
setHiddenAttribute(hiddenAttribute);
|
||||
calculateVisibilityMask();
|
||||
@@ -568,5 +652,15 @@ public class HiddenAspect
|
||||
{
|
||||
return filter.matcher(path).matches();
|
||||
}
|
||||
|
||||
public boolean cascadeHiddenAspect()
|
||||
{
|
||||
return cascadeHiddenAspect;
|
||||
}
|
||||
|
||||
public boolean cascadeIndexControlAspect()
|
||||
{
|
||||
return cascadeIndexControlAspect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user