Class HiddenAspect

java.lang.Object
org.alfresco.repo.model.filefolder.HiddenAspect

@AlfrescoPublicApi public class HiddenAspect extends Object
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.
  • Field Details

    • HIDDEN_PROPERTIES

      public static Set<QName> HIDDEN_PROPERTIES
  • Constructor Details

    • HiddenAspect

      public HiddenAspect()
  • Method Details

    • setBehaviourFilter

      public void setBehaviourFilter(BehaviourFilter behaviourFilter)
    • setPolicyComponent

      public void setPolicyComponent(PolicyComponent policyComponent)
    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setFileFolderService

      public void setFileFolderService(FileFolderService fileFolderService)
    • setSearchService

      public void setSearchService(SearchService searchService)
    • setPatterns

      public void setPatterns(List<HiddenFileFilter> filters)
    • init

      public void init()
    • getPatterns

      public List<HiddenFileInfo> getPatterns()
    • getClients

      public FileFilterMode.Client[] getClients()
    • hideNodeExplicit

      public void hideNodeExplicit(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(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(NodeRef nodeRef)
    • hasHiddenAspect

      public boolean hasHiddenAspect(NodeRef nodeRef)
    • removeHidden

      public void removeHidden(NodeRef nodeRef)
    • getClientVisibilityMask

      public int getClientVisibilityMask(FileFilterMode.Client client, HiddenAspect.Visibility visibility)
      getClientVisibilityMap
      Parameters:
      client - Client
      visibility - Visibility
      Returns:
      the client visibilityMask
    • onHiddenPath

      public HiddenFileInfo onHiddenPath(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(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 - nodeRef
      cascadeHiddenAspect - boolean
      cascadeIndexControlAspect - boolean
      clientControlled - boolean
    • showNode

      public void showNode(NodeRef nodeRef, boolean cascade)
      Removes the hidden and index contol aspect. Reverses the effect of calling hideNode(NodeRef nodeRef)
      Parameters:
      nodeRef - the node to show
      cascade - 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 hide
      clientVisibilityMask - int
      cascadeHiddenAspect - boolean
      cascadeIndexControlAspect - boolean
      clientControlled - boolean
    • checkHidden

      public void checkHidden(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 - FileInfo
      both - if true, will check if the node should not be hidden and remove hidden and index control aspects if they are present
      checkChildren - 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 hidden
      visibilityMask - int
      cascadeHiddenAspect - boolean
      cascadeIndexControlAspect - boolean
      clientControlled - boolean
    • isClientControlled

      public boolean isClientControlled(NodeRef nodeRef)
    • checkHidden

      public boolean checkHidden(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 - NodeRef
      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.
      checkChildren - boolean
      Returns:
      true if the node is hidden, irrespective of the clientVisibility property value.
    • getVisibility

      public HiddenAspect.Visibility getVisibility(FileFilterMode.Client client, NodeRef nodeRef)
      Gets the visibility constraint for the given client on the given node.
      Parameters:
      client - Client
      nodeRef - NodeRef
      Returns:
      the visibility constraint for the given client and node