|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.util.CmsResourceUtil
Provides CmsResource
utility functions.
This class provides in java all resource information used by the explorer view, mostly generated in javascript (see explorer.js)
Constructor Summary | |
CmsResourceUtil(CmsObject cms)
Creates a new CmsRequestUtil object. |
|
CmsResourceUtil(CmsObject cms,
CmsResource resource)
Creates a new CmsRequestUtil object. |
|
CmsResourceUtil(CmsResource resource)
Creates a new CmsRequestUtil object. |
Method Summary | |
CmsObject |
getCms()
Returns the cms context. |
java.lang.String |
getIconPathExplorer()
Returns the resource icon path displayed in the explorer view for the given resource. |
java.lang.String |
getIconPathLock()
Returns the lock icon path for the given resource. |
java.lang.String |
getIconPathProjectState()
Returns the project state icon path for the given resource. |
java.lang.String |
getIconPathResourceType()
Returns the resource type icon path for the given resource. |
CmsLock |
getLock()
Returns the the lock for the given resource. |
java.lang.String |
getLockedByName()
Returns the user name who owns the lock for the given resource. |
int |
getLockedInProjectId()
Returns the id of the project in which the given resource is locked. |
java.lang.String |
getLockedInProjectName()
Returns the project name that locked the current resource's. |
java.lang.String |
getPermissions()
Returns the permissions string for the given resource. |
int |
getProjectId()
Returns the id of the project which the resource belongs to. |
java.lang.Boolean |
getProjectState()
Returns the project state of the given resource. |
CmsProject |
getReferenceProject()
Returns the project to use to check project state. |
CmsResource |
getResource()
Returns the resource. |
I_CmsResourceType |
getResourceType()
Returns the resource type for the given resource. |
int |
getResourceTypeId()
Returns the resource type id for the given resource. |
java.lang.String |
getResourceTypeName()
Returns the resource type name for the given resource. |
java.lang.String |
getSizeString()
Returns the size of the given resource as a String. |
char |
getStateAbbreviation()
Returns resource state abbreviation. |
static char |
getStateAbbreviation(int state)
Returns resource state abbreviation. |
java.lang.String |
getStateName()
Returns the state name for a resource. |
java.lang.String |
getStyleClassName()
Returns the style class to use for the given resource. |
java.lang.String |
getStyleRange()
Returns additional style sheets depending on publication constraints. |
java.lang.String |
getStyleSiblings()
Returns additional style sheets for the resource type icon depending on siblings. |
java.lang.String |
getTitle()
Returns the title of a resource. |
java.lang.String |
getUserCreated()
Returns the name of the user who created the given resource. |
java.lang.String |
getUserLastModified()
Returns the name of the user who last modified the given resource. |
boolean |
isEditable()
Returns true if the given resource is editable by the current user. |
boolean |
isExpired()
Returns true if the given resource has expired. |
boolean |
isInRange()
Returns true if the given resource has been released and has not expired. |
boolean |
isInsideProject()
Returns true if the given resource is in the reference project. |
boolean |
isReleased()
Returns true if the given resource has been released. |
void |
setCms(CmsObject cms)
Sets the cms context. |
void |
setReferenceProject(CmsProject project)
Sets the project to use to check project state. |
void |
setResource(CmsResource resource)
Sets the resource. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CmsResourceUtil(CmsObject cms)
CmsRequestUtil
object.
cms
- the cms contextpublic CmsResourceUtil(CmsObject cms, CmsResource resource)
CmsRequestUtil
object.
cms
- the cms contextresource
- the resourcepublic CmsResourceUtil(CmsResource resource)
CmsRequestUtil
object.
resource
- the resourceMethod Detail |
public static char getStateAbbreviation(int state)
state
- the resource state
public CmsObject getCms()
public java.lang.String getIconPathExplorer()
Relative to /system/workplace/resources/
.
If the resource has no sibling it is the same as getIconPathResourceType()
.
getStyleSiblings()
public java.lang.String getIconPathLock()
Relative to /system/workplace/resources/
.
Returns explorer/project_none.gif
if request context is null
.
public java.lang.String getIconPathProjectState()
Relative to /system/workplace/resources/
.
public java.lang.String getIconPathResourceType()
Relative to /system/workplace/resources/
.
public CmsLock getLock()
public java.lang.String getLockedByName()
public int getLockedInProjectId()
public java.lang.String getLockedInProjectName()
public java.lang.String getPermissions()
public int getProjectId()
public java.lang.Boolean getProjectState()
public CmsProject getReferenceProject()
public CmsResource getResource()
public I_CmsResourceType getResourceType()
public int getResourceTypeId()
public java.lang.String getResourceTypeName()
public java.lang.String getSizeString()
For directories it returns #SIZE_DIR
.
public char getStateAbbreviation()
public java.lang.String getStateName()
Uses default locale if request context is null
.
public java.lang.String getStyleClassName()
CmsListExplorerColumn.getExplorerStyleDef()
public java.lang.String getStyleRange()
That is, depending on CmsResource.getDateReleased()
and
CmsResource.getDateExpired()
.
public java.lang.String getStyleSiblings()
That is, depending on CmsResource.getSiblingCount()
Use it with the getIconPathExplorer()
method.
public java.lang.String getTitle()
public java.lang.String getUserCreated()
public java.lang.String getUserLastModified()
public boolean isEditable()
true
if the given resource is editable by the current user.
Retuns false
if no request context is set.
true
if the given resource is editable by the current userpublic boolean isExpired()
true
if the given resource has expired.
Retuns true
if no request context is set.
true
if the given resource has expiredpublic boolean isInRange()
true
if the given resource has been released and has not expired.
Retuns false
if no request context is set.
true
if the given resource has been released and has not expiredpublic boolean isInsideProject()
true
if the given resource is in the reference project.
Returns false
if the request context is null
.
true
if the given resource is in the reference projectgetReferenceProject()
public boolean isReleased()
true
if the given resource has been released.
true
if the given resource has been releasedpublic void setCms(CmsObject cms)
cms
- the cms context to setpublic void setReferenceProject(CmsProject project)
project
- the project to setpublic void setResource(CmsResource resource)
resource
- the resource to set
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |