|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workplace.explorer.CmsResourceUtil
public final class 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)
Nested Class Summary | |
---|---|
static class |
CmsResourceUtil.CmsResourceProjectState
Enumeration class for defining the resource project state. |
Field Summary | |
---|---|
static int |
LAYOUTSTYLE_AFTEREXPIRE
Layout style for resources after expire date. |
static int |
LAYOUTSTYLE_BEFORERELEASE
Layout style for resources before release date. |
static int |
LAYOUTSTYLE_INRANGE
Layout style for resources after release date and before expire date. |
static org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode |
SITE_MODE_CURRENT
Constant that signalizes that all path operations will be based on the current site. |
static org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode |
SITE_MODE_MATCHING
Constant that signalizes that all path operations will be based on the best matching site. |
static org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode |
SITE_MODE_ROOT
Constant that signalizes that all path operations will be based on the root path. |
static CmsResourceUtil.CmsResourceProjectState |
STATE_LOCKED_FOR_PUBLISHING
Constant for the project state locked for publishing. |
static CmsResourceUtil.CmsResourceProjectState |
STATE_MODIFIED_IN_CURRENT_PROJECT
Constant for the project state locked in current project. |
static CmsResourceUtil.CmsResourceProjectState |
STATE_MODIFIED_IN_OTHER_PROJECT
Constant for the project state locked in other project. |
Constructor Summary | |
---|---|
CmsResourceUtil(CmsObject cms)
Creates a new CmsResourceUtil object. |
|
CmsResourceUtil(CmsObject cms,
CmsResource resource)
Creates a new CmsResourceUtil object. |
|
CmsResourceUtil(CmsResource resource)
Creates a new CmsResourceUtil object. |
Method Summary | |
---|---|
int |
getAbbrevLength()
Returns the path abbreviation length. |
CmsObject |
getCms()
Returns the cms context. |
java.lang.String |
getDateExpired()
Returns the formatted date of expiration. |
java.lang.String |
getDateReleased()
Returns the formatted date of release. |
java.lang.String |
getFullPath()
Returns the path of the current resource, taking into account just the site mode. |
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. |
int |
getLinkType()
Returns an integer representation for the link type. |
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. |
CmsUUID |
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. |
int |
getLockState()
Returns the lock state of the current resource. |
java.lang.String |
getNavText()
Returns the navtext of a resource. |
java.lang.String |
getPath()
Returns the path of the current resource. |
CmsPermissionSet |
getPermissionSet()
Returns the permission set for the given resource. |
java.lang.String |
getPermissionString()
Returns the permissions string for the given resource. |
CmsUUID |
getProjectId()
Returns the id of the project which the resource belongs to. |
CmsResourceUtil.CmsResourceProjectState |
getProjectState()
Returns the project state of the given resource. |
CmsProject |
getReferenceProject()
Returns the project to use to check project state. |
java.lang.String |
getRelativeTo()
Returns the 'relative to' path. |
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 |
getSite()
Returns the site of the current resources, taking into account the set site mode. |
org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode |
getSiteMode()
Returns the site mode. |
java.lang.String |
getSiteTitle()
Returns the title of the site. |
java.lang.String |
getSizeString()
Returns the size of the given resource as a String. |
char |
getStateAbbreviation()
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 |
getStyleSiblings()
Returns additional style sheets for the resource type icon depending on siblings. |
java.lang.String |
getSystemLockInfo(boolean forExplorer)
Returns the system lock information tooltip for the explorer view. |
java.lang.String |
getTimeWindowLayoutStyle()
Returns additional style sheets depending on publication constraints. |
int |
getTimeWindowLayoutType()
Returns the layout style for the current time window state. |
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 |
isInsideProject()
Returns true if the given resource is in the reference project. |
boolean |
isReleasedAndNotExpired()
Returns true if the stored resource has been released and has not expired. |
void |
setAbbrevLength(int abbrevLength)
Sets the path abbreviation length. |
void |
setCms(CmsObject cms)
Sets the cms context. |
void |
setReferenceProject(CmsProject project)
Sets the project to use to check project state. |
void |
setRelativeTo(java.lang.String relativeTo)
Sets the 'relative to' path. |
void |
setResource(CmsResource resource)
Sets the resource. |
void |
setSiteMode(org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode siteMode)
Sets the site mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LAYOUTSTYLE_AFTEREXPIRE
public static final int LAYOUTSTYLE_BEFORERELEASE
public static final int LAYOUTSTYLE_INRANGE
public static final org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode SITE_MODE_CURRENT
public static final org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode SITE_MODE_MATCHING
public static final org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode SITE_MODE_ROOT
public static final CmsResourceUtil.CmsResourceProjectState STATE_LOCKED_FOR_PUBLISHING
public static final CmsResourceUtil.CmsResourceProjectState STATE_MODIFIED_IN_CURRENT_PROJECT
public static final CmsResourceUtil.CmsResourceProjectState STATE_MODIFIED_IN_OTHER_PROJECT
Constructor Detail |
---|
public CmsResourceUtil(CmsObject cms)
CmsResourceUtil
object.
cms
- the cms contextpublic CmsResourceUtil(CmsObject cms, CmsResource resource)
CmsResourceUtil
object.
cms
- the cms contextresource
- the resourcepublic CmsResourceUtil(CmsResource resource)
CmsResourceUtil
object.
resource
- the resourceMethod Detail |
---|
public int getAbbrevLength()
If greater than zero, the path will be formatted to this number of chars.
This only affects the generation of the path for the current resource.
public CmsObject getCms()
public java.lang.String getDateExpired()
public java.lang.String getDateReleased()
public java.lang.String getFullPath()
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 int getLinkType()
0
: No sibling
1
: Sibling
2
: Labeled sibling
public CmsLock getLock()
public java.lang.String getLockedByName()
public CmsUUID getLockedInProjectId()
public java.lang.String getLockedInProjectName()
public int getLockState()
public java.lang.String getNavText()
public java.lang.String getPath()
Taking into account following settings:
public CmsPermissionSet getPermissionSet()
public java.lang.String getPermissionString()
public CmsUUID getProjectId()
public CmsResourceUtil.CmsResourceProjectState getProjectState()
public CmsProject getReferenceProject()
public java.lang.String getRelativeTo()
This only affects the generation of the path for the current resource.
public CmsResource getResource()
public I_CmsResourceType getResourceType()
public int getResourceTypeId()
public java.lang.String getResourceTypeName()
public java.lang.String getSite()
public org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode getSiteMode()
This only affects the generation of the path for the current resource.
public java.lang.String getSiteTitle()
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 getStyleSiblings()
That is, depending on CmsResource.getSiblingCount()
Use it with the getIconPathExplorer()
method.
public java.lang.String getSystemLockInfo(boolean forExplorer)
forExplorer
- if the tool tip should be generated for the explorer view
public java.lang.String getTimeWindowLayoutStyle()
That is, depending on CmsResource.getDateReleased()
and
CmsResource.getDateExpired()
.
getTimeWindowLayoutType()
public int getTimeWindowLayoutType()
LAYOUTSTYLE_INRANGE
: The time window is in range
LAYOUTSTYLE_BEFORERELEASE
: The resource is not yet released
LAYOUTSTYLE_AFTEREXPIRE
: The resource has already expired
getTimeWindowLayoutStyle()
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.
Returns false
if no request context is set.
true
if the given resource is editable by the current userpublic 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 isReleasedAndNotExpired()
true
if the stored resource has been released and has not expired.If no request context is available, the current time is used for the validation check.
true
if the stored resource has been released and has not expiredCmsResource.isReleasedAndNotExpired(long)
public void setAbbrevLength(int abbrevLength)
If greater than zero, the path will be formatted to this number of chars.
This only affects the generation of the path for the current resource.
abbrevLength
- the path abbreviation length to setpublic void setCms(CmsObject cms)
cms
- the cms context to setpublic void setReferenceProject(CmsProject project)
project
- the project to setpublic void setRelativeTo(java.lang.String relativeTo)
This only affects the generation of the path for the current resource.
relativeTo
- the 'relative to' path to setpublic void setResource(CmsResource resource)
resource
- the resource to setpublic void setSiteMode(org.opencms.workplace.explorer.CmsResourceUtil.CmsResourceUtilSiteMode siteMode)
This only affects the generation of the path for the current resource.
siteMode
- the site mode to set
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |