Switching between repositories
I've already set up multiple repositories with single Nuxeo instance and my question is how to switch between them? In my nuxeo.conf file I have: nuxeo.templates=default,custom but after login I am always redirected to the default one. I would like to have 2 repos working at the same time and also an option that enables me to choose one of them.
I've got no errors in logs. This is what I did yet:
I've created secondary-repository-config.xml with content like this:
<clustering enabled="${repository.clustering.enabled}" delay="${repository.clustering.delay}" /> <binaryStore path="C:\\Programy\\Nuxeo DM\\nuxeo-cap-5.5-tomcat\\nxserver\\data2\\binaries" /> <schema> <field type="largetext">note</field> <field type="largetext">relatedtext</field> <field type="largetext">webp:content</field> <field type="largetext">webc:welcomeText</field> <field type="largetext">comment:comment</field> <field type="largetext">post</field> <field type="largetext">mail:mail</field> </schema> <indexing> <!-- for H2 (Lucene Analyzer): --> <fulltext analyzer="org.apache.lucene.analysis.standard.StandardAnalyzer"> <index name="secondary"> <!-- all props implied --> </index> <index name="title"> <field>dc:title</field> </index> <index name="description"> <field>dc:description</field> </index> </fulltext> </indexing> <xa-datasource>org.postgresql.xa.PGXADataSource</xa-datasource> <property name="ServerName">localhost</property> <property name="PortNumber">5432</property> <property name="DatabaseName">secondary</property> <property name="User">nuxeo</property> <property name="Password">nuxeo</property>
I've put this xml in NUXEO_HOME/templates/custom/nxserver/config
In nuxeo.conf I've set nuxeo.templates=default,custom
I've created proper datababase with PostgreSQL
I am working with Tomcat distribution (v 5.5). Both of my repos are PostgreSQL, each of them has its own database.
You can choose the repository with the following URL: http://yourserver/nuxeo/nxpath/default@view_servers which is accessible from the breadcrumbs navigation, clicking on the left arrow. But if you're logging in as an administrator user, you should be redirected to this view after login.
If the only item you see on this page is the default repository, then you may have a configuration issue: please comment your post to give more information about what you did, and check if you have any errors in logs.
I found out that there is one more thing to do while setting up multiple repositories. I just had to contribute “repositories” extension point, just like this:
<component name="com.nuxeo.multi.repository">
<require>org.nuxeo.ecm.platform.api.DefaultPlatform</require>
<extension target="org.nuxeo.ecm.core.api.repository.RepositoryManager"
point="repositories">
<repository name="secondary" label="Secondary Repo" />
</extension>
</component>
Everything seems to work fine, after login I'm able to choose repo.
NUXEO_HOME/nxserver
to know if the templates are taken into account correctly.