org.locomotive.loco
Class StandardInsertions

java.lang.Object
  |
  +--org.locomotive.loco.StandardInsertions

public class StandardInsertions
extends java.lang.Object

This class has methods which insert some standard variables into the steam substitutions for use in HTML templates. For example, the requester's username, userid, and session id are inserted as USERNAME, USERID, SESSIONID, respectively. The current date and time are also inserted, as DATE, and TIME.


Field Summary
protected static java.text.SimpleDateFormat dateFormat
           
protected static java.text.SimpleDateFormat timeFormat
           
 
Method Summary
static void insertAll(HandlerData hd)
          This method adds all the insertions implemented in the methods in this class.
static java.util.Hashtable insertAll(javax.servlet.ServletRequest req, java.util.Hashtable subs)
          This method adds all the insertions implemented in the methods in this class, for servlets.
static void insertDateTime(HandlerData hd)
          Inserts the current date and time.
static void insertHandlerURL(HandlerData hd)
          Inserts the handler url token, if there is one.
static void insertRequestID(HandlerData hd)
          Inserts the request id for this handler.
static void insertSessionID(HandlerData hd)
          Inserts the current session id.
static void insertSystemTags(HandlerData hd)
          Inserts two tags that unquely identify the Locomotive the that is handling the request.
static void insertUserID(HandlerData hd)
          Inserts the current User's ID.
static void insertUserName(HandlerData hd)
          Insters the current user's name, if the session is not anonymous.
static void insertVersion(HandlerData hd)
          Inserts the current Locomotive Version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateFormat

protected static java.text.SimpleDateFormat dateFormat

timeFormat

protected static java.text.SimpleDateFormat timeFormat
Method Detail

insertAll

public static void insertAll(HandlerData hd)
This method adds all the insertions implemented in the methods in this class. See the other methods for the names and types of these insertions.

insertVersion

public static void insertVersion(HandlerData hd)
Inserts the current Locomotive Version. the version tag is [LOCOMOTIVE_SERVER_VERSION]

insertSessionID

public static void insertSessionID(HandlerData hd)
Inserts the current session id. the session tag is [SESSIONID]

insertUserID

public static void insertUserID(HandlerData hd)
Inserts the current User's ID. The User ID tag is [USERID]

insertUserName

public static void insertUserName(HandlerData hd)
Insters the current user's name, if the session is not anonymous. The user name tag is [USERNAME]

insertHandlerURL

public static void insertHandlerURL(HandlerData hd)
Inserts the handler url token, if there is one. The handler URL tag is [HANDLER_URLTOKEN]

insertDateTime

public static void insertDateTime(HandlerData hd)
Inserts the current date and time. the date tag is [DATE]; the time tag is [TIME]

insertRequestID

public static void insertRequestID(HandlerData hd)
Inserts the request id for this handler. The tage is [REQUEST_ID]

insertSystemTags

public static void insertSystemTags(HandlerData hd)
Inserts two tags that unquely identify the Locomotive the that is handling the request. The tags are [SYSTEM_TAG] which represents the main Locomotive tag, and [SYSTEM_INSTANCE_ID], which is each Locomotive's unique ID. These tags are set in the Locomotive configuration files.

insertAll

public static java.util.Hashtable insertAll(javax.servlet.ServletRequest req,
                                            java.util.Hashtable subs)
This method adds all the insertions implemented in the methods in this class, for servlets. See the other methods for the names and types of these insertions. It inserts the following:
SESSIONID, USERID, USERNAME, REQUEST_ID, LOCOMOTIVE_SERVER_VERSION, SERVLET_API_VERSION, SYSTEM_TAG, SYSTEM_INSTANCE_ID, DATE, TIME, SERVLET_URL_TOKEN, REQUEST_URI, SERVER_INFO.
Parameters:
req - the ServletRequest to pull the info from.
servlet - the Servlet to pull info from.
subs - the subs to insert into.
Returns:
the subs hashtable with the inserted values.