Since you want to activate _all_ your nodes, the rule doesn't matter
that much. You can call addAllowType() for all the node types that you
create. The point of the rule is to ensure that during the activation of
single node/page, only that given node/page gets activated (including
paragraphs and metadata), but any children pages are not.

Another thing to be aware of when playing with rule: If you change the
rule to include every node you want to activate, it will be activated in
one chunk. This is fine if the data set is not too big, but might cause
the issues for very big sets (big transfer files (slow activation),
memory consumption at import, slow session saving (hence long time to
commit the activation transaction). 

If the data set is too big, you should not include the "yourType" node
type (the type of the activated node itself) in the rule but set it as
the main item type activateAll.setItemType("yourType");

HTH,
Jan

On Fri, 2009-08-28 at 11:01 +0200, Matteo Pelucco wrote:
> Hi all,
> I need a quick consult :-)
> 
> I do a strong data import below data ws and a certain path (e.g.: 
> /2009/09/20...)
> 
> At the end of import / elaboration, I need to activate the data.
> I would like to use the <data><activateAll> command.
> Is correct this way? My doubts are expecially on rule definition, 
> because we have different NodeTypes under path (but they should extends 
> dataItem type, isn't it?).
> 
> 
> *****************
> 
> DataActivateAllCommand activateAll = (DataActivateAllCommand) 
> CommandsManager.getInstance().getCommand("data", "activateAll");
> if (null != activateAll){
>                               
>    activateAll.setRepository("data");
>    activateAll.setPath(path);
>                               
>    // dataItem is implicit
>    Rule rule = new Rule();
>    rule.addAllowType("dataItem");
>    rule.addAllowType(ItemType.NT_METADATA);
>    rule.addAllowType(ItemType.NT_RESOURCE);
>                               
>    activateAll.setRule(rule);
>    activateAll.execute(ctx);
>                               
> } else {
>    log.error("cmd not found");
> }
> 
> *****************
> 
> Thanks for your support..
> matteo
> 
> 
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
-- 
Best regards,

Jan Haderka
Magnolia International Ltd.

Meet us at the Magnolia Conference
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: <[email protected]>
----------------------------------------------------------------

Reply via email to