Hi devs! As you know XWQL was introduced in 1.6, but without some easy access from scripts. Currently it is accessible via $xwiki.xWiki.store.queryManager.createQuery(stmt, "xwql") and only with programming rights.
We need some easy ways to access to XWQL similar as $xwiki.searchDocuments, countDocuments and search. This will allow to users much more test XWQL and send us feedback. I planed to implement this by 1.7RC1 or 1.7. This is just an interface for xwiki scripts and doesn't affect to important parts of platform. Name of this service? 1. $xwiki.queryManager ($xwiki.query is occupied by old QueryPlugin) Later this will be obsoleted by 2. or 2. $services.query $services was proposed in our velocity bridge proposal[1]. We may implement only $service now as just simple services holder, without uberspectors. $services will be reimplemented later, but "$service.query" name will be saved. [1] http://markmail.org/message/nnybto3mluvp2rov I'm for 1 because velocity bridge isn't exist yet and its design may be changed. Technically it will be just some proxy for QueryManager and Query with access right checking. Functionality? 1. Just the same as QueryManager so: .createQuery("stmt", "lang").execute() or 2. The same as QueryManager + .xwql("stmt") method which will call .createQuery("stmt", "xwql") .xwql("stmt") is much more laconically than createQuery. Later it may be transparently replaced by 3. or 3. QueryManager + dynamic methods like .language("stmt") impossible without velocity bridge uberspectors. I'm for 2. Access rights? One way: 1. short-form xwql queries like "where <whereexpr>" and "from <fromexp> where <whereexpr>" return only document names, so will be available for everyone. this is analogue for $xwiki.searchDocuments() 2. full-form xwql ("select <selectlist> from <etc>" ) will require programming rights. this is analogue for $xwiki.search() 3. all other languages (currently only HQL) in QueryManager will require programming rights. 4. Query.setWiki will require programming rights. So we need to wrap Query with some SecureQuery. How should be analogue for "$xwiki.countDocuments"? Ways: 0. No analogue. just query.execute().size() JCRSQL2 has no aggregate functions at all. We could make lazy query result list to fix negatives. 1. just accept all queries like "select count(*) ..." ("*" is not supported in count() according jpql) 2. implement some simple syntax extension in xwql: "count [from ...] where ..." no parser change, just replace the statement prefix I'm 0 for now. WDYT? -- Artem Melentyev _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

