|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.UPFileSpec
public class UPFileSpec
This helper class allows for easy access to the information contained in the ever-changing uP file URL spec. The uP file syntax is likely to change often, therefore we encourage developers to use this class instead of trying to parse the uP file on your own.
Note: in case you're wondering what in the world "uP file" is, take a look at the portal URLs. The context path ends with a file-like specification that always has ".uP" at the end ... that's what we call a "uP" file. It is used to provide information on how different requests should be processed.
Current uP file syntax looks like this: "[tag.tagId.]{method}.methodId.[target.targetId.][*.]uP",
where "[]" denote optional expressions and "{}" choice-defined expressions. The "{method}" field, at the moment has
two choices: "render" and "worker".
uPortal will assume that the .uP file spec is always well-formed, so don't try to construct it on your own, use
baseActionURL or one of the workerActionURLs.
| Field Summary | |
|---|---|
static java.lang.String |
DETACH_URL_ELEMENT
|
static java.lang.String |
FILE_DOWNLOAD_WORKER
|
(package private) java.lang.String |
method
|
(package private) java.lang.String |
methodNodeId
|
static java.lang.String |
PORTAL_URL_SEPARATOR
|
static java.lang.String |
PORTAL_URL_SUFFIX
|
static int |
RENDER_METHOD
|
static java.lang.String |
RENDER_URL_ELEMENT
|
static java.lang.String |
TAG_URL_ELEMENT
|
(package private) java.lang.String |
tagId
|
static java.lang.String |
TARGET_URL_ELEMENT
|
(package private) java.lang.String |
targetNodeId
|
(package private) java.lang.String |
uPFile_extras
|
static int |
WORKER_METHOD
|
static java.lang.String |
WORKER_URL_ELEMENT
|
| Constructor Summary | |
|---|---|
UPFileSpec()
Creates a new UPFileSpec instance with all values being null. |
|
UPFileSpec(javax.servlet.http.HttpServletRequest req)
Construct a .uP file spec object for a .uP file contained in a given request. |
|
UPFileSpec(java.lang.String uPFile)
Construct a .uP file spec object by providing the actual .uP file string |
|
UPFileSpec(java.lang.String tagId,
int method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
A building constructor. |
|
UPFileSpec(UPFileSpec up)
Copy constructor. |
|
| Method Summary | |
|---|---|
protected void |
analyze(java.lang.String uPFile)
|
static java.lang.String |
buildUPFile(java.lang.String tagId,
int method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
Constructs a .uP file |
static java.lang.String |
buildUPFileBase(java.lang.String tagId,
int method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
Constructs a .uP file, without the suffix (actual ".uP") so it can be extended further. |
protected static java.lang.String |
buildUPFileBase(java.lang.String tagId,
java.lang.String method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
|
java.lang.String |
getMethod()
Determine method name |
java.lang.String |
getMethodNodeId()
Determine Id specified by the method element. |
java.lang.String |
getTagId()
Returns a tag identifier. |
java.lang.String |
getTargetNodeId()
Determine Id specified by the "target" element. |
java.lang.String |
getUPFile()
Get the full .uP file String. |
java.lang.String |
getUPFileExtras()
Returns a "cleaned-up" version of the uP file with all known fields such as tag, method, and target, removed. |
void |
setMethod(int method)
Set a method. |
void |
setMethodNodeId(java.lang.String nodeId)
Set method node id. |
void |
setTagId(java.lang.String id)
Set a tag id |
void |
setTargetNodeId(java.lang.String nodeId)
Set target node id |
void |
setUPFileExtras(java.lang.String extras)
Set extras to be appended to the spec before the suffix element (".uP") |
private static java.lang.String |
sinkTokenization(java.util.StringTokenizer st,
java.lang.String delimiter,
java.lang.String initialValue)
Sinks tokens back into a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TAG_URL_ELEMENT
public static final java.lang.String TARGET_URL_ELEMENT
public static final java.lang.String WORKER_URL_ELEMENT
public static final java.lang.String DETACH_URL_ELEMENT
public static final java.lang.String RENDER_URL_ELEMENT
public static final java.lang.String PORTAL_URL_SEPARATOR
public static final java.lang.String PORTAL_URL_SUFFIX
public static final java.lang.String FILE_DOWNLOAD_WORKER
public static final int RENDER_METHOD
public static final int WORKER_METHOD
java.lang.String tagId
java.lang.String method
java.lang.String methodNodeId
java.lang.String targetNodeId
java.lang.String uPFile_extras
| Constructor Detail |
|---|
public UPFileSpec()
UPFileSpec instance with all values being null.
public UPFileSpec(javax.servlet.http.HttpServletRequest req)
req - a HttpServletRequest valuepublic UPFileSpec(java.lang.String uPFile)
uPFile - a String valuepublic UPFileSpec(UPFileSpec up)
up - an UPFileSpec value to copy the values from
public UPFileSpec(java.lang.String tagId,
int method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
throws PortalException
tagId - a tag id String value (can be null)method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. RENDER_METHOD or WORKER_METHOD)methodNodeId - a method node id String value (required value, can not be null)targetNodeId - a target id String value (can be null)extraElements - a String to be incorporated into the file name before the suffix (".uP"). These values will be available from the getUPFileExtras() result when .uP file is parsed. (can be null)
PortalException - if an invalid method code is passed or no methodNodeId is present.| Method Detail |
|---|
public void setTagId(java.lang.String id)
id - a String value
public void setMethod(int method)
throws PortalException
method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. RENDER_METHOD or WORKER_METHOD)
PortalException - if an invalid method id is passed.public void setMethodNodeId(java.lang.String nodeId)
nodeId - a String valuepublic void setTargetNodeId(java.lang.String nodeId)
nodeId - a String valuepublic void setUPFileExtras(java.lang.String extras)
extras - a String valuepublic java.lang.String getTagId()
String tag value, null if no tag was specified.public java.lang.String getMethod()
String method name, null if no method was specified.public java.lang.String getMethodNodeId()
String method node Id value, null if no method was specified.public java.lang.String getTargetNodeId()
String target Id value, null if no target was specified.
public java.lang.String getUPFile()
throws PortalException
String.
String value
PortalExceptionpublic java.lang.String getUPFileExtras()
String value, null if none were encountered.
public static java.lang.String buildUPFile(java.lang.String tagId,
int method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
throws PortalException
tagId - a tag id String value (can be null)method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. RENDER_METHOD or WORKER_METHOD)methodNodeId - a method node id String value (required value, can not be null)targetNodeId - a target id String value (can be null)extraElements - a String to be incorporated into the file name before the suffix (".uP"). These values will be available from the getUPFileExtras() result when .uP file is parsed. (can be null)
String value
PortalException - if an invalid method code is passed or no methodNodeId is present.
public static java.lang.String buildUPFileBase(java.lang.String tagId,
int method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
throws PortalException
tagId - a tag id String value (can be null)method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. RENDER_METHOD or WORKER_METHOD)methodNodeId - a method node id String value (required value, can not be null)targetNodeId - a target id String value (can be null)extraElements - a String to be incorporated into the file name before the suffix (".uP"). These values will be available from the getUPFileExtras() result when .uP file is parsed. (can be null)
String value
PortalException - if an invalid method code is passed or no methodNodeId is present.
protected static java.lang.String buildUPFileBase(java.lang.String tagId,
java.lang.String method,
java.lang.String methodNodeId,
java.lang.String targetNodeId,
java.lang.String extraElements)
throws PortalException
PortalExceptionprotected void analyze(java.lang.String uPFile)
private static java.lang.String sinkTokenization(java.util.StringTokenizer st,
java.lang.String delimiter,
java.lang.String initialValue)
st - a StringTokenizer valuedelimiter - a String delimeter value used to produce the tokenizationinitialValue - a String value to which to append remaining tokens
String value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||