Hi Frank!

Yes, of course the  "not(MetaData/@mgnl:activated)" is important to catch new 
nodes - I should have thought of that!

Also, a word of caution:

In my experience, Nodes imported via XML or the Packager module keep their 
activation status, even if they were never actually activated on the instance 
they are imported into.
So your results are reliable only if you have not imported any content.

Regards from Vienna,

Richard

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von frank rittinger
Gesendet: Dienstag, 18. Jänner 2011 15:40
An: Magnolia User-List
Betreff: AW: [magnolia-user] AW: find not activated nodes

Hello Jan, Richard and Zdenek,

thanks a lot for your suggestions! 

A colleague of mine also found the following JCR query which can be pasted into 
the JCR-Query browser in the tools menu:  //*[not(MetaData/@mgnl:activated) or 
MetaData/@mgnl:activated='false']

This also finds new nodes that don't have the attribute yet.

Best regards,

Frank

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Zdenek Skodik
Gesendet: Dienstag, 18. Januar 2011 13:48
An: Magnolia User-List
Betreff: Re: [magnolia-user] AW: find not activated nodes


and on top of that to retrieve nodes that 

>have changes and are not yet activated.

you can follow something along this

if (getIsActivated() && getModificationDate() != null && 
getModificationDate().after(getLastActionDate())) 

in other words the main rule is mgnl:lastaction < mgnl:lastmodified, see 
MetaData#getActivationStatus()

http://svn.magnolia-cms.com/svn/community/magnolia/trunk/magnolia-core/src/main/java/info/magnolia/cms/core/MetaData.java


-zdenek

P.S. It would be really appreciated if you could put it to 
wiki.magnolia-cms.com afterwards.

On Tue, 2011-01-18 at 12:28 +0000, Unger, Richard wrote:
> Hi Frank!
> 
>  
> 
> The Node-Metadata contains a field “mgnl:activated”.
> 
> Programmatically, you should be able to check this using something like:   
> content.getMetadata().isActivated()
> 
> As a JCR-Query (here in XPath Syntax) the following should give you a list of 
> pages not yet activated:
> 
>  
> 
> /jcr:root/mysite//element(*,mgnl:content)[MetaData/@mgnl:activated = 
> "false"]
> 
>  
> 
> (Replace “mysite” with your site’s root node name…)
> 
>  
> 
> Regards from Vienna,
> 
> 
> Richard
> 
>  
> 
>  
> 
>  
> 
>  
> 
> Von: [email protected] 
> [mailto:[email protected]] Im Auftrag von frank 
> rittinger
> Gesendet: Dienstag, 18. Jänner 2011 12:26
> An: [email protected]
> Betreff: [magnolia-user] find not activated nodes
> 
> 
>  
> 
> Hi list,
> 
>  
> 
> I’m twisting my brain to find a way to get all nodes of my website that have 
> changes and are not yet activated.
> 
>  
> 
> Is there a feature built-in or does anyone have a JCR query to find those 
> nodes?
> 
>  
> 
> Best regards,
> 
>  
> 
> Frank
> 
> 
> _____________________________________________________________________
> 
> Vorstand: Ralf Heller, Udo Mobes
> Vorsitzende des Aufsichtsrates: Kirsten Heller Sitz der Gesellschaft: 
> Gruenwaelderstrasse 10-14, D-79098 Freiburg Amtsgericht Freiburg HRB 
> 6218
> 
> Versand am 18.01.2011 12:25 von rittinger frank
> Validation-Code: 2475777544171
> 
> 
> 
> 
>                                    
> ______________________________________________________________________
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 
> 
> 
> 
> 
> ______________________________________________________________________
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------



----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------




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