mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged 5.0.N (5.0.3) to HEAD (5.1)
110822: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.3) 110619: Merged V4.2.5 (4.2.5) to V4.2-BUG-FIX (4.2.6) 110422: Merged DEV to V4.2.5 (4.2.5) 110332: MNT-14151 : CMIS Upload/Create in 4.2 adds the sys:hidden and cm:indexControl Aspect to documents starting with a period - added system property in order to enable/disable cmis hidden behavior git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@110935 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.repo.model.filefolder;
|
||||
|
||||
/**
|
||||
* Represents configurable hidden file information, based on which some filename
|
||||
* patterns will be hidden or not depending the client
|
||||
*
|
||||
* @author Andreea Dragoi
|
||||
* @since 4.2.5
|
||||
*/
|
||||
|
||||
public interface ConfigurableHiddenFileInfo extends HiddenFileInfo
|
||||
{
|
||||
public boolean isCmisDisableHideConfig();
|
||||
public void setCmisDisableHideConfig(boolean cmisDisableHideConfig);
|
||||
|
||||
}
|
@@ -165,7 +165,7 @@ public class HiddenAspect
|
||||
{
|
||||
for(HiddenFileFilter filter : filters)
|
||||
{
|
||||
this.filters.add(new HiddenFileInfoImpl(filter.getFilter(), filter.getVisibility(), filter.getHiddenAttribute(), filter.cascadeHiddenAspect(), filter.cascadeIndexControlAspect()));
|
||||
this.filters.add(new HiddenFileInfoImpl(filter.getFilter(), filter.getVisibility(), filter.getHiddenAttribute(), filter.cascadeHiddenAspect(), filter.cascadeIndexControlAspect(), filter.isCmisDisableHideConfig()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,6 +527,13 @@ public class HiddenAspect
|
||||
|
||||
OUTER: for(HiddenFileInfo filter : filters)
|
||||
{
|
||||
if (Client.cmis.equals(FileFilterMode.getClient()) && filter instanceof ConfigurableHiddenFileInfo)
|
||||
{
|
||||
if (((ConfigurableHiddenFileInfo) filter).isCmisDisableHideConfig())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(filter.cascadeHiddenAspect() || filter.cascadeIndexControlAspect())
|
||||
{
|
||||
if(path == null)
|
||||
@@ -943,7 +950,7 @@ public class HiddenAspect
|
||||
return ret;
|
||||
}
|
||||
|
||||
private class HiddenFileInfoImpl implements HiddenFileInfo
|
||||
private class HiddenFileInfoImpl implements ConfigurableHiddenFileInfo
|
||||
{
|
||||
private Pattern filter;
|
||||
private Set<Client> clientVisibility = new HashSet<Client>(10);
|
||||
@@ -951,6 +958,7 @@ public class HiddenAspect
|
||||
private int visibilityMask;
|
||||
private boolean cascadeHiddenAspect;
|
||||
private boolean cascadeIndexControlAspect;
|
||||
private boolean cmisDisableHideConfig;
|
||||
|
||||
public HiddenFileInfoImpl(String regexp, String visibility, String hiddenAttribute, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect)
|
||||
{
|
||||
@@ -961,6 +969,12 @@ public class HiddenAspect
|
||||
setHiddenAttribute(hiddenAttribute);
|
||||
calculateVisibilityMask();
|
||||
}
|
||||
|
||||
public HiddenFileInfoImpl(String regexp, String visibility, String hiddenAttribute, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean cmisDisableHideConfig)
|
||||
{
|
||||
this(regexp,visibility,hiddenAttribute, cascadeHiddenAspect, cascadeIndexControlAspect);
|
||||
this.cmisDisableHideConfig = cmisDisableHideConfig;
|
||||
}
|
||||
|
||||
private void setVisibility(String visibility)
|
||||
{
|
||||
@@ -1036,5 +1050,15 @@ public class HiddenAspect
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isCmisDisableHideConfig()
|
||||
{
|
||||
return cmisDisableHideConfig;
|
||||
}
|
||||
|
||||
public void setCmisDisableHideConfig(boolean cmisDisableHideConfig)
|
||||
{
|
||||
this.cmisDisableHideConfig = cmisDisableHideConfig;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ public class HiddenFileFilter implements InitializingBean
|
||||
private String hiddenAttribute;
|
||||
private boolean cascadeHiddenAspect = true;
|
||||
private boolean cascadeIndexControlAspect = true;
|
||||
private boolean cmisDisableHideConfig;
|
||||
|
||||
public HiddenFileFilter()
|
||||
{
|
||||
@@ -70,7 +71,16 @@ public class HiddenFileFilter implements InitializingBean
|
||||
{
|
||||
return cascadeIndexControlAspect;
|
||||
}
|
||||
|
||||
public void setCmisDisableHideConfig(boolean cmisDisableHideConfig)
|
||||
{
|
||||
this.cmisDisableHideConfig = cmisDisableHideConfig;
|
||||
}
|
||||
|
||||
public boolean isCmisDisableHideConfig()
|
||||
{
|
||||
return cmisDisableHideConfig;
|
||||
}
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
|
||||
|
Reference in New Issue
Block a user