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:
Dave Ward
2012-05-22 16:51:44 +00:00
parent 6e6cd1e11b
commit 5245ec7316
17 changed files with 277 additions and 117 deletions

View File

@@ -116,7 +116,7 @@
<value>${content.transformer.failover}</value>
</property>
<property name="transformerDebug">
<ref bean="transformerDebug"></ref>
<ref bean="transformerDebug" />
</property>
</bean>
@@ -276,17 +276,25 @@
<!-- Abstract bean definition defining base definition for all transformers -->
<bean id="baseContentTransformer"
class="org.alfresco.repo.content.transform.AbstractContentTransformer2"
abstract="true"
init-method="register"
parent="unregisteredBaseContentTransformer">
<property name="registry">
<ref bean="contentTransformerRegistry" />
</property>
</bean>
<!-- Abstract bean definition defining base definition for all transformer that are not registered -->
<bean id="unregisteredBaseContentTransformer"
class="org.alfresco.repo.content.transform.AbstractContentTransformer2"
abstract="true"
init-method="register">
<property name="mimetypeService">
<ref bean="mimetypeService" />
</property>
<property name="registry">
<ref bean="contentTransformerRegistry" />
</property>
<property name="transformerDebug">
<ref bean="transformerDebug"></ref>
<ref bean="transformerDebug" />
</property>
<property name="timeoutMs"><value>${content.transformer.default.timeoutMs}</value></property>
<property name="readLimitTimeMs"><value>${content.transformer.default.readLimitTimeMs}</value></property>
@@ -314,11 +322,11 @@
<!-- For this reason they do not extend the baseContentTransformer bean and so will not be registered. -->
<bean id="failover.transformer.PdfRenderer.PdfToImage"
class="org.alfresco.repo.content.transform.PdfToImageContentTransformer"
parent="baseContentTransformer" />
parent="unregisteredBaseContentTransformer" />
<bean id="failover.transformer.PdfBox.PdfToImage"
class="org.alfresco.repo.content.transform.PdfBoxPdfToImageContentTransformer"
parent="baseContentTransformer" />
parent="unregisteredBaseContentTransformer" />
<!-- Content Transformations -->
<bean id="transformer.StringExtracter"

View File

@@ -15,7 +15,7 @@ ALTER TABLE alf_acl_change_set
--FOREACH alf_acl_change_set.id system.upgrade.alf_acl_change_set.batchsize
UPDATE alf_acl_change_set
SET
commit_time_ms = id
commit_time_ms = ${NOW}
WHERE
id >= ${LOWERBOUND} AND id <= ${UPPERBOUND}
;

View File

@@ -17,7 +17,7 @@ ALTER TABLE alf_acl_change_set
--FOREACH alf_acl_change_set.id system.upgrade.alf_acl_change_set.batchsize
UPDATE alf_acl_change_set
SET
commit_time_ms = id
commit_time_ms = ${NOW}
WHERE
id >= ${LOWERBOUND} AND id <= ${UPPERBOUND}
;

View File

@@ -470,3 +470,8 @@ patch.migrateTenantsFromAttrsToTable.result=Processed {0} tenants
patch.remoteCredentialsContainer.description=Patch to add the root folder for Shared Remote Credentials
patch.syncSetDefinitionsContainer.description=Patch to add the root folder for SyncSet Definitions
patch.swsdpPatch.description=Patch to fix up the Sample: Web Site Design Project.
patch.swsdpPatch.success=Successfully patched the Sample: Web Site Design Project.
patch.swsdpPatch.skipped=Skipped, not required.
patch.swsdpPatch.missingSurfConfig=surf-config folder is not present in Sample: Web Site Design Project.

View File

@@ -35,9 +35,11 @@
<property name="visibility" value="webdav,nfs,ftp" />
<property name="hiddenAttribute" value="cifs" />
</bean>
<!-- completely hidden i.e. to all clients -->
<!-- completely hidden i.e. to all clients and does not apply to children -->
<bean class="org.alfresco.repo.model.filefolder.HiddenFileFilter">
<property name="filter" value="surf-config" />
<property name="cascadeHiddenAspect" value="false" />
<property name="cascadeIndexControlAspect" value="false" />
</bean>
</list>
</property>

View File

@@ -3175,4 +3175,15 @@
</list>
</property>
</bean>
<bean id="patch.swsdpPatch" class="org.alfresco.repo.admin.patch.impl.SWSDPPatch" parent="basePatch" >
<property name="id"><value>patch.swsdpPatch</value></property>
<property name="description"><value>patch.swsdpPatch.description</value></property>
<property name="fixesFromSchema"><value>0</value></property>
<property name="fixesToSchema"><value>6007</value></property>
<property name="targetSchema"><value>6008</value></property>
<property name="siteService" ref="siteService" />
<property name="hiddenAspect" ref="hiddenAspect" />
</bean>
</beans>

View File

@@ -1,3 +1,4 @@
# Repository configuration
repository.name=Main Repository
@@ -652,7 +653,7 @@ content.transformer.OpenOffice.mimeTypeLimits.potm.pdf.maxSourceSizeKBytes=1024
content.transformer.OpenOffice.mimeTypeLimits.ppam.pdf.maxSourceSizeKBytes=1024
content.transformer.OpenOffice.mimeTypeLimits.sldx.pdf.maxSourceSizeKBytes=1024
content.transformer.OpenOffice.mimeTypeLimits.sldm.pdf.maxSourceSizeKBytes=1024
content.transformer.OpenOffice.mimeTypeLimits.xls.pdf.maxSourceSizeKBytes=-10240
content.transformer.OpenOffice.mimeTypeLimits.xls.pdf.maxSourceSizeKBytes=10240
content.transformer.OpenOffice.mimeTypeLimits.xlsx.pdf.maxSourceSizeKBytes=1536
content.transformer.OpenOffice.mimeTypeLimits.xltx.pdf.maxSourceSizeKBytes=1536
content.transformer.OpenOffice.mimeTypeLimits.xlsm.pdf.maxSourceSizeKBytes=1536

View File

@@ -19,4 +19,4 @@ version.build=@build-number@
# Schema number
version.schema=6007
version.schema=6008

View File

@@ -1977,6 +1977,12 @@ public class ContentDiskDriver extends AlfrescoTxDiskDriver implements DiskInter
// if ( fstate.hasAccessDateTime())
// netFile.setAccessDate( fstate.getAccessDateTime());
// Set the live file size, if available
if ( fstate.hasFileSize())
netFile.setFileSize( fstate.getFileSize());
}
// Debug

View File

@@ -602,15 +602,19 @@ public class ContentNetworkFile extends NodeRefNetworkFile
// Set modification flag
modified = true;
incrementWriteCount();
// Set the new file size
setFileSize( size);
// Update the modification date/time
// Update the modification date/time and file size
if ( getFileState() != null)
if ( getFileState() != null) {
getFileState().updateModifyDateTime();
getFileState().setFileSize( size);
getFileState().setAllocationSize( size);
}
// DEBUG

View File

@@ -536,7 +536,9 @@ public class ContentSearchContext extends SearchContext
* @return boolean
*/
protected boolean returningPseudoFiles() {
return donePseudoFiles ? true : false;
if ( pseudoList == null)
return false;
return donePseudoFiles ? false : true;
}
/**

View File

@@ -127,9 +127,9 @@ public class PdfToImageContentTransformer extends AbstractContentTransformer2
{
throw new AlfrescoRuntimeException("Unable to create image from pdf file.", e1);
}
catch (IOException e)
catch (Exception e)
{
throw new AlfrescoRuntimeException("Unable to create image from pdf file.", e);
throw new AlfrescoRuntimeException("Unable to create image from pdf file. "+e.getMessage(), e);
}
finally
{

View File

@@ -1139,6 +1139,9 @@ public class SchemaBootstrap extends AbstractLifecycleBean
varAssignments.put("TRUE", "1");
varAssignments.put("FALSE", "0");
}
long now = System.currentTimeMillis();
varAssignments.put("now", new Long(now).toString());
varAssignments.put("NOW", new Long(now).toString());
while(true)
{

View File

@@ -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;
}
}
}

View File

@@ -256,7 +256,7 @@ public class HiddenAspectTest
assertEquals("", 0, results.length());
for(Client client : hiddenAspect.getClients())
{
assertEquals(Visibility.NotVisible, hiddenAspect.getVisibility(client, node));
assertEquals("Client " + client.toString(), Visibility.NotVisible, hiddenAspect.getVisibility(client, node));
}
}
finally

View File

@@ -14,6 +14,8 @@ public class HiddenFileFilter implements InitializingBean
private String filter;
private String visibility;
private String hiddenAttribute;
private boolean cascadeHiddenAspect = true;
private boolean cascadeIndexControlAspect = true;
public HiddenFileFilter()
{
@@ -48,8 +50,28 @@ public class HiddenFileFilter implements InitializingBean
{
this.hiddenAttribute = hiddenAttribute;
}
public void setCascadeHiddenAspect(boolean cascadeHiddenAspect)
{
this.cascadeHiddenAspect = cascadeHiddenAspect;
}
/*
public boolean cascadeHiddenAspect()
{
return cascadeHiddenAspect;
}
public void setCascadeIndexControlAspect(boolean cascadeIndexControlAspect)
{
this.cascadeIndexControlAspect = cascadeIndexControlAspect;
}
public boolean cascadeIndexControlAspect()
{
return cascadeIndexControlAspect;
}
/*
* (non-Javadoc)
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/

View File

@@ -8,6 +8,8 @@ package org.alfresco.repo.model.filefolder;
*/
public interface HiddenFileInfo
{
public boolean cascadeHiddenAspect();
public boolean cascadeIndexControlAspect();
public int getVisibilityMask();
public String getFilter();
public boolean isHidden(String path);