|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.repository.seo.UrlParameterLookup
public class UrlParameterLookup
Class that represents a parameter in a UrlTemplate
.
This object holds the following details about a parameter:
When the UrlParameter
is first created the value will be null. This class provides
a method to lookup the value for a given request.
The item name and the property name are obtained by splitting the parameter name up by the first '.'.
If a parameter name is wrapped by curly brackets then the parameter value will be escaped. Otherwise if the parameter name is wrapped by square brackets then the value will not be escaped.
e.g. For "[item.template.url]":
Lookup items are objects of class UrlParameterLookup
. They are created during
initialization of indirect templates from the properties file and also by the ItemLink
droplet from the request parameters.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
protected int |
mGroupIndex
|
protected java.lang.String |
mItemDescriptorName
|
protected ApplicationLogging |
mLogger
|
protected java.lang.String |
mName
|
protected Repository |
mRepository
|
protected RepositoryItem |
mRepositoryItem
|
protected java.lang.String |
mRepositoryItemID
|
protected java.lang.String |
mRepositoryName
|
protected java.lang.String |
mType
|
Constructor Summary | |
---|---|
UrlParameterLookup(ApplicationLogging pLogger,
int pGroupIndex,
java.lang.String[] pParts)
Constructor. |
|
UrlParameterLookup(ApplicationLogging pLogger,
java.lang.String pName,
java.lang.String pType)
Constructor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones this object for use in a request |
int |
getGroupIndex()
Getter method for the group index. |
java.lang.String |
getItemDescriptorName()
Getter method of the item descriptor name. |
java.lang.String |
getName()
Getter method for the name of this lookup object. |
Repository |
getRepository()
Gets the Repository instance to use for looking up the item. |
Repository |
getRepository(DynamoHttpServletRequest pRequest)
Gets the Repository for the item doing a lookup if needed. |
RepositoryItem |
getRepositoryItem()
Getter method for the repository item. |
RepositoryItem |
getRepositoryItem(DynamoHttpServletRequest pRequest)
Method to get the repository item doing a lookup if needed. |
java.lang.String |
getRepositoryItemID()
Getter method for the repository item ID. |
java.lang.String |
getRepositoryName()
Getter method of the repository name to lookup the item. |
java.lang.String |
getType()
Getter method of the type of this lookup object. |
java.lang.String |
getValue(java.lang.String pPropertyName,
DynamoHttpServletRequest pRequest,
java.lang.Object pElementValue)
Gets the value of a property of the item represented by this lookup object. |
Repository |
lookupRepository(DynamoHttpServletRequest pRequest)
Method to resolve a Repository using the request context. |
RepositoryItem |
lookupRepositoryItem(DynamoHttpServletRequest pRequest)
Looks up the repository item from the repository. |
protected void |
setGroupIndex(int pGroupIndex)
Setter method for group index. |
void |
setItemDescriptorName(java.lang.String pItemDescriptorName)
Setter method of the item descriptor name. |
void |
setName(java.lang.String pName)
Setter method for the lookup object name. |
void |
setRepository(Repository pRepository)
Sets the Repository>code> to use when looking up the item |
void |
setRepositoryItem(RepositoryItem pRepositoryItem)
Setter method for the repository item. |
void |
setRepositoryItemID(java.lang.String pRepositoryItemID)
Setter method for the repository item ID. |
void |
setRepositoryName(java.lang.String pRepositoryName)
Setter method of the repository name to lookup the item. |
void |
setType(java.lang.String pType)
Setter method for the type of this lookup object. |
java.lang.String |
toString()
Overrides toString() to provide meaningful logging. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
protected ApplicationLogging mLogger
protected int mGroupIndex
protected java.lang.String mName
protected java.lang.String mType
protected java.lang.String mRepositoryName
protected java.lang.String mItemDescriptorName
protected Repository mRepository
protected RepositoryItem mRepositoryItem
protected java.lang.String mRepositoryItemID
Constructor Detail |
---|
public UrlParameterLookup(ApplicationLogging pLogger, int pGroupIndex, java.lang.String[] pParts)
element name | element type [| [
pLogger
- ApplicationLogging object to do logging withpGroupIndex
- int index of the regex grouppParts
- String array of element parts.public UrlParameterLookup(ApplicationLogging pLogger, java.lang.String pName, java.lang.String pType)
pLogger
- ApplicationLogging object to do logging withpName
- String name of this elementpType
- String type of this elementMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public int getGroupIndex()
The group index is an index into the regex Matcher
for this lookup object.
i.e. given a Matcher
object the value is obtained by:
value = matcher.group(getGroupIndex())
;
protected void setGroupIndex(int pGroupIndex)
pGroupIndex
- The group index to setpublic java.lang.String getName()
public void setName(java.lang.String pName)
pName
- String name of the lookup object.public java.lang.String getType()
public void setType(java.lang.String pType)
pType
- String typepublic java.lang.String getRepositoryName()
public void setRepositoryName(java.lang.String pRepositoryName)
pRepositoryName
- String repository namepublic java.lang.String getItemDescriptorName()
public void setItemDescriptorName(java.lang.String pItemDescriptorName)
pItemDescriptorName
- String item descriptor namepublic java.lang.String getRepositoryItemID()
public void setRepositoryItemID(java.lang.String pRepositoryItemID)
pRepositoryItemID
- String ID of the repository itempublic Repository getRepository()
Repository
instance to use for looking up the item.
Repository
for this itempublic void setRepository(Repository pRepository)
Repository>code> to use when looking up the item
- Parameters:
pRepository
- The Repository
object to set
public RepositoryItem getRepositoryItem()
RepositoryItem object
public void setRepositoryItem(RepositoryItem pRepositoryItem)
pRepositoryItem
- The RepositoryItem
to setpublic Repository getRepository(DynamoHttpServletRequest pRequest)
DynamoHttpServletRequest
- object
Repository
for the itempublic RepositoryItem getRepositoryItem(DynamoHttpServletRequest pRequest)
pRequest
- DynamoHttpServletRequest
object
RepositoryItem
objectpublic Repository lookupRepository(DynamoHttpServletRequest pRequest)
Repository
using the request context.
pRequest
- DynamoHttpServletRequest
object
Repository
objectpublic RepositoryItem lookupRepositoryItem(DynamoHttpServletRequest pRequest) throws RepositoryException
pRequest
- DynamoHttpServletRequest
object
RepositoryItem
object
RepositoryException
public java.lang.String getValue(java.lang.String pPropertyName, DynamoHttpServletRequest pRequest, java.lang.Object pElementValue) throws RepositoryException
If the lookup object type is "string" then the pElementValue
is returned as a String.
If the type is "id" then the passed in pElementValue
is used as the repository item id and
the item is looked up and the property value retrieved.
If the type is "item" then the property of the item is looked up from the already set item.
pPropertyName
- String property name to lookuppRequest
- DynamoHttpServletRequest objectpElementValue
- Used to perform the lookup
RepositoryException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |