Class HiddenAspect
java.lang.Object
org.alfresco.repo.model.filefolder.HiddenAspect
Functionality 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 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckHidden(FileInfo fileInfo, boolean both, boolean checkChildren) Checks whether the file should be hidden and applies the hidden and not indexed aspects if so.booleancheckHidden(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(StoreRef storeRef) Searches for nodes in the given store that should be hidden (i.e.intgetClientVisibilityMask(FileFilterMode.Client client, HiddenAspect.Visibility visibility) getClientVisibilityMapgetVisibility(FileFilterMode.Client client, NodeRef nodeRef) Gets the visibility constraint for the given client on the given node.booleanhasHiddenAspect(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(NodeRef nodeRef, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled) Hides the node by applying the hidden and not indexed aspects.voidhideNode(NodeRef nodeRef, int clientVisibilityMask, boolean cascadeHiddenAspect, boolean cascadeIndexControlAspect, boolean clientControlled) Hides the node by applying the hidden and not indexed aspects.voidhideNodeExplicit(NodeRef nodeRef) Mark this node as hidden regardless of any name/pattern/matching rules.voidinit()booleanisClientControlled(NodeRef nodeRef) onHiddenPath(NodeRef nodeRef) Checks whether the node is on a hidden pathvoidremoveHidden(NodeRef nodeRef) voidremoveHiddenAspect(NodeRef nodeRef) voidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetFileFolderService(FileFolderService fileFolderService) voidsetNodeService(NodeService nodeService) voidsetPatterns(List<HiddenFileFilter> filters) voidsetPolicyComponent(PolicyComponent policyComponent) voidsetSearchService(SearchService searchService) voidRemoves the hidden and index contol aspect.voidunhideExplicit(NodeRef nodeRef) Remove the explicit hiding of a node.
-
Field Details
-
HIDDEN_PROPERTIES
-
-
Constructor Details
-
HiddenAspect
public HiddenAspect()
-
-
Method Details
-
setBehaviourFilter
-
setPolicyComponent
-
setNodeService
-
setFileFolderService
-
setSearchService
-
setPatterns
-
init
public void init() -
getPatterns
-
getClients
-
hideNodeExplicit
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
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
-
hasHiddenAspect
-
removeHidden
-
getClientVisibilityMask
public int getClientVisibilityMask(FileFilterMode.Client client, HiddenAspect.Visibility visibility) getClientVisibilityMap- Parameters:
client- Clientvisibility- Visibility- Returns:
- the client visibilityMask
-
onHiddenPath
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(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
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(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
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
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
-
checkHidden
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
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
-