Thanks, most excellent!

Can we change nxd:docLink to nxd:documenLink ? We never use abbreviations anywhere else.

Also it seems to me that #{nxd:typeLabel(document)} is the same as # {nxd:typeInfo(document).label} -- or is this syntax forbidden? (also nxd:iconPath(document) and #{nxd:typeInfo(document).icon}). If the replacement is so simple, are they really needed?

Florent


On 30 Jan 2007, at 02:02, Anahide Tchertchian wrote:

Hi,

Here is an overview of new features, please read carefully if you'd like to make your life easier when writing xhtml files :)

First the "test" method has been moved to the util taglib, you should now use:

xmlns:nxu="http://nuxeo.org/nxweb/util";
itemStyleClass="#{nxu:test(webActions.currentTabAction == tab, 'selected', '')}"

Another tag in util called methodResult exposes the result of a method binding as a request-scope attribute. This allows you to avoid having to define a method on your action listener to get some rendering info. This is comparable to f:param or ui:param tags, but using method bindings instead of value bindings.

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

Think of using facelets templating features for other common use cases: http://www.jsftoolbox.com/documentation/facelets/10-TagReference/ index.jsf

Document lists have been refactored so that multi selection is made easier to define and implement in an action listener. I'll give more information about it soon.

A document can be rendered as any other object, accessing field values with a syntax such as "#{document.schema.field}" (for instance: "#{document.dublincore.title}". Usual converters can be used too.
Take a look at the Nuxeo/web/incl/documents_table.xhtml for examples:
http://svn.nuxeo.org/trac/nuxeo/browser/Nuxeo/trunk/web/incl/ documents_table.xhtml

Some functions and tags have been added to the xmlns:nxd="http:// nuxeo.org/nxweb/document" taglib to make it easier to render a document model for common use cases.

You can now use

- <nxd:docLink title="#{document.dublincore.title} or 'whatever'" document="#{document}" /> to get a link to a given document model. All other attributes defined for a commandLink are also accepted (except value and action).

- "#{nxd:typeInfo(document)}": uses a document adapter to get the document type information as described in contributions like ecm- types-contrib.xml.

Example usage:

import org.nuxeo.ecm.core.api.DocumentModel;
import org.nuxeo.ecm.types.adapter.TypeInfo;

TypeInfo typeInfo = document.getAdapter(TypeInfo.class);
if (typeInfo != null) {
  iconPath = typeInfo.getIcon();
}

Of course this can be used in any other code than taglib functions.

- "#{nxd:typeLabel(document)" to get the document type label. Common use case: <h:outputText value="#{messages[nxd:typeLabel (document)}" />

- "#{nxd:iconPath(document)" to get the document icon path (tries to get the field "icon" in schema "common", and defaults to the document type icon).

- "#{nxd:titleOrId(document)" to get the document title, and its id if title is somehow not set (can be very handy if you'd still like to click on the link to access it).

Also, the commandLink and commandButton methods defined in xmlns:nxh="http://nuxeo.org/nxweb/html"; taglib have been changed so that they can invoke a method binding which is the result of the given method binding. Ok, here's an example :)

NXActions items can be configured to hold method bindings as a link like "${documentAction.createDocument('Domain')}". This information can be accessed in a page via "${action.getLink()}". The nxh:commandLink tag will not consider this as a string (default behaviour of the h:commandLink tag) but will invoke the corresponding method binding.
So now you can have:
<nxh:commandLink value="#{action.label}" action="${action.getLink ()}" />

--
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87



_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to