08-22-2011 06:44 PM
08-23-2011 09:03 AM
There are several ways to do that depending on how you'd like this feature to affect all document types, or whether you'd like to fine-tune it per document type.
To affect all document types, the easiest is to override the /incl/tabs/document_view.xhtml template to add your specific xhtml code.
To affect only some document types, you can package the xhtml code as a widget template, taking example on what's done for the widget showing comments in the summary, for instance: this template is at /widgets/summary/comments_widget_template.xhtml and its definition is made through extension points, you can browse it content here: org.nuxeo.ecm.platform.forms.layouts.webapp.summary
Note that the summary layout can be configured on documents by specifying the layout to use in the mode "summary", see for instance the specific configuration for the "Note" document type:
<type id="Note">
[...]
<layouts mode="summary">
<layout>note_summary_layout</layout>
</layouts>
[...]
</type>
Defining your code as a widget template is also a good thing to be able to configure its presence on the summary view of a given document type using Nuxeo Studio.
08-22-2011 10:17 PM
If you already have the content and the XHTML, what you have to do is to declare an action in a contrib to display your content. Something like this:
<?xml version="1.0" encoding="UTF-8"?>
<component name="my.component.name">
<extension target="org.nuxeo.ecm.platform.actions.ActionService"
point="actions">
...
<action id="my_view" link="/incl/tabs/my_document_view.xhtml"
enabled="true" label="My view" icon="/icons/file.gif" order="9">
<category>VIEW_ACTION_LIST</category>
<filter id="my_document_view_filter">
<rule grant="true">
<type>my_document</type>
</rule>
</filter>
</action>
...
</extension>
</component>
This will display your content as a new tab.
If the only thing you want is to display your content on summary, go to summary xhtml and include your own.
08-23-2011 09:03 AM
There are several ways to do that depending on how you'd like this feature to affect all document types, or whether you'd like to fine-tune it per document type.
To affect all document types, the easiest is to override the /incl/tabs/document_view.xhtml template to add your specific xhtml code.
To affect only some document types, you can package the xhtml code as a widget template, taking example on what's done for the widget showing comments in the summary, for instance: this template is at /widgets/summary/comments_widget_template.xhtml and its definition is made through extension points, you can browse it content here: org.nuxeo.ecm.platform.forms.layouts.webapp.summary
Note that the summary layout can be configured on documents by specifying the layout to use in the mode "summary", see for instance the specific configuration for the "Note" document type:
<type id="Note">
[...]
<layouts mode="summary">
<layout>note_summary_layout</layout>
</layouts>
[...]
</type>
Defining your code as a widget template is also a good thing to be able to configure its presence on the summary view of a given document type using Nuxeo Studio.
08-23-2011 05:33 PM
The problem with overriding, it makes you more fragile to updates in nuxeo-dm.
08-24-2011 08:00 AM
You're right, the second option is better in terms of maintenance.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.