Taglib Reference

Taglib Reference

In This Section



In addition to the information in this topic, see also the description of the class nl.gx.webmanager.taglib of the XperienCentral Javadoc.




The CMS Library

The CMS library is used for retrieving information from the XperienCentral content management system.



<%@taglib uri="http://www.gx.nl/taglib/wm" prefix="wm" %>




documentLink

<wm:documentLink> -  Returns an HTML link to a document and checks for web user authorization. Example usage:



<wm:documentLink var="docLink" contentId="${productInfo.document}" dataSource="jdbc/internaldb" /> ${docLink}





Attribute

Description

Required

Expression*

Attribute

Description

Required

Expression*

contentId

Sets the content ID of the document to which a link should be returned.

Yes

Yes

dataSource

Sets the data source name which can be queried to retrieve more information about the document.

Yes

Yes

className

Specifies the class name to be used in the class="..." attribute of the resulting HTML link.

No

Yes

linkText

The text to be used in building the link. The default value is the title of the document that is referred to.

No

Yes

mimeTypeOnly

Specifies whether the MIME type of the document should be returned (set to true) or whether to return an HTML link to the document itself (set to false). The default value is false.

No

No

mouseOverText

Specifies the text to be used in the title="..." attribute of the resulting HTML link. This text is usually shown as a tooltip if the mouse cursor is hovered over the link. The default is the value of the linkText attribute (see above).

No

Yes

showDocumentTypeIcon

Specifies whether the documenttype icon should be shown to left of the link. The default value is false (no icon).

No

No

showTitleOnly

Specifies whether the linkText (see above) should be shown as an HTML link or as normal text. The default value is true (normal text).

No

No

target

Specifies the name of the HTML frame to be used in the target="..." attribute of the resulting link. If the link is clicked, the document is opened in this frame. If no frame with this name can be found, the link is opened in a new browser window. The default value for this attribute is empty which means the link will open in the same window.

No

Yes

var

Specifies the JSP variable to store the result in.

No

No

webUserGroups

Sets the web user groups who are granted access to the document.

No

Yes

*The attribute supports EL (Expression Language) values.



Back to Top




editable

<wm:editable> -  Marks editable content areas on the page inside the editor. The inline edit mode in XperienCentral needs to know where editable content exists on the page. This is accomplished by wrapping the editable areas using the <wm:editable> tag, thereby indicating where the editable content is located. Example usage:



<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="0" tag="div"></wm:editable>



This is the most basic and common usage. The class attribute is passed through to the outputted HTML. The following example shows how to wrap the title of a page version:



<wm:editable tag="div" contentHolder="${pageVersion}" area="title" class="main_title"> ${pageVersion.title} </wm:editable>





When wrapping content like a page title, no extra static HTML should appear inside the <wm:editable> tag except the page title itself. Any static HTML could be appended to the field being wrapped. Do not use your own element render loop to output the elements content in the tag itself or with a wm:pagepart tag.





The following are examples of incorrect usage of the <wm:editable> tag:



Incorrect usage of the <wm:editable> tag
<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="0" tag="div"> <wm:render presentationName="freestylepresentation content" object="${contentholder}" startSeparator="0" endSeparator="1"/> </wm:editable>





Incorrect usage of the <wm:editable> tag
<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="0" tag="div"><wm:render bject="${contentholder}"/></wm:editable>



Naming Convention Best Practice

It is best to give areas a meaningful name instead of assigning them a number. Doing so gives you the flexibility to change the order of areas at a later time if you decide to. For example:



<wm:editable contentHolder="${contentholder}" class="maincontentarea" area="maincontent" tag="div"></wm:editable>



Back to Top




form

<wm:form> - Returns an HTML form tag and a (number of) hidden input tags enclosed in it. Additional inputs can be defined in the body of the <wm:form> tag.

The <wm:form> tag is mostly used to render various types of forms. All these forms are processed by the FormHandler which runs on the frontend and processes forms submitted by users. This FormHandler expects several inputs in the form. The <wm:form> tag automatically generates these. What exactly is generated, depends on the handle. Currently the following builtin handles are supported in the <wm:form> tag:

  • form - Indicates that the form should be processed using the FormHandler.

  • formback - Navigates back one page in the form flow.

  • search - Generates a search form.

  • poll - Generates a form for the poll functionality.

  • forum - Generates a form for the forum functionality.

  • verseonstatus - Generates a form to get to call the VerseonFormStatusHandler.

  • locationservicemappoint - Used by the Location services functionality in XperienCentral.

Except for the form handle, these are all related to specific XperienCentral features.

Example usage (1):



<wm:form handle="search" onSubmit="doSearch();"> <input type="text" name="keyword" /> </wm:form>



The example above displays a search form (handle="search"). A search form should specify a keyword, therefore an input is included to set the keyword (using the HTML input tag). Also, some JavaScript should be executed if the form is to be submitted. The onSubmit parameter takes care of that. The rendering of the form parts is delegated using the <wm:render> tag ***. This tag renders the form object of the form element.

Example usage (2):



<wm:form handle="form" onSubmit="return checkForm${formElementId}();"> <input name="dummybutton" type="image" value="" alt="" src="${presentationcontext.website.emptyImage}" style="position: absolute; border-style: none; padding: 0; spacing: 0; text-indent: 0;" height="0" width="0"/> <wm:render object="${formElement.form}" /> </wm:form>



Example usage (3):



<wm:form handle="formback" />



This displays the back button in a form.



Attribute

Description

Required

Expression*

Attribute

Description

Required

Expression*

handle

Sets the name of the handle that should be used. Valid values: see the description of the available handles above.

Yes

Yes

extraPassOn

Specifies a comma-separated list of extra parameters to be used in generating the URL in the form. This is the URL of the page to display when an action is performed in the form. By default the following values are already passed on: contentid,dbid,typeofpage,step,orgurl,cfe, and forum.

No

Yes

target

Specifies the name of the HTML frame to be used in the target="..." attribute of the resulting HTML form tag. The response to the form is displayed in the target frame. If the specified frame does not exist, the response is shown in a new window.

No

Yes

frame

If a value (OUTP) for this attribute is specified, an HTML input tag is created as follows in the body of the form tag: <input type="hidden" name="frame" value="OUTP" />. This attribute may be used in conjunction with the attribute "target" to specify the frame to load in the response to the form.

No

Yes

onSubmit

Specifies the name of the JavaScript function to be used in the onSubmit="..." attribute of the resulting HTML form tag. This function can be used to, for example, do some error checking on the form data. The default value is empty (no function).

No

Yes

*The attribute supports EL (Expression Language) values.



Back to Top






The following filterHTML tags were introduced in XperienCentral version 10.19.1. These methods rely on the JSoup clean method.



filterHTMLBasic

<wmfn:filterHTMLBasic> -  Filters the HTML using a basic filtering configuration. It allows the following range of text nodes: <a>, <b>, <blockquote>, <br>, <cite>, <code>, <dd>, <dl>, <dt>, <em>, <i>, <li>, <ol>, <p>, <pre>, <q>, <small>, <span>, <strike>, <strong>, <sub>, <sup>, <u>, <ul> and <l>.



${wmfn:filterHTMLBasic(myHtmlToFilter)}



Back to Top




filterHTMLRelaxed

<wmfn:filterHTMLRelaxed> -  Filters the HTML using a relaxed filtering configuration. It allows the following range of text and structural body HTML:  <a>, <b>, <blockquote>, <br>, <caption>, <cite>, <code>, <col>, <colgroup>, <dd>, <div>, <dl>, <dt>, <em>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <i>, <img>, <li>, <ol>, <p>, <pre>, <q>, <small>, <span>, <strike>, <strong>, <sub>, <sup>, <table>, <tbody>, <td>, <tfoot>, <th>, <thead>, <tr>, <u>, <ul> and <l>. Example usage:



${wmfn:filterHTMLRelaxed(myHtmlToFilter)}



Back to Top




filterHTMLTags

<wmfn:filterHTMLTags> -  Filters the HTML. Passed tags are allowed — other tags are removed from the HTML. Example usage:



<c:set var="imagesFilter" value="figure,img,figcaption" /> <c:set var="allImages" value="${wmfn:filterHTMLTags(myContent, imagesFilter)}" />

Back to Top




filterHTMLTagsAndAttributes

<wmfn:filterHTMLTagsAndAttributes> -  Filters the HTML. Passed tags and attributes are allowed — other tags and attributes are removed from the HTML. Example usage:



Create an overview of only the a links on an html page: ${wmfn:filterHTMLTagsAndAttributes(myHtmlToFilter, 'a', 'href')} Extract all images from an html page: ${wmfn:filterHTMLTagsAndAttributes(myHtmlWithImages, 'figure,img,figcaption,a', 'src,width,height,href')} Remove any styling from the forms in content: ${wmfn:filterHTMLTagsAndAttributes(myStyledForms, 'form,input,fieldset,textarea,label,select,option', 'action,method,type,value,name,for')}



Back to Top




formPart

<wm:formPart> -  This tag retrieves a form part using its alias as the search criteria. Example usage:



<wm:formPart var="userNameFormPart" alias="username" /> ${userNameFormPart}



The fragment above will look up the form part with the alias "username".



Attribute

Description

Required

Expression*

Attribute

Description

Required

Expression*

alias

Specifies the alias of the form part to search for. This is the alias that is used in the XSL of the form handlers to identify the form part.

Yes

Yes

var

Specifies the JSP variable in which to store the result.

Yes

No

*The attribute supports EL (Expression Language) values.



Back to Top




getMediaItems



The getMediaItems tag was deprecated in XperienCentral version R31. Use getMediaItemVersions instead. See below.



<wm:getMediaItems> - This tag retrieves media items from the Content Repository and sorts the results. Example usage:



<wm:getmediaitems var="mediaItems"/>



The example above retrieves all media items that match a specified term.



Attribute

Description

Required

Expression*

Attribute

Description

Required

Expression*

andnotterms

Specifies a comma separated list of terms the returned media item doesn't have. This includes terms present in other channels (XperienCentral R25 and higher).

No

Yes

andterms

Specifies a comma separated list of terms the returned media item must have. This includes terms present in other channels (XperienCentral R25 and higher).

No

Yes

contenttypes

Specifies the content type of the media item (article, image, etc.).

No

Yes

createdsince

Specifies the date after which the returned media items must have been created.

No

Yes

excludemediaitemids

Specifies the returned media item IDs that need to be excluded.

No

Yes

orterms

Specifies the term(s) that the returned media items must have at least one of. This includes terms present in other channels (XperienCentral R25 and higher).

No

Yes

publicationdatefrom

Specifies the beginning of the date range in which the returned media item was published.

No

Yes

publicationdateto

Specifies the end of the date range in which the returned media item was published.

No

Yes

referenceddatabaseentity

Specifies the database entity the returned media item is linked to.

No

Yes

referencedresourceinstance

Specifies the resource instance the returned media item is linked to.

No

Yes

resultrange

Specifies the number of returned media items to display.

No

Yes

sortascending

Specifies whether to sort the returned media items in ascending order.

No

Yes

sortoptions

Specifies how to sort the returned media items. The options are:

  • creationdate

  • mostviewed

  • mostreactions

  • publicationdate

  • modificationdate

  • voteaverage

  • webtitle

  • lastpost

No

Yes

statusid

Specifies the media item’s workflow state.

No

Yes

websiteid

Specifies the ID of the website from which the media items are retrieved.

No

Yes

*The attribute supports EL (Expression Language) values.



Back to Top



Back to Top




getMediaItemVersions



The getMediaItemVersions tag was introduced in XperienCentral version R31.



<wm:getMediaItemVersions> - This tag retrieves media items from the Content Repository and sorts the results. Example usage:



<wm:getmediaitemversions var="mediaItemVersions"/>

The example above retrieves all media items that match a specified term.



Attribute

Description

Required

Expression*

Attribute

Description

Required

Expression*

andnotterms

Specifies a comma separated list of terms the returned media item doesn't have. This includes terms present in other channels (XperienCentral R25 and higher).

No

Yes

andterms

Specifies a comma separated list of terms the returned media item must have. This includes terms present in other channels (XperienCentral R25 and higher).

No

Yes

contenttypes

Specifies the content type of the media item (article, image, etc.).

No

Yes

createdsince

Specifies the date after which the returned media items must have been created.