| java.lang.Object org.jasig.portal.UPFileSpec
UPFileSpec | public class UPFileSpec (Code) | | 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 workerActionURL s.
author: Peter Kharchenko pkharchenko@interactivebusiness.com" version: $Revision: 36690 $ |
Constructor Summary | |
public | UPFileSpec() Creates a new UPFileSpec instance with all values being null. | public | UPFileSpec(HttpServletRequest req) Construct a .uP file spec object for a .uP file contained in a given request. | public | UPFileSpec(String uPFile) | public | UPFileSpec(UPFileSpec up) Copy constructor. | public | UPFileSpec(String tagId, int method, String methodNodeId, String targetNodeId, String extraElements) A building constructor.
Parameters: tagId - a tag id String value (can be null ) Parameters: method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. |
Method Summary | |
protected void | analyze(String uPFile) | public static String | buildUPFile(String tagId, int method, String methodNodeId, String targetNodeId, String extraElements) Constructs a .uP file
Parameters: tagId - a tag id String value (can be null ) Parameters: method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. | public static String | buildUPFileBase(String tagId, int method, String methodNodeId, String targetNodeId, String extraElements) Constructs a .uP file, without the suffix (actual ".uP") so it can be extended further.
Parameters: tagId - a tag id String value (can be null ) Parameters: method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. | protected static String | buildUPFileBase(String tagId, String method, String methodNodeId, String targetNodeId, String extraElements) | public String | getMethod() | public String | getMethodNodeId() Determine Id specified by the method element. | public String | getTagId() Returns a tag identifier. | public String | getTargetNodeId() Determine Id specified by the "target" element. | public String | getUPFile() Get the full .uP file String . | public String | getUPFileExtras() Returns a "cleaned-up" version of the uP file with all known
fields such as tag, method, and target, removed. | public void | setMethod(int method) Set a method.
Parameters: method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. | public void | setMethodNodeId(String nodeId) Set method node id. | public void | setTagId(String id) | public void | setTargetNodeId(String nodeId) | public void | setUPFileExtras(String extras) |
DETACH_URL_ELEMENT | final public static String DETACH_URL_ELEMENT(Code) | | |
FILE_DOWNLOAD_WORKER | final public static String FILE_DOWNLOAD_WORKER(Code) | | |
PORTAL_URL_SEPARATOR | final public static String PORTAL_URL_SEPARATOR(Code) | | |
PORTAL_URL_SUFFIX | final public static String PORTAL_URL_SUFFIX(Code) | | |
RENDER_METHOD | final public static int RENDER_METHOD(Code) | | |
RENDER_URL_ELEMENT | final public static String RENDER_URL_ELEMENT(Code) | | |
TAG_URL_ELEMENT | final public static String TAG_URL_ELEMENT(Code) | | |
TARGET_URL_ELEMENT | final public static String TARGET_URL_ELEMENT(Code) | | |
WORKER_METHOD | final public static int WORKER_METHOD(Code) | | |
WORKER_URL_ELEMENT | final public static String WORKER_URL_ELEMENT(Code) | | |
UPFileSpec | public UPFileSpec()(Code) | | Creates a new UPFileSpec instance with all values being null.
|
UPFileSpec | public UPFileSpec(HttpServletRequest req)(Code) | | Construct a .uP file spec object for a .uP file contained in a given request.
Parameters: req - a HttpServletRequest value |
UPFileSpec | public UPFileSpec(String uPFile)(Code) | | Construct a .uP file spec object by providing the actual .uP file string
Parameters: uPFile - a String value |
UPFileSpec | public UPFileSpec(UPFileSpec up)(Code) | | Copy constructor.
Parameters: up - an UPFileSpec value to copy the values from |
UPFileSpec | public UPFileSpec(String tagId, int method, String methodNodeId, String targetNodeId, String extraElements) throws PortalException(Code) | | A building constructor.
Parameters: tagId - a tag id String value (can be null ) Parameters: method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. UPFileSpec.RENDER_METHOD or UPFileSpec.WORKER_METHOD) Parameters: methodNodeId - a method node id String value (required value, can not be null ) Parameters: targetNodeId - a target id String value (can be null ) Parameters: extraElements - a String to be incorporated into the file name before the suffix (".uP"). These values will be available from the UPFileSpec.getUPFileExtras() result when .uP file is parsed. (can be null ) exception: PortalException - if an invalid method code is passed or no methodNodeId is present. |
buildUPFile | public static String buildUPFile(String tagId, int method, String methodNodeId, String targetNodeId, String extraElements) throws PortalException(Code) | | Constructs a .uP file
Parameters: tagId - a tag id String value (can be null ) Parameters: method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. UPFileSpec.RENDER_METHOD or UPFileSpec.WORKER_METHOD) Parameters: methodNodeId - a method node id String value (required value, can not be null ) Parameters: targetNodeId - a target id String value (can be null ) Parameters: extraElements - a String to be incorporated into the file name before the suffix (".uP"). These values will be available from the UPFileSpec.getUPFileExtras() result when .uP file is parsed. (can be null ) a String value exception: PortalException - if an invalid method code is passed or no methodNodeId is present. |
buildUPFileBase | public static String buildUPFileBase(String tagId, int method, String methodNodeId, String targetNodeId, String extraElements) throws PortalException(Code) | | Constructs a .uP file, without the suffix (actual ".uP") so it can be extended further.
Parameters: tagId - a tag id String value (can be null ) Parameters: method - a method String value (required, must be one of the UPFileSpec.*_METHOD constants, i.e. UPFileSpec.RENDER_METHOD or UPFileSpec.WORKER_METHOD) Parameters: methodNodeId - a method node id String value (required value, can not be null ) Parameters: targetNodeId - a target id String value (can be null ) Parameters: extraElements - a String to be incorporated into the file name before the suffix (".uP"). These values will be available from the UPFileSpec.getUPFileExtras() result when .uP file is parsed. (can be null ) a String value exception: PortalException - if an invalid method code is passed or no methodNodeId is present. |
getMethod | public String getMethod()(Code) | | Determine method name
a String method name, null if no method was specified. |
getMethodNodeId | public String getMethodNodeId()(Code) | | Determine Id specified by the method element.
a String method node Id value, null if no method was specified. |
getTagId | public String getTagId()(Code) | | Returns a tag identifier.
a String tag value, null if no tag was specified. |
getTargetNodeId | public String getTargetNodeId()(Code) | | Determine Id specified by the "target" element.
a String target Id value, null if no target was specified. |
getUPFileExtras | public String getUPFileExtras()(Code) | | Returns a "cleaned-up" version of the uP file with all known
fields such as tag, method, and target, removed. This can be used by...
a String value, null if none were encountered. |
setMethodNodeId | public void setMethodNodeId(String nodeId)(Code) | | Set method node id.
Parameters: nodeId - a String value |
setTagId | public void setTagId(String id)(Code) | | Set a tag id
Parameters: id - a String value |
setTargetNodeId | public void setTargetNodeId(String nodeId)(Code) | | Set target node id
Parameters: nodeId - a String value |
setUPFileExtras | public void setUPFileExtras(String extras)(Code) | | Set extras to be appended to the spec before the suffix element (".uP")
Parameters: extras - a String value |
|
|