Have a look at the STKModuleVersionHandler.java -> getBasicInstallTasks()
The is a example which uses that NodeTypeRegistrationTask for registering the 
'Contact' node type (used in the data module).

Cheers
Christian

On Apr 21, 2011, at 8:00 AM, Jan Haderka wrote:

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

Best regards,

Christian Ringele
Magnolia International Ltd.

Register now for Magnolia Conference 2011:
http://www.magnolia-cms.com/conference

Magnolia®  - Simple Open Source Content Management



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