opencms documentation€¦ · 20 search with apache solr 56 ... • add and manage jsp in the...

79
OpenCms Documentation Version 8.5.0

Upload: nguyenthien

Post on 10-Apr-2018

227 views

Category:

Documents


3 download

TRANSCRIPT

  • OpenCms DocumentationVersion 8.5.0

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH

    Contents1 Introduction 12 JSP basics 22.1.1 JSP features 22.1.2 How to continue from here? 2The JSP cms-taglib 22.1.3 How to insert the "taglib" directive? 22.1.4 Available tags 32.1.5 Available EL functions 33 Page editor 53.1 Toolbar 53.1.1 Controls 53.2 Edit points 53.3 The Add Content 63.3.1 Creating new content 63.3.2 Searching for content 63.3.2.1 Results 63.4 Clipboard 63.4.1 Recent list 73.4.2 Favorites 73.4.2.1 Add to favorites 83.4.2.2 Favorites list 83.5 Context 83.5.1 Availability 83.5.2 Show workplace 93.5.3 Properties 93.6 Publish 93.6.1 Publish dialog 94 Sitemap Editor 104.1 Introduction 104.2 Open the Sitemap Editor 104.3 Sitemap toolbar 114.3.1 Controls 114.4 Create page 114.4.1 Container Pages 124.4.1.1 Edit Model Page 134.4.2 Type pages 13

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH

    4.4.2.1 Detail pages 134.4.3 Function pages 134.4.3.1 HTML Redirect 144.4.3.2 Navigation Level 144.4.3.3 Function detail pages 144.5 Clipboard 144.5.1 Modified 154.5.2 Deleted 154.6 Display all Resources 154.7 Context menu 154.8 Edit point 155 Inline Editing 165.1 Demo 165.2 XmlContent fields with inline editing option 175.3 Configuration 175.3.1 Formatters 175.3.2 Nested contents 185.3.3 Details 186 Content editor widgets 196.1 Widgets 196.2 Widget description 196.2.1 BooleanWidget 196.2.2 DisplayWidget 196.2.3 StringWidget 196.2.4 TextareaWidget 206.2.5 HtmlWidget 206.2.6 RadioSelectWidget 216.2.7 SelectorWidget 226.2.8 MultiSelectWidget 226.2.9 ComboWidget 236.2.10 TypeComboWidget 236.2.11 LocalizationWidget 246.2.12 ColorpickerWidget 256.2.13 DateTimeWidget 256.2.14 CategoryWidget 266.2.15 GroupWidget 276.2.16 GroupMultiSelectorWidget 276.2.17 VfsFileWidget 28

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH

    6.2.18 VfsImageWidget 286.2.19 DownloadGalleryWidget 306.2.20 ImageGalleryWidget 306.2.21 HtmlGalleryWidget 316.2.22 TableGalleryWidget 326.2.23 LinkGalleryWidget 327 Model Page 337.1 Creation 337.2 Configuration 337.3 Extended feature 348 Element Group 348.1 Description 348.2 Combination with model page 348.3 How to use the element group 358.3.1 Editing 359 Inheritance Group 3610 Description 3611 Basic definitions 3612 Usage 3712.1 Creating new inheritance groups 3712.2 Using existing inheritance groups 3712.3 Changing inheritance groups 3712.3.1 Changing the title and description 3712.3.2 Adding content elements 3812.3.3 Removing content elements 3912.3.4 Reordering content elements 3912.3.5 Inheritance status 4012.3.6 Showing previously hidden elements 4012.3.7 Save 4112.3.8 Break up 4112.3.9 Edit settings 4113 Internals 4113.1 Resource types 4214 Detail Page 4214.1 Use Case 4214.2 Configuration 4214.2.1 Module adjustments 4314.2.2 Add detail page to the sitemap 43

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH

    15 Function Detail Page 4415.1 Use Case 4415.2 General steps 4415.3 Creating dynamic function 4415.4 Create and configure function detail page 4415.5 Usage 4516 Simple Collector 4616.1 Demo 4616.2 Implementation 4616.3 Configuration 4616.4 How to use collector in a jsp 4716.5 How to drop the list into a container page 4716.6 How to use detail pages for lists 4816.7 Code examples 4817 XSD Choice Element 4917.1 Definition 4917.2 Single and multiple choice 5017.3 Content editor 5017.4 Accessing values in JSP 5017.5 Examples 5217.5.1 v8 InfoBox 5217.5.2 Development Demo 5218 Navigation Level 5318.1 Use Case 5318.2 How to use the "Navigation Level" 5318.3 Implementation details 5318.3.1 Navigation tag 5318.3.2 Styling 5318.4 Examples 5419 Hidden Entries 5419.1 Description 5419.2 Usage 5420 Search with Apache Solr 5621 Abstract 5622 Searching for Content in OpenCms 5622.1 DEMO 5622.2 Quick Start Example 5622.2.1 Send a REST-like query 57

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH

    22.2.2 Retrieve the response 5722.2.3 Send a Java-API query 5922.2.4 Use CmsSolrQuery class for querying Solr 6022.3 Advanced Search Feature Examples 6022.3.1 Auto suggestion/completion/correction 6022.3.2 Excerpt 6022.3.3 Facteted search 6022.3.4 Grouping 6022.3.5 Highlighting 6022.3.6 Range queries 6022.3.7 Sorting 6022.3.8 Spellchecking 6022.3.9 Thesaurus/Synomys 6122.3.10 Querying multiple cores (indexes) 6122.4 Using the standard OpenCms Solr collector 6123 Indexing Content of OpenCms 6223.1 Search Configuration 6223.1.1 Embedded/HTTP Solr Server 6223.1.2 Search index(es) 6323.1.3 Index sources 6323.1.4 A new document type 6423.1.5 The Solr default field configuration 6423.1.6 Migrating a Lucene index to a Solr index 6423.2 Indexed data 6623.2.1 The Solr index schema (schema.xml) 6623.2.2 Default index fields 6823.2.3 Custom fields for XML contents 6923.2.4 Dynamic field mappings 7023.2.5 Custom field configuration 7023.2.6 Extend the CmsSolrFieldConfiguration 7024 Behind the walls 7024.1 The request handler 7024.2 Permission check 7024.3 Configurable post processor 7024.4 Multilingual support 7124.5 Multilingual dependency resolving 7124.6 Extraction result cache 7125 SEO 72

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH

    26 CMIS 72

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 1

    1 IntroductionThis documentation has been developed by Alkacon Software - the OpenCms experts [1]. Weoffer standard service and support packages for OpenCms, providing an optional layer ofsecurity and convenience often required for mission critical OpenCms projects. For moreinformation about our services, please contact us at [email protected] [2].It aims to help developers from getting started with OpenCms up to getting familiar withadvanced development topics regarding OpenCms. It uses links referring a locally installedOpenCms verion >= 8.5 including the OpenCms v8 Modules ('modules-v8 [3]') together with theOpenCms Developer Modules ('dev-demo'). In order to use the interactive development demofrom OpenCms 8 together with this documentation we assume you have a running OpenCms onlocalhost:8080 and the OpenCmsServlet is reachable under http:/ / localhost:8080/opencms/ opencms [4]. If so, you are able use the links inside this documentation that will openthe according DEMO pages inside the "Wonderful world of flowers".If you don't have a running OpenCms including the Alkacon OpenCms Demo Modules yet,please read OpenCms server installation and you will see how to setup and run OpenCms...This documentation is published under the GNU FDL Free Documentation License by AlkaconSoftware GmbH. We certainly welcome all contributions and feedback to this documentation.

    Developer Documentation

    Version Date

    OpenCms 8.5.0 2012-09-24

    Document 1.0 2012-09-24

    References[1] http:/ / www. alkacon. com[2] mailto:info@alkacon. com[3] https:/ / github. com/ alkacon/ modules-v8[4] http:/ / localhost:8080/ opencms/ opencms

    http://www.alkacon.commailto:[email protected]://github.com/alkacon/modules-v8http://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencmshttp://dev-wiki.alkacon.com/index.php?title=OpenCms_server_installationhttp://dev-wiki.alkacon.com/index.php?title=File%3AOpenCms_Logo_800_transparent_24bit.pnghttp://www.alkacon.commailto:[email protected]://github.com/alkacon/modules-v8http://localhost:8080/opencms/opencms

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 2

    2 JSP basicsThis part of the documentation describes the basics of JSP application development withOpenCms. It provides an overview and some background information about the technology usedfor the OpenCms JSP integration. Other sections available in the Alkacon OpenCmsdocumentation accompany this introduction and serve as further reference material.Please note that this is not an introduction to JSP developing, there are certainly many goodtutorials or books for that around.The JSP integration part in OpenCms is called Flex. So if we talk about an OpenCms/Flex orjust a Flex application, we actually mean a JSP application built with OpenCms. The name Flexwas chosen because the ultimate goal of the JSP integration was to make OpenCms moreflexible to use. We think that we have achieved that goal. But judge for yourself...

    2.1.1 JSP features Add and manage JSP in the OpenCms Workplace Supports WYSIWYG editable pages which use JSP templates Use the same JSP template for editable pages and interactive forms JSP Taglib for common OpenCms tasks JSP API to directly access OpenCms functionality Separate online and offline versions of the same JSP The FlexCache, a powerful declarative caching mechanism Optional output streaming on a per-page basis Optional static export of JSP

    2.1.2 How to continue from here? Creating a JSP in 7 simple steps - 7 simple steps that show how to create, edit and publish

    JSP pages with the OpenCms workplace explorer. Using OpenCms features within JSP files - Introduces the basic concepts how to access

    OpenCms from JSP pages in order to work with XML-contents, templates, users and otherdata stored and managed in OpenCms.

    Advanced JSP topics - Important background information about the OpenCms JSPintegration

    JSP includes in OpenCms - How to include sub-elements in an OpenCms managed JSP

    The JSP -taglib

    2.1.3 How to insert the "taglib" directive?If you like to use the OpenCms JSP taglib, you must insert the "taglib" directive in your JSPpage to specify where the OpenCms taglib definition can be found. This can be done in twodifferent ways: 1. With standard JSP-/Servlet-Technology:

    This directive must be set before any cms tags are used. If used like shown in the example, theprefix "cms" is unique for the OpenCms Taglib. In our examples, all tags of the OpenCms taglibstart with the prefix "cms:". 2. With OpenCms specific short form:

    http://dev-wiki.alkacon.com/index.php?title=Creating_a_JSP_in_7_simple_stepshttp://dev-wiki.alkacon.com/index.php?title=Using_OpenCms_features_within_JSP_fileshttp://dev-wiki.alkacon.com/index.php?title=Advanced_JSP_topicshttp://dev-wiki.alkacon.com/index.php?title=JSP_includes_in_OpenCmshttp://www.opencms.org/taglib/cms

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 3

    2.1.4 Available tagsThe following list of -tags is available in the OpenCms standard taglib. An tag can beexecuted by calling:

    cms:container - Enables the template mechanism for container pages. cms:contentaccess - Provides access to the content for the JSP EL. cms:contentcheck - Provides conditional logic for checking the element of a XML content. cms:contentinfo - Provides access to the result set of a contentload. cms:contentload - Loads XML content items from the OpenCms VFS. cms:contentloop - Allows looping through XML content node element values. cms:contentshow - Provides access to individual XML content node element values. cms:decorate - Provides decoration of HTML content. cms:device - Provides different HTML output for various device types. cms:editable - Enables the direct editing within a template. cms:elementsetting - Provides access to the settings of an ADE container element. cms:enable-ade - Enables the advanced direct editing within a template. cms:export - Writes JSP code from a JSP to files in the static export. cms:formatter - Loads single XML content items for ADE formatters. cms:headincludes - Includes required css or javascript resources, placed in html/head. cms:img - Supports image scaling using the OpenCms native image scaling mechanism. cms:include - Includes other JSP elements dynamically at runtime. cms:info - Enables access to some system information like OpenCms version etc. cms:jquery - Allows to include jquery and some jquery plugins code and style sheets. cms:label - Reads localized values from the resource bundles (Java property files like

    workplace.properties) that hold user messages. cms:link - Builds a valid OpenCms URL for a given resource. cms:navigation - Provides access to the navigation information. cms:nocache - Sends no-cache headers to the browser. cms:param - Adds a parameter to the outer tag (if supported). cms:parse - Decorates HTML with custom A_CmsConfiguredHtmlParser implementations

    given in the parserClass attribute. cms:property - Enables read access to the current VFS file's properties. cms:resourceaccess - Provides access the the resources for the JSP EL. cms:resourceload - Loads resources from the OpenCms VFS. cms:secureparams - Enables automatic parameter escaping for the current flex request. cms:template - Splits a JSP page into elements to be included by the 'cms:include' tag. cms:user - Enables access to the properties of the currently logged in user. cms:usertracking - Performs user tracking actions like visit resources or

    subscribe/unsubscribe.

    http://dev-wiki.alkacon.com/index.php?title=Cms:containerhttp://dev-wiki.alkacon.com/index.php?title=Cms:contentaccesshttp://dev-wiki.alkacon.com/index.php?title=Cms:contentcheckhttp://dev-wiki.alkacon.com/index.php?title=Cms:contentinfohttp://dev-wiki.alkacon.com/index.php?title=Cms:contentloadhttp://dev-wiki.alkacon.com/index.php?title=Cms:contentloophttp://dev-wiki.alkacon.com/index.php?title=Cms:contentshowhttp://dev-wiki.alkacon.com/index.php?title=Cms:decoratehttp://dev-wiki.alkacon.com/index.php?title=Cms:devicehttp://dev-wiki.alkacon.com/index.php?title=Cms:editablehttp://dev-wiki.alkacon.com/index.php?title=Cms:elementsettinghttp://dev-wiki.alkacon.com/index.php?title=Cms:enable-adehttp://dev-wiki.alkacon.com/index.php?title=Cms:exporthttp://dev-wiki.alkacon.com/index.php?title=Cms:formatterhttp://dev-wiki.alkacon.com/index.php?title=Cms:headincludeshttp://dev-wiki.alkacon.com/index.php?title=Cms:imghttp://dev-wiki.alkacon.com/index.php?title=Cms:includehttp://dev-wiki.alkacon.com/index.php?title=Cms:infohttp://dev-wiki.alkacon.com/index.php?title=Cms:jqueryhttp://dev-wiki.alkacon.com/index.php?title=Cms:labelhttp://dev-wiki.alkacon.com/index.php?title=Cms:linkhttp://dev-wiki.alkacon.com/index.php?title=Cms:navigationhttp://dev-wiki.alkacon.com/index.php?title=Cms:nocachehttp://dev-wiki.alkacon.com/index.php?title=Cms:paramhttp://dev-wiki.alkacon.com/index.php?title=Cms:parsehttp://dev-wiki.alkacon.com/index.php?title=Cms:propertyhttp://dev-wiki.alkacon.com/index.php?title=Cms:resourceaccesshttp://dev-wiki.alkacon.com/index.php?title=Cms:resourceloadhttp://dev-wiki.alkacon.com/index.php?title=Cms:secureparamshttp://dev-wiki.alkacon.com/index.php?title=Cms:templatehttp://dev-wiki.alkacon.com/index.php?title=Cms:userhttp://dev-wiki.alkacon.com/index.php?title=Cms:usertracking

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 4

    2.1.5 Available EL functionsThe following list of EL-functions is available in the OpenCms standard taglib. AnEL-function can be accessed by calling:${cms:functionName(parameters)}

    cms:vfs - Provides simple access to a OpenCms JSP / EL content vfs access bean. cms:convertDate - Allows conversion of Long values to Dates. Can also handle Strings that

    represent a Long or a Date. cms:convertLocale - Allows conversion of Objects to Locales. Can also handle Strings that

    are locales, or Locales itself. cms:convertList - Returns a list of attribute values specified by the attribute name of the

    items of the given list. cms:getCmsObject - Returns the current OpenCms user context from the page context. cms:getListSize - Returns the size of the given list. cms:stripHtml - Strips all HTML markup from the given input. cms:trimToSize - Returns a substring of the input, which is not longer then the given int

    value. cms:convertUUID - Allows conversion of String values to CmsUUIDs. Can also handle byte[]

    that are CmsUUIDs, or CmsUUID itself. cms:getRequestParam - Returns the value of a parameter from a String that is formatted for

    a GET request. cms:getRequestLink - Returns the link without parameters from a String that is formatted for

    a GET request. cms:escape - Encodes a String in a way that is compatible with the JavaScript escape

    function. cms:unescape - Decodes a String in a way that is compatible with the JavaScript unescape

    function. cms:navUri - Returns the current navigation URI.

    http://dev-wiki.alkacon.com/index.php?title=Cms:vfshttp://dev-wiki.alkacon.com/index.php?title=Cms:convertDatehttp://dev-wiki.alkacon.com/index.php?title=Cms:convertLocalehttp://dev-wiki.alkacon.com/index.php?title=Cms:convertListhttp://dev-wiki.alkacon.com/index.php?title=Cms:getCmsObjecthttp://dev-wiki.alkacon.com/index.php?title=Cms:getListSizehttp://dev-wiki.alkacon.com/index.php?title=Cms:stripHtmlhttp://dev-wiki.alkacon.com/index.php?title=Cms:trimToSizehttp://dev-wiki.alkacon.com/index.php?title=Cms:convertUUIDhttp://dev-wiki.alkacon.com/index.php?title=Cms:getRequestParamhttp://dev-wiki.alkacon.com/index.php?title=Cms:getRequestLinkhttp://dev-wiki.alkacon.com/index.php?title=Cms:escapehttp://dev-wiki.alkacon.com/index.php?title=Cms:unescapehttp://dev-wiki.alkacon.com/index.php?title=Cms:navUri

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 5

    3 Page editor

    3.1 ToolbarThe toolbar is docked on the window top, when browsing the offline preview of the page. Youcan toggle it on or off by clicking the Edit point icon in the upper right corner.

    3.1.1 ControlsThe edit toolbar appears on top of the page and shows the available options:

    Available options are:

    Publish: This icon opens the publish dialog. Clipboard: Opens the clipboard, where a content editor can access favorites and

    recently changed files. Add content: The "Add content" allows to add content to a container page by drag &

    drop. Edit point: Clicking the "Edit point" icon switches on / off the edit points for the editable

    elements on the website. Context: Opens the context menu of the current container page Sitemap: Opens the Sitemap Editor

    The following section explains all Controls in detail. The order of the described controls differs.

    http://dev-wiki.alkacon.com/index.php?title=File:Page_editor_with_toolbar.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_publish.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_clipboard.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_add.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_selection.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_context.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_sitemap.png

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 6

    3.2 Edit pointsBy clicking on the Edit point on the toolbar, you can turn on / off the editable mode for allelements on the page. The edit points appear on all editable elements.

    3.3 The Add Content

    3.3.1 Creating new contentNew Content is created by using the Add content option in the toolbar.The gallery dialog opens in an overlay and shows a list of all possible Resource Types forcontent that can be added to the current container page.The Content Editor simply selects the content type needed and drags this on the page.

    3.3.2 Searching for contentSimilar to adding new content you can also add existing content to your page.

    To search for existing content click on the Add content icon in the toolbar. Select one ormore resource types and click on result button.All elements displayed in the Add content dialog can be added to a page by drag & drop.

    3.3.2.1 ResultsYou can combine all of the given search refinements by Types, Galleries, Categories andAdvanced if you like. Click the Results button to generate an overview according to your searchsettings to display content of the given criteria. Thus it is possible to see a result list of allexisting contents of these types in the OpenCms repository.

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_selection.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_add.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Page_editor_add_content_dialog.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_add.png

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 7

    3.4 Clipboard

    3.4.1 Recent listYou can access the Clipboard and Recent list from the page you are editing by clicking on the

    Clipboard icon in the toolbar.The clipboard holds a list of all elements that have recently been edited or modified. You candirectly add content from the clipboard to your page by drag & drop.

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_clipboard.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_clipboard.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Page_editor_recent_list.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 8

    3.4.2 Favorites

    3.4.2.1 Add to favoritesEditing your page you can add any element to user individual favorites list using the Add tofavorites option on the element.

    3.4.2.2 Favorites listThe favorites list is also part of the clipboard and can be accessed via the Clipboard option fromthe toolbar. Any element of the favorites list can be added to your page by drag & drop.

    3.5 ContextYou can access the page's context menu by selecting the from the toolbar.Available options are:

    Properties: Display and edit the OpenCms properties of current container page.Attributes: container page attributes, like date created, date last modified, etc.Availability: the availability optionsLock report: lock state report of current container pageAssign categories: dialog to assign categories to current container pageSEO options: Search engine optimazationUndo changesShow workplace: open the OpenCmsworkplaceLogout

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_favorites.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Page_editor_add_favorites.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_context.png

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 9

    3.5.1 AvailabilityBy selecting the Availability option from the page's context menu you can access and setdifferent properties concerning the resource's online visibility.Available options in the Availability / Publish Scheduled dialog are: Publish scheduled

    Publish scheduled date: Using the Publish scheduled date, this page will be publishedautomatically on the set date / time.

    Availability Date released: By setting the release date, this page will be visible online from the chosen

    date / time on (if published). Date expired: By setting the expiry date, this page will be online (if published) until this

    date / time and the will disappear but still remain in the OpenCms VFSYou can set the dates by keyboard input or by using the simple calendar widget that will appear,when the mouse is clicked in the according field.

    3.5.2 Show workplaceTo access the OpenCms workplace, select the Show workplace option from the context menu.The OpenCms workplace opens featuring more advanced options to inspect and modifyresources.

    3.5.3 PropertiesTo edit the page properties, select the Properties option from the page's context menu.The newly designed property dialog allows changing of all properties of the resource in theOpenCms VFS. In the Properties dialog, there are 3 different subsets of properties available:Basic, Individual and Shared Properties.

    3.6 PublishAfter you made one or many changes in the page editor or in the sitemap editor, you still need topublish those changes to be visible in the OpenCms "Online" project.The Publish option allows you to publish all changes you recently made directly from pageeditor.

    To publish the edited page and its contents select the Publish option from the toolbar. Thepublish dialog opens in an overlaying window.

    3.6.1 Publish dialogThe publish list contains all unpublished resources that have been added, modified or deleted bythe current user. Unchanged resources are never shown in the publish list. If a resource islocked by another user it will not be shown in the publish list.For a better overview the publish list displays different sessions of the current user.It is possible to select single resources with a checkbox, or select / deselect all displayedresources or select / deselect all resources of a certain session.A new option that is available when publishing from page editor is to deselect individual itemsfrom the publish list.

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_publish.png

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 10

    On mouse-over there appears the option to remove a single resource from the user's personalpublish list.In case the deselected resource has siblings or related resources, these will also be removedfrom the list provided these options have been chosen by the user (see below: "Include relatedresources").If an item was removed from the publish list, it will re-appear if the dialog is opened again.With the two checkboxes below the publish list it is possible to extend the publish list. Include related resources will publish all new / changed resources that are related to the

    original resource (e.g. images or linked resources). Include siblings will publish resources that are directly link to the original resource and that

    get changed when the original resource gets changed.Resources can also be published from the Sitemap Editor.

    4 Sitemap Editor

    4.1 IntroductionThe sitemap editor allows you to build the site navigation structure by creating new containerpages and changing the navigation information of the existing sites.The sitemap represents the website structure displaying the container page tree. The user candrop new container pages to different levels of the navigation tree, enter further information liketitle, create new sub sitemaps or break the exiting and change the order of the pages with drag& drop.The container page sitemap describes the navigation structure of the website. It approximate thefile tree in the workplace VFS explorer but does not cover it exactly. To see the complete VFStree, switch to extended view.This documentation adresses content editors. It does not cover the topics related to sitemapconfiguration.

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 11

    4.2 Open the Sitemap EditorFrom the page editor click the icon Sitemap in the toolbar to open the Sitemap editor in anew window. The sitemap editor displays the container page tree not VFS structure in theorder they appear in the navigation. When moving the mouse over a page in the sitemap editortwo options get displayed on the right side of the bar: Context and Move.

    4.3 Sitemap toolbarSitemap editor comes up with its own toolbar.

    4.3.1 ControlsThe following options are available:

    Publish: opens the publish dialog Clipboard: shows deleted or recently modified pages Create page: opens the dialog from which model pages can be dropped to the sitemap Display all Resources: opens an extended sitemap view, which corresponds to the VFS

    explorer view in the workplace. Context: opens the context menu for the sitemap Edit point: returns to the page editor

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_sitemap.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Sitemap_editor_toolbar.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_publish.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_clipboard.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_add.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_sitemap.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_context.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_selection.png

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 12

    4.4 Create pageWith the Create page option from the Sitemap toolbar you can add a new page to a sitemapby drag & drop.The opening dialog features three options: Container pages Type pages Function pages

    4.4.1 Container PagesDepending on the configured model pages provided by the template designer you can selectfrom different "blank" pages meeting your requirements.You can drag a new container page to wherever you need it in the sitemap.

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_add.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Sitemap_editor_create_page_tabs.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Sitemap_editor_create_page_dialog_dragging.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 13

    Hint: to add a sub-page to an existing leaf, drag the container page on the move symbol andplace it over the container page icon.

    If the displayed page contains sub-pages itself that are currently not displayed (you might wantto unfold them by clicking the (+) more symbol) you can insert the new page after the existingpage at the same navigation level.The folder structure can be unfold while drag & drop by moving the mouse over a folder icon.

    4.4.1.1 Edit Model PageTo edit a model page open the Create page dialog in tab Container pages and select the Edit option from the context menu of a new container page. You have to confirm this operationsince you are about to edit the model for new pages. This will not change already existingpages. This option will open the model page in ADE so you can add or remove default elementsfor new pages.

    4.4.2 Type pagesSelecting the Type pages option from the Create page dialog offers a selection of detail pagesfor specific resource types. Detail pages do not contain content elements themselves.

    4.4.2.1 Detail pagesIt is not necessary to create a new page in the sitemap for every instance of a resource typeholding content. You should maintain a single "Detail page" to show all contents of a specificresource type. Detail pages are used to link from search results, content collector lists or teaserelements.The detail content gets displayed in the center column of the detail page (depends on templateand columns) and can be accessed by an automatically generated URI, built from the detailcontents Title property.Read more about the detail pages in section Detail pages.

    http://dev-wiki.alkacon.com/index.php?title=File:Sitemap_editor_add_sub_page.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_edit.png

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 14

    4.4.3 Function pagesSelecting the Function pages option from the Create page dialog offers a selection of pages forspecial purpose. Following function pages are possible. HTML Redirect Navigation level function detail pages

    4.4.3.1 HTML RedirectA HTML Redirect might be accessible through the page navigation and redirects the browser toanother URI within the site or to an external link.It might also be excluded from navigation but necessary if a page / sub-site has moved toanother location and to prevent dead links from users' bookmarks.

    4.4.3.2 Navigation LevelRead more about navigation level here: Navigation Level.

    4.4.3.3 Function detail pagesRead more about function detail pages here: Function detail pages.

    http://dev-wiki.alkacon.com/index.php?title=File:Sitemap_editor_function_pages.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 15

    4.5 ClipboardWhen selecting the Clipboard option from the sitemap toolbar the clipboard opens in anoverlay window.It features two lists of pages recently edited in the sitemap editor.

    4.5.1 ModifiedThe Modified list will be displayed as default and contains pages that have recently beenmodified in the Sitemap Editor. When you move the mouse over a list entry, to the right side ofthe bar there appears an option to show the page in the Sitemap Editor. If clicked the overlaywindow is closed and the selected page will show up blinking in the Sitemap Editor.

    4.5.2 DeletedThis list holds all pages that had been deleted from the sitemap editor without publishing thedeletion.Moving the mouse over a list entry will show up an Undelete option to the right side of the bar,restoring the original state of the resource before it was deleted.

    4.6 Display all ResourcesWhen sitemap editor is opened it display the navigation structure of the website. This meansthat you edit the sitemap as it is accessible to a user browsing your site or a search engine'srobot crawling your site. This structure does not correspond the VFS explorer tree of theworkplace

    If necessary, the Display all Resources option will show the site's folder tree and allcontained resources.When this option is selected, the "Create page" dialog as well as drag & drop feature is disabled.The user can browse the file tree and use the context menu to access other options.Note: This option might display resources that are not necessarily accessible from the site as auser browses it and thus might be of resource types that could not properly be rendered.Note: When displaying all resources the available options for each Sitemap element arereduced to Context menu. Moving an element is deactivated.

    4.7 Context menuIn the context menu display options available for this part of a sitemap. Show parent sitemap map Edit aliases Refresh Show worklpace Logout

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_clipboard.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_sitemap.png

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 16

    4.8 Edit pointThe Edit point returns to the page editor of the container page, which was edited as the lastpage.

    5 Inline EditingInline editing is a new feature introduced with OpenCms 8, which improves user experienceduring editing of page contents. The Inline Editing enables the editor to change the contentsdirectly on the preview page. The content editor can still be used as usual for editing thecomplete content of the resource.Click here to open the corresponding Inline Editing Demo of Development Demo Module [1]

    5.1 DemoInline editing is enabled by clicking on the Edit point in the toolbar. An edit cursor appears,when the cursor is hovering text, which can be edited inline.

    By cliking the inline editable field, the text is highlighted and optionally a format toolbar isswitched on.

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_selection.pnghttp://localhost:8080/opencms/opencms/dev-demo/inline-editing-demo/http://dev-wiki.alkacon.com/index.php?title=File:Inline_editing_cursor.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 17

    5.2 XmlContent fields with inline editing optionInline Editing can be enabled for following xmlcontent fields of type OpenCmsString: OpenCmsString (without widget configuration) HtmlWidgetWe intend to extend this list for the future versions.

    5.3 ConfigurationInline Editing is configured inside a formatter jsp. Each formatter of a resource type defines itsown inline edit behavior. E.g. an article can be dropped to the center column as well as to theside column, but the editor should only be able to edit the article in the center column. Toachieve this only the formatter used to render the article in the center column container shouldenable the inline editing.

    http://dev-wiki.alkacon.com/index.php?title=File:Inline_editing_active.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 18

    5.3.1 FormattersThere is an xmlcontent with a field Title. The inline editig feature for this xmlcontent field canbe configured in the formatter jsp in only two steps:1. To enable the inline editing add a new attribute rdfa="rdfa" to tag.2. Add ${rdfa.fieldName} as attribute to the html element, which surrounds the field

    content.

    ${value.Text}

    5.3.2 Nested contentsWith EL the nested content field can be accessed like in following example:

    ...

    ${paragraph.value.Headline}

    ${paragraph.value.Text}

    ${content.valueList.Paragraph} return a list ofCmsJspContentAccessValueWrapper objects${paragraph.value.Headline} and ${paragraph.value.Text} access the values ofthe nested fieldsJust replace the .value with rdfa to get the css attributes required for inline editing. Toenable the inline editing add ${paragraph.rdfa.Headline} and${paragraph.rdfa.Text} to the html tag, which surround the field content:

    ...

    ${paragraph.value.Headline}

    ${paragraph.value.Text}

    5.3.3 Detailsrdfa attribute of the tag is used in a similar manner to the val attribute.Assume the xmlcontent has a field with the name Title. In EL with ${rdfa.Title} you getthe specific css attributes, which are required to enable the inline editing feature for this contentfield. These automatically generated attributes has to be set as attribute on the html element,which surrounds the field content. Note that the inline editing feature cannot be applied to fieldcontents, that are manipulated in a jsp e.g. with cms:stripHtml() or cms:trimToSite().

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 19

    References[1] http:/ / localhost:8080/ opencms/ opencms/ dev-demo/ inline-editing-demo/

    6 Content editor widgets

    6.1 WidgetsWidgets are used to create a suitable content editor for XML content. The widgets to be usedare defined in the XML Schema Definition of your XML content type. The new content editorwidgets support all known widgets. In some cases the way of display is changed and some havemore parameters than before. The following will describe each widget and its parameters with ashort example.

    6.2 Widget description

    6.2.1 BooleanWidgetThe BooleanWidget provides a checkbox.

    This widget does not need any configuration and can be define in the xsd by this way:

    ...

    6.2.2 DisplayWidgetThe DisplyWidget only shows a value. The value cannot be changed or edit by the user. It is setduring configuration of this widget.

    During the definition of this widget it could be set a configuration string. This string is displayedin the display widget. It can be define in the xsd by this way:

    ...

    ...

    ...

    http://localhost:8080/opencms/opencms/dev-demo/inline-editing-demo/http://dev-wiki.alkacon.com/index.php?title=File:CheckboxWindget.jpeghttp://dev-wiki.alkacon.com/index.php?title=File:Display.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 20

    6.2.3 StringWidgetThe StringWidget provides an input field to write or edit the text.

    This widget does not need any configuration and can be define in the xsd by this way:

    ...

    6.2.4 TextareaWidgetThe TextareaWidget provides a text area field for input. It is like the StringWidget but can showmore than one row at once and it supports to scroll if the text is too big to display all. The fieldcan also be resized by using the mark at the right bottom corner.

    This widget has only one parameter that can be set during the definition in xsd. This parametersets the number of rows that should be shown. The default value, if no configuration is set, is toshow fife rows of text. This value also sets the minimum height of the field. It cannot be resizedsmaller than the given row count.

    ...

    ...

    ...

    6.2.5 HtmlWidgetThe HtmlWidget is like the text area but it allows formatting the text directly in the input field. Likea text editor it has some implemented functions to format the text left or right, to indent the textor to build a bulleted list. This formatted text will be saved with the entire html format.

    http://dev-wiki.alkacon.com/index.php?title=File:Input.jpghttp://dev-wiki.alkacon.com/index.php?title=File:TextArea.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Html.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 21

    Options can be defined for each element of the type OpenCmsHtml using the widgetHtmlWidget. They have to be placed in the annotation section of a XSD describing XML content.The configuration attribute in the layout node for the element must contain the activated optionsas a comma separated String value:

    ...

    ...

    ...

    Available options are: anchor: the anchor dialog button buttonbar:${button bar items, separated by ';'}: an individual button bar configuration. css:/vfs/path/to/cssfile.css: the absolute path in the OpenCms VFS to the CSS style sheet to

    use to render the contents in the editor (availability depends on the integrated editor) formatselect: the format selector for selecting text format like paragraph or headings formatselect.options:${list of options, separated by ';'}: the options that should be available in

    the format selector, e.g. formatselect.options:p;h1;h2 fullpage: the editor creates an entire HTML page code ${gallerytype}: Shows a gallery dialog button, e.g. imagegallery displays the image gallery

    button or downloadgallery displays the download gallery button height:${editorheight}: the editor height, where the height can be specified in px or %, e.g.

    400px hidebuttons:${list of buttons to hide, separated by ';'}: the buttons to hide that usually appear

    in the default button bar, e.g. hidebuttons:bold;italic;underline;strikethrough hides someformatting buttons

    image: the image dialog button (availability depends on the integrated editor) link: the link dialog button source: shows the source code toggle button(s) stylesxml:/vfs/path/to/stylefile.xml: the absolute path in the OpenCms VFS to the user defined

    styles that should be displayed in the style selector (availability depends on the integratededitor)

    stylesformat:/vfs/path/to/stylefile.xml: the absolute path in the OpenCms VFS to the userdefined styles format that should be displayed in the style selector (availability depends on theintegrated editor)

    table: the table dialog button (availability depends on the integrated editor)Some configurations like the button bar items should be defined in the global widgetconfiguration of the file opencms-vfs.xml.

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 22

    6.2.6 RadioSelectWidgetThe RadioSelectWidget provides a group of radio buttons to select only one value.

    For the configuration of this widget please read "SelectWidgetConfiguration".An example for an xsd definition is:

    ...

    ...

    ...

    6.2.7 SelectorWidgetThe SelectorWidget provides a select box to select only one value.

    For the configuration of this widget please read "SelectWidgetConfiguration".An example for an xsd definition is:

    ...

    ...

    ...

    http://dev-wiki.alkacon.com/index.php?title=File:RadioButton.jpghttp://dev-wiki.alkacon.com/index.php?title=SelectWidgetConfigurationhttp://dev-wiki.alkacon.com/index.php?title=File:SelectBox.jpghttp://dev-wiki.alkacon.com/index.php?title=SelectWidgetConfiguration

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 23

    6.2.8 MultiSelectWidgetThe RadioSelectWidget provides a group of check boxes to select one or more value.

    For the configuration of this widget please read "SelectWidgetConfiguration".An example for an xsd definition is:

    ...

    ...

    ...

    6.2.9 ComboWidgetThe ComboWidget is like the SelectorWidget with the different that it combines an input field andthe select box. That means you can either select the value from the select box or type it yourself.

    For the configuration of this widget please read "SelectWidgetConfiguration".An example for an xsd definition is:

    ...

    ...

    ...

    http://dev-wiki.alkacon.com/index.php?title=File:MultiSelectBox.jpghttp://dev-wiki.alkacon.com/index.php?title=SelectWidgetConfigurationhttp://dev-wiki.alkacon.com/index.php?title=File:Combo.jpghttp://dev-wiki.alkacon.com/index.php?title=SelectWidgetConfiguration

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 24

    6.2.10 TypeComboWidgetThis like the ComboWidget, with the difference that it directly a list of all types provides. It hasnot to be configurated to show the selection.

    This widget does not need any configuration and can be define in the xsd by this way:

    ...

    ...

    ...

    6.2.11 LocalizationWidgetThe LocalizationWidget provides a standard HTML form input field for overwriting localizedvalues of a resource bundle. The resource bundle is configured with the widget configurationattribute. An optional key name to look up in the bundle can be given, too, in case it is differentfrom the element name: key=mykey.

    The locale to get the value for can be configured, too, by adding a configuration directive:locale=en.

    ...

    ...

    http://dev-wiki.alkacon.com/index.php?title=File:TypeCombo.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Localization.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 25

    ...

    To use the stored localization values and have the values of the resource bundles as fallback,use the CmsXmlMessages object.

    6.2.12 ColorpickerWidgetThe color picker widget provides an easy way to select a color. There are two ways to use thiswidget. The first way is to type the color value directly into the input field. The second is to openthe popup and choose there a color, known by other color picker like Photoshop. If you use thepopup, the value will automatically select by closing the popup.

    This widget does not need any configuration and can be define in the xsd by this way:

    ...

    6.2.13 DateTimeWidgetThe date picker widget is an easy way to select a date. On the one hand you can select the dateby selecting it in the popup; on the other you can type it directly into the input field.

    This widget does not need any configuration and can be define in the xsd by this way:

    http://dev-wiki.alkacon.com/index.php?title=File:ColorPicker.jpghttp://dev-wiki.alkacon.com/index.php?title=File:DateTimeWidget.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 26

    ...

    6.2.14 CategoryWidgetThe CategoryWidget provides a category based selection. By clicking on the widget it open acategory selection where the category can be selected. On depended of the configuration onlyone category is selectable (singe selection) or more categories are selectable at once.

    This widget has some optional configuration parameters: category: Path to the folder of the categories that should be selectable onlyleafs: starts the selection in a list view parentSelection: add this parameter if the parent categories should be stored with the children

    by multiselecitoncategryThis widget has two different schema types. As a function of this schema type the widget will bea single selection or a multi selection. For the single selection please use the OpenCmsVfsFileschema type in xsd, for the multi selection use OpenCmsCategorySingle selection category widget can be decelerated this way:

    ...

    ...

    ...

    Multi selection category widget can be decelerated this way:

    http://dev-wiki.alkacon.com/index.php?title=File:Category.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 27

    ...

    ...

    ...

    6.2.15 GroupWidgetThe GroupWidget is like the select widget. The different is that no configuration is neededbecause the selection is automatically built. This selection is a list of groups from the OpenCms.

    This widget does not need any configuration and can be define in the xsd by this way:

    ...

    ...

    ...

    6.2.16 GroupMultiSelectorWidgetThe GroupMultiSelectorWidget is like the GroupWidget. The different is that more than onevalue can be selected.

    This widget is configurable with the following options: groupfilter: regular expression to filter available groups groups: comma separated list of group names to show in the select box.

    Note: if this configuration option if used, groupfilter and includesubous are not consideredanymore.

    includesubous: boolean flag to indicate if sub OUs should be scanned for groups to select oufqn: the fully qualified name of the OU to read the groups fromTo map the selected group to a permission to set, use the following mapping configuration:

    http://dev-wiki.alkacon.com/index.php?title=File:Group.jpghttp://dev-wiki.alkacon.com/index.php?title=File:GroupMulti.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 28

    This means that the +r+v permission is written for the principal GROUP on the resource.Additionally two permissions are written as default: for ALL_OTHERS, no allowed permission isset, for Projectmanagers, "+r+v+w+c" is set.This widget does not need any configuration and can be define in the xsd by this way:

    ...

    ...

    ...

    6.2.17 VfsFileWidgetThe VfsFileWidget provides a selection of a file in the vfs. It either can be typed in directly or bechoosing with the gallery. This gallery will come up by pushing the button on the right side of theinput field. A detail description of the popup can you find here: "GallerySelection"

    This widget has this configuration options: hidesiteselector, showsiteselector: The site selector is hidden or shown (default) excludefiles, includefiles: Files are hidden in the popup tree or shown (default) notprojectaware, projectaware: Folders and files are shown according to the current project or

    not (default) startsite: The site the popup tree should be opened withAnd can be declared this way:

    ...

    ...

    ...

    http://dev-wiki.alkacon.com/index.php?title=File:VfsFile.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 29

    6.2.18 VfsImageWidgetThe VfsImageWidget provides a selection of a image in the vfs. It either can be typed in directlyor be choosing with the gallery. This gallery will come up by pushing the button on the right sideof the input field. A detail description of the popup can you find here: "GallerySelection"

    Configuration options for the VFS image widget. The configuration options are read from theconfiguration String of the widget. The configuration String has to be formatted as JSON object,with the following possible keys: class: optional class implementing to dynamically configure startup parameters and format

    values formatnames: list of format names to select, with pairs of selectable value and selectable text,

    e.g. value1:optiontext1|value2:optiontext2 formatvalues: corresponding format values to the format names list, can be dynamically

    generated by the dynamic configuration class. The list of values should contain width andheight information, with a '?' as sign for dynamic size and with an 'x' as separator for widthand height. Example: ['200x?', '800x600']

    scaleparams: default scale parameters (no width, height or crop information should beprovided!)

    startup: the startup folder, can be dynamically generated by the provided class, in that case,use 'dynamic' as value

    type: the startup folder type, can be 'gallery' or 'category'. Can be dynamically generated bythe provided class, in that case, use 'dynamic' as value

    usedescription: indicates if the description input field for the image should be shown or not useformat: indicates if the format select box for the image should be shown or notAn example configuration can look like this: {scaleparams: 'q:70,r:2,c:CCCC00', type: 'gallery', startup:

    '/demo_en/images/',usedescription: true,

    useformat: true, formatnames: 'imageleft:Image left|imageright:Image

    right|imagetop:Image top',

    formatvalues: ['150x?', '250x300', '?x250']}

    An example for the xsd declaration:

    ...

    ...

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 30

    formatvalues: ['200x?', '200x?', '450x?']}"/>

    ...

    6.2.19 DownloadGalleryWidgetThe DownloadGalleryWidget provides a selection of a file in the download gallery. This gallerywill come up by pushing the button on the right side of the input field.

    The configuration options are read from the configuration String of the widget. For nested XMLschemas the configuration String must be defined inside the nested content. The configurationString has to be formatted as JSON object, with the following possible keys: class: optional class implementing to dynamically configure startup parameters and format

    values startup: the startup folder, can be dynamically generated by the provided class, in that case,

    use 'dynamic' as value. type: the startup folder type, can be 'gallery' or 'category'. Can be dynamically generated by

    the provided class, in that case, use 'dynamic' as valueExample configurations can look like this: {type: 'gallery', startup: '/demo_en/images/'}

    Example of the xsd declaration:

    ...

    ...

    ...

    6.2.20 ImageGalleryWidgetThe ImageGalleryWidget provides a selection of a file in the image gallery. This gallery will comeup by pushing the button on the right side of the input field.

    The configuration options are read from the configuration String of the widget. For nested XMLschemas the configuration String must be defined inside the nested content. The configurationString has to be formatted as JSON object, with the following possible keys: class: optional class implementing to dynamically configure startup parameters and format

    values

    http://dev-wiki.alkacon.com/index.php?title=File:DownloadGallery.jpghttp://dev-wiki.alkacon.com/index.php?title=File:ImageGallery.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 31

    startup: the startup folder, can be dynamically generated by the provided class, in that case,use 'dynamic' as value.

    type: the startup folder type, can be 'gallery' or 'category'. Can be dynamically generated bythe provided class, in that case, use 'dynamic' as value

    Example configurations can look like this: {type: 'gallery', startup: '/demo_en/images/'}

    Example of the xsd declaration:

    ...

    ...

    ...

    6.2.21 HtmlGalleryWidgetThe HtmlGalleryWidget provides a selection of a file in the html gallery. This gallery will come upby pushing the button on the right side of the input field.

    The configuration options are read from the configuration String of the widget. For nested XMLschemas the configuration String must be defined inside the nested content. The configurationString has to be formatted as JSON object, with the following possible keys: class: optional class implementing to dynamically configure startup parameters and format

    values startup: the startup folder, can be dynamically generated by the provided class, in that case,

    use 'dynamic' as value. type: the startup folder type, can be 'gallery' or 'category'. Can be dynamically generated by

    the provided class, in that case, use 'dynamic' as valueExample configurations can look like this: {type: 'gallery', startup: '/demo_en/html/'}

    Example of the xsd declaration:

    ...

    ...

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 32

    configuration="{type: 'gallery',

    startup: '/demo_en/html/'}"/>

    ...

    6.2.22 TableGalleryWidgetThe TableGalleryWidget provides a selection of a file in the table gallery. This gallery will comeup by pushing the button on the right side of the input field.

    The configuration options are read from the configuration String of the widget. For nested XMLschemas the configuration String must be defined inside the nested content. The configurationString has to be formatted as JSON object, with the following possible keys: class: optional class implementing to dynamically configure startup parameters and format

    values startup: the startup folder, can be dynamically generated by the provided class, in that case,

    use 'dynamic' as value. type: the startup folder type, can be 'gallery' or 'category'. Can be dynamically generated by

    the provided class, in that case, use 'dynamic' as valueExample configurations can look like this: {type: 'gallery', startup: '/demo_en/table/'}

    Example of the xsd declaration:

    ...

    ...

    ...

    6.2.23 LinkGalleryWidgetThe LinkGalleryWidget provides a selection of a file in the link gallery. This gallery will come upby pushing the button on the right side of the input field.

    The configuration options are read from the configuration String of the widget. For nested XMLschemas the configuration String must be defined inside the nested content. The configurationString has to be formatted as JSON object, with the following possible keys: class: optional class implementing to dynamically configure startup parameters and format

    values

    http://dev-wiki.alkacon.com/index.php?title=File:TableGallery.jpghttp://dev-wiki.alkacon.com/index.php?title=File:LinkGallery.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 33

    startup: the startup folder, can be dynamically generated by the provided class, in that case,use 'dynamic' as value.

    type: the startup folder type, can be 'gallery' or 'category'. Can be dynamically generated bythe provided class, in that case, use 'dynamic' as value

    Example configurations can look like this: {type: 'gallery', startup: '/demo_en/link/'}

    Example of the xsd declaration:

    ...

    ...

    ...

    7 Model PageA model page is a default copy model for the container page, where common contents, whichshould appear on a new created container page, are defined. This documentation part describeshow model pages can be used to simplify the creation of new pages in the site. It uses linksreferring a locally installed OpenCms verion >= 8.5. Assuming you run OpenCms onlocalhost:8080 and the OpenCmsServlet is reachable under http:/ / localhost:8080/ opencms/opencms you can click the links and will show the examples inside the Development Demo.Click here to open the corresponding Model Page use case in Development Demo [1]

    Click here to open Element Group use case in Development Demo [2]

    7.1 CreationFor a OpenCms 8 template you have to create and configure a model page in order to enablethe "Create page" Dialog in the sitemap editor. Usually the template developer should createand configure one or more model pages after the template and resource type creation, beforethe editor starts writing contents for the website. The model page is used as a copy to create anew page. The contents dropped to the selected model page automatically appears on all newpages.Create a new container page in the explorer view. If the template property is not set on the sitefolder, edit the template property. Create several model pages, if the site has pages withdifferent template configuration. Place the model pages in the following folder of the subsitemap:/{sitefolder}/{sub sitemap path}/.content/.new/

    Open the preview by clicking the model page and drop some elements, which will appear on anew created page.

    http://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencms/dev-demo/model-containerpage/http://localhost:8080/opencms/opencms/dev-demo/model-containerpage-group/

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 34

    7.2 ConfigurationConfigure the model page in the sitemap configuration file:/{sitefolder}/{sub sitemap path}/.content/.config

    In tab "Model pages" add a new node for each model page and select its path. Now theconfigured model pages appear in the list of container pages of the "Create page" in the sitemapeditor. In order to have a nice name for the page model, edit additionally its title property. If setas default this page is also used to create the new page, when it is added over the context menuin the sitemap editor. Further use the check box of the page model configuration to control thevisibility of the inherited page models from the upper sitemaps.

    7.3 Extended featureCombine the model pages with other techniques like element groups and inheritance groups forbetter organizing common content parts on the website.

    References[1] http:/ / localhost:8080/ opencms/ opencms/ dev-demo/ model-containerpage/[2] http:/ / localhost:8080/ opencms/ opencms/ dev-demo/ model-containerpage-group/

    8 Element GroupAn Element Group is a new content element in OpenCms 8, which references a group of othercontent elements. This documentation uses links referring a locally installed OpenCms verion >=8.5. Assuming you run OpenCms on localhost:8080 and the OpenCmsServlet is reachableunder http:/ / localhost:8080/ opencms/ opencms you can click the links and will show theexamples inside the Development Demo.Click here to open the corresponding model page use case of the Development Module [2]

    8.1 DescriptionAn element group is a content element similar to inheritance group, which allow the user to dropother elements in it. The user can edit, delete or replace the elements inside the group as wellas changing their order. All changes on the element group affects all container pages to whichthe element group is dropped. So the element group allows to maintain the referenced elementsin one place to take effect on many pages.

    8.2 Combination with model pageThe most popular use case for element group is its combination with the model page. Drop theelement group to the appropriate container in the model page and organize all elements insidethe element groups, if you would like to have following effects on the site: Common content parts appear on all created pages, e.g. header, footer, side columns

    sections. All future changes in these containers should effect all pages using this page model, for

    example: editing dropping new elements

    http://dev-wiki.alkacon.com/index.php?title=Element_grouphttp://dev-wiki.alkacon.com/index.php?title=Inheritance_grouphttp://localhost:8080/opencms/opencms/dev-demo/model-containerpage/http://localhost:8080/opencms/opencms/dev-demo/model-containerpage-group/http://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencms/dev-demo/model-containerpage-group/

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 35

    deleting elements changing order of elements

    8.3 How to use the element group

    8.3.1 Editing Drop an element group to container page like any other content from the "Add content" dialog. Open the element group editor by clicking on the edit symbol. The element group dialog

    opens in an overlay, where the title and the description of the element group can be edited. During the element group is edited the ADE toolbar is active and can be used as usual.

    Drag and drop new elements from the "Add content" dialog to the element group.

    http://dev-wiki.alkacon.com/index.php?title=File:Element_group_edit.jpghttp://dev-wiki.alkacon.com/index.php?title=File:Element_group_gallery.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 36

    Edit or delete the existing elements of the element group. Reorder the elements inside the group. Save all changes by clicking the ok-button of the element group editor.

    All changes on the elements inside of the element group like editing, removing elements,moving elements insider the group as well as changing settings of the element arepopulated to all pages using this page model.

    9 Inheritance GroupInheritance groups are a new content type in OpenCms 8.5 for use in container pages. Thisdocumentation uses links referring a locally installed OpenCms verion >= 8.5. Assuming you runOpenCms on localhost:8080 and the OpenCmsServlet is reachable under http:/ / localhost:8080/opencms/ opencms you can click the links and will show the examples inside the DevelopmentDemo.Click here to open the inheritance-group page use case of the Development Module [1]

    10 DescriptionA Inheritance group is similar to an Element Group in that they allow you to drop a set of contentelements into your page as a single object. But Element Groups don't allow you to change theset of elements only for a specific subset of pages; when you make a change to an elementgroup, this change is visible across all pages using that element group. This is the problem thatInheritance Groups are meant to solve:When changing an inheritance group on a page, the content of the same group will only bechanged on the page and any pages which are descendants of the page's parent folder; In otherwords, changes will be "inherited" by the group in child pages, but nowhere else.For example, you may want to define an inheritance group for the right column of your template,define some common content which you want to be visible everywhere on your site, and thenadd more specific contents for each subsection of your site.

    http://dev-wiki.alkacon.com/index.php?title=File:Element_group_reoder.jpghttp://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencms/dev-demo//inheritance-group/

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 37

    11 Basic definitionsWe will call a container page a.html a descendant page of another container page b.html if theparent folder of a.html is a direct or indirect subfolder of the parent folder of b.html. Conversely,we call b.html an ancestor page of a.html.When editing a container page, we call the parent folder of that page the current folder. This isimportant because inheritance group data is attached to folders, not to individual containerpages. So container pages in the same folder can't have different content for the sameinheritance group.

    12 Usage

    12.1 Creating new inheritance groupsYou can create a new inheritance group in the container page editor by opening the galleriesmenu and dragging the item "Inheritance group" from the "Types" tab onto your page. As withother resources, the inheritance group will only be created in the VFS once you edit it.

    12.2 Using existing inheritance groupsYou can use an existing inheritance group on your container page by opening the galleriesmenu, selecting the type "Inheritance group" from theOnce created, inheritance groups can be freely dropped onto container pages.

    12.3 Changing inheritance groupsTo edit an inheritance group, first you need to open a container page that contains theinheritance group. Hover over the Edit point of the inheritance group and click the editsymbol . Now the inheritance group editor will pop up. You can now perform various actions:

    http://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_selection.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Opencms_8_icons_edit.pnghttp://dev-wiki.alkacon.com/index.php?title=File:Inheritance_group_edit.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 38

    12.3.1 Changing the title and descriptionUsing the text fields in the dialog, you can change the title and description of the inheritancegroup. The title and description are not displayed when rendering the inheritance group, but aremainly used for finding the inheritance group using the galleries dialog.

    12.3.2 Adding content elementsYou can add new content elements to the inheritance group by opening the gallery dialog,searching for the content you want to add, and then drag it inside the inheritance group.

    http://dev-wiki.alkacon.com/index.php?title=File:Inheritance_group_drag_element.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 39

    Note that when adding new elements to inheritance groups on a page, those elements willinherited by the same inheritance group on any descendant page. By default, new elements willappear on the bottom of the inheritance group on descendant pages.

    12.3.3 Removing content elementsClicking on the 'Remove' symbol in the inheritance group editor will perform one of two actions,depending on where the content element was added to the inheritance group.If the content element was added to the inheritance group of the currently edited page or a pagein the current folder, the element will just be removed from the inheritance group, and will notappear in the inheritance group on any descendant pages. But if the content element was addedto the inheritance group in an ancestor folder, the element will be hidden, and will also be hiddenin the inheritance group on descendant pages. The difference is that a hidden element can beset to "visible" again in a descendant page.

    http://dev-wiki.alkacon.com/index.php?title=File:Inheritance_group_drag_elementto_group.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 40

    12.3.4 Reordering content elementsInheritance groups can be reordered via drag-and-drop. Just pull the elements by their moveicons to rearrange them inside the inheritance group.

    12.3.5 Inheritance statusIf an element of an inheritance group was not added for the current folder, a tree-like"Inheritance info" icon will be available from the element's toggle menu. Hovering your mouseover this icon will tell you from which folder this element was added to the inheritance group.

    12.3.6 Showing previously hidden elementsThe inheritance group editor's "Show removed" button will toggle the display of elements whichhave been hidden from the inheritance group in an ancestor folder in the inheritance groupeditor. To show a hidden element in the current page, first click on the "Show removed" button,which will display the hidden elements. They are displayed with diagonal stripes on top todistinguish them from the other elements. Now hover your mouse over Edit point of the elementyou want to show and click the "Add content" (plus) button from the appearing toggle menu.

    http://dev-wiki.alkacon.com/index.php?title=File:Inheritance_group_info_in_toggle.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 41

    12.3.7 SaveAll changes to an inheritance group will only take effect if you click on the "Save" button. Theinheritance group editor will then be closed.

    12.3.8 Break upWhen using this button, the inheritance group will be replaced by its current, individual contentelements in the container page, just as with group containers. Note that this action takes effectimmediately, not just after pressing the "Save" button.

    12.3.9 Edit settingsJust like with other container page elements, the element settings of inheritance group elementscan be edited. But note that element settings can only be changed for an element if that elementwas added to the inheritance group in the current folder. If the element was added to theinheritance group in a different folder, the option for editing element settings will not appear.

    http://dev-wiki.alkacon.com/index.php?title=File:Inheritance_group_show_removed.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 42

    13 Internals

    13.1 Resource typesThere are two resource types used for the implementation of inheritance groups:inheritance_group and inheritance_config. inheritance_group is the type of the contents whichare actually inserted into the container page when creating new inheritance groups or draggingexisting inheritance groups from the galleries into a page. They only contain the internal id of theinheritance group they represent.The resources of type inheritance_config contain the actual contents of the inheritance groups.The inheritance group changes for a folder will be stored in a file (of type inheritance_config)named .inherited which is contained in the same folder. Since only one file per folder is used,data for multiple inheritance groups will be stored in the same file. The content of this config fileshould not be edited manually.

    References[1] http:/ / localhost:8080/ opencms/ opencms/ dev-demo/ / inheritance-group/

    14 Detail PageDetail page is an OpenCms 8 technique to create nice url for a resource which is not dropped toa container page but automatically created in the /.content/ directory, e.g. by a collector.This documentation part uses links referring a locally installed OpenCms version >= 8.5.Assuming you run OpenCms on localhost:8080 and the OpenCmsServlet is reachable underhttp:/ / localhost:8080/ opencms/ opencms you can click the links and will show the examplesinside the Development Demo.Click here to open corresponding use case in Development Demo [1]

    14.1 Use CaseIn OpenCms 8, all resources dropped into a container page are automatically created in adirectory, which is configured either in the module configuration or in the sitemap configuration.Usually the resource path contains /.content/ in it. When resources are linked from a list,the editor should not have to drop every linked resource in its own container page to get a niceurl for it. The idea is to create a single page in the navigation, which is called detail page, and touse the url of this detail page combined with the Title property of the resource to generate aresource link without /.content/ in it.Generated url:/dev-demo/collector-with-detail-page/generated_resource_title

    where /dev-demo/collector-with-detail-page/ is the path of the detail page andgenerated_resource_title is the url postfix generated from the mapped property.

    http://localhost:8080/opencms/opencms/dev-demo//inheritance-group/http://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencms/dev-demo/collector-with-detail-page/

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 43

    14.2 ConfigurationFollowing steps are necessary to use a detail page for a resource type. The configuration isrelated to the module containing the template and the resource type as well as the websitecontent.

    14.2.1 Module adjustments Add following mapping in the XML schema definition of the resource. If the resource does not

    have Title field, use a field, which comply with a title.

    Add the attribute detailview="true" to the tag in the template jsp,where the xmlcontent should be displayed. Usually it is the center column.

    When using collector to list the resources, surround the resource path${content.filename} with . The takes care of generating theproper url.

    ${content.value.Title}

    14.2.2 Add detail page to the sitemap Open the "Create page" dialog in the sitemap editor. From tab "Type pages" drop the type page for the resource type, which is used in collector. The detail page is automatically configured by OpenCms in the sub-sitemap configuration

    file.Now links should be automatically generated in the collector list.

    References[1] http:/ / localhost:8080/ opencms/ opencms/ dev-demo/ collector-with-detail-page/

    http://localhost:8080/opencms/opencms/dev-demo/collector-with-detail-page/

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 44

    15 Function Detail PageThe function detail page is a detail page mechanism for dynamic functions. This documentationpart describes how to create and configure a detail page for a dynamic function. It uses linksreferring a locally installed OpenCms verion >= 8.5. Assuming you run OpenCms onlocalhost:8080 and the OpenCmsServlet is reachable under http:/ / localhost:8080/ opencms/opencms [1] you can click the links and will show the examples inside the Development Demo.Click here to open the corresponding Dynamic Function use case of the Development Module [2]

    Click here to open the corresponding Function Detail Page use case of the Development Module[3]

    15.1 Use CaseCollect data in a form, which can appear on several pages of the website. Display the results ofthe user request on one page in the navigation. For example, integration of a search form onseveral pages of the website and displaying of the search results on one page in the navigation.Since OpenCms 8.0.3 you can use function detail page to define such result pages.

    15.2 General stepsFollowing steps are required to create dynamic function and its function detail page: Create dynamic function element inside the module. Create and configure the function detail page for the created dynamic function. Drop the dynamic function to container pages. Drop the function detail page to the website structure using the sitemap editor.

    15.3 Creating dynamic functionAs only users with the role TEMPLATE_DEVELOPER can edit the dynamic function elements,the function should be created inside the module in folder:/system/modules/[module name]/functions/

    To hide the function element from "Add content" Dialog set following property:

    The Drag&Drop functionality is enabled for user with the role WORKPLACE_USERS.

    15.4 Create and configure function detail page Implement the jsp with a form, which should be used on several container pages of the

    website. Use the following value ${cms.functionDetail['Name of the functiondetail page']} as attribute action of the tag.

    ...

    http://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencms|http://dev-opencms-v8:8080/opencms/opencms/dev-demo/dynamic-function/http://dev-opencms-v8:8080/opencms/opencms/dev-demo/dynamic-function-detail/http://dev-wiki.alkacon.com/index.php?title=File:Property_search_exclude.jpg

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 45

    Implement another jsp, which evaluates the form data and generates the html output for thedetail view.

    In explorer view create two dynamic function elements in folder/system/modules/[module name]/functions/ of the module. One of the dynamicfunctions should point to the form jsp and another to the detail page jsp.

    Edit the module configuration file /system/modules/[module name]/.config andconfigure the function detail page in the tab "Functions". Add new field "Named function".Define a unique name for the function detail. This should be the same name, which is used inthe form jsp as action parameter. After this configuration the function detail page appears inthe tab "Function pages" of the "Create page" dialog in the sitemap editor.

    Edit property container.info on the template jsp. Set the property valuefunctionDetail=[container name attribute]. Use as the value the name attributeof the container, in which the function results should be displayed.

    15.5 Usage Drop the dynamic function element with the form into container pages. Open the "Create page" dialog of the sitemap editor. Use the configured function detail page from tab "Function pages" as page model to add new

    page to the navigation.

    References[1] http:/ / localhost:8080/ opencms/ opencms|[2] http:/ / dev-opencms-v8:8080/ opencms/ opencms/ dev-demo/ dynamic-function/[3] http:/ / dev-opencms-v8:8080/ opencms/ opencms/ dev-demo/ dynamic-function-detail/

    http://dev-wiki.alkacon.com/index.php?title=File:Property_container_info.jpghttp://localhost:8080/opencms/opencms|http://dev-opencms-v8:8080/opencms/opencms/dev-demo/dynamic-function/http://dev-opencms-v8:8080/opencms/opencms/dev-demo/dynamic-function-detail/

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 46

    16 Simple Collector

    16.1 DemoThis documentation part provides implementation details for a simple collector that can be usedto display a list of contents on the website.It uses links referring a locally installed OpenCms verion >= 8.5. Assuming you run OpenCms onlocalhost:8080 and the OpenCmsServlet is reachable under http:/ / localhost:8080/ opencms/opencms you can click the links and will show the examples inside the Development Demo.Click here to open the corresponding Simple Collector use case of the Development Module [1]

    16.2 ImplementationIn order to develop a collector, which can be used with tag, the newcollector should implement org.opencms.file.collectors.I_CmsResourceCollectorinterface. The package org.opencms.file.collectors already provides a standardimplementation for this interface withorg.opencms.org.opencms.file.collectors.A_CmsResourceCollector. Extend thisclass, if you develop your own collector.Following methods has to be implemented:List getCollectorNames();

    getCollectorNames() return one or more collector names as list of strings.String getCreateLink(CmsObject cms, String collectorName, String param)

    throws CmsException, CmsDataAccessException;

    getCreateLink(CmsObject, String, String) returns the link that must be executedwhen a user clicks on the direct edit "new" button on a list created by the named collector. If thismethod returns null, it indicated that the selected collector implementation does not support a"create link", and so no "new" button will not be shown on lists generated with this collector.String getCreateParam(CmsObject cms, String collectorName, String

    param)

    throws CmsDataAccessException;

    The method getCreateParam(CmsObject, String, String) returns the parameter thatmust be passed to the getCreateLink(CmsObject, String, String). If this methodreturns null, it indicates that the selected collector implementation does not support a "createlink", and so no "new" button will be should shown on lists generated with this collector.List getResults(CmsObject cms, String collectorName, String param)

    throws CmsDataAccessException, CmsException;

    getResults(CmsObject, String, String) returns a list oforg.opencms.file.CmsResource Objects that are gathered in the VFS using the namedcollector.

    http://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencms/dev-demo/collector-with-detail-page/

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 47

    16.3 ConfigurationEdit opencms-vfs.xml and add following line to node:

    Restart the Servlet Container.

    16.4 How to use collector in a jspUse the tag to collect the resouces.

    ...

    This tag requires following parameters:collector

    the name of the collectorparam

    collector parameter. The standard parameter has the form [path]|[resource type]|[count].editable

    Set this attribute to true, to enable the direct edit option on that list.With you can access CmsResource object ofthe list returned by collector in current iteration.

    ${content.value.Title}

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 48

    16.5 How to drop the list into a container pageA common way to drop a jsp directly into a container page is to use the dynamic function. Create a new dynamic function. Usually this resource type is a part of the module and should

    be created in folder /system/modules/mymodule/functions/. In Dev Demo module thecollector jsp is in folder:

    /system/modules/org.opencms.dev.demo/functions/

    Select the jsp containing "myCollector". In Dev Demo it is the following jsp:/system/modules/org.opencms.dev.demo/pages/collector.jsp

    To define the collector parameters set the initial request parameters in the dynamic function.These parameters are used in collector.jsp: folder=/dev-demo/collector-with-detail-page/.content/article/ type=ddarticle count=5

    Now you can open a container page in ADE and drop the new dynamic function into thecontainer page.

    16.6 How to use detail pages for lists Open the sitemap editor and open the "Create page" dialog. From tab "Type pages" drop the type page for the resource type, which is configured for

    collector. In the Dev Demo the "Dev Demo article" type detail is used (ddarticle). OpenCms configures the new detail page automatically for the sub-sitemap.Now when you click on the link to open the resource, the detail page of the resource is opened.In the list the detail page url is used.

    16.7 Code examplesExample of a simple collector class: https:/ / github. com/ alkacon/ modules-v8/ blob/ master/ src-modules/ com/ alkacon/

    opencms/ dev/ demo/ CmsSimpleResourceCollector. javaExample of the collector jsp: https:/ / github. com/ alkacon/ modules-v8/ blob/ master/ modules/ org. opencms. dev. demo/

    resources/ system/ modules/ org. opencms. dev. demo/ pages/ simple-collector. jsp

    https://github.com/alkacon/modules-v8/blob/master/src-modules/com/alkacon/opencms/dev/demo/CmsSimpleResourceCollector.javahttps://github.com/alkacon/modules-v8/blob/master/src-modules/com/alkacon/opencms/dev/demo/CmsSimpleResourceCollector.javahttps://github.com/alkacon/modules-v8/blob/master/modules/org.opencms.dev.demo/resources/system/modules/org.opencms.dev.demo/pages/simple-collector.jsphttps://github.com/alkacon/modules-v8/blob/master/modules/org.opencms.dev.demo/resources/system/modules/org.opencms.dev.demo/pages/simple-collector.jsp

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 49

    17 XSD Choice ElementIn OpenCms the Xsd choice element extends the XML Schema definition. The Xsd choiceprovides a single or multiple choice of OpenCms types in arbitrary order. This documentationpart describes how to use the choice element within XSD and how to access the values in a JSPwith EL.It uses links referring a locally installed OpenCms verion >= 8.5. Assuming you run OpenCms onlocalhost:8080 and the OpenCmsServlet is reachable under http:/ / localhost:8080/ opencms/opencms you can click the links and will show the examples inside the Development Demo.

    17.1 DefinitionThe node can be used in the same way as a to describe anOpenCms type. It has to be defined in XML schema definition of a nested xmlcontent. Theelement in the root schema has to be optional. Add attribute minOccurs="0" on the elementto make it optional.Root XML Schema Dfinition:

    ...

    ...

    ...

    ...

    Use the node to define the element of the selection.Nested XML schema defenition with :

    ...

    http://localhost:8080/opencms/opencmshttp://localhost:8080/opencms/opencms

  • OpenCms DocumentationVersion 8.5.0 Date: September 21, 2012

    Alkacon Software GmbH Page 50

    ...

    The elements, which define the selection options of the have to be optional,too.

    17.2 Single and multiple choiceThe element can be used as single or multiple choice.To use the single choice do not use any attributes on the node. This is thedefault setting.To use the multiple choice set following attributes: minOccurs="0" and maxOccurs="[max number of element