You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Andreas Hartmann <an...@apache.org> on 2006/05/19 14:46:39 UTC

[1.4] [heads-up] Removed NodeCreatorInterface

Hi Lenya devs,

according to many discussions, the NodeCreatorInterface was considered
harmful and therefore deprecated.

I removed it now, the creation is handled completely by the
DocumentManager.

If you want to initialize your documents in a specific way, you can
do this in the corresponding usecase.

To make your resource types work again, you have to remove the
creator element:

instead of

   <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
     <sample-name>fallback://lenya/modules/...</sample-name>
   </creator>

it is sufficient to write

   <sample-name>fallback://lenya/modules/links/samples/links.xml</sample-name>


Sorry for the inconvenience,

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [1.4] [heads-up] Removed NodeCreatorInterface

Posted by Andreas Hartmann <an...@apache.org>.
Renaud Richardet wrote:
> Hello Andi,
> 
> Andreas Hartmann wrote:
> 
>> Hi Lenya devs,
>>
>> according to many discussions, the NodeCreatorInterface was considered
>> harmful and therefore deprecated.
>>
>> I removed it now, the creation is handled completely by the
>> DocumentManager.
>>
>> If you want to initialize your documents in a specific way, you can
>> do this in the corresponding usecase.
> 
> Could you explain a little more?

Sure, see below.

> It seems to break a lot of modules that 
> Wyona developed (available at http://svn.wyona.com/repos/public/lenya/).

I assume these modules used the deprecated NodeCreator interface.

The NodeCreatorInterface was used for a resource-type-specific
post-processing of the created document. The default implementation
provided a template method to apply an XSL transformation, a hack
was used to determine if the document was XML based on the source
extension.

This post-processing relied on a parameter map which was part of
the interface (magic container antipattern). This map was passed
from the usecase handler through the DocumentManager to the
NodeCreator. This is a useless indirection - the usecase handler
and the NodeCreator have to agree upon a parameter set. So the
NodeCreator directly depends on the usecase, so the interface
can in fact be removed. This reduces the complexity of the codebase
(see the recent thread "deprecated NodeCreatorInterface" by Michael
Ralston.

So, to make your code work again, you just call your NodeCreator
implementation directly from the usecase, without the indirection
through the DocumentManager. I suggest to remove the parameter map
from the method signature and use explicit parameters instead,
this will improve the understandability and maintainability of the
code.

I hope this helps, otherwise I'll post an example.

-- Andreas





> Thanks,
> Renaud
> 
>>
>> To make your resource types work again, you have to remove the
>> creator element:
>>
>> instead of
>>
>>   <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
>>     <sample-name>fallback://lenya/modules/...</sample-name>
>>   </creator>
>>
>> it is sufficient to write
>>
>>   
>> <sample-name>fallback://lenya/modules/links/samples/links.xml</sample-name> 
>>
>>
>>
>> Sorry for the inconvenience,
>>
>> -- Andreas
>>
>>
> 


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [1.4] [heads-up] Removed NodeCreatorInterface

Posted by Renaud Richardet <re...@wyona.com>.
Hello Andi,

Andreas Hartmann wrote:

> Hi Lenya devs,
>
> according to many discussions, the NodeCreatorInterface was considered
> harmful and therefore deprecated.
>
> I removed it now, the creation is handled completely by the
> DocumentManager.
>
> If you want to initialize your documents in a specific way, you can
> do this in the corresponding usecase.

Could you explain a little more? It seems to break a lot of modules that 
Wyona developed (available at http://svn.wyona.com/repos/public/lenya/).

Thanks,
Renaud

>
> To make your resource types work again, you have to remove the
> creator element:
>
> instead of
>
>   <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
>     <sample-name>fallback://lenya/modules/...</sample-name>
>   </creator>
>
> it is sufficient to write
>
>   
> <sample-name>fallback://lenya/modules/links/samples/links.xml</sample-name> 
>
>
>
> Sorry for the inconvenience,
>
> -- Andreas
>
>

-- 
Renaud Richardet
COO America
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
office +1 857 776-3195                     mobile +1 617 230 9112
renaud.richardet <at> wyona.com              http://www.wyona.com


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org