|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlumis.portal.url.WebResource
@StableMinor(version="6.1", sinceVersion="5.0") public abstract class WebResource
Represents a resource that is accessible through a web server.
Note: the public methods of this class are considered stable, but it is not considered stable for being used in JPA queries.
Constructor Summary | |
---|---|
WebResource()
|
Method Summary | |
---|---|
protected WebResource |
clone()
|
java.util.Date |
getCreatedDateTime()
Returns the date-time this web resource was created. |
java.lang.String |
getDynamicPath()
Returns the dynamic path to access this web resource. |
java.lang.String |
getFriendlyPath()
Returns the friendly path to access this web resource. |
java.lang.String |
getFriendlyURLPattern()
Returns the pattern to be used to resolve friendly URL for this web resource. |
java.lang.String |
getId()
Returns the unique identifier for this web resource. |
java.util.Locale |
getLocale()
Returns the locale for this web resource. |
abstract java.lang.String |
getName()
Returns the name for this web resource. |
PageCacheConfig |
getPageCache()
Returns the cache definition for this web resource. |
java.lang.String |
getParameter(java.lang.String parameterName)
Returns the value of a parameter for this web resource. |
abstract java.util.Map<java.lang.String,java.lang.String[]> |
getParameterMap()
Returns a map containing all parameters for this web resource. |
java.lang.String[] |
getParameterValues(java.lang.String parameterName)
Returns the values of a parameter for this web resource. |
abstract WebResource |
getParent()
Returns the web resource of the parent element of this web resource. |
java.lang.String |
getPath()
Returns the path to access this web resource. |
protected java.lang.String |
getPath(boolean considerGuestOnlyCache)
Returns the path to access this web resource. |
abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getProperties()
Returns the properties for this web resource. |
protected java.lang.String |
getRecommendedFileExtension()
Returns the file extension recommended for this web resource, according to its configurations. |
abstract java.lang.String |
getTitle()
Returns the title for this web resource. |
protected boolean |
hasSSI()
Returns whether this web resource has Server Side Include (requires SSI pos-processing). |
protected boolean |
isAvailableForGetRequest()
Returns whether this web resource is available for a GET request to it. |
boolean |
isCacheEnabled(boolean considerGuestOnlyCache)
Returns if the cache is enabled for this web resource for the current user. |
protected boolean |
isDynamicRequestValid(javax.servlet.http.HttpServletRequest request)
Indicates whether the given request is a valid dynamic request for this web resource. |
protected boolean |
isFriendlyURLEnabled()
Indicates if friendly URL is enabled for this web resource. |
protected java.lang.String |
localize(java.lang.String key)
Returns the localized version of the given string. |
protected boolean |
mayBePersisted()
Indicates whether this web resource may be persisted. |
protected void |
setDynamicPath(java.lang.String dynamicPath)
Sets the dynamic path for this web resource. |
protected void |
setFriendlyPath(java.lang.String friendlyPath)
Sets the friendly path for this web resource. |
protected void |
setId(java.lang.String id)
Sets the unique identifier for this web resource. |
protected void |
setLocale(java.util.Locale locale)
Sets the locale for this web resource. |
protected void |
setPageCache(PageCacheConfig pageCache)
Sets the cache definition for this web resource. |
java.lang.String |
toString()
Returns a string representation for debug and logging purposes. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WebResource()
Method Detail |
---|
public java.lang.String getId()
null
if it is not persisted.protected void setId(java.lang.String id)
id
- the value to set.public java.lang.String getDynamicPath()
getFriendlyPath()
protected void setDynamicPath(java.lang.String dynamicPath)
dynamicPath
- the dynamic path relative to the portal web
application root. It must start with '/'.public java.lang.String getFriendlyPath()
Note that even thought a friendly path is returned, the use of friendly URL may be disabled for this web resource.
null
if there is
no friendly path set.getPath()
protected boolean isFriendlyURLEnabled()
true
if it is enabled, false
otherwise.protected void setFriendlyPath(java.lang.String friendlyPath)
friendlyPath
- the friendly path relative to the portal web
application root. It must start with '/', or be null
for no friendly path set.public java.lang.String getFriendlyURLPattern()
The specific syntax or usage of the pattern is up to the
IURLResolver
configured for this web resource.
public java.util.Locale getLocale()
protected void setLocale(java.util.Locale locale)
This method must be called inside a transactional context, so that
PortalTransactionFactory.getCurrentTransaction()
does not return
null.
locale
- the locale to set.public java.util.Date getCreatedDateTime()
public PageCacheConfig getPageCache()
null
if this web resource
does not have cache.protected void setPageCache(PageCacheConfig pageCache)
pageCache
- the cache definition.public final java.lang.String getPath()
getFriendlyPath()
or getDynamicPath()
.
The current user session
affects the resolution if a cache should or not be used.
protected java.lang.String getPath(boolean considerGuestOnlyCache)
getFriendlyPath()
or getDynamicPath()
.
considerGuestOnlyCache
- indicates if the path for the cached file
should be used even if the cache is only for guest.
public boolean isCacheEnabled(boolean considerGuestOnlyCache)
considerGuestOnlyCache
- indicates if the result should be
true
even if the cache is only for guest.
true
if the cache is enabled, false
otherwise.public abstract WebResource getParent()
null
if it
has no parent.public abstract java.lang.String getName()
getLocale()
public abstract java.lang.String getTitle()
getLocale()
public abstract java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
public java.lang.String getParameter(java.lang.String parameterName)
parameterName
- the parameter name.
null
if no parameter with such
name exists for this web resource.public java.lang.String[] getParameterValues(java.lang.String parameterName)
parameterName
- the parameter name.
null
if no parameter with such
name exists for this web resource.public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getProperties()
protected java.lang.String localize(java.lang.String key)
key
- the string.
getLocale()
protected boolean mayBePersisted()
There are other rules relating to web resource persisting. If this
method returns false
, this web resource may never be
persisted. If this method returns true
, it will depend
on the other rules to decide if it will be persisted.
This method may be called when the web resource object is not with all its attributes set yet.
protected boolean isAvailableForGetRequest()
Normally non-persisted web resources whose dynamic path differs from the main path indicates that it was not generated
true
if this web resource is available,
false
otherwise.protected boolean isDynamicRequestValid(javax.servlet.http.HttpServletRequest request)
request
- the request.
true
if valid, false
otherwise.protected boolean hasSSI()
true
if this web resource has SSI, false
otherwise.protected java.lang.String getRecommendedFileExtension()
public java.lang.String toString()
toString
in class java.lang.Object
protected WebResource clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |