org.opencms.workplace.galleries
Class A_CmsAjaxGallery

java.lang.Object
  extended by org.opencms.workplace.CmsWorkplace
      extended by org.opencms.workplace.tools.CmsToolDialog
          extended by org.opencms.workplace.CmsDialog
              extended by org.opencms.workplace.galleries.A_CmsAjaxGallery
Direct Known Subclasses:
CmsAjaxDownloadGallery, CmsAjaxHtmlGallery, CmsAjaxImageGallery, CmsAjaxLinkGallery, CmsAjaxTableGallery

public abstract class A_CmsAjaxGallery
extends CmsDialog

Provides the general helper methods to generate the content of a gallery dialog used in the XML content editors, WYSIWYG editors and context menu. It

It is also used for AJAX requests to dynamically switch galleries or categories and get additional information for the currently active item of the dialog.

Extend this class for every gallery type (e.g. image gallery or download gallery) to build.

Since:
7.5.0
Version:
$Revision: 1.9 $
Author:
Polina Smagina

Field Summary
static java.lang.String DIALOG_CHANGEITEMLINKURL
          Request parameter value for the action: change the item link url value.
static java.lang.String DIALOG_CHANGEITEMTITLE
          Request parameter value for the action: change the item title property value.
static java.lang.String DIALOG_GETACTIVEITEM
          Request parameter value for the action: get the currently active item object.
static java.lang.String DIALOG_GETCATEGORIES
          Request parameter value for the action: get the category selection list.
static java.lang.String DIALOG_GETGALLERIES
          Request parameter value for the action: get the gallery selection list.
static java.lang.String DIALOG_GETGALLERY
          Request parameter value for the action: get a specific gallery.
static java.lang.String DIALOG_GETITEMS
          Request parameter value for the action: get the items for a gallery or category.
static java.lang.String DIALOG_LIST
          Request parameter value for the action: list gallery items.
static java.lang.String LISTMODE_CATEGORY
          The list mode name "category" for getting the items.
static java.lang.String LISTMODE_GALLERY
          The list mode name "gallery" for getting the items.
protected  java.lang.String m_galleryTypeParams
          The optional parameters for the gallery from the XML configuration.
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 PARAM_DIALOGMODE
          Request parameter name for the dialog mode (widget or editor).
static java.lang.String PARAM_EDITEDRESOURCE
          Request parameter name for the edited resource.
static java.lang.String PARAM_FIELDID
          Request parameter name for the input field id.
static java.lang.String PARAM_GALLERYPATH
          Request parameter name for the gallery path.
static java.lang.String PARAM_ITEMPATH
          Request parameter name for the active item path.
static java.lang.String PARAM_PARAMS
          Request parameter name for the dialog initialization parameters.
static java.lang.String PARAM_STARTUPFOLDER
          Request parameter name for the startup folder.
static java.lang.String PARAM_STARTUPTYPE
          Request parameter name for the startup type.
static java.lang.String PATH_GALLERIES
          The galleries path in the workplace containing the JSPs.
static java.lang.String RETURNVALUE_NONE
          Value that is returned if no result was found.
 
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_FORCE, 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_CmsAjaxGallery()
          Public empty constructor, required for createInstance(String, CmsJspActionElement).
A_CmsAjaxGallery(CmsJspActionElement jsp)
          Public constructor with JSP action element.
A_CmsAjaxGallery(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Public constructor with JSP variables.
 
Method Summary
protected  void buildJsonActiveItem(java.lang.String itemUrl)
          Builds the Javascript to set the currently active item object.
protected  void buildJsonCategoryList()
          Builds the JSON code for the category list as JSON array.
protected  void buildJsonGalleryItem(java.lang.String galleryUrl)
          Creates a JSON object with the information found on the given gallery URL.
protected  void buildJsonGalleryList()
          Builds the JSON code for the gallery list as JSON array.
protected  void buildJsonItemCommonPart(JSONObject jsonObj, CmsResource res, java.lang.String sitePath)
          Fills the JSON object with the information used for all resource types.
protected  JSONObject buildJsonItemObject(CmsResource res)
          Returns a JSON object containing information of the given resource for usage in the gallery.
protected abstract  void buildJsonItemSpecificPart(JSONObject jsonObj, CmsResource res, java.lang.String sitePath)
          Fills the JSON object with the specific information used for this resource type.
protected  void buildJsonResourceItems(java.util.List resourceitems, java.lang.String parentFolder)
          Builds the JSON code to create items for the folder.
protected  void changeItemLinkUrl(java.lang.String itemUrl)
          Changes the content of the CmsResource.
protected  void changeItemTitle(java.lang.String itemUrl)
          Changes the title property value of the given item.
static A_CmsAjaxGallery createInstance(java.lang.String galleryTypeName, CmsJspActionElement jsp)
          Creates a new gallery instance of the given gallery type name.
 void displayDialog()
          Called from the JSP that is used for the AJAX requests to OpenCms.
protected  java.util.List getCategoryItems()
          Returns the resource items for the selected category.
 java.util.List getGalleries()
          Returns a list of galleries which have the required gallery type id.
static java.util.List getGalleries(int galleryTypeId, CmsObject cms)
          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.
abstract  int getGalleryTypeId()
          Returns the type id of this gallery instance.
abstract  java.lang.String getGalleryTypeName()
          Returns the type name of this gallery instance.
 java.lang.String getGalleryTypeParams()
          Returns the (optional) parameters of this gallery instance.
 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 getParamListMode()
          Returns the list mode for getting the items, either LISTMODE_CATEGORY or LISTMODE_GALLERY.
 java.lang.String getParamPropertyValue()
          Returns the property value parameter.
 CmsResourceTypeFolderExtended getResourceType()
          Returns the extended folder resource type this gallery is based on.
 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.
 boolean isModeEditor()
          Returns if the dialog mode is the "editor" mode.
 boolean isModeView()
          Returns if the dialog mode is the "view" mode.
 boolean isModeWidget()
          Returns if the dialog mode is the "widget" mode.
 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 setParamListMode(java.lang.String paramListMode)
          Sets the list mode for getting the items, either LISTMODE_CATEGORY or LISTMODE_GALLERY.
 void setParamPropertyValue(java.lang.String paramPropertyValue)
          Sets the property value parameter.
 void setResourceType(CmsResourceTypeFolderExtended type)
          Sets the extended folder resource type this gallery is based on.
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, getParamForce, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamForce, 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

DIALOG_CHANGEITEMLINKURL

public static final java.lang.String DIALOG_CHANGEITEMLINKURL
Request parameter value for the action: change the item link url value.

See Also:
Constant Field Values

DIALOG_CHANGEITEMTITLE

public static final java.lang.String DIALOG_CHANGEITEMTITLE
Request parameter value for the action: change the item title property value.

See Also:
Constant Field Values

DIALOG_GETACTIVEITEM

public static final java.lang.String DIALOG_GETACTIVEITEM
Request parameter value for the action: get the currently active item object.

See Also:
Constant Field Values

DIALOG_GETCATEGORIES

public static final java.lang.String DIALOG_GETCATEGORIES
Request parameter value for the action: get the category selection list.

See Also:
Constant Field Values

DIALOG_GETGALLERIES

public static final java.lang.String DIALOG_GETGALLERIES
Request parameter value for the action: get the gallery selection list.

See Also:
Constant Field Values

DIALOG_GETGALLERY

public static final java.lang.String DIALOG_GETGALLERY
Request parameter value for the action: get a specific gallery.

See Also:
Constant Field Values

DIALOG_GETITEMS

public static final java.lang.String DIALOG_GETITEMS
Request parameter value for the action: get the items for a gallery or category.

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

LISTMODE_CATEGORY

public static final java.lang.String LISTMODE_CATEGORY
The list mode name "category" for getting the items.

See Also:
Constant Field Values

LISTMODE_GALLERY

public static final java.lang.String LISTMODE_GALLERY
The list mode name "gallery" for getting the items.

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

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_EDITEDRESOURCE

public static final java.lang.String PARAM_EDITEDRESOURCE
Request parameter name for the edited resource.

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_GALLERYPATH

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

See Also:
Constant Field Values

PARAM_ITEMPATH

public static final java.lang.String PARAM_ITEMPATH
Request parameter name for the active item path.

See Also:
Constant Field Values

PARAM_PARAMS

public static final java.lang.String PARAM_PARAMS
Request parameter name for the dialog initialization parameters.

See Also:
Constant Field Values

PARAM_STARTUPFOLDER

public static final java.lang.String PARAM_STARTUPFOLDER
Request parameter name for the startup folder.

See Also:
Constant Field Values

PARAM_STARTUPTYPE

public static final java.lang.String PARAM_STARTUPTYPE
Request parameter name for the startup type.

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

RETURNVALUE_NONE

public static final java.lang.String RETURNVALUE_NONE
Value that is returned if no result was found.

See Also:
Constant Field Values

m_galleryTypeParams

protected java.lang.String m_galleryTypeParams
The optional parameters for the gallery from the XML configuration.

Constructor Detail

A_CmsAjaxGallery

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


A_CmsAjaxGallery

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

Parameters:
jsp - an initialized JSP action element

A_CmsAjaxGallery

public A_CmsAjaxGallery(javax.servlet.jsp.PageContext context,
                        javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse res)
Public constructor with JSP variables.

Parameters:
context - the JSP page context
req - the JSP request
res - the JSP response
Method Detail

createInstance

public static A_CmsAjaxGallery 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

getGalleries

public static java.util.List getGalleries(int galleryTypeId,
                                          CmsObject cms)
Returns a list of galleries which have the required gallery type id.

Parameters:
galleryTypeId - type id of the gallery
cms - the initialized CmsObject for the current user
Returns:
a list of galleries

initGallery

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

Parameters:
wp - the workplace object

displayDialog

public void displayDialog()
Called from the JSP that is used for the AJAX requests to OpenCms.


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 abstract int getGalleryTypeId()
Returns the type id of this gallery instance.

Returns:
the type id of this gallery instance

getGalleryTypeName

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

Returns:
the 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

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

getParamListMode

public java.lang.String getParamListMode()
Returns the list mode for getting the items, either LISTMODE_CATEGORY or LISTMODE_GALLERY.

Returns:
the list mode for getting the item

getParamPropertyValue

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

Returns:
the property value parameter

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

init

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

It can be overwritten in the inherited class, e.g. CmsAjaxImageGallery.init().


isModeEditor

public boolean isModeEditor()
Returns if the dialog mode is the "editor" mode.

Returns:
true if the dialog mode is the "editor" mode, otherwise false

isModeView

public boolean isModeView()
Returns if the dialog mode is the "view" mode.

Returns:
true if the dialog mode is the "view" mode, otherwise false

isModeWidget

public boolean isModeWidget()
Returns if the dialog mode is the "widget" mode.

Returns:
true if the dialog mode is the "editor" mode, otherwise false

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

setParamListMode

public void setParamListMode(java.lang.String paramListMode)
Sets the list mode for getting the items, either LISTMODE_CATEGORY or LISTMODE_GALLERY.

Parameters:
paramListMode - the list mode for getting the items

setParamPropertyValue

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

Parameters:
paramPropertyValue - the property value parameter to set

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

buildJsonActiveItem

protected void buildJsonActiveItem(java.lang.String itemUrl)
Builds the Javascript to set the currently active item object.

Parameters:
itemUrl - the URL of the currently selected item

buildJsonCategoryList

protected void buildJsonCategoryList()
Builds the JSON code for the category list as JSON array.


buildJsonGalleryItem

protected void buildJsonGalleryItem(java.lang.String galleryUrl)
Creates a JSON object with the information found on the given gallery URL.

Parameters:
galleryUrl - the given gallery URL

buildJsonGalleryList

protected void buildJsonGalleryList()
Builds the JSON code for the gallery list as JSON array.


buildJsonItemCommonPart

protected void buildJsonItemCommonPart(JSONObject jsonObj,
                                       CmsResource res,
                                       java.lang.String sitePath)
Fills the JSON object with the information used for all resource types.

Parameters:
jsonObj - containing information used by all possible resource
res - the resource to create the object from
sitePath - site path to the object

buildJsonItemObject

protected JSONObject buildJsonItemObject(CmsResource res)
Returns a JSON object containing information of the given resource for usage in the gallery.

The content of the JSON object consists of a common and a specific part of the given resource.

Parameters:
res - the resource to create the object from
Returns:
the JSON object containing information from the given resource

buildJsonItemSpecificPart

protected abstract void buildJsonItemSpecificPart(JSONObject jsonObj,
                                                  CmsResource res,
                                                  java.lang.String sitePath)
Fills the JSON object with the specific information used for this resource type.

Parameters:
jsonObj - containing information used by all possible resource
res - the resource to create the object from
sitePath - site path to the object

buildJsonResourceItems

protected void buildJsonResourceItems(java.util.List resourceitems,
                                      java.lang.String parentFolder)
Builds the JSON code to create items for the folder.

Parameters:
resourceitems - the file resource to build the displayed items
parentFolder - the parent folder of the collected files (for a gallery)

changeItemLinkUrl

protected void changeItemLinkUrl(java.lang.String itemUrl)
Changes the content of the CmsResource.

This function should be overwritten in CmsAjaxLinkGallery.

Parameters:
itemUrl - the item URL

changeItemTitle

protected void changeItemTitle(java.lang.String itemUrl)
Changes the title property value of the given item.

Parameters:
itemUrl - the item URL on which the title is changed

getCategoryItems

protected java.util.List getCategoryItems()
Returns the resource items for the selected category.

Returns:
the resource items for the selected category

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
Parameters:
settings - the workplace settings
request - the current request
See Also:
CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)

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