net.ontopia.topicmaps.webed.impl.utils
Class TagUtils

java.lang.Object
  extended by net.ontopia.topicmaps.webed.impl.utils.TagUtils

public final class TagUtils
extends Object

INTERNAL: Utilities used by the tag classes.


Field Summary
protected static String VELOCITY_TEMPLATE_PATH
          The default location where the velocity templates are stored in.
 
Constructor Summary
TagUtils()
           
 
Method Summary
static ActionDataSet createActionDataSet(javax.servlet.jsp.PageContext pageContext)
           
static String createRequestId()
          INTERNAL: Creates a new request ID, guaranteed to be unique throughout the lifetime of the web application (that is, until server restart).
static List deserializeParameters(List parameters, TopicMapIF topicmap)
           
static List evaluateParameterList(javax.servlet.jsp.PageContext pageContext, String params)
          INTERNAL: Evaluates a string of space-separated variable names as a list of collections, and returns it.
static ActionDataSet getActionDataSet(javax.servlet.jsp.PageContext pageContext)
          INTERNAL: Retrieves the action data set for the current form.
static String getActionGroup(javax.servlet.jsp.PageContext pageContext)
          Gets the name of the action group as an attribute value (residing in the page scope).
static String getActionID(javax.servlet.jsp.PageContext pageContext, String action_name, String group_name, Set value)
          INTERNAL: Utility for attaching an ID to an action.
static ActionRegistryIF getActionRegistry(javax.servlet.jsp.PageContext pageContext)
          Gets the action registry object from application scope.
static ActionRegistryIF getActionRegistry(javax.servlet.ServletRequest request)
           
static FormTag getCurrentFormTag(javax.servlet.ServletRequest request)
           
static NamedLockManager getNamedLockManager(javax.servlet.ServletContext servletContext)
           
static LockResult getReadOnlyLock(javax.servlet.http.HttpServletRequest request)
           
static String getRequestId(javax.servlet.jsp.PageContext pageContext)
           
static Map getSchemaRegistry(javax.servlet.ServletContext servletContext)
           
static TMObjectIF getTMObject(javax.servlet.jsp.PageContext pageContext, String obj_name)
          Gets the topic map object from the given obj_name by requesting the context manager retrieved by the given pageContext.
static org.apache.velocity.VelocityContext getVelocityContext(javax.servlet.jsp.PageContext pageContext)
           
protected static org.apache.velocity.app.VelocityEngine getVelocityEngine(javax.servlet.ServletContext scontext)
           
static boolean isComponentReadOnly(javax.servlet.jsp.PageContext pageContext, String compReadOnlyAttr)
           
static boolean isComponentReadOnly(javax.servlet.ServletRequest request, boolean componentIsReadOnly)
           
static boolean isFormReadOnly(javax.servlet.ServletRequest request)
          INTERNAL: Returns true if the form is read-only.
static ActionData makeActionData(javax.servlet.jsp.PageContext pageContext, String action_name, String group_name, String params)
          INTERNAL: Creates an ActionData wrapper for the given action and parameters.
static void processWithVelocity(javax.servlet.jsp.PageContext pageContext, String template_file, Writer writer, org.apache.velocity.VelocityContext vc)
           
static String registerData(javax.servlet.jsp.PageContext pageContext, String action_name, String group_name, List paramlist, List sub_actions, Set value)
          INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.
static String registerData(javax.servlet.jsp.PageContext pageContext, String action_name, String group_name, List paramlist, Set value)
          INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.
static String registerData(javax.servlet.jsp.PageContext pageContext, String action_name, String group_name, String params, List sub_actions, Set value)
          INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.
static String registerData(javax.servlet.jsp.PageContext pageContext, String action_name, String group_name, String params, Set value)
          INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.
static String registerData(javax.servlet.jsp.PageContext pageContext, String action_name, String group_name, String params, Set value, boolean run_if_no_changes)
          INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.
static List serializeParameters(List parameters)
           
static void setActionGroup(javax.servlet.jsp.PageContext pageContext, String actionGroup)
          Sets the name of the action group (an attribute is set in the page scope).
static void setCurrentFormTag(javax.servlet.ServletRequest request, FormTag tag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VELOCITY_TEMPLATE_PATH

protected static final String VELOCITY_TEMPLATE_PATH
The default location where the velocity templates are stored in.

See Also:
Constant Field Values
Constructor Detail

TagUtils

public TagUtils()
Method Detail

getActionGroup

public static String getActionGroup(javax.servlet.jsp.PageContext pageContext)
Gets the name of the action group as an attribute value (residing in the page scope).


setActionGroup

public static void setActionGroup(javax.servlet.jsp.PageContext pageContext,
                                  String actionGroup)
Sets the name of the action group (an attribute is set in the page scope).


getTMObject

public static TMObjectIF getTMObject(javax.servlet.jsp.PageContext pageContext,
                                     String obj_name)
                              throws javax.servlet.jsp.JspTagException
Gets the topic map object from the given obj_name by requesting the context manager retrieved by the given pageContext.

Throws:
javax.servlet.jsp.JspTagException

getSchemaRegistry

public static Map getSchemaRegistry(javax.servlet.ServletContext servletContext)

getNamedLockManager

public static NamedLockManager getNamedLockManager(javax.servlet.ServletContext servletContext)

getActionRegistry

public static ActionRegistryIF getActionRegistry(javax.servlet.ServletRequest request)
                                          throws javax.servlet.jsp.JspTagException
Throws:
javax.servlet.jsp.JspTagException

getActionID

public static String getActionID(javax.servlet.jsp.PageContext pageContext,
                                 String action_name,
                                 String group_name,
                                 Set value)
                          throws javax.servlet.jsp.JspTagException
INTERNAL: Utility for attaching an ID to an action.

Throws:
javax.servlet.jsp.JspTagException

evaluateParameterList

public static List evaluateParameterList(javax.servlet.jsp.PageContext pageContext,
                                         String params)
                                  throws javax.servlet.jsp.JspTagException
INTERNAL: Evaluates a string of space-separated variable names as a list of collections, and returns it.

Throws:
javax.servlet.jsp.JspTagException

registerData

public static String registerData(javax.servlet.jsp.PageContext pageContext,
                                  String action_name,
                                  String group_name,
                                  String params,
                                  Set value)
                           throws javax.servlet.jsp.JspTagException
INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.

Throws:
javax.servlet.jsp.JspTagException

registerData

public static String registerData(javax.servlet.jsp.PageContext pageContext,
                                  String action_name,
                                  String group_name,
                                  String params,
                                  Set value,
                                  boolean run_if_no_changes)
                           throws javax.servlet.jsp.JspTagException
INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.

Throws:
javax.servlet.jsp.JspTagException

registerData

public static String registerData(javax.servlet.jsp.PageContext pageContext,
                                  String action_name,
                                  String group_name,
                                  String params,
                                  List sub_actions,
                                  Set value)
                           throws javax.servlet.jsp.JspTagException
INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.

Throws:
javax.servlet.jsp.JspTagException

registerData

public static String registerData(javax.servlet.jsp.PageContext pageContext,
                                  String action_name,
                                  String group_name,
                                  List paramlist,
                                  Set value)
                           throws javax.servlet.jsp.JspTagException
INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.

Throws:
javax.servlet.jsp.JspTagException

registerData

public static String registerData(javax.servlet.jsp.PageContext pageContext,
                                  String action_name,
                                  String group_name,
                                  List paramlist,
                                  List sub_actions,
                                  Set value)
                           throws javax.servlet.jsp.JspTagException
INTERNAL: Creates the field name used by a particular action and registers the data used by the action in the user session.

Throws:
javax.servlet.jsp.JspTagException

makeActionData

public static ActionData makeActionData(javax.servlet.jsp.PageContext pageContext,
                                        String action_name,
                                        String group_name,
                                        String params)
                                 throws javax.servlet.jsp.JspTagException
INTERNAL: Creates an ActionData wrapper for the given action and parameters.

Parameters:
params - A whitespace-separated list of navigator variable names
Throws:
javax.servlet.jsp.JspTagException

createRequestId

public static String createRequestId()
INTERNAL: Creates a new request ID, guaranteed to be unique throughout the lifetime of the web application (that is, until server restart).


getActionDataSet

public static ActionDataSet getActionDataSet(javax.servlet.jsp.PageContext pageContext)
INTERNAL: Retrieves the action data set for the current form.


createActionDataSet

public static ActionDataSet createActionDataSet(javax.servlet.jsp.PageContext pageContext)

getVelocityContext

public static org.apache.velocity.VelocityContext getVelocityContext(javax.servlet.jsp.PageContext pageContext)

getVelocityEngine

protected static org.apache.velocity.app.VelocityEngine getVelocityEngine(javax.servlet.ServletContext scontext)

processWithVelocity

public static void processWithVelocity(javax.servlet.jsp.PageContext pageContext,
                                       String template_file,
                                       Writer writer,
                                       org.apache.velocity.VelocityContext vc)

getActionRegistry

public static ActionRegistryIF getActionRegistry(javax.servlet.jsp.PageContext pageContext)
                                          throws javax.servlet.jsp.JspTagException
Gets the action registry object from application scope.

Throws:
javax.servlet.jsp.JspTagException

getRequestId

public static String getRequestId(javax.servlet.jsp.PageContext pageContext)

isFormReadOnly

public static boolean isFormReadOnly(javax.servlet.ServletRequest request)
INTERNAL: Returns true if the form is read-only.

Parameters:
request - The current request object
Returns:
a boolean object indicating whether the form is read-only or not

getReadOnlyLock

public static LockResult getReadOnlyLock(javax.servlet.http.HttpServletRequest request)

isComponentReadOnly

public static boolean isComponentReadOnly(javax.servlet.ServletRequest request,
                                          boolean componentIsReadOnly)

isComponentReadOnly

public static boolean isComponentReadOnly(javax.servlet.jsp.PageContext pageContext,
                                          String compReadOnlyAttr)

getCurrentFormTag

public static FormTag getCurrentFormTag(javax.servlet.ServletRequest request)

setCurrentFormTag

public static void setCurrentFormTag(javax.servlet.ServletRequest request,
                                     FormTag tag)

serializeParameters

public static List serializeParameters(List parameters)

deserializeParameters

public static List deserializeParameters(List parameters,
                                         TopicMapIF topicmap)


Copyright © 2000-2012 Ontopia.