Package net.ontopia.topicmaps.nav2.utils
Class NavigatorUtils
java.lang.Object
net.ontopia.topicmaps.nav2.utils.NavigatorUtils
INTERNAL: A utility class with miscellaneous helper methods used by
the navigator tag-libraries and the framework.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NavigatorApplicationIFgetNavigatorApplication(javax.servlet.jsp.PageContext pageContext) INTERNAL: Gets the navigator application instance belonging to the web application.static NavigatorApplicationIFgetNavigatorApplication(javax.servlet.ServletContext servletContext) INTERNAL: Gets the navigator application instance belonging to the web application.static StringgetStableId(TMObjectIF object) INTERNAL: Returns a stable identifier for the topic map object.static TopicMapRepositoryIFgetTopicMapRepository(javax.servlet.jsp.PageContext pageContext) INTERNAL: Gets the topic map repository used by the web application.static TopicMapRepositoryIFgetTopicMapRepository(javax.servlet.ServletContext servletContext) INTERNAL: Gets the topic map repository used by the web application.static Collectionstring2Collection(String strList) INTERNAL: convert String entries separated by whitespaces to a ordered collection.static Collectionstring2Collection(String strList, String delimiter) INTERNAL: convert String entries separated by whitespaces (default) to a ordered collection.static TMObjectIFstringID2Object(TopicMapIF tm, String s) INTERNAL: Tries to convert a string which should contain a subject identifier, XML ID, or object ID to aTMObjectIFobject in the following order: try to match a subject indicator (tm.getTopicBySubjectIdentifier) try to match a source locator (tm.getObjectByItemIdentifier) try to match a topic id (tm.getObjectById)static TMObjectIFstringID2Object(TopicMapIF tm, String s, DeclarationContextIF context) INTERNAL: Tries to convert a string which should contain a subject identifier, XML ID, or object ID to aTMObjectIFobject in the following order: try to match a subject indicator (tm.getTopicBySubjectIdentifier) try to match a source locator (tm.getObjectByItemIdentifier) try to match a topic id (tm.getObjectById) try to match a subject identifier with a prefix defined in the DeclarationContextIFstatic TopicIFstringID2Topic(TopicMapIF tm, String s) INTERNAL: Tries to convert a string which should contain a subject identifier, XML ID, or object ID to aTopicIFobject in the following order: try to match a subject indicator (tm.getTopicBySubjectIdentifier) try to match a source (tm.getObjectByItemIdentifier) try to match a topic id (tm.getObjectById)static CollectionstringIDs2Topics(TopicMapIF tm, String strList, String delimiter) INTERNAL: Converts from a string of subject identities, source IDs or object IDs separated by spaces (default) to a Collection of topics.
-
Constructor Details
-
NavigatorUtils
public NavigatorUtils()
-
-
Method Details
-
string2Collection
INTERNAL: convert String entries separated by whitespaces to a ordered collection.- Parameters:
strList- delimiter separated list of string entries.
-
string2Collection
INTERNAL: convert String entries separated by whitespaces (default) to a ordered collection.- Parameters:
strList- delimiter separated list of string entries.delimiter- characters which are used to separate the list entries.
-
stringID2Topic
INTERNAL: Tries to convert a string which should contain a subject identifier, XML ID, or object ID to aTopicIFobject in the following order:- try to match a subject indicator (tm.getTopicBySubjectIdentifier)
- try to match a source (tm.getObjectByItemIdentifier)
- try to match a topic id (tm.getObjectById)
- Parameters:
tm- the topic map objects- the String which should be investigated.- Returns:
- A matched topic otherwise null.
-
stringIDs2Topics
INTERNAL: Converts from a string of subject identities, source IDs or object IDs separated by spaces (default) to a Collection of topics.- Parameters:
tm- the topic mapstrList- separated list of identities and/or idsdelimiter- characters which are used to separate the list entries.- Returns:
- A Collection of matched topics in the order they were listed. Arguments that do not match will be ignored.
-
stringID2Object
INTERNAL: Tries to convert a string which should contain a subject identifier, XML ID, or object ID to aTMObjectIFobject in the following order:- try to match a subject indicator (tm.getTopicBySubjectIdentifier)
- try to match a source locator (tm.getObjectByItemIdentifier)
- try to match a topic id (tm.getObjectById)
- Parameters:
tm- the topic map objects- the String which should be investigated.- Returns:
- A matched object, or null.
-
stringID2Object
INTERNAL: Tries to convert a string which should contain a subject identifier, XML ID, or object ID to aTMObjectIFobject in the following order:- try to match a subject indicator (tm.getTopicBySubjectIdentifier)
- try to match a source locator (tm.getObjectByItemIdentifier)
- try to match a topic id (tm.getObjectById)
- try to match a subject identifier with a prefix defined in the DeclarationContextIF
- Parameters:
tm- the topic map objects- the String which should be investigated.context- the context to lookup the prefix in- Returns:
- A matched object, or null.
-
getTopicMapRepository
INTERNAL: Gets the topic map repository used by the web application.- Since:
- 3.1
-
getTopicMapRepository
public static TopicMapRepositoryIF getTopicMapRepository(javax.servlet.ServletContext servletContext) INTERNAL: Gets the topic map repository used by the web application.- Since:
- 3.1
-
getStableId
INTERNAL: Returns a stable identifier for the topic map object. This will either be the fragment of a source locator, or the object ID if no suitable source locator is found.
-