But in this case you have a collection and not an iterator.
It depends on how many data you have to iterate, sorry for my iterations ;-)

Cheers
SC

On 06/12/2012 11:08 PM, Will Scheidegger wrote:
> Or simply execute a query:
>
> String query = "/jcr:root/mydatarootpath//element(*,mydatatype)";
> Collection hits = QueryUtil.query("data", query, "xpath", "mydatatype");
>
> and save yourself 1 extra module and a bunch of lines of code.
>
> -will
>
> On 12.06.2012, at 20:10, Jean-Francois Nadeau (via Magnolia Forums) wrote:
>
>> [SOLVED] Here is an example of the openmind lab criteria module to search 
>> the data workspace
>>
>> AdvancedResult result = JCRCriteriaFactory
>> .createCriteria()
>> .setWorkspace("data")
>> .setBasePath("/mydatarootpath")
>> .add(Restrictions.eq(Criterion.JCR_PRIMARYTYPE, "mydatatype"))
>> .execute();
>> ResultIterator<MyData>  myDataResult = result.getItems(MyData.class);
>> for (MyData myData: myDataResult) {
>> //do something
>> }
>>
>> -- 
>> Context is everything: 
>> http://forum.magnolia-cms.com/forum/thread.html?threadId=353ed44f-7616-4ec2-8827-b6912281bb47
>>
>>
>> ----------------------------------------------------------------
>> For list details, see 
>> http://www.magnolia-cms.com/community/mailing-lists.html
>> Alternatively, use our forums: http://forum.magnolia-cms.com/
>> To unsubscribe, E-mail to:<user-list-unsubscr...@magnolia-cms.com>
>> ----------------------------------------------------------------
>>
>
>
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to:<user-list-unsubscr...@magnolia-cms.com>
> ----------------------------------------------------------------
>



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

Reply via email to