Re: [xwiki-users] Fw : Re: Fw : Re: How can I get event object through a form

2016-01-19 Thread vinc...@massol.net
 

On 19 Jan 2016 at 10:00:13, Pascal BASTIEN 
(pbasnews-xw...@yahoo.fr(mailto:pbasnews-xw...@yahoo.fr)) wrote:

>  
>  
> --- En date de : Mar 19.1.16, vinc...@massol.net a écrit :
>  
> > De: vinc...@massol.net  
> > Objet: Re: [xwiki-users] Fw : Re: How can I get event object through a form
> > À: "XWiki Users"  
> > Date: Mardi 19 janvier 2016, 8h09
> > Also note that the AS has
> > a buitin feature to delete old events, see your xwiki.cfg
> > file:
> >
> 
> > xwiki.plugin.activitystream.daystokeepevents=0
>  
> Yes I know that and delete some event with API :-)
> My problem is the way to give some selected event object through a form with 
> $request.getParameterValues() to delete these events.
>  
> >
> > If you still need to delete
> > event manually you could check the code executed by the
> > scheduler job.
>  
> I didn't found it either Scheduler.ActivityStreamCleaner is empty and anyway 
> I suppose it is groovy code (look into xar source if needed).

The job is written in java:
https://github.com/xwiki/xwiki-platform/blob/4303f79df9c0ef657a8f8f823fb76aff3f9a1f99/xwiki-platform-core/xwiki-platform-activitystream/xwiki-platform-activitystream-api/src/main/java/com/xpn/xwiki/plugin/activitystream/impl/ActivityStreamCleanerJob.java#L43-L43

Thanks
-Vincent

> > > Did you try using
> > searchEvents and building an HQL that
> > >
>  
> Anyway I found table and field to use an hql query here:
> http://platform.xwiki.org/xwiki/bin/view/DevGuide/DatabaseSchema (I must use 
> a ggogle glass+zoom to see field ;-) )
> but my query with $services.query.hql($hql).execute() doesn't work with table 
> name (rg.hibernate.hql.ast.QuerySyntaxException: activitystream_events is not 
> mapped ).
> Then I tested with simple query:
> SELECT doc.XWD_TITLE FROM xwikidoc AS doc WHERE doc.XWD_FULLNAME = 
> 'Main.WebHome'
> didn't work => Caused by: org.hibernate.hql.ast.QuerySyntaxException: 
> xwikidoc is not mapped [select doc.XWD_TITLE FROM xwikidoc AS doc WHERE 
> doc.XWD_FULLNAME = 'Main.WebHome']
> SELECT doc.title FROM XWikiDocument AS doc WHERE doc.fullName = 'Main.WebHome'
> working fine
> With velocity+API we can not use hql query with true field/table name?
> If we can not then where I can found field/table mapping name for 
> activitystream_events table?
>  
> Thxs

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Fw : Re: Fw : Re: How can I get event object through a form

2016-01-19 Thread Pascal BASTIEN


--- En date de : Mar 19.1.16, vinc...@massol.net  a écrit :

> De: vinc...@massol.net 
> Objet: Re: [xwiki-users] Fw : Re: How can I get event object through a form
> À: "XWiki Users" 
> Date: Mardi 19 janvier 2016, 8h09
> Also note that the AS has
> a buitin feature to delete old events, see your xwiki.cfg
> file:
> 

> xwiki.plugin.activitystream.daystokeepevents=0

Yes I know that and delete some event with API :-)
My problem is the way to give some selected event object through a form with 
$request.getParameterValues() to delete these events.

> 
> If you still need to delete
> event manually you could check the code executed by the
> scheduler job.

I didn't found it either Scheduler.ActivityStreamCleaner is empty and anyway I 
suppose it is groovy code (look into xar source if needed).


> > Did you try using
> searchEvents and building an HQL that
> >

Anyway I found table and field to use an hql query here:
http://platform.xwiki.org/xwiki/bin/view/DevGuide/DatabaseSchema (I must use a 
ggogle glass+zoom to see field ;-) )
but my query with $services.query.hql($hql).execute() doesn't work with table 
name (rg.hibernate.hql.ast.QuerySyntaxException: activitystream_events is not 
mapped ).
Then I tested with simple query:
SELECT doc.XWD_TITLE FROM xwikidoc AS doc WHERE doc.XWD_FULLNAME = 
'Main.WebHome'
didn't work => Caused by: org.hibernate.hql.ast.QuerySyntaxException: xwikidoc 
is not mapped [select doc.XWD_TITLE FROM xwikidoc AS doc WHERE doc.XWD_FULLNAME 
= 'Main.WebHome']
SELECT doc.title FROM XWikiDocument AS doc WHERE doc.fullName = 'Main.WebHome'
working fine
With velocity+API we can not use hql query with true field/table name?
If we can not then where I can found field/table mapping name for 
activitystream_events table?

Thxs
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users