|
||||||||||
| 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 String |
DETACH_URL_ELEMENT
|
static String |
FILE_DOWNLOAD_WORKER
|
static String |
PORTAL_URL_SEPARATOR
|
static String |
PORTAL_URL_SUFFIX
|
static int |
RENDER_METHOD
|
static String |
RENDER_URL_ELEMENT
|
static String |
TARGET_URL_ELEMENT
|
static String |
USER_LAYOUT_ROOT_NODE
Used to designate user layout root node in .uP files |
static int |
WORKER_METHOD
|
static String |
WORKER_URL_ELEMENT
|
| Constructor Summary | |
|---|---|
UPFileSpec()
Creates a new UPFileSpec instance with all values being null. |
|
UPFileSpec(HttpServletRequest req)
Construct a .uP file spec object for a .uP file contained in a given request. |
|
UPFileSpec(int method,
String methodNodeId,
String targetNodeId,
String extraElements)
A building constructor. |
|
UPFileSpec(String uPFile)
Construct a .uP file spec object by providing the actual .uP file string |
|
UPFileSpec(UPFileSpec up)
Copy constructor. |
|
| Method Summary | |
|---|---|
protected void |
analyze(String uPFile)
|
static String |
buildUPFile(int method,
String methodNodeId,
String targetNodeId,
String extraElements)
Constructs a .uP file |
static String |
buildUPFileBase(int method,
String methodNodeId,
String targetNodeId,
String extraElements)
Constructs a .uP file, without the suffix (actual ".uP") so it can be extended further. |
protected static String |
buildUPFileBase(String method,
String methodNodeId,
String targetNodeId,
String extraElements)
|
String |
getMethod()
Determine method name |
String |
getMethodNodeId()
Determine Id specified by the method element. |
String |
getTargetNodeId()
Determine Id specified by the "target" element. |
String |
getUPFile()
Get the full .uP file String. |
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(String nodeId)
Set method node id. |
void |
setTargetNodeId(String nodeId)
Set target node id |
void |
setUPFileExtras(String extras)
Set extras to be appended to the spec before the suffix element (".uP") |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String USER_LAYOUT_ROOT_NODE
public static final String TARGET_URL_ELEMENT
public static final String WORKER_URL_ELEMENT
public static final String DETACH_URL_ELEMENT
public static final String RENDER_URL_ELEMENT
public static final String PORTAL_URL_SEPARATOR
public static final String PORTAL_URL_SUFFIX
public static final String FILE_DOWNLOAD_WORKER
public static final int RENDER_METHOD
public static final int WORKER_METHOD
| Constructor Detail |
|---|
public UPFileSpec()
UPFileSpec instance with all values being null.
public UPFileSpec(HttpServletRequest req)
req - a HttpServletRequest valuepublic UPFileSpec(String uPFile)
uPFile - a String valuepublic UPFileSpec(UPFileSpec up)
up - an UPFileSpec value to copy the values from
public UPFileSpec(int method,
String methodNodeId,
String targetNodeId,
String extraElements)
throws PortalException
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 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(String nodeId)
nodeId - a String valuepublic void setTargetNodeId(String nodeId)
nodeId - a String valuepublic void setUPFileExtras(String extras)
extras - a String valuepublic String getMethod()
String method name, null if no method was specified.public String getMethodNodeId()
String method node Id value, null if no method was specified.public String getTargetNodeId()
String target Id value, null if no target was specified.
public String getUPFile()
throws PortalException
String.
String value
PortalExceptionpublic String getUPFileExtras()
String value, null if none were encountered.
public static String buildUPFile(int method,
String methodNodeId,
String targetNodeId,
String extraElements)
throws PortalException
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 String buildUPFileBase(int method,
String methodNodeId,
String targetNodeId,
String extraElements)
throws PortalException
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 String buildUPFileBase(String method,
String methodNodeId,
String targetNodeId,
String extraElements)
throws PortalException
PortalExceptionprotected void analyze(String uPFile)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||