I had the same issue. I ended up using jdbc as following:

*Implementation steps*
1. Fetching the DataSource from JNDI ( I use the jboss version)
2. Run an SQL to fetch the ID's.
3. Use the CoreSession to fetch the actual documents.

When I did this, I had to solve the following challenges:

*Security*
Security. We needed a bit of security so I added a join to the 
hierarchy_read_acl and a condition that the nx_get_read_acls_for should contain 
my user. (This function takes in the user + groups, and we have not implemented 
this correctly yet.)

*Unit-tests*
We had to hack the unit tests a bit in order to fetch the datasource from JNDI 
during unit-tests.

*Example of our SQL to fetch ids on complex objects:*
SELECT h.id FROM vodkioskinstance ki 
JOIN hierarchy hki ON (ki.id=hki.id) 
JOIN hierarchy h ON (h.id=hki.parentid)
JOIN hierarchy_read_acl a ON (h.id=a.id)
JOIN hierarchy hr ON (hr.parentid=h.id) 
JOIN vodgenres g ON (g.id=hr.id)
WHERE hki.primarytype='vodkioskinstance' 
AND hr.primarytype='vodregistration'
AND a.acl_id in (SELECT * FROM nx_get_read_acls_for('{"guest"}'))
AND ki.kiosk=? 
AND g.item=? 
ORDER BY ki.from 
LIMIT ? OFFSET ?




Where my datastructure looks a bit like this:

<ul><li>        voditem 
<ul><li>vodkioskinstance[] ki
<ul><li>kiosk 
</li>
</ul>
</li>
<li>vodregistration[] r
<ul><li>vodgenres[] g
<ul><li>item</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
--
Posted by "kjetilny" at Nuxeo Discussions <http://nuxeo.org/discussions>
View the complete thread: 
<http://www.nuxeo.org/discussions/thread.jspa?threadID=3265#11239>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to