Class PublicationPath
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- org.silverpeas.core.util.ContributionPath<NodeDetail>
-
- org.silverpeas.core.node.model.NodePath
-
- org.silverpeas.core.contribution.publication.model.PublicationPath
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<NodeDetail>
,Collection<NodeDetail>
,List<NodeDetail>
,RandomAccess
,ResourcePath<NodeDetail>
public class PublicationPath extends NodePath
The path of a given publication in an application. The path is represented here by a list of nodes, each of them being a path segment of the publication path. The path ended by the publication itself.- Author:
- mmoquillon
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.silverpeas.core.util.ResourcePath
ResourcePath.Constants
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.util.ContributionPath
lastPathByLanguage
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
format(String language, boolean fullSpacePath, String pathSep)
Formats a path from the node that the list contains by using the specified path separator.static PublicationPath
getBestPathForGroup(ContributionIdentifier pubId, String groupId)
Gets the best publication path of the group represented by the given group identifier by taking care about its access authorizations.static PublicationPath
getBestPathForUser(ContributionIdentifier pubId, String userId)
Gets the best publication path of the user represented by the given user identifier by taking care about its access authorizations.PublicationDetail
getContribution()
Gets the contribution aimed by the path.Location
getLocation()
Gets the location of the publication into the component instance aimed by the path.static PublicationPath
getPath(ContributionIdentifier pubId)
Gets a publication path without taking care about right accesses.static PublicationPath
getPath(PublicationDetail pub)
Gets a publication path without taking care about right accesses.int
hashCode()
protected boolean
isRoot(NodeDetail node)
-
Methods inherited from class org.silverpeas.core.node.model.NodePath
getLabel, rootIsComponentInstance
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Methods inherited from interface org.silverpeas.core.util.ResourcePath
format, format
-
-
-
-
Method Detail
-
getBestPathForUser
public static PublicationPath getBestPathForUser(ContributionIdentifier pubId, String userId)
Gets the best publication path of the user represented by the given user identifier by taking care about its access authorizations.- Parameters:
pubId
- theContributionIdentifier
of a publication.userId
- the identifier as string of a user.- Returns:
- an initialized
PublicationPath
.
-
getBestPathForGroup
public static PublicationPath getBestPathForGroup(ContributionIdentifier pubId, String groupId)
Gets the best publication path of the group represented by the given group identifier by taking care about its access authorizations.- Parameters:
pubId
- theContributionIdentifier
of a publication.groupId
- the identifier as string of a group.- Returns:
- an initialized
PublicationPath
.
-
getPath
public static PublicationPath getPath(ContributionIdentifier pubId)
Gets a publication path without taking care about right accesses.The main location of the publication is taken into account.
- Parameters:
pubId
- the publication contribution identifier.- Returns:
- an initialized
PublicationPath
.
-
getPath
public static PublicationPath getPath(PublicationDetail pub)
Gets a publication path without taking care about right accesses.The main location of the publication is taken into account.
- Parameters:
pub
- a publication contribution instance.- Returns:
- an initialized
PublicationPath
.
-
getContribution
public PublicationDetail getContribution()
Gets the contribution aimed by the path.- Returns:
- a
PublicationDetail
instance.
-
getLocation
public Location getLocation()
Gets the location of the publication into the component instance aimed by the path.If the component does not handle topic, a root location on the instance is returned.
- Returns:
- a
Location
instance.
-
isRoot
protected boolean isRoot(NodeDetail node)
-
format
public String format(String language, boolean fullSpacePath, String pathSep)
Description copied from class:ContributionPath
Formats a path from the node that the list contains by using the specified path separator.- Specified by:
format
in interfaceResourcePath<NodeDetail>
- Overrides:
format
in classContributionPath<NodeDetail>
- Parameters:
language
- the aimed translation.fullSpacePath
- if false, the space host is taken into account, if true the space host and all of its parents are taken into account.pathSep
- the path separator to use.- Returns:
- a string.
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceCollection<NodeDetail>
- Specified by:
equals
in interfaceList<NodeDetail>
- Overrides:
equals
in classContributionPath<NodeDetail>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection<NodeDetail>
- Specified by:
hashCode
in interfaceList<NodeDetail>
- Overrides:
hashCode
in classContributionPath<NodeDetail>
-
-