cancel
Showing results for 
Search instead for 
Did you mean: 

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

ben-Nabiy_Derus
Star Contributor
Star Contributor

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 ACCEPTED ANSWER

Thierry_Martins
Star Collaborator
Star Collaborator

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

View answer in original post

6 REPLIES 6

Thierry_Martins
Star Collaborator
Star Collaborator

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

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

in a JAR file, you can name your file as you want, you just need to reference it in your MANIFEST.MF

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

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.

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."

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

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.