@StableMinor(version="12.2", sinceVersion="5.0") public abstract class WebResource extends Object implements Cloneable, ICloneableCacheEntry
Note: the public methods of this class are considered stable, but it is not considered stable for being used in JPA queries.
Constructor and Description |
---|
WebResource() |
Modifier and Type | Method and Description |
---|---|
protected String |
calculatePath()
Returns the path to access this web resource.
|
WebResource |
clone() |
Date |
getCreatedDateTime()
Returns the date-time this web resource was created.
|
String |
getDynamicPath()
Returns the dynamic path to access this web resource.
|
String |
getFriendlyPath()
Returns the friendly path to access this web resource.
|
String |
getFriendlyURLPattern()
Returns the pattern to be used to resolve friendly URL for this web
resource.
|
String |
getId()
Returns the unique identifier for this web resource.
|
Locale |
getLocale()
Returns the locale for this web resource.
|
abstract String |
getName()
Returns the name for this web resource.
|
PageCacheConfig |
getPageCache()
Returns the cache definition for this web resource.
|
String |
getParameter(String parameterName)
Returns the value of a parameter for this web resource.
|
abstract Map<String,String[]> |
getParameterMap()
Returns a map containing all parameters for this web resource.
|
String[] |
getParameterValues(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.
|
String |
getPath()
Returns the path to access this web resource.
|
abstract Map<String,List<String>> |
getProperties()
Returns the properties for this web resource.
|
protected String |
getRecommendedFileExtension()
Returns the file extension recommended for this web resource, according
to its configurations.
|
protected abstract String |
getSeoRuleUrlPattern()
Get the Url Path from the SeoRule linked to this WebResource.
|
abstract String |
getTitle()
Returns the title for this web resource.
|
abstract String |
getUrlTitle()
Returns the title value meant to be used for friendly URL generation of this web resource.
|
IWebsite |
getWebsite()
Returns the website this web resource belongs to.
|
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()
Returns if the cache is enabled for this web resource.
|
boolean |
isCacheEnabled(boolean considerGuestOnlyCache)
Deprecated.
since 10.3.0 replaced by
isCacheEnabled() . From version 10.3.0 on,
the parameter considerGuestOnlyCache is ignored. |
protected boolean |
isDynamicRequestValid(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 String |
localize(String key)
Returns the localized version of the given string.
|
protected boolean |
mayBePersisted()
Indicates whether this web resource may be persisted.
|
protected void |
setDynamicPath(String dynamicPath)
Sets the dynamic path for this web resource.
|
protected void |
setFriendlyPath(String friendlyPath)
Sets the friendly path for this web resource.
|
protected void |
setId(String id)
Sets the unique identifier for this web resource.
|
protected void |
setLocale(Locale locale)
Sets the locale for this web resource.
|
protected void |
setPageCache(PageCacheConfig pageCache)
Sets the cache definition for this web resource.
|
protected void |
setWebsite(IWebsite website)
Sets the website this web resource belongs to.
|
String |
toString()
Returns a string representation for debug and logging purposes.
|
public String getId()
null
if it is not persisted.protected void setId(String id)
id
- the value to set.public String getDynamicPath()
getFriendlyPath()
protected void setDynamicPath(String dynamicPath)
dynamicPath
- the dynamic path relative to the portal web
application root. It must start with '/'.public 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(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 String getFriendlyURLPattern()
The specific syntax or usage of the pattern is up to the
IURLResolver
configured for this web resource.
protected abstract String getSeoRuleUrlPattern() throws PortalException
null
if not specified.PortalException
public Locale getLocale()
protected void setLocale(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 Date getCreatedDateTime()
public PageCacheConfig getPageCache()
null
if this web resource
does not have cache.protected void setPageCache(PageCacheConfig pageCache)
pageCache
- the cache definition.public IWebsite getWebsite()
The full URL to access this web resource is composed by a base URL of the web site it belongs, and the path of this web resource.
If this web resource
is located in an area of portal that do not belong to any website
, this method will return null
.
protected void setWebsite(IWebsite website)
The website of the web resource must be set during its creation. The website of an existing web resource cannot be changed. It must be deleted and recreated instead.
website
- the website.getWebsite()
public final String getPath()
getFriendlyPath()
or getDynamicPath()
.protected String calculatePath()
getFriendlyPath()
or getDynamicPath()
.@Deprecated public boolean isCacheEnabled(boolean considerGuestOnlyCache)
isCacheEnabled()
. From version 10.3.0 on,
the parameter considerGuestOnlyCache is ignored.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 boolean isCacheEnabled()
true
if the cache is enabled, false
otherwise.public abstract WebResource getParent()
null
if it
has no parent.public abstract String getName()
getLocale()
public abstract String getTitle()
getLocale()
public abstract String getUrlTitle()
IURLResolver
public abstract Map<String,String[]> getParameterMap()
public String getParameter(String parameterName)
parameterName
- the parameter name.null
if no parameter with such
name exists for this web resource.public String[] getParameterValues(String parameterName)
parameterName
- the parameter name.null
if no parameter with such
name exists for this web resource.public abstract Map<String,List<String>> getProperties()
protected String localize(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(HttpServletRequest request)
request
- the request.true
if valid, false
otherwise.protected boolean hasSSI()
true
if this web resource has SSI, false
otherwise.protected String getRecommendedFileExtension()
public String toString()
public WebResource clone() throws CloneNotSupportedException
clone
in interface ICloneableCacheEntry
clone
in class Object
CloneNotSupportedException
LumisXP 12.2.0.200122 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.