Have a look at NodeTypeRegistrationTask you can use this task directly or do 
something similar to what it does. To use the task you have override 
getBasicInstallTasks() in your version handler and put this task at the 
beginning of the list returned by the super call. This way your type will be 
registered before bootstrapping.

HTH,
Jan

On Apr 20, 2011, at 9:49 AM, JAKABFI Attila wrote:

> 
> Hi
>  I would like to use custom node types. I register them as follows:
> 
> //module cunstructor
> public MyModule() {
>       init();
> }
> 
> public static void init() {
>               log.info("Starting module init");
>               Provider provider = 
> ContentRepository.getRepositoryProvider(WORKSPACE);
>               try {
>                       provider.registerNamespace(PREFIX, NAMESPACE, 
> MgnlContext.getHierarchyManager(WORKSPACE).getWorkspace());
>                       provider.registerNodeTypes(NODES_PATH); //xml 
> containing the node types
>               } catch (RepositoryException e) {
>                       log.error("Could not load node types: " + e.getClass() 
> + " "+ e.getMessage());
>               }
>               log.info("Finished module init");
> }
> 
> The problem is that I can't bootstrap content that uses these node types. I 
> suppose that the bootstrapping happens before the node types are imported.
> 
> Where do I have to put this code so I could bootstrap content?
> 
> Thanks
> Attila
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
> ----------------------------------------------------------------




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to