How to set up a hierarchy of folders in the workspace without the studio when the server starts nuxeo-dm-tomcat?

How to create folder hierarchy in work area at start of the server without using studio? I would want that folders in work area formed not in manual or studio, and automatically from.

For example:

Workspace

| - MyFolder1

| - MyFolder2

I was looking for information on how to do it and ran only on information about PublisherService. It said the following:

“You should create a new config file, publisher-server-config.xml for instance, in the nuxeo.ear / config folder of your Nuxeo acting as a server.”

Here is a sample configuration:

<? xml version = "1.0"?>
   <component name="org.nuxeo.ecm.platform.publisher.contrib.server">

     <extension target = "org.nuxeo.ecm.platform.publisher.impl.service.PublisherServiceImpl"
       point = "treeInstance">

       <publicationTreeConfig name="ServerRemoteTree" tree="CoreTreeWithExternalDocs" factory="RemoteDocModel">
         <parameters>
           <parameter name="RootPath"> / default-domain/sections </ parameter>
         </ parameters>
       </ publicationTreeConfig>

     </ extension>

   </ component>

But this configuration does not work. Help please.

0 votes

1 answers

981 views

ANSWER



The service we are using to generate the default structure is the content-template service.

I let you discover the service here.

The content template manager service provide factories to automatically create Documents. The factories are used whenever a document is created using EventListener.

As a root document is created the first time your are starting your Nuxeo instance, a factory is activated to created a domain named default-domain. As a domain is created (default-domain) another factory is activated to create the Workspace root, the Section root and the Template root, etc…

If I understand well you want to add a factory associated to the Workspace root doc type to create your Folder1, Folder2, …

Be careful, the content template working even after the first start. So if you create a factory for the Folder doc type, the template you describe in it will be generated each time you will create a Folder doc type.

Hope this will help you.

0 votes