|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.util.DynamicURI
TurbineURI
instead.
This creates a Dynamic URI for use within the Turbine system
If you use this class to generate all of your href tags as well
as all of your URI's, then you will not need to worry about having
session data setup for you or using HttpServletRequest.encodeUrl()
since this class does everything for you.
The above call to getA() would return the String:
<A HREF="http://www.server.com:80/servlets/Turbine/screen=UserScreen&user=jon">Click Here</A>
DynamicURI dui = new DynamicURI (data, "UserScreen" );
dui.setName("Click Here").addPathInfo("user","jon");
dui.getA();
Field Summary | |
protected RunData |
data
Deprecated. The RunData object. |
protected boolean |
hasPathInfo
Deprecated. Fast shortcut to determine if there is any data in the path info. |
protected boolean |
hasQueryData
Deprecated. Fast shortcut to determine if there is any data in the query data. |
static java.lang.String |
HTTP
Deprecated. Use URIConstants.HTTP |
static java.lang.String |
HTTPS
Deprecated. Use URIConstants.HTTPS |
protected static int |
PATH_INFO
Deprecated. P = 0 for path info. |
protected java.util.List |
pathInfo
Deprecated. A List that contains all the path info if any. |
protected static int |
QUERY_DATA
Deprecated. Q = 1 for query data. |
protected java.util.List |
queryData
Deprecated. A List that contains all the query data if any. |
protected boolean |
redirect
Deprecated. Whether we want to redirect or not. |
protected java.lang.String |
reference
Deprecated. #ref |
javax.servlet.http.HttpServletResponse |
res
Deprecated. Servlet response interface. |
protected ServerData |
sd
Deprecated. The ServerData object. |
Constructor Summary | |
DynamicURI()
Deprecated. Default constructor - one of the init methods must be called before use. |
|
DynamicURI(RunData data)
Deprecated. Constructor sets up some variables. |
|
DynamicURI(RunData data,
boolean redirect)
Deprecated. Constructor sets up some variables. |
|
DynamicURI(RunData data,
java.lang.String screen)
Deprecated. Constructor sets up some variables. |
|
DynamicURI(RunData data,
java.lang.String screen,
boolean redirect)
Deprecated. Constructor sets up some variables. |
|
DynamicURI(RunData data,
java.lang.String screen,
java.lang.String action)
Deprecated. Constructor sets up some variables. |
|
DynamicURI(RunData data,
java.lang.String screen,
java.lang.String action,
boolean redirect)
Deprecated. Constructor sets up some variables. |
|
DynamicURI(ServerData sd)
Deprecated. Main constructor for DynamicURI. |
|
DynamicURI(ServerData serverData,
boolean redirect)
Deprecated. Main constructor for DynamicURI. |
|
DynamicURI(ServerData sd,
java.lang.String screen)
Deprecated. Main constructor for DynamicURI. |
|
DynamicURI(ServerData serverData,
java.lang.String screen,
boolean redirect)
Deprecated. Main constructor for DynamicURI. |
|
DynamicURI(ServerData sd,
java.lang.String screen,
java.lang.String action)
Deprecated. Main constructor for DynamicURI. |
|
DynamicURI(ServerData sd,
java.lang.String screen,
java.lang.String action,
boolean redirect)
Deprecated. Main constructor for DynamicURI. |
Method Summary | |
protected void |
add(int type,
ParameterParser pp)
Deprecated. Method for a quick way to add all the parameters in a ParameterParser. |
protected void |
add(int type,
java.lang.String name,
java.lang.String value)
Deprecated. If the type is PATH_INFO , then add name/value to the
pathInfo. |
DynamicURI |
addPathInfo(ParameterParser pp)
Deprecated. Adds a name=value pair for every entry in a ParameterParser object to the path_info string. |
DynamicURI |
addPathInfo(java.lang.String name,
double value)
Deprecated. Adds a name=value pair to the path_info string. |
DynamicURI |
addPathInfo(java.lang.String name,
int value)
Deprecated. Adds a name=value pair to the path_info string. |
DynamicURI |
addPathInfo(java.lang.String name,
long value)
Deprecated. Adds a name=value pair to the path_info string. |
DynamicURI |
addPathInfo(java.lang.String name,
java.lang.Object value)
Deprecated. Adds a name=value pair to the path_info string. |
DynamicURI |
addPathInfo(java.lang.String name,
java.lang.String value)
Deprecated. Adds a name=value pair to the path_info string. |
DynamicURI |
addQueryData(ParameterParser pp)
Deprecated. Adds a name=value pair for every entry in a ParameterParser object to the query string. |
DynamicURI |
addQueryData(java.lang.String name,
double value)
Deprecated. Adds a name=value pair to the query string. |
DynamicURI |
addQueryData(java.lang.String name,
int value)
Deprecated. Adds a name=value pair to the query string. |
DynamicURI |
addQueryData(java.lang.String name,
long value)
Deprecated. Adds a name=value pair to the query string. |
DynamicURI |
addQueryData(java.lang.String name,
java.lang.Object value)
Deprecated. Adds a name=value pair to the query string. |
DynamicURI |
addQueryData(java.lang.String name,
java.lang.String value)
Deprecated. Adds a name=value pair to the query string. |
protected void |
assertInitialized()
Deprecated. Verifies that one of the init() methods has been called |
java.lang.String |
getA(java.lang.String name)
Deprecated. Create an anchor object. |
java.lang.String |
getContextPath()
Deprecated. Gets the context path |
java.lang.String |
getReference()
Deprecated. Gets the reference (#ref). |
java.lang.String |
getScriptName()
Deprecated. Gets the script name (/servlets/Turbine). |
ServerData |
getServerData()
Deprecated. Returns the ServerData used to initialize this DynamicURI. |
java.lang.String |
getServerName()
Deprecated. Gets the server name. |
int |
getServerPort()
Deprecated. Gets the server port. |
java.lang.String |
getServerScheme()
Deprecated. Gets the server scheme (HTTP or HTTPS). |
void |
init(RunData data)
Deprecated. Initialize with a RunData object |
void |
init(ServerData serverData)
Deprecated. Initialize with a ServerData object. |
protected void |
remove(int type,
java.lang.String name)
Deprecated. If the type is PATH_INFO , then remove name/value from the
pathInfo. |
void |
removePathInfo()
Deprecated. Removes all the path info elements. |
void |
removePathInfo(java.lang.String name)
Deprecated. Removes a name=value pair from the path info. |
void |
removeQueryData()
Deprecated. Removes all the query string elements. |
void |
removeQueryData(java.lang.String name)
Deprecated. Removes a name=value pair from the query string. |
protected java.lang.String |
renderPathInfo(java.util.List data)
Deprecated. This method takes a List of key/value arrays and converts it into a URL encoded querystring format. |
protected java.lang.String |
renderQueryString(java.util.List data)
Deprecated. This method takes a List of key/value arrays and converts it into a URL encoded querystring format. |
DynamicURI |
setAction(java.lang.String action)
Deprecated. Sets the action= value for this URL. |
DynamicURI |
setActionEvent(java.lang.String actionName,
java.lang.String eventName)
Deprecated. Sets the action= value for this URL and added eventSubmit_[eventName] to the path_info. |
DynamicURI |
setContextPath(java.lang.String contextPath)
Deprecated. Sets the context path |
DynamicURI |
setReference(java.lang.String reference)
Deprecated. Sets the reference (#ref). |
DynamicURI |
setScreen(java.lang.String screen)
Deprecated. Sets the screen= value for this URL. |
DynamicURI |
setScriptName(java.lang.String name)
Deprecated. Sets the script name (/servlets/Turbine). |
DynamicURI |
setSecure()
Deprecated. Method to specify that a URI should use SSL. |
DynamicURI |
setSecure(int port)
Deprecated. Method to specify that a URI should use SSL. |
void |
setServerData(ServerData serverData)
Deprecated. no replacement. This value is set during initialization and should not be changed. |
DynamicURI |
setServerName(java.lang.String name)
Deprecated. Sets the server name. |
DynamicURI |
setServerPort(int port)
Deprecated. Sets the server port. |
DynamicURI |
setServerScheme(java.lang.String scheme)
Deprecated. Sets the scheme (HTTP or HTTPS). |
java.lang.String |
toString()
Deprecated. Builds the URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl(). |
static java.lang.String |
toString(RunData data)
Deprecated. Given a RunData object, get a URI for the request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String HTTP
public static final java.lang.String HTTPS
protected ServerData sd
protected RunData data
protected java.lang.String reference
public javax.servlet.http.HttpServletResponse res
protected java.util.List pathInfo
protected java.util.List queryData
protected boolean hasPathInfo
protected boolean hasQueryData
protected boolean redirect
protected static final int PATH_INFO
protected static final int QUERY_DATA
Constructor Detail |
public DynamicURI(RunData data)
data
- A Turbine RunData object.public DynamicURI()
public DynamicURI(RunData data, java.lang.String screen)
data
- A Turbine RunData object.screen
- A String with the name of a screen.public DynamicURI(RunData data, java.lang.String screen, java.lang.String action)
data
- A Turbine RunData object.screen
- A String with the name of a screen.action
- A String with the name of an action.public DynamicURI(RunData data, java.lang.String screen, java.lang.String action, boolean redirect)
data
- A Turbine RunData object.screen
- A String with the name of a screen.action
- A String with the name of an action.redirect
- True if it should redirect.public DynamicURI(RunData data, java.lang.String screen, boolean redirect)
data
- A Turbine RunData object.screen
- A String with the name of a screen.redirect
- True if it should redirect.public DynamicURI(RunData data, boolean redirect)
data
- A Turbine RunData object.redirect
- True if it should redirect.public DynamicURI(ServerData sd)
sd
- A ServerData.public DynamicURI(ServerData sd, java.lang.String screen)
sd
- A ServerData.screen
- A String with the name of a screen.public DynamicURI(ServerData sd, java.lang.String screen, java.lang.String action)
sd
- A ServerData.screen
- A String with the name of a screen.action
- A String with the name of an action.public DynamicURI(ServerData sd, java.lang.String screen, java.lang.String action, boolean redirect)
sd
- A ServerData.screen
- A String with the name of a screen.action
- A String with the name of an action.redirect
- True if it should redirect.public DynamicURI(ServerData serverData, java.lang.String screen, boolean redirect)
serverData
- A ServerData.screen
- A String with the name of a screen.redirect
- True if it should redirect.public DynamicURI(ServerData serverData, boolean redirect)
serverData
- A ServerData.redirect
- True if it should redirect.Method Detail |
public void init(RunData data)
data
- RunData instancepublic void init(ServerData serverData)
serverData
- protected void add(int type, java.lang.String name, java.lang.String value)
PATH_INFO
, then add name/value to the
pathInfo.
If the type is QUERY_DATA
, then add name/value to the
queryData.
type
- Type of insertion.name
- A String with the name to add.value
- A String with the value to add.protected void add(int type, ParameterParser pp)
If the type is PATH_INFO
, then add name/value to the
pathInfo.
If the type is QUERY_DATA
, then add name/value to the
queryData.
type
- Type of insertion.pp
- A ParameterParser.public DynamicURI addPathInfo(java.lang.String name, java.lang.Object value)
name
- A String with the name to add.value
- An Object with the value to add.
public DynamicURI addPathInfo(java.lang.String name, java.lang.String value)
name
- A String with the name to add.value
- A String with the value to add.
public DynamicURI addPathInfo(java.lang.String name, double value)
name
- A String with the name to add.value
- A double with the value to add.
public DynamicURI addPathInfo(java.lang.String name, int value)
name
- A String with the name to add.value
- An int with the value to add.
public DynamicURI addPathInfo(java.lang.String name, long value)
name
- A String with the name to add.value
- A long with the value to add.
public DynamicURI addPathInfo(ParameterParser pp)
pp
- A ParameterParser.
public DynamicURI addQueryData(java.lang.String name, java.lang.Object value)
name
- A String with the name to add.value
- An Object with the value to add.
public DynamicURI addQueryData(java.lang.String name, java.lang.String value)
name
- A String with the name to add.value
- A String with the value to add.
public DynamicURI addQueryData(java.lang.String name, double value)
name
- A String with the name to add.value
- A double with the value to add.
public DynamicURI addQueryData(java.lang.String name, int value)
name
- A String with the name to add.value
- An int with the value to add.
public DynamicURI addQueryData(java.lang.String name, long value)
name
- A String with the name to add.value
- A long with the value to add.
public DynamicURI addQueryData(ParameterParser pp)
pp
- A ParameterParser.
public java.lang.String getA(java.lang.String name)
DynamicURI dui = new DynamicURI (data, "UserScreen" );
dui.setName("Click Here").addPathInfo("user","jon");
dui.getA();
would return the String:
<A HREF="http://www.server.com:80/servlets/Turbine/screen=UserScreen&user=jon">Click Here</A>
name
- A String with the name for the anchor.
public java.lang.String getScriptName()
getScriptName
in interface URI
public java.lang.String getContextPath()
getContextPath
in interface URI
public java.lang.String getReference()
getReference
in interface URI
public java.lang.String getServerName()
getServerName
in interface URI
public int getServerPort()
getServerPort
in interface URI
public java.lang.String getServerScheme()
getServerScheme
in interface URI
protected void remove(int type, java.lang.String name)
If the type is PATH_INFO
, then remove name/value from the
pathInfo.
If the type is QUERY_DATA
, then remove name/value from the
queryData.
type
- Type of removal.name
- A String with the name to be removed.public void removePathInfo()
public void removePathInfo(java.lang.String name)
name
- A String with the name to be removed.public void removeQueryData()
public void removeQueryData(java.lang.String name)
name
- A String with the name to be removed.protected java.lang.String renderPathInfo(java.util.List data)
data
- A List of key/value arrays.
protected java.lang.String renderQueryString(java.util.List data)
data
- A List of key/value arrays.
public DynamicURI setAction(java.lang.String action)
By default it adds the information to the path_info instead of the query data.
action
- A String with the action value.
public DynamicURI setActionEvent(java.lang.String actionName, java.lang.String eventName)
actionName
- name of the action to calleventName
- name of the event.
public DynamicURI setScreen(java.lang.String screen)
By default it adds the information to the path_info instead of the query data.
screen
- A String with the screen value.
public DynamicURI setScriptName(java.lang.String name)
name
- A String with the script name.
public DynamicURI setContextPath(java.lang.String contextPath)
contextPath
- A String with the servlet context path
public DynamicURI setReference(java.lang.String reference)
reference
- A String containing the reference.
public DynamicURI setServerName(java.lang.String name)
name
- A String with the server name.
public DynamicURI setServerPort(int port)
port
- An int with the port.
public DynamicURI setSecure()
public DynamicURI setSecure(int port)
port
- An int with the port number.
public DynamicURI setServerScheme(java.lang.String scheme)
scheme
- A String with the scheme.
public java.lang.String toString()
The above call to toString() would return the String:
DynamicURI dui = new DynamicURI (data, "UserScreen" );
dui.addPathInfo("user","jon");
dui.toString();
http://www.server.com/servlets/Turbine/screen/UserScreen/user/jon
public static java.lang.String toString(RunData data)
data
- A Turbine RunData object.
public ServerData getServerData()
public void setServerData(ServerData serverData)
serverData
- A ServerData used to initialize this DynamicURI.protected void assertInitialized()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |