Can one component *-config.xml file extend two or more different extension points?

I know according to the Customization documentation:

http://doc.nuxeo.com/display/NXDOC55/Customization+and+Development

When you are not creating a real Nuxeo Plugin (i.e. a JAR), XML configuration files should:

  • be copied in the “config” directory (nuxeo.ear/config or nxserver/config),
  • have a filename ending with -config.xml,
  • have a unique component identifier.

But I was wondering if I would need two seperate whatever*-config.xml files to extend two different components, e.g. ContentViewService ( org.nuxeo.ecm.platform.ui.web.ContentViewService ) and WebLayoutManager ( org.nuxeo.ecm.platform.forms.layout.WebLayoutManager ) with the following format ( simplified ) if anyone knows how to get the code to display properly, please feel free to edit this… :

> < ?xml version="1.0"? > 
> 
> < component
> name="com.my.creation.contentView.contrib" >
> 
> < require
> >org.nuxeo.ecm.platform.forms.layouts.webapp.listing<
> /require >
> 
> < extension
> target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
> point="layouts" >
> 
>    < layout name="document_listing" >
> 
>        < templates >
> 
>           ...
> 
>        < /templates >
> 
>    < /layout >
> 
>   < /extension >
> 
>   < extension
> target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
> point="widgets" >
> 
>     < layout name="document_virtual_navigation_listing_ajax"
> >
>     
>        < templates >
> 
>       ...
> 
>        < /templates >
> 
>     < /layout >
> 
>  < /extension > 
> 
>  < extension
> target="org.nuxeo.ecm.platform.ui.web.ContentViewService"
> point="contentViews" >
>      < contentView name="faceted_search_default" >
> 
>       ...
>      < /contentView >
> 
>  < /extension >       < /component >

I know by default, XML files contributed in the “config” directory are loaded only when the server starts, and that I would need to restart the server to see the changes, but could changes be made to both extensions within the one contribution file?

Thanks in advance!

1 votes

1 answers

1225 views

ANSWER



hello,

the answer is yes: you can contribute to as many extension points as you want in a single -config.xml (or -bundle.xml) file deployed in $NUXEO/nxserver/config/

that's the case for the file defining LDAP servers and directories: http://doc.nuxeo.com/download/attachments/5570895/default-ldap-users-directory-bundle.xml

Thierry

2 votes



Thank you! Would it need to be a -bundle.xml if it were part of a JAR file?
08/28/2013

in a JAR file, you can name your file as you want, you just need to reference it in your MANIFEST.MF But the convention is to name it -contrib.xml
08/28/2013

So then what is the difference between using a -bundle.xml extension, and a -config.xml ? Does nuxeo handle them differently?
08/28/2013

There is no difference. This is historical, we used to put in -bundles.xml files things having to do with the service definitions, and in -config.xml files things that we contributions to service. This separation is not really needed.
08/29/2013

Thank you for the clarification. In English, you would say "… and in -config.xml files things that are contributions to a service." or "… things we contribute to a service."
08/30/2013