net.ontopia.topicmaps.nav2.utils
Class ContextUtils

java.lang.Object
  extended by net.ontopia.topicmaps.nav2.utils.ContextUtils

public final class ContextUtils
extends java.lang.Object

PUBLIC: Utility methods for working with the variable bindings in the Navigator context.


Method Summary
static TopicMapRepositoryIF getRepository(javax.servlet.ServletContext servletContext)
          EXPERIMENTAL: Gets the topic map repository used by the navigator framework.
static java.lang.Object getSingleValue(java.lang.String name, javax.servlet.jsp.PageContext pageContext)
          PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope.
static java.lang.Object getSingleValue(java.lang.String name, javax.servlet.ServletRequest request)
          PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope.
static TopicMapIF getTopicMap(javax.servlet.jsp.PageContext pageContext)
          EXPERIMENTAL: Get the topic map object the context tag is working with.
static TopicMapIF getTopicMap(javax.servlet.ServletRequest request)
          EXPERIMENTAL: Get the topic map object the context tag is working with.
static java.util.Collection getValue(java.lang.String name, javax.servlet.jsp.PageContext pageContext)
          PUBLIC: Returns the value bound to a specific variable in the current scope.
static java.util.Collection getValue(java.lang.String name, javax.servlet.jsp.PageContext pageContext, java.util.Collection defaultValue)
          PUBLIC: Returns the value bound to a specific variable in the current scope.
static void setSingleValue(java.lang.String name, javax.servlet.jsp.PageContext pageContext, java.lang.Object value)
          PUBLIC: Sets the value of the named variable to a collection consisting only of the single value given.
static void setValue(java.lang.String name, javax.servlet.jsp.PageContext pageContext, java.util.Collection value)
          PUBLIC: Sets the value of the named variable to the collection given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRepository

public static final TopicMapRepositoryIF getRepository(javax.servlet.ServletContext servletContext)
EXPERIMENTAL: Gets the topic map repository used by the navigator framework.

Since:
3.4

getTopicMap

public static TopicMapIF getTopicMap(javax.servlet.ServletRequest request)
EXPERIMENTAL: Get the topic map object the context tag is working with. This method will give direct access to the same transaction as the context tag is using.

Since:
3.4

getTopicMap

public static TopicMapIF getTopicMap(javax.servlet.jsp.PageContext pageContext)
EXPERIMENTAL: Get the topic map object the context tag is working with. This method will give direct access to the same transaction as the context tag is using.

Since:
3.2.1

getValue

public static java.util.Collection getValue(java.lang.String name,
                                            javax.servlet.jsp.PageContext pageContext)
PUBLIC: Returns the value bound to a specific variable in the current scope. The value returned will be null if the variable is unknown.


getValue

public static java.util.Collection getValue(java.lang.String name,
                                            javax.servlet.jsp.PageContext pageContext,
                                            java.util.Collection defaultValue)
PUBLIC: Returns the value bound to a specific variable in the current scope. The value returned will be defaultValue if the variable is unknown.


getSingleValue

public static java.lang.Object getSingleValue(java.lang.String name,
                                              javax.servlet.jsp.PageContext pageContext)
PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope. The value returned will be null if the variable is unknown or if the collection is empty.


getSingleValue

public static java.lang.Object getSingleValue(java.lang.String name,
                                              javax.servlet.ServletRequest request)
PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope. The value returned will be null if the variable is unknown or if the collection is empty.

Since:
2.2.1

setValue

public static void setValue(java.lang.String name,
                            javax.servlet.jsp.PageContext pageContext,
                            java.util.Collection value)
PUBLIC: Sets the value of the named variable to the collection given. The value can be null, which effectively unsets the variable.


setSingleValue

public static void setSingleValue(java.lang.String name,
                                  javax.servlet.jsp.PageContext pageContext,
                                  java.lang.Object value)
PUBLIC: Sets the value of the named variable to a collection consisting only of the single value given.



Copyright © 2000-2012 Ontopia.