|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.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 workerActionURL
s.
Field Summary | |
static java.lang.String |
DETACH_URL_ELEMENT
|
static java.lang.String |
FILE_DOWNLOAD_WORKER
|
static java.lang.String |
PORTAL_URL_SEPARATOR
|
static java.lang.String |
PORTAL_URL_SUFFIX
|
static java.lang.String |
PORTLET_PARAMS_DELIM_BEG
|
static java.lang.String |
PORTLET_PARAMS_DELIM_END
|
static int |
RENDER_METHOD
|
static java.lang.String |
RENDER_URL_ELEMENT
|
static java.lang.String |
TAG_URL_ELEMENT
|
static java.lang.String |
TARGET_URL_ELEMENT
|
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 | |
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. |
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") |
Methods inherited from class java.lang.Object |
equals, 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 PORTLET_PARAMS_DELIM_BEG
public static final java.lang.String PORTLET_PARAMS_DELIM_END
public static final java.lang.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(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 frompublic 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
valuepublic 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
PortalException
public 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.
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |