Class HiddenAspect
- java.lang.Object
-
- org.alfresco.repo.model.filefolder.HiddenAspect
-
@AlfrescoPublicApi public class HiddenAspect extends java.lang.ObjectFunctionality relating to hidden files and folders. Support for nodes marked as hidden but with visibility constraints for specific clients. A node can have the hidden aspect applied, which means that the node is hidden. However, for specific clients it can be defined whether the node is visible or will have its hidden attribute set in FileInfo.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHiddenAspect.Visibility
-
Field Summary
Fields Modifier and Type Field Description static java.util.Set<org.alfresco.service.namespace.QName>HIDDEN_PROPERTIES
-
Constructor Summary
Constructors Constructor Description HiddenAspect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckHidden(FileInfo fileInfo, boolean both, boolean checkChildren)Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.booleancheckHidden(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean both, boolean checkChildren)Checks whether the file should be hidden and applies the hidden and not indexed aspects to it and its children (if cascadeHidden == true).voidcheckHidden(org.alfresco.service.cmr.repository.StoreRef storeRef)Searches for nodes in the given store that should be hidden (i.e.org.alfresco.util.FileFilterMode.Client[]getClients()intgetClientVisibilityMask(org.alfresco.util.FileFilterMode.Client client, HiddenAspect.Visibility visibility)getClientVisibilityMapjava.util.List<HiddenFileInfo>getPatterns()HiddenAspect.VisibilitygetVisibility(org.alfresco.util.FileFilterMode.Client client, org.alfresco.service.cmr.repository.NodeRef nodeRef)Gets the visibility constraint for the given client on the given node.booleanhasHiddenAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef)voidhideNode(FileInfoImpl fileInfo, int visibilityMask, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled)Hides the node by applying the hidden and not indexed aspects.voidhideNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled)Hides the node by applying the hidden and not indexed aspects.voidhideNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, int clientVisibilityMask, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled)Hides the node by applying the hidden and not indexed aspects.voidhideNodeExplicit(org.alfresco.service.cmr.repository.NodeRef nodeRef)Mark this node as hidden regardless of any name/pattern/matching rules.voidinit()booleanisClientControlled(org.alfresco.service.cmr.repository.NodeRef nodeRef)HiddenFileInfoonHiddenPath(org.alfresco.service.cmr.repository.NodeRef nodeRef)Checks whether the node is on a hidden pathvoidremoveHidden(org.alfresco.service.cmr.repository.NodeRef nodeRef)voidremoveHiddenAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef)voidsetBehaviourFilter(BehaviourFilter behaviourFilter)voidsetFileFolderService(FileFolderService fileFolderService)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPatterns(java.util.List<HiddenFileFilter> filters)voidsetPolicyComponent(PolicyComponent policyComponent)voidsetSearchService(org.alfresco.service.cmr.search.SearchService searchService)voidshowNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean cascade)Removes the hidden and index contol aspect.voidunhideExplicit(org.alfresco.service.cmr.repository.NodeRef nodeRef)Remove the explicit hiding of a node.
-
-
-
Method Detail
-
setBehaviourFilter
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
-
setPolicyComponent
public void setPolicyComponent(PolicyComponent policyComponent)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setFileFolderService
public void setFileFolderService(FileFolderService fileFolderService)
-
setSearchService
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
-
setPatterns
public void setPatterns(java.util.List<HiddenFileFilter> filters)
-
init
public void init()
-
getPatterns
public java.util.List<HiddenFileInfo> getPatterns()
-
getClients
public org.alfresco.util.FileFilterMode.Client[] getClients()
-
hideNodeExplicit
public void hideNodeExplicit(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Mark this node as hidden regardless of any name/pattern/matching rules. Following this call the node will be hidden. If the node is already hidden will do nothing.- Parameters:
nodeRef- NodeRef
-
unhideExplicit
public void unhideExplicit(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Remove the explicit hiding of a node. Following this call the node may or may not remain hidden based upon the other properties of the node.- Parameters:
nodeRef- NodeRef
-
removeHiddenAspect
public void removeHiddenAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef)
-
hasHiddenAspect
public boolean hasHiddenAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef)
-
removeHidden
public void removeHidden(org.alfresco.service.cmr.repository.NodeRef nodeRef)
-
getClientVisibilityMask
public int getClientVisibilityMask(org.alfresco.util.FileFilterMode.Client client, HiddenAspect.Visibility visibility)getClientVisibilityMap- Parameters:
client- Clientvisibility- Visibility- Returns:
- the client visibilityMask
-
onHiddenPath
public HiddenFileInfo onHiddenPath(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Checks whether the node is on a hidden path- Parameters:
nodeRef- NodeRef- Returns:
- the matching filter, or null if no match
-
hideNode
public void hideNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled)Hides the node by applying the hidden and not indexed aspects. The node will be hidden from all clients.- Parameters:
nodeRef- nodeRefcascadeHiddenAspect- booleancascadeIndexControlAspect- booleanclientControlled- boolean
-
showNode
public void showNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean cascade)Removes the hidden and index contol aspect. Reverses the effect of calling hideNode(NodeRef nodeRef)- Parameters:
nodeRef- the node to showcascade- true to cascade to all descendents of this node
-
hideNode
public void hideNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, int clientVisibilityMask, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled)Hides the node by applying the hidden and not indexed aspects. The node will be hidden from clients according to the visibility mask.- Parameters:
nodeRef- the node to hideclientVisibilityMask- intcascadeHiddenAspect- booleancascadeIndexControlAspect- booleanclientControlled- boolean
-
checkHidden
public void checkHidden(org.alfresco.service.cmr.repository.StoreRef storeRef)
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.- Parameters:
storeRef- StoreRef
-
checkHidden
public boolean checkHidden(FileInfo fileInfo, boolean both, boolean checkChildren)
Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.- Parameters:
fileInfo- FileInfoboth- if true, will check if the node should not be hidden and remove hidden and index control aspects if they are presentcheckChildren- boolean- Returns:
- boolean
-
hideNode
public void hideNode(FileInfoImpl fileInfo, int visibilityMask, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled)
Hides the node by applying the hidden and not indexed aspects. The node will be hidden from clients according to the visibility mask.- Parameters:
fileInfo- file to make hiddenvisibilityMask- intcascadeHiddenAspect- booleancascadeIndexControlAspect- booleanclientControlled- boolean
-
isClientControlled
public boolean isClientControlled(org.alfresco.service.cmr.repository.NodeRef nodeRef)
-
checkHidden
public boolean checkHidden(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean both, boolean checkChildren)Checks whether the file should be hidden and applies the hidden and not indexed aspects to it and its children (if cascadeHidden == true). The visibility mask property will determine visibility for specific clients.Can optionally remove the hidden and index control aspects if the name of a node no longer matches the filter.
- Parameters:
nodeRef- NodeRefboth- 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.checkChildren- boolean- Returns:
- true if the node is hidden, irrespective of the clientVisibility property value.
-
getVisibility
public HiddenAspect.Visibility getVisibility(org.alfresco.util.FileFilterMode.Client client, org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets the visibility constraint for the given client on the given node.- Parameters:
client- ClientnodeRef- NodeRef- Returns:
- the visibility constraint for the given client and node
-
-