nxu

Tag Library Information 
InfoValue
ID (tag prefix)nxu
URIhttp://nuxeo.org/nxweb/util
Tag Summary 
TagDescription
set

Facelet tag handler that exposes an expression as a variable, and makes it possible to cache it.

This is very close to the c:set tag, but allows caching, and the variable is only exposed inside the tag. Note that this tag will not work as expected when used with iteration variables inside a standard table, for instance.

Example:
        <nxu:set var="actions" value="#{webActions.getActionsList('SUBVIEW_UPPER_LIST')}" cache="true">
          <nxu:dataList var="action" value="#{actions}">
            ...
          </nxu:dataList>
        </nxu:set>
      
methodResult

Facelet tag handler that exposes the result of a method binding as a variable. Note that this tag is deprecated since Seam 2.0 handles method resolution natively. The tag nxu:set can be used instead.

This is helpful to avoid having to define a getter on a class to get some rendering info. This is comparable to f:param or ui:param tags, but using method bindings instead of value bindings.

WARNING : the variable is only exposed inside the tag: this is a different behaviour than the c:set tag that can be closed immediately.

Example:
        <nxu:methodResult name="actions" value="#{webActions.getActionsList('SUBVIEW_UPPER_LIST')}">
          <nxu:dataList var="action" value="#{actions}">
            ...
          </nxu:dataList>
        </nxu:methodResult>
      
repeat

Facelet tag handler that performs an iteration.

This handler is very close to the facelets c:forEach tag handler. It holds additional configuration to handle ajax re-rendering of lists, avoiding potential JSF duplicate id issues, as well as cache issue, when the iteration list changes.

Example:
        <nxu:repeat items="#{layoutNames}" var="layout">
          <nxl:layout name="#{layout}" value="#{document}" />
        </nxu:repeat>
      
actionListenerMethod

Facelet tag handler that add an action listener to the parent component. Available since 5.3.1.

Parent needs to be an action source for the action listener to be declared on it.

This is useful when declaring several action listeners on the same parent component, and when the order of calls needs to be respected: the action listener method declared on a component is the first one called. So this method makes it possible to add other action listeners before it, without having to declare a class (when using the f:actionListener tag).

Since 5.6, this tag can resolve expressions twice, making it possible to use it with Nuxeo actions configured to reference an EL expression in their definition: first to call action#getLink and then to call the actual action defined by another EL expression.

Example:
        <h:commandLink value="Go">
          <nxu:actionListenerMethod value="#{myBean.performFirstAction}" />
          <nxu:actionListenerMethod value="#{myBean.performSecondAction}" />
        </h:commandLink>
      
selectItems

This tag is similar to the f:selectItems tag, except that it allows to iterate on any kind of data, and have control on the resulting selection values and labels.

It has been adapted to work with datamodel lists wrapped by Seam (when using the Datamodel annotation).

Examples:
        <nxu:selectItems value="#{myBean.myList}" var="item"
          itemValue="#{item.id}" itemLabel="#{item.title}" />

        <nxu:selectItems value="#{documentList}" var="document"
          itemValue="#{document.ref}" itemLabel="#{document.dublincore.title}" />
      
selectItem

This tag is similar to the f:selectItem tag, except that it allows to resolve the item from any kind of data, and have control on the resulting selection value and label.

Examples:
        <nxu:selectItem value="#{myBean.myElement}" var="item"
          itemValue="#{item.id}" itemLabel="#{item.title}" />

        <nxu:selectItem value="#{document}" var="document"
          itemValue="#{document.ref}" itemLabel="#{document.dublincore.title}" />
      
inputFile

Util tag to perform a complex file upload dealing with edition and deletion.

It only deals with Nuxeo Core blobs.

This tag uses a component that will handle its rendering using other existing components. It will present a radio menu with existing choices: upload a file, keep it (eventually change its filename), delete it, or do nothing. Choices will be presented automatically given values and tag attributes (is there a blob set, is there a filename, is the blob required, etc...).

It uses the nxu:outputFile related component rendering for the "keep" option and the tomahwak t:inputFileUpload tag for the "upload" option.

It is possible to use a facet named "download" to override the default "keep" option rendering (e.g the document download presentation).

Example:
        <nxu:inputFile value="#{document.file.content}"
          filename="#{document.file.content.filename}"
          editFilename="true" />
      
validateFileSize

Registers an InputFileSizeValidator instance on the UIComponent associated with the closest parent UIComponent custom action.

Example:
        <nxu:inputFile value="#{document.file.content}"
          filename="#{document.file.filename}"
          editFilename="true">
          <nxu:validateFileSize maxSize="10Mo" />
        </nxu:inputFile>
      
validateFileMimetype

Register an InputFileMimetypeValidator instance on the UIComponent associated with the closest parent UIComponent custom action.

Example:
        <nxu:inputFile value="#{document.file.content}"
          filename="#{document.file.filename}"
          editFilename="true">
          <nxu:validateFileMimetype extensions=".jpg, .png" />
        </nxu:inputFile>
      
validateDocumentConstraint

Registers an DocumentConstraintValidator instance on the UIComponent associated with the closest parent input.

The bound value is resolved, and if it matches a document, the corresponding field constraints are checked (if not, no validation is performed).

Example:

        <nxu:validateDocumentConstraint handleSubProperties="false" />
      
outputFile

Util tag to perform a blob rendering, useful if a rest URL cannot be provided (on a JSF form postback for instance).

It only deals with Nuxeo Core blobs.

Display is an immediate link to the blob, with filename as link value if provided, together with the blob mimetype icon.

Example:
        <nxu:outputFile value="#{document.file.content}"
          filename="#{document.file.filename}" />
      
jsInputList

Tag that perform edition of a list of items.

It only deals with lists or arrays of serializable objects.

This tags puts a model in the request which can be accessed to get information about each list item value.

This tags adds and removes elements in the list using JavaScript functions. Available since 7.2.

Example:
        <nxu:jsInputList value="#{currentDocument.files.files}"
          id="myId" model="model" diff="true"
          template="#{nxd:defaultValue('files', 'files')}">
          <h:panelGrid columns="2">
            <h:inputHidden>
              <f:passThroughAttribute name="name" value="myFormId:myId:#{isListTemplate ? 'TEMPLATE_INDEX_MARKER:': ''}rowIndex[]" />
              <f:attribute name="value" value="#{isListTemplate ? 'TEMPLATE_INDEX_MARKER' : model.rowIndex}"/>
            </h:inputHidden>
            <h:panelGroup>
              <a href="#" class="deleteBtn"
                 onclick="return nuxeo.utils.deleteFromList(jQuery(this).closest('.listItem'))" />
              <a href="#" class="moveUpBtn"
                 onclick="return nuxeo.utils.moveUpList(jQuery(this).closest('.listItem'))" />
              <a href="#" class="moveDownBtn"
                 onclick="return nuxeo.utils.moveDownList(jQuery(this).closest('.listItem'))" />
            </h:panelGroup>
            <h:panelGroup>
              <table>
                <tbody>
                  <tr>
                    <td class="fieldColumn">
                      <h:inputText value="#{model.rowData} />
                    </td>
                  </tr>
                </tbody>
              </table>
            </h:panelGroup>
          </h:panelGrid>
        </nxu:jsInputList>

        <a id="myId_add" href="#nogo"
           onclick="return nuxeo.utils.addFromListTemplate('myForm:myId', jQuery(this).prev());">
          <h:outputText value="#{messages['command.add']}" />
        </a>
      
inputList

Tag that perform edition of a list of items. Note that this tag is deprecated since Nuxeo 7.2: use nxu:jsInputList instead.

It only deals with lists or arrays of serializable objects.

This tags puts a model in the request which can be accessed to get information about each list item value.

Examples make extensive use of ajax4jsf so that validation of other components that may be on the page does not occur while adding and deleting items in the list.

Example:
        <a4j:region renderRegionOnly="false">
          <a4j:outputPanel ajaxRendered="true">
            <nxu:inputList value="#{currentDocument.files.files}"
              id="files" model="model" diff="true"
              template="#{nxd:defaultValue('files', 'files')}">
              <h:panelGrid columns="2">
                <a4j:commandLink immediate="true"
                  actionListener="#{editableListBean.performAction}"
                  reRender="fichiers" bypassUpdates="true">
                  <h:graphicImage value="/icons/delete.png" />
                  <f:param name="for" value="fichiers" />
                  <f:param name="index" value="#{model.rowIndex}" />
                  <f:param name="type" value="remove" />
                </a4j:commandLink>
                <h:panelGroup>
                  <nxu:inputFile value="#{model.rowData.file}"
                    filename="#{model.rowData.fileName}" editFilename="false"
                    id="file" />
                  <h:message for="file" />
                </h:panelGroup>
              </h:panelGrid>
            </nxu:inputList>
          </a4j:outputPanel>
          <a4j:commandLink immediate="true"
            actionListener="#{editableListBean.performAction}"
            reRender="fichiers">
            <h:graphicImage value="/icons/action_add.gif" />
            <f:param name="for" value="fichiers" />
            <f:param name="type" value="add" />
          </a4j:commandLink>
        </a4j:region>
      
editor

Tag rendering a HTML editor relying on TinyMCE library.

Example:
        <nxu:editor
          value="#{document.dublincore.description}"
          required="false" />
      
inputDateTime

Calendar with date and time chosing.

Example:
        <nxu:inputDateTime
          value="#{document.project.dueDate}"
          format="mm/dd/YY"
          required="false" />
      
valueHolder

Tag to hold a value and expose it to the request context.

It can control a value to submit as any input component, or not.

Available since 5.5.

Example:
        <nxu:valueHolder var="myVar" value="#{myComp.myValue}">
          <h:outputText value="#{myVar}" />
        </nxu:valueHolder>
      
selectOneRadio

Allows creating radio checkboxes, that will be referenced for display in another part of the page when used in conjunction with nxu:radio.

Example:
          <nxu:selectOneRadio id="objectType"
            value="#{relationActions.objectType}" layout="spread">
            <f:selectItem
              itemLabel="#{messages['label.relation.object.text']}"
              itemValue="literal" />
            <f:selectItem itemLabel="#{messages['label.relation.object.uri']}"
              itemValue="uri" />
            <f:selectItem
              itemLabel="#{messages['label.relation.object.documentUid']}"
              itemValue="document" />
          </nxu:selectOneRadio>
          [...]
          <nxu:radio for="objectType" index="0" id="literal" />
          [...]
          <nxu:radio for="objectType" index="1" id="uri" />
          [...]
          <nxu:radio for="objectType" index="2" id="document" />
        
radio

Allows placing radio checkboxes by reference, to ve used in conjunction with nxu:selectOneRadio.

Example:
          <nxu:selectOneRadio id="objectType"
            value="#{relationActions.objectType}" layout="spread">
            <f:selectItem
              itemLabel="#{messages['label.relation.object.text']}"
              itemValue="literal" />
            <f:selectItem itemLabel="#{messages['label.relation.object.uri']}"
              itemValue="uri" />
            <f:selectItem
              itemLabel="#{messages['label.relation.object.documentUid']}"
              itemValue="document" />
          </nxu:selectOneRadio>
          [...]
          <nxu:radio for="objectType" index="0" id="literal" />
          [...]
          <nxu:radio for="objectType" index="1" id="uri" />
          [...]
          <nxu:radio for="objectType" index="2" id="document" />
        
form

Tag handler generating a form (or not) depending on attributes values, useful when handling widgets that may need to be surrounded by a form (or not) depending on their configuration.

Available since 8.2

Example:
        <nxu:form id="#{widget.id}_form"
          useAjaxForm="#{useAjaxForm and supportAjax}"
          disableDoubleClickShield="#{disableDoubleClickShield}">
          <nxl:widget widget="#{widget}" value="#{fieldOrValue}" />
        </nxu:form>
      
dataList Compatibility tag relying on RichFaces rich:dataList tag features.
dataTable Compatibility tag relying on JSF h:dataTable tag features.
column Compatibility tag relying on JSF h:column tag features.
inputDate Disabled component that will display a corresponding message, the tag declaration kept to avoid page crash.
inputCalendar Disabled component that will display a corresponding message, the tag declaration kept to avoid page crash.
schedule Disabled component that will display a corresponding message, the tag declaration kept to avoid page crash.
graphicImage Compatibility tag, see nxh:graphicImage instead.
inputFileUpload Disabled component that will display a corresponding message, the tag declaration kept to avoid page crash.
lazyTree Disabled component that will display a corresponding message, the tag declaration kept to avoid page crash.
Function Summary 
TypeFunctionDescription
java.lang.Objecttest(java.lang.Boolean, java.lang.Object, java.lang.Object)Alternative to the Java unary operator.
java.lang.Stringjoin(java.lang.String[], java.lang.String) Helper function to join an array of String elements with given delimiter.
java.lang.StringjoinCollection(java.util.Collection, java.lang.String) Helper function to join a collection of String elements with given delimiter.
java.lang.StringjoinCollectionWithFinalDelimiter(java.util.Collection, java.lang.String, java.lang.String) Helper function to join a collection of String elements with given delimiter, and given final delimiter.
java.lang.StringjoinArrayWithFinalDelimiter(java.lang.Object[], java.lang.String, java.lang.String) Helper function to join an array of String elements with given delimiter, and given final delimiter.
StringcombineLists(java.util.List[]) Returns an aggregate list with the elements all the lists passed as arguments, preserving the global ordering.
java.lang.Stringconcat(java.lang.String, java.lang.String) Helper function to concatenate the two given strings.
java.lang.StringindentString(java.lang.Integer, java.lang.String) Returns a String with given String appended as many times as given integer.
java.lang.StringhtmlEscape(java.lang.String) Returns an HTML escaped string (can be use to use h:outputText tags safely in scripts).
java.lang.StringjavaScriptEscape(java.lang.String) Returns an escaped string for use in JavaScript code (escapes single quote characters for instance).
java.lang.Stringtranslate(java.lang.String, java.lang.Object[])

Returns a translated message with optional given parameters, to be used when formatting the message value.

Equivalent to using the h:outputFormat tag, with f:param subtags as parameters.

booleanhasMessages(java.lang.String) Returns true if faces context has messages for client ids starting with given string (if not null). If given String is null, returns true if there are any kind of messages.
java.lang.StringjsfTagIdEscape(java.lang.String) Returns a valid string to be used as a JSF tag id from the given name. Throws an error if given name is empty. Available since 5.7.
java.lang.StringjoinRender(java.lang.String, java.lang.String) Joins two strings to generate a valid render attribute for ajax components using JSF2. Available since 5.9.5.
java.lang.StringcomponentAbsoluteId(javax.faces.component.UIComponent, java.lang.String)

Returns the target component absolute id given an anchor in the tree and a local id.

WARNING: this resolution is costly and can affect your page performances.

If given targetId parameter contains spaces, consider that several ids should be resolved, and split them.

java.lang.StringprintFileSize(java.lang.String) Same as nxu:printFormatedFileSize(size, "SI", true). Since 7.4, the default format can be controlled thanks to the JSF configuration property nuxeo.jsf.defaultBytePrefixFormat.
java.lang.StringprintFormatedFileSize(java.lang.String, java.lang.String, java.lang.Boolean) Displays a pretty print of the size of a file, using the format given in its short or long form. Available formats are "SI", "IEC" or "JEDEC". See the Wikipedia article on Byte for more information on those formats.
java.lang.StringprintFormattedDuration(java.lang.Object, java.util.Map) Displays a pretty print of a raw duration measured in seconds as "1 hr 23 min" or "31 min 29 sec" or "3 sec" for instance. The given map can fill alternative labels for duration names.
java.lang.StringfileExtension(java.lang.String) Returns the extension from the given filename. Available since 5.7.
java.lang.StringfileBaseName(java.lang.String) Returns the base name from the given filename. Available since 5.7.
java.lang.StringdateFormatter(java.lang.String) Returns a date format pattern using format given in parameter. Accepted values: short, shortWithCentury (since 5.6), medium, long, full.
java.lang.StringdateFormater(java.lang.String) Deprecated since 5.9.1, use nxu:dateFormatter instead.
java.lang.StringbasicDateFormatter() Returns a date format pattern using the default format "shortWithCentury".
java.lang.StringbasicDateFormater() Deprecated since 5.9.1, use nxu:basicDateFormatter instead.
java.lang.StringformatDateUsingBasicFormatter(java.util.Date) Returns a formatted string for given date, using the nxu:basicDateFormatter function logics.
java.lang.StringdateAndTimeFormatter(java.lang.String) Returns a date and time format pattern using format given in parameter. Accepted values: short, shortWithCentury, medium, long, full.
java.lang.StringdateAndTimeFormater(java.lang.String) Deprecated since 5.9.1, use nxu:dateAndTimeFormatter instead.
java.lang.StringbasicDateAndTimeFormatter() Returns a date and time format pattern using the default format "shortWithCentury".
java.lang.StringbasicDateAndTimeFormater() Deprecated since 5.9.1, use nxu:basicDateAndTimeFormatter instead.
booleanuserIsMemberOf(java.lang.String) Returns true if current user is a member of the given group.
StringuserFullName(java.lang.String) Returns the fullname of a user given its id.
StringuserDisplayName(java.lang.String, java.lang.String, java.lang.String) Returns the full name of a user given its id, first name and last name.
StringuserDisplayNameAndEmail(java.lang.String, java.lang.String, java.lang.String, java.lang.String) Returns the full name of a user, and its email, given its id, first name, last name and email. Available since 5.5.
StringuserUrl(java.lang.String, java.lang.String, java.lang.String, boolean) Returns the user profile rest URL given the pattern name (usually 'user'), the user name, the view id (can be null) and a boolean stating if a new Seam conversation should be created or not. Available since 5.5.
StringgroupFullName(java.lang.String) Returns the label of a group given its id. Available since 5.5.
StringgroupDisplayName(java.lang.String, java.lang.String) Returns the label of a group given its id and label. Available since 5.5.

Output generated by Vdldoc View Declaration Language Documentation Generator.