|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FriendlySelectionService
Service that helps to work with friendly selection. The service allows to encode and decode friendly selection prefixes to and from portal pages. In addition it is possible to generate URLs in a special friendly URL format.
Note that this interface extends Disposable
, it needs
to be disposed explicitly before leaving scope by calls to
Disposable.dispose()
Nested Class Summary | |
---|---|
static interface |
FriendlySelectionService.PathMatchingResult
The result of a path matching operation. |
Method Summary | |
---|---|
SearchableTreeModel<NavigationNode> |
getSearchableTreeModel()
Returns the SearchableTreeModel used to encode and decode
friendly selections. |
FriendlyURLFactory |
getURLFactory()
Returns access to the URL generation functionality for friendly URLs. |
FriendlySelectionService.PathMatchingResult |
matchPathPrefix(java.lang.String friendlyPath,
Identifiable node)
Checks if the friendly path that is passed in as a parameter matches the friendly path that corresponds to the node as a prefix. |
FriendlySelectionService.PathMatchingResult |
matchPathPrefix(java.lang.String friendlyPath,
java.lang.String pathInfo)
Checks if the friendly path that is passed in as a parameter has the given path info as a prefix. |
boolean |
pathEquals(java.lang.String friendlyPath,
Identifiable node)
Checks if the friendly path that is passed in as a parameter matches the friendly path that corresponds to the node. |
boolean |
pathPrefixMatches(java.lang.String friendlyPath,
Identifiable node)
Checks if the friendly path that is passed in as a parameter matches the friendly path that corresponds to the node as a prefix. |
boolean |
resolve(SelectionResult res,
java.lang.String path)
Convenience method that converts the complete path string into a SelectionResult . |
boolean |
resolve(SelectionResult res,
java.lang.String path,
int off,
int len)
Converts from a path to a list of ObjectID of
selections |
boolean |
write(java.io.Writer out,
NavigationNode node)
Encodes the friendly selection string from a node. |
Methods inherited from interface com.ibm.portal.Disposable |
---|
dispose |
Method Detail |
---|
SearchableTreeModel<NavigationNode> getSearchableTreeModel()
Returns the SearchableTreeModel
used to encode and decode
friendly selections. The model will typically be based on the navigation
model for the current user but might differ from it if nodes in the
navigation model are hidden from the friendly name hierarchy.
null
FriendlyURLFactory getURLFactory()
FriendlyURLFactory
is part of the instance of the service and
does not need to be disposed separately.
null
boolean resolve(SelectionResult res, java.lang.String path) throws ModelException
SelectionResult
. See
#resolve(SelectionResult, String, int, int, SearchableTreeModel, Object)
for more details.
The friendly path corresponds to the string generated by the
write(Writer, NavigationNode)
method, i.e. it must contain a
correctly escaped URL prefix.
ModelException
boolean resolve(SelectionResult res, java.lang.String path, int off, int len) throws ModelException
Converts from a path to a list of ObjectID
of
selections
The friendly path corresponds to the string generated by the
write(Writer, NavigationNode)
method, i.e. it must contain a
correctly escaped URL prefix.
res
- bean that contains the resulting list of selectionspath
- path string to decodeoff
- first valid character in the path string, should point to the
starting slashlen
- length of the valid segment
true
, if the complete path could be matched, else
false
ModelException
- -
if the path could not be resolvedboolean write(java.io.Writer out, NavigationNode node) throws java.io.IOException, ModelException
Encodes the friendly selection string from a node. The node must be part
of the TreeModel
returned by
getSearchableTreeModel()
. In case the friendly name cannot be
generated the method returns false
and no output is
written to the writer.
The generated friendly path will be URL escaped, i.e. characters that are not valid for the URL are replaced by their UTF8 based % escapes.
out
- target writer to write the friendly string tonode
- node to encode, not null
java.io.IOException
- -
if the friendly name could not be generated
ModelException
- -
if the model could not be accessedboolean pathEquals(java.lang.String friendlyPath, Identifiable node) throws java.io.IOException, ModelException
Checks if the friendly path that is passed in as a parameter matches the
friendly path that corresponds to the node. If the friendlyPath is
null
or the empty string and the node is not represented
by a friendly path, then this method returns true
.
The friendly path starts with a slash, e.g. /test/page
The friendly path corresponds to the string generated by the
write(Writer, NavigationNode)
method, i.e. it must contain a
correctly escaped URL prefix.
friendlyPath
- path to check, may be null
node
- the identifiable to check for. This node does not necessarily
need to be part of the model. Must not be null
true
if the path matches, else false
java.io.IOException
ModelException
boolean pathPrefixMatches(java.lang.String friendlyPath, Identifiable node) throws java.io.IOException, ModelException
Checks if the friendly path that is passed in as a parameter matches the
friendly path that corresponds to the node as a prefix. If the friendlyPath is
null
or the empty string and the node is not represented
by a friendly path, then this method returns true
.
The friendly path starts with a slash, e.g. /test/page
The friendly path corresponds to the string generated by the
write(Writer, NavigationNode)
method, i.e. it must contain a
correctly escaped URL prefix.
friendlyPath
- path to check, may be null
node
- the identifiable to check for. This node does not necessarily
need to be part of the model. Must not be null
true
if the path matches, else false
java.io.IOException
ModelException
FriendlySelectionService.PathMatchingResult matchPathPrefix(java.lang.String friendlyPath, Identifiable node) throws java.io.IOException, ModelException
Checks if the friendly path that is passed in as a parameter matches the
friendly path that corresponds to the node as a prefix. If the friendlyPath is
null
or the empty string and the node is not represented
by a friendly path, then the path is considered to match.
The friendly path starts with a slash, e.g. /test/page
The friendly path corresponds to the string generated by the
write(Writer, NavigationNode)
method, i.e. it must contain a
correctly escaped URL prefix.
friendlyPath
- path to check, may be null
node
- the identifiable to check for. This node does not necessarily
need to be part of the model. Must not be null
PathMatchingResult
. The PathMatchingResult
contains a flag indicating if the path prefix matches, and a string that represents
the not matching suffix of the path, if one exists.
java.io.IOException
ModelException
FriendlySelectionService.PathMatchingResult matchPathPrefix(java.lang.String friendlyPath, java.lang.String pathInfo) throws java.io.IOException
Checks if the friendly path that is passed in as a parameter has the given path info as a prefix.
The friendly path and path info starts with a slash, e.g. /test/content
friendlyPath
- path to checkpathInfo
- path info string the path should be matched against
PathMatchingResult
. The PathMatchingResult
contains a flag indicating if the path prefix matches, and a string that represents
the not matching suffix of the path, if one exists.
java.io.IOException
ModelException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |