On Wed, Jan 15, 2014 at 10:26 PM, PSwamy <preethi(a)comdata.com> wrote:
Well, I tried something using Xwiki Query Manager.
Code below -
{{velocity}}
#set($resultDocuments = $services.query.xwql("from
doc.object(Blog.BlogPostClass) as blog where blog.published = '1' and
:category member of blog.category and blog.hidden = '0' and doc.web =
'Blog'").execute())
#foreach($resultDocument in $resultDocuments)
$resultDocument
#end
{{/velocity}}
I get this below error. What is programming right and how do I enable this
right?
I don't get this error. I get another one, because you didn't bind the
parameter value. So adding
.bindValue('category', 'Blog.News')
before executing the query fixes the problem for me. See
http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module#HXWiki-sp…
for what a short form query is. As for what Programming Right is, it
controls whether users can use protected APIs & Groovy code in wiki
pages.
Hope this helps,
Marius
Caused by: org.xwiki.query.QueryException: Full form statements requires
programming right. Query statement = [select doc.fullName where from
doc.object(Blog.BlogPostClass) as blog where blog.published = '1' and
:category member of blog.category and blog.hidden = '0' and doc.web =
'Blog'] at
org.xwiki.query.internal.SecureQueryExecutorManager.execute(SecureQueryExecutorManager.java:88)
at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:248) at
org.xwiki.query.internal.ScriptQuery.execute(ScriptQuery.java:236)
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Display-Blog-of-specific-Category-on-Main…
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users