Class Location

  • All Implemented Interfaces:
    Serializable, Cloneable, ComponentResourceIdentifier, ResourceIdentifier

    public class Location
    extends NodePK
    Location of a publication. The location of a publication is the node in a tree of nodes in which is located the publication. This is for Silverpeas components that use nodes to organize the publications they manage into a tree view.

    The location concept here comes from the filesystem: a publication can be located only at a given location and any others locations from which the publication can be accessed is said to be virtual, that is to say to be an alias, a shortcut to the original location. This is useful to restrict the node concept to the folder or directory one and to reified this constrain.

    See Also:
    Serialized Form
    • Constructor Detail

      • Location

        public Location​(String nodeId,
                        String instanceId)
        Constructs a new location for a publication.
        Parameters:
        nodeId - the unique identifier of a node.
        instanceId - the unique identifier of the component instance that uses the node to organize the publications.
    • Method Detail

      • setAsAlias

        public void setAsAlias​(String userId,
                               Date date)
      • setAsAlias

        public void setAsAlias​(String userId)
      • isNode

        public boolean isNode​(NodeDetail nodeDetail)
        Is this location matches the specified node in a given component instance?
        Parameters:
        nodeDetail - a node in a component instance.
        Returns:
        true if this location matches exactly the specified node. False otherwise.
      • isAlias

        public boolean isAlias()
        Is this location actually an alias to the publication.
        Returns:
        true if this location is in fact a shortcut to the publication in its true location. If false, then this location represents the true position of the publication. Then only move can be used to relocate the publication.
      • getPubOrder

        public int getPubOrder()
        Gets the order of this publication among other publications in the same location.
        Returns:
        the order of the publication in this location.
      • setPubOrder

        public void setPubOrder​(int pubOrder)
        Sets the order of the publication among others ones in this location.
        Parameters:
        pubOrder - a new order of the publication in this location.
      • equals

        public boolean equals​(Object other)
        Description copied from class: NodePK
        Check if an another object is equal to this object
        Overrides:
        equals in class NodePK
        Parameters:
        other - the object to compare to this NodePK
        Returns:
        true if other is equals to this object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Description copied from class: NodePK
        Returns a hash code for the key
        Overrides:
        hashCode in class NodePK
        Returns:
        A hash code for this object
        See Also:
        Object.hashCode()