|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workplace.CmsWorkplace
org.opencms.workplace.tools.CmsToolDialog
org.opencms.workplace.CmsDialog
org.opencms.workplace.galleries.A_CmsGallery
Provides constants, members and methods to generate a gallery popup window usable in editors or as widget.
Extend this class for every gallery type (e.g. image gallery) to build.
Field Summary | |
static int |
ACTION_DELETE
Value for the action: delete the gallery item. |
static int |
ACTION_LIST
Value for the action: list gallery items. |
static int |
ACTION_SEARCH
Value for the action: search gallery items. |
static int |
ACTION_UPLOAD
Value for the action: upload a new gallery item. |
static java.lang.String |
CSS_FILENAME
The CSS filename used in the galleries. |
static java.lang.String |
DIALOG_DELETE
Request parameter value for the action: delete the gallery item. |
static java.lang.String |
DIALOG_EDITPROPERTY
Request parameter value for the action: edit property value. |
static java.lang.String |
DIALOG_LIST
Request parameter value for the action: list gallery items. |
static java.lang.String |
DIALOG_SEARCH
Request parameter value for the action: search gallery items. |
static java.lang.String |
DIALOG_TYPE
The dialog type. |
static java.lang.String |
DIALOG_UPLOAD
Request parameter value for the action: upload a new gallery item. |
static java.lang.String |
MODE_EDITOR
Request parameter value for the dialog mode: editor. |
static java.lang.String |
MODE_VIEW
Request parameter value for the dialog mode: view. |
static java.lang.String |
MODE_WIDGET
Request parameter value for the dialog mode: widget. |
static java.lang.String |
OPEN_URI_SUFFIX
The uri suffix for the gallery start page. |
static java.lang.String |
PARAM_DIALOGMODE
Request parameter name for the dialog mode (widget or editor). |
static java.lang.String |
PARAM_FIELDID
Request parameter name for the input field id. |
static java.lang.String |
PARAM_GALLERY_TYPENAME
Request parameter name for the gallery type. |
static java.lang.String |
PARAM_GALLERYPATH
Request parameter name for the gallery path. |
static java.lang.String |
PARAM_PAGE
Request parameter name for the gallery list page. |
static java.lang.String |
PARAM_PROPERTYVALUE
Request parameter name for the property value. |
static java.lang.String |
PARAM_RESOURCEPATH
Request parameter name for the resourcepath. |
static java.lang.String |
PARAM_SEARCHWORD
Request parameter name for the search word. |
static java.lang.String |
PATH_GALLERIES
The galleries path in the workplace containing the JSPs. |
Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
PARAM_BASE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW |
Constructor Summary | |
A_CmsGallery()
Public empty constructor, required for createInstance(String, CmsJspActionElement) . |
|
A_CmsGallery(CmsJspActionElement jsp)
Public constructor with JSP action element. |
Method Summary | |
java.lang.String |
applyButton()
Generates an apply button for the gallery button bar. |
java.lang.String |
buildGalleryButtonBar()
Builds the html String for the buttonbar frame. |
protected java.lang.String |
buildGalleryItemListCustomEndCols(CmsResource res,
java.lang.String tdClass)
Generates the HTML for custom columns to shown at the end of the list of gallery columns. |
protected java.lang.String |
buildGalleryItemListCustomStartCols(CmsResource res,
java.lang.String tdClass)
Generates the HTML for custom columns to shown at the start of the list of gallery columns. |
protected java.lang.String |
buildGalleryItemListHeadline()
Generates the HTML for the gallery item list headline. |
abstract java.lang.String |
buildGalleryItemPreview()
Builds the html String for the preview frame. |
java.lang.String |
buildGalleryItems()
Builds the html for the gallery items list. |
java.lang.String |
buildGallerySelectBox()
Returns the html for the gallery select box. |
java.lang.String |
buildPageSelectBox()
Builds the HTML String for the page select box. |
int |
compareTo(java.lang.Object o)
Compares gallery objects by their order, this is used to sort the gallery buttons for the editors. |
static A_CmsGallery |
createInstance(CmsJspActionElement jsp)
Creates a new gallery instance. |
static A_CmsGallery |
createInstance(java.lang.String galleryTypeName,
CmsJspActionElement jsp)
Creates a new gallery instance of the given gallery type name. |
java.lang.String |
deleteButton()
Generates a delete button for the gallery button bar. |
java.lang.String |
editPropertyButton()
Generates an edit property button for the gallery button bar. |
boolean |
galleriesExists()
Checks if at least one gallery exists. |
java.lang.String |
getBodyOnload()
Returns the javascript body onload call for the gallery head frame. |
java.lang.String |
getCssPath()
Return the path of the css file used in the galleries. |
CmsResource |
getCurrentResource()
Returns the current resource in the gallery. |
java.util.List |
getGalleries()
Returns a list of galleries which have the required gallery type id. |
java.util.List |
getGalleryItems()
Returns a list of gallery items (resources) for the currently selected gallery and resource type id. |
abstract int |
getGalleryItemsTypeId()
Returns the type id of the gallery items that should be listed. |
int |
getGalleryTypeId()
Returns the resource type id of this gallery instance. |
java.lang.String |
getGalleryTypeName()
Returns the resource type name of this gallery instance. |
java.lang.String |
getGalleryTypeParams()
Returns the (optional) parameters of this gallery instance. |
java.lang.String |
getHeadFrameSetHeight()
Returns the height of the head frameset. |
java.lang.String |
getKeyTitle()
Returns the key title of the current gallery view. |
java.lang.String |
getNoGalleryErrorMsg()
Returns the error message if no gallery could be found. |
java.lang.Integer |
getOrder()
Returns the order of the implemented gallery, used to sort the gallery buttons in the editors. |
java.lang.String |
getParamDialogMode()
Returns the current mode of the dialog. |
java.lang.String |
getParamFieldId()
Returns the input field ID when in widget mode. |
java.lang.String |
getParamGalleryPath()
Returns the path of the gallery to display. |
java.lang.String |
getParamPage()
Returns the current page to display in the item list. |
java.lang.String |
getParamPropertyValue()
Returns the property value parameter. |
java.lang.String |
getParamResourcePath()
Returns the resource path. |
java.lang.String |
getParamSearchWord()
Returns the search word to look up in the gallery items. |
java.lang.String |
getPreviewBodyStyle()
Returns the style for the body tag of the preview frame. |
java.lang.String |
getPreviewDivStyle()
Returns the style for the div tag of the preview frame. |
protected java.lang.String |
getPropertyValue(CmsResource resource,
java.lang.String propertydefinition)
Returns the value of the given property definition of the specified resource. |
CmsResourceTypeFolderExtended |
getResourceType()
Returns the extended folder resource type this gallery is based on. |
protected java.util.List |
getSearchHits(java.util.List items)
Returns a list of hit items. |
protected java.lang.String |
getTargetOptions()
Returns a HTML String representing the options of the target select box. |
java.lang.String |
getWizardUrl()
Returns the url for the upload applet or JSP dialog. |
protected boolean |
hasWritePermissions()
Checks if the current user has required permissions to edit the current resource. |
void |
init()
Initialization method that is called after the gallery instance has been created. |
static void |
initGallery(CmsDialog wp)
Initializes the gallery dialog before redirecting. |
protected void |
initWorkplaceRequestValues(CmsWorkplaceSettings settings,
javax.servlet.http.HttpServletRequest request)
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly. |
java.lang.String |
previewButton()
Generates a preview button for the gallery button bar. |
java.lang.String |
previewRow(java.lang.String column1,
java.lang.String column2)
Generates a HTML table row with two columns. |
java.lang.String |
publishButton()
Generates a publish button for the gallery button bar. |
java.lang.String |
searchButton()
Builds the HTML for the search button. |
void |
setCurrentResource(CmsResource currentResource)
Sets the current resource. |
void |
setParamDialogMode(java.lang.String dialogMode)
Sets the current mode of the dialog. |
void |
setParamFieldId(java.lang.String fieldId)
Sets the input field ID if in widget mode. |
void |
setParamGalleryPath(java.lang.String galleryPath)
Sets the path of the gallery to display. |
void |
setParamPage(java.lang.String page)
Sets the current page to display in the item list. |
void |
setParamPropertyValue(java.lang.String paramPropertyValue)
Sets the property value parameter. |
void |
setParamResourcePath(java.lang.String resourcePath)
Sets the resource path. |
void |
setParamSearchWord(java.lang.String searchWord)
Sets the search word to look up in the gallery items. |
void |
setResourceType(CmsResourceTypeFolderExtended type)
Sets the extended folder resource type this gallery is based on. |
protected int |
sortOptions(java.util.List options,
java.util.List values)
Sorts the options and associated values in alphabetical order. |
java.lang.String |
targetSelectBox()
Generates a HTML String representing a target select box. |
java.lang.String |
wizardButton()
Builds the HTML for the wizard button. |
protected void |
writeTitleProperty(CmsResource res)
Changes the value of the property title for the specified resource. |
Methods inherited from class org.opencms.workplace.tools.CmsToolDialog |
dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamPath, setParamRoot, setParamStyle, useNewStyle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ACTION_DELETE
public static final int ACTION_LIST
public static final int ACTION_SEARCH
public static final int ACTION_UPLOAD
public static final java.lang.String CSS_FILENAME
public static final java.lang.String DIALOG_DELETE
public static final java.lang.String DIALOG_EDITPROPERTY
public static final java.lang.String DIALOG_LIST
public static final java.lang.String DIALOG_SEARCH
public static final java.lang.String DIALOG_TYPE
public static final java.lang.String DIALOG_UPLOAD
public static final java.lang.String MODE_EDITOR
public static final java.lang.String MODE_VIEW
public static final java.lang.String MODE_WIDGET
public static final java.lang.String OPEN_URI_SUFFIX
public static final java.lang.String PARAM_DIALOGMODE
public static final java.lang.String PARAM_FIELDID
public static final java.lang.String PARAM_GALLERY_TYPENAME
public static final java.lang.String PARAM_GALLERYPATH
public static final java.lang.String PARAM_PAGE
public static final java.lang.String PARAM_PROPERTYVALUE
public static final java.lang.String PARAM_RESOURCEPATH
public static final java.lang.String PARAM_SEARCHWORD
public static final java.lang.String PATH_GALLERIES
Constructor Detail |
public A_CmsGallery()
createInstance(String, CmsJspActionElement)
.
public A_CmsGallery(CmsJspActionElement jsp)
jsp
- an initialized JSP action elementMethod Detail |
public static A_CmsGallery createInstance(CmsJspActionElement jsp)
jsp
- an initialized JSP action element
public static A_CmsGallery createInstance(java.lang.String galleryTypeName, CmsJspActionElement jsp)
galleryTypeName
- the gallery type name to create the instance forjsp
- an initialized JSP action element
public static void initGallery(CmsDialog wp)
wp
- the workplace objectpublic java.lang.String applyButton()
The default apply button calls the javascript function link(resourcePath, input.title.value, input.title.value). Overwrite this method if necessary in the specified gallery class.
public java.lang.String buildGalleryButtonBar()
public abstract java.lang.String buildGalleryItemPreview()
public java.lang.String buildGalleryItems()
public java.lang.String buildGallerySelectBox()
public java.lang.String buildPageSelectBox()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
Comparable.compareTo(java.lang.Object)
public java.lang.String deleteButton()
This button is disabled if the urrent user has no write permissions.
Overwrite this method if necessary in the specified gallery class.
public java.lang.String editPropertyButton()
If the current resource is not 'editable' a disabled button will be returned.
Overwrite this method if necessary in the specified gallery class.
public boolean galleriesExists()
public java.lang.String getBodyOnload()
public java.lang.String getCssPath()
public CmsResource getCurrentResource()
public java.util.List getGalleries()
public java.util.List getGalleryItems()
public abstract int getGalleryItemsTypeId()
In case of downloadgallery use '-1' to list all resources excluding folders.
public int getGalleryTypeId()
public java.lang.String getGalleryTypeName()
public java.lang.String getGalleryTypeParams()
public java.lang.String getHeadFrameSetHeight()
public java.lang.String getKeyTitle()
public java.lang.String getNoGalleryErrorMsg()
public java.lang.Integer getOrder()
public java.lang.String getParamDialogMode()
This is necessary to distinguish between widget mode, view mode and editor mode.
public java.lang.String getParamFieldId()
public java.lang.String getParamGalleryPath()
public java.lang.String getParamPage()
public java.lang.String getParamPropertyValue()
public java.lang.String getParamResourcePath()
public java.lang.String getParamSearchWord()
public java.lang.String getPreviewBodyStyle()
public java.lang.String getPreviewDivStyle()
public CmsResourceTypeFolderExtended getResourceType()
public java.lang.String getWizardUrl()
public void init()
public java.lang.String previewButton()
Overwrite this method if neccessary in the specified gallery class.
public java.lang.String previewRow(java.lang.String column1, java.lang.String column2)
The first column includes the given key as localized string, the second column includes the value of the given property.
column1
- the string value for the first columncolumn2
- the string value for the second column
public java.lang.String publishButton()
This button is disabled if the current user has no publish rights.
public java.lang.String searchButton()
public void setCurrentResource(CmsResource currentResource)
currentResource
- the current resource to setpublic void setParamDialogMode(java.lang.String dialogMode)
This is necessary to distinguish between widget mode and editor mode.
dialogMode
- the current mode of the dialogpublic void setParamFieldId(java.lang.String fieldId)
fieldId
- the input field IDpublic void setParamGalleryPath(java.lang.String galleryPath)
galleryPath
- the path of the gallery to displaypublic void setParamPage(java.lang.String page)
page
- the current page to display in the item listpublic void setParamPropertyValue(java.lang.String paramPropertyValue)
paramPropertyValue
- the property value parameter to setpublic void setParamResourcePath(java.lang.String resourcePath)
resourcePath
- the resource path to setpublic void setParamSearchWord(java.lang.String searchWord)
searchWord
- the search word to look up in the gallery itemspublic void setResourceType(CmsResourceTypeFolderExtended type)
type
- the extended folder resource type this gallery is based onpublic java.lang.String targetSelectBox()
public java.lang.String wizardButton()
protected java.lang.String buildGalleryItemListCustomEndCols(CmsResource res, java.lang.String tdClass)
res
- the current VFS resourcetdClass
- the current syle sheet class name for the table cell
protected java.lang.String buildGalleryItemListCustomStartCols(CmsResource res, java.lang.String tdClass)
res
- the current VFS resourcetdClass
- the current syle sheet class name for the table cell
protected java.lang.String buildGalleryItemListHeadline()
protected java.lang.String getPropertyValue(CmsResource resource, java.lang.String propertydefinition)
If the property value is null, '[resourcename]' will be returned instead.
resource
- the cms resourcepropertydefinition
- the property definition
protected java.util.List getSearchHits(java.util.List items)
Searches by the title property value and resource name.
items
- a list of resource items
protected java.lang.String getTargetOptions()
protected boolean hasWritePermissions() throws CmsException
CmsException
- if something goes wrongprotected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
CmsWorkplace
initWorkplaceRequestValues
in class CmsDialog
CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
protected int sortOptions(java.util.List options, java.util.List values)
options
- a list of optionsvalues
- a list of associated values
protected void writeTitleProperty(CmsResource res)
res
- the resource to change the property value
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |