org.opencms.workplace.galleries
Class A_CmsGallery

java.lang.Object
  extended byorg.opencms.workplace.CmsWorkplace
      extended byorg.opencms.workplace.tools.CmsToolDialog
          extended byorg.opencms.workplace.CmsDialog
              extended byorg.opencms.workplace.galleries.A_CmsGallery
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
CmsDownloadGallery, CmsHtmlGallery, CmsImageGallery, CmsLinkGallery

public abstract class A_CmsGallery
extends CmsDialog
implements java.lang.Comparable

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.

Since:
6.0.0
Version:
$Revision: 1.27 $
Author:
Andreas Zahner, Armen Markarian

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_CSSPATH
          Request parameter name for the CSS path used in the preview area.
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.CmsDialog
ACTION_CANCEL, ACTION_CLOSEPOPUP, ACTION_CLOSEPOPUP_SAVE, ACTION_CONFIRMED, ACTION_CONTINUE, ACTION_DEFAULT, ACTION_LOCKS_CONFIRMED, ACTION_OK, ACTION_REPORT_BEGIN, ACTION_REPORT_END, ACTION_REPORT_UPDATE, ACTION_SET, ACTION_WAIT, ATTRIBUTE_THROWABLE, BUTTON_ADVANCED, BUTTON_BACK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_CONTINUE, BUTTON_DETAILS, BUTTON_DISCARD, BUTTON_EDIT, BUTTON_OK, BUTTON_OK_NO_SUBMIT, BUTTON_SET, DIALOG_BACK, DIALOG_CANCEL, DIALOG_CONFIRMED, DIALOG_CONTINUE, DIALOG_INITIAL, DIALOG_LOCKS_CONFIRMED, DIALOG_OK, DIALOG_SET, DIALOG_WAIT, PARAM_ACTION, PARAM_CLOSELINK, PARAM_DIALOGTYPE, PARAM_ERRORSTACK, PARAM_FILE, PARAM_FRAMENAME, PARAM_ISPOPUP, PARAM_LOCK, PARAM_MESSAGE, PARAM_ORIGINALPARAMS, PARAM_PREACTIONDONE, PARAM_REDIRECT, PARAM_RESOURCE, PARAM_TARGET, PARAM_THREAD, PARAM_THREAD_HASNEXT, PARAM_TITLE, REPORT_BEGIN, REPORT_END, REPORT_UPDATE
 
Fields inherited from class org.opencms.workplace.tools.CmsToolDialog
PARAM_BASE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW
 
Fields inherited from class org.opencms.workplace.CmsWorkplace
DEBUG, DEFAULT_LANGUAGE, DEFAULT_LOCALE, DIALOG_PATH_COMMON, FILE_DIALOG_CLOSE, FILE_DIALOG_SCREEN_CONFIRM, FILE_DIALOG_SCREEN_ERROR, FILE_DIALOG_SCREEN_ERRORPAGE, FILE_DIALOG_SCREEN_WAIT, FILE_EXPLORER_FILELIST, FILE_REPORT_OUTPUT, HTML_END, HTML_START, PARAM_WP_EXPLORER_RESOURCE, PARAM_WP_PROJECT, PARAM_WP_SITE, PATH_DIALOGS, PATH_WORKPLACE, REQUEST_ATTRIBUTE_MULTIPART, REQUEST_ATTRIBUTE_RELOADTREE, RFS_PATH_RESOURCES, SESSION_WORKPLACE_CLASS, TEMP_FILE_PREFIX, VFS_DIR_DEFAULTBODIES, VFS_DIR_TEMPLATES, VFS_PATH_COMMONS, VFS_PATH_EDITORS, VFS_PATH_GALLERIES, VFS_PATH_LOCALES, VFS_PATH_MODULES, VFS_PATH_RESOURCES, VFS_PATH_SYSTEM, VFS_PATH_VIEWS, VFS_PATH_WORKPLACE
 
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 getParamCssPath()
          Returns the CSS path used in the preview area.
 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 setParamCssPath(java.lang.String paramCssPath)
          Sets the CSS path used in the preview area.
 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.CmsDialog
actionCloseDialog, appendDelimiter, buildAjaxResultContainer, buildAjaxWaitMessage, buildLockAdditionalOptions, buildLockConfirmationMessageJS, buildLockDialog, buildLockDialog, buildLockHeaderBox, checkResourcePermissions, checkResourcePermissions, computeCurrentFolder, dialog, dialogBlock, dialogBlockEnd, dialogBlockStart, dialogButtonRow, dialogButtonRowEnd, dialogButtonRowStart, dialogButtons, dialogButtonsClose, dialogButtonsClose, dialogButtonsCloseDetails, dialogButtonsHtml, dialogButtonsOk, dialogButtonsOk, dialogButtonsOkCancel, dialogButtonsOkCancel, dialogButtonsOkCancelAdvanced, dialogButtonsSetOkCancel, dialogContent, dialogContentEnd, dialogContentStart, dialogEnd, dialogHead, dialogHorizontalSpacer, dialogLockButtons, dialogRow, dialogRowEnd, dialogRowStart, dialogScriptSubmit, dialogSeparator, dialogSpacer, dialogStart, dialogStart, dialogSubheadline, dialogToggleStart, dialogWhiteBox, dialogWhiteBoxEnd, dialogWhiteBoxStart, getAction, getAdministrationBackLink, getCancelAction, getDialogRealUri, getDialogUri, getOnlineHelpUriCustom, getParamAction, getParamCloseLink, getParamDialogtype, getParamFramename, getParamIsPopup, getParamMessage, getParamOriginalParams, getParamPreActionDone, getParamRedirect, getParamResource, getParamTitle, getState, hasCorrectLockstate, hasSiblings, htmlStart, htmlStart, htmlStart, htmlStartStyle, includeErrorpage, initCmsDialog, isPopup, isPreEditor, pageHtml, pageHtml, setAction, setOnlineHelpUriCustom, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamOriginalParams, setParamPreActionDone, setParamRedirect, setParamResource, setParamTitle
 
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 org.opencms.workplace.CmsWorkplace
addMessages, addMessages, allParamsAsHidden, allParamsAsRequest, allParamValues, bodyEnd, bodyStart, bodyStart, buildSelect, buildSelect, button, button, buttonBar, buttonBar, buttonBarHorizontalLine, buttonBarLabel, buttonBarLabel, buttonBarLine, buttonBarLineSpacer, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, checkLock, checkLock, checkRole, decodeParamValue, fillParamValues, fillParamValues, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, htmlEnd, initMessages, initSettings, initTimeWarp, initUserSettings, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, isTemporaryFileName, key, key, keyDefault, nullToEmpty, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, switchToCurrentProject, switchToTempProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_DELETE

public static final int ACTION_DELETE
Value for the action: delete the gallery item.

See Also:
Constant Field Values

ACTION_LIST

public static final int ACTION_LIST
Value for the action: list gallery items.

See Also:
Constant Field Values

ACTION_SEARCH

public static final int ACTION_SEARCH
Value for the action: search gallery items.

See Also:
Constant Field Values

ACTION_UPLOAD

public static final int ACTION_UPLOAD
Value for the action: upload a new gallery item.

See Also:
Constant Field Values

CSS_FILENAME

public static final java.lang.String CSS_FILENAME
The CSS filename used in the galleries.

See Also:
Constant Field Values

DIALOG_DELETE

public static final java.lang.String DIALOG_DELETE
Request parameter value for the action: delete the gallery item.

See Also:
Constant Field Values

DIALOG_EDITPROPERTY

public static final java.lang.String DIALOG_EDITPROPERTY
Request parameter value for the action: edit property value.

See Also:
Constant Field Values

DIALOG_LIST

public static final java.lang.String DIALOG_LIST
Request parameter value for the action: list gallery items.

See Also:
Constant Field Values

DIALOG_SEARCH

public static final java.lang.String DIALOG_SEARCH
Request parameter value for the action: search gallery items.

See Also:
Constant Field Values

DIALOG_TYPE

public static final java.lang.String DIALOG_TYPE
The dialog type.

See Also:
Constant Field Values

DIALOG_UPLOAD

public static final java.lang.String DIALOG_UPLOAD
Request parameter value for the action: upload a new gallery item.

See Also:
Constant Field Values

MODE_EDITOR

public static final java.lang.String MODE_EDITOR
Request parameter value for the dialog mode: editor.

See Also:
Constant Field Values

MODE_VIEW

public static final java.lang.String MODE_VIEW
Request parameter value for the dialog mode: view.

See Also:
Constant Field Values

MODE_WIDGET

public static final java.lang.String MODE_WIDGET
Request parameter value for the dialog mode: widget.

See Also:
Constant Field Values

OPEN_URI_SUFFIX

public static final java.lang.String OPEN_URI_SUFFIX
The uri suffix for the gallery start page.

See Also:
Constant Field Values

PARAM_CSSPATH

public static final java.lang.String PARAM_CSSPATH
Request parameter name for the CSS path used in the preview area.

See Also:
Constant Field Values

PARAM_DIALOGMODE

public static final java.lang.String PARAM_DIALOGMODE
Request parameter name for the dialog mode (widget or editor).

See Also:
Constant Field Values

PARAM_FIELDID

public static final java.lang.String PARAM_FIELDID
Request parameter name for the input field id.

See Also:
Constant Field Values

PARAM_GALLERY_TYPENAME

public static final java.lang.String PARAM_GALLERY_TYPENAME
Request parameter name for the gallery type.

See Also:
Constant Field Values

PARAM_GALLERYPATH

public static final java.lang.String PARAM_GALLERYPATH
Request parameter name for the gallery path.

See Also:
Constant Field Values

PARAM_PAGE

public static final java.lang.String PARAM_PAGE
Request parameter name for the gallery list page.

See Also:
Constant Field Values

PARAM_PROPERTYVALUE

public static final java.lang.String PARAM_PROPERTYVALUE
Request parameter name for the property value.

See Also:
Constant Field Values

PARAM_RESOURCEPATH

public static final java.lang.String PARAM_RESOURCEPATH
Request parameter name for the resourcepath.

See Also:
Constant Field Values

PARAM_SEARCHWORD

public static final java.lang.String PARAM_SEARCHWORD
Request parameter name for the search word.

See Also:
Constant Field Values

PATH_GALLERIES

public static final java.lang.String PATH_GALLERIES
The galleries path in the workplace containing the JSPs.

See Also:
Constant Field Values
Constructor Detail

A_CmsGallery

public A_CmsGallery()
Public empty constructor, required for createInstance(String, CmsJspActionElement).


A_CmsGallery

public A_CmsGallery(CmsJspActionElement jsp)
Public constructor with JSP action element.

Parameters:
jsp - an initialized JSP action element
Method Detail

createInstance

public static A_CmsGallery createInstance(CmsJspActionElement jsp)
Creates a new gallery instance.

Parameters:
jsp - an initialized JSP action element
Returns:
a new gallery instance

createInstance

public static A_CmsGallery createInstance(java.lang.String galleryTypeName,
                                          CmsJspActionElement jsp)
Creates a new gallery instance of the given gallery type name.

Parameters:
galleryTypeName - the gallery type name to create the instance for
jsp - an initialized JSP action element
Returns:
a new gallery instance of the given gallery type name

initGallery

public static void initGallery(CmsDialog wp)
Initializes the gallery dialog before redirecting.

Parameters:
wp - the workplace object

applyButton

public java.lang.String applyButton()
Generates an apply button for the gallery button bar.

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.

Returns:
an apply button for the gallery button bar

buildGalleryButtonBar

public java.lang.String buildGalleryButtonBar()
Builds the html String for the buttonbar frame.

Returns:
the html String for the buttonbar frame

buildGalleryItemPreview

public abstract java.lang.String buildGalleryItemPreview()
Builds the html String for the preview frame.

Returns:
the html String for the preview frame

buildGalleryItems

public java.lang.String buildGalleryItems()
Builds the html for the gallery items list.

Returns:
the html for the gallery items list

buildGallerySelectBox

public java.lang.String buildGallerySelectBox()
Returns the html for the gallery select box.

Returns:
the html for the gallery select box

buildPageSelectBox

public java.lang.String buildPageSelectBox()
Builds the HTML String for the page select box.

Returns:
the HTML String for the page select box

compareTo

public int compareTo(java.lang.Object o)
Compares gallery objects by their order, this is used to sort the gallery buttons for the editors.

Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

deleteButton

public java.lang.String deleteButton()
Generates a delete button for the gallery button bar.

This button is disabled if the urrent user has no write permissions.

Overwrite this method if necessary in the specified gallery class.

Returns:
a delete button for the gallery button bar

editPropertyButton

public java.lang.String editPropertyButton()
Generates an edit property button for the gallery button bar.

If the current resource is not 'editable' a disabled button will be returned.

Overwrite this method if necessary in the specified gallery class.

Returns:
an edit property button for the gallery button bar

galleriesExists

public boolean galleriesExists()
Checks if at least one gallery exists.

Returns:
true if at least one gallery exists, otherwise false

getBodyOnload

public java.lang.String getBodyOnload()
Returns the javascript body onload call for the gallery head frame.

Returns:
the javascript body onload call for the gallery head frame

getCssPath

public java.lang.String getCssPath()
Return the path of the css file used in the galleries.

Returns:
the path of the css file used in the galleries

getCurrentResource

public CmsResource getCurrentResource()
Returns the current resource in the gallery.

Returns:
the current resource in the gallery

getGalleries

public java.util.List getGalleries()
Returns a list of galleries which have the required gallery type id.

Returns:
a list of galleries

getGalleryItems

public java.util.List getGalleryItems()
Returns a list of gallery items (resources) for the currently selected gallery and resource type id.

Returns:
a list of gallery items (resources)

getGalleryItemsTypeId

public abstract int getGalleryItemsTypeId()
Returns the type id of the gallery items that should be listed.

In case of downloadgallery use '-1' to list all resources excluding folders.

Returns:
the type id of the gallery items that should be listed

getGalleryTypeId

public int getGalleryTypeId()
Returns the resource type id of this gallery instance.

Returns:
the resource type id of this gallery instance

getGalleryTypeName

public java.lang.String getGalleryTypeName()
Returns the resource type name of this gallery instance.

Returns:
the resource type name of this gallery instance

getGalleryTypeParams

public java.lang.String getGalleryTypeParams()
Returns the (optional) parameters of this gallery instance.

Returns:
the (optional) parameters of this gallery instance

getHeadFrameSetHeight

public java.lang.String getHeadFrameSetHeight()
Returns the height of the head frameset.

Returns:
the height of the head frameset

getKeyTitle

public java.lang.String getKeyTitle()
Returns the key title of the current gallery view.

Returns:
the key title of the current gallery view

getNoGalleryErrorMsg

public java.lang.String getNoGalleryErrorMsg()
Returns the error message if no gallery could be found.

Returns:
the error message if no gallery could be found

getOrder

public java.lang.Integer getOrder()
Returns the order of the implemented gallery, used to sort the gallery buttons in the editors.

Returns:
the order of the implemented gallery

getParamCssPath

public java.lang.String getParamCssPath()
Returns the CSS path used in the preview area.

Returns:
the CSS path used in the preview area

getParamDialogMode

public java.lang.String getParamDialogMode()
Returns the current mode of the dialog.

This is necessary to distinguish between widget mode, view mode and editor mode.

Returns:
the current mode of the dialog

getParamFieldId

public java.lang.String getParamFieldId()
Returns the input field ID when in widget mode.

Returns:
the input field ID

getParamGalleryPath

public java.lang.String getParamGalleryPath()
Returns the path of the gallery to display.

Returns:
the path of the gallery to display

getParamPage

public java.lang.String getParamPage()
Returns the current page to display in the item list.

Returns:
the current page to display in the item list

getParamPropertyValue

public java.lang.String getParamPropertyValue()
Returns the property value parameter.

Returns:
the property value parameter

getParamResourcePath

public java.lang.String getParamResourcePath()
Returns the resource path.

Returns:
the resource path

getParamSearchWord

public java.lang.String getParamSearchWord()
Returns the search word to look up in the gallery items.

Returns:
the search word to look up in the gallery items

getPreviewBodyStyle

public java.lang.String getPreviewBodyStyle()
Returns the style for the body tag of the preview frame.

Returns:
the style for the body tag of the preview frame

getPreviewDivStyle

public java.lang.String getPreviewDivStyle()
Returns the style for the div tag of the preview frame.

Returns:
the style for the div tag of the preview frame

getResourceType

public CmsResourceTypeFolderExtended getResourceType()
Returns the extended folder resource type this gallery is based on.

Returns:
the extended folder resource type this gallery is based on

getWizardUrl

public java.lang.String getWizardUrl()
Returns the url for the upload applet or JSP dialog.

Returns:
the url for the upload applet or JSP dialog

init

public void init()
Initialization method that is called after the gallery instance has been created.


previewButton

public java.lang.String previewButton()
Generates a preview button for the gallery button bar.

Overwrite this method if neccessary in the specified gallery class.

Returns:
a preview button for the gallery button bar

previewRow

public java.lang.String previewRow(java.lang.String column1,
                                   java.lang.String column2)
Generates a HTML table row with two columns.

The first column includes the given string, the second column includes the value of the given property.

Parameters:
column1 - the string value for the first column
column2 - the string value for the second column
Returns:
a HTML table row with two columns

publishButton

public java.lang.String publishButton()
Generates a publish button for the gallery button bar.

This button is disabled if the current user has no publish rights.

Returns:
a publish button for the gallery button bar

searchButton

public java.lang.String searchButton()
Builds the HTML for the search button.

Returns:
the HTML for the search button

setCurrentResource

public void setCurrentResource(CmsResource currentResource)
Sets the current resource.

Parameters:
currentResource - the current resource to set

setParamCssPath

public void setParamCssPath(java.lang.String paramCssPath)
Sets the CSS path used in the preview area.

Parameters:
paramCssPath - the CSS path used in the preview area

setParamDialogMode

public void setParamDialogMode(java.lang.String dialogMode)
Sets the current mode of the dialog.

This is necessary to distinguish between widget mode and editor mode.

Parameters:
dialogMode - the current mode of the dialog

setParamFieldId

public void setParamFieldId(java.lang.String fieldId)
Sets the input field ID if in widget mode.

Parameters:
fieldId - the input field ID

setParamGalleryPath

public void setParamGalleryPath(java.lang.String galleryPath)
Sets the path of the gallery to display.

Parameters:
galleryPath - the path of the gallery to display

setParamPage

public void setParamPage(java.lang.String page)
Sets the current page to display in the item list.

Parameters:
page - the current page to display in the item list

setParamPropertyValue

public void setParamPropertyValue(java.lang.String paramPropertyValue)
Sets the property value parameter.

Parameters:
paramPropertyValue - the property value parameter to set

setParamResourcePath

public void setParamResourcePath(java.lang.String resourcePath)
Sets the resource path.

Parameters:
resourcePath - the resource path to set

setParamSearchWord

public void setParamSearchWord(java.lang.String searchWord)
Sets the search word to look up in the gallery items.

Parameters:
searchWord - the search word to look up in the gallery items

setResourceType

public void setResourceType(CmsResourceTypeFolderExtended type)
Sets the extended folder resource type this gallery is based on.

Parameters:
type - the extended folder resource type this gallery is based on

targetSelectBox

public java.lang.String targetSelectBox()
Generates a HTML String representing a target select box.

Returns:
a HTML String representing a target select box

wizardButton

public java.lang.String wizardButton()
Builds the HTML for the wizard button.

Returns:
the HTML for the wizard button

buildGalleryItemListCustomEndCols

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.

Parameters:
res - the current VFS resource
tdClass - the current syle sheet class name for the table cell
Returns:
the HTML for custom columns to shown at the end of the list of gallery columns

buildGalleryItemListCustomStartCols

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.

Parameters:
res - the current VFS resource
tdClass - the current syle sheet class name for the table cell
Returns:
the HTML for custom columns to shown at the end of the list of gallery columns

buildGalleryItemListHeadline

protected java.lang.String buildGalleryItemListHeadline()
Generates the HTML for the gallery item list headline.

Returns:
the HTML for the gallery item list headline

getPropertyValue

protected java.lang.String getPropertyValue(CmsResource resource,
                                            java.lang.String propertydefinition)
Returns the value of the given property definition of the specified resource.

If the property value is null, '[resourcename]' will be returned instead.

Parameters:
resource - the cms resource
propertydefinition - the property definition
Returns:
the value of the title property or '[resourcename]' if property value was null

getSearchHits

protected java.util.List getSearchHits(java.util.List items)
Returns a list of hit items.

Searches by the title property value and resource name.

Parameters:
items - a list of resource items
Returns:
a list of hit items

getTargetOptions

protected java.lang.String getTargetOptions()
Returns a HTML String representing the options of the target select box.

Returns:
a HTML String representing the options of the target select box

hasWritePermissions

protected boolean hasWritePermissions()
                               throws CmsException
Checks if the current user has required permissions to edit the current resource.

Returns:
true if the required permissions are satisfied
Throws:
CmsException - if something goes wrong

initWorkplaceRequestValues

protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings,
                                          javax.servlet.http.HttpServletRequest request)
Description copied from class: CmsWorkplace
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly.

Overrides:
initWorkplaceRequestValues in class CmsDialog
See Also:
CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)

sortOptions

protected int sortOptions(java.util.List options,
                          java.util.List values)
Sorts the options and associated values in alphabetical order.

Parameters:
options - a list of options
values - a list of associated values
Returns:
the new index of the currently selected option according to the new order

writeTitleProperty

protected void writeTitleProperty(CmsResource res)
Changes the value of the property title for the specified resource.

Parameters:
res - the resource to change the property value