[xwiki-users] delete spam comments
Robin Fernandes
rewbs.soal at gmail.com
Tue Oct 17 18:36:15 CEST 2006
> Then, you're stuck with the $xwiki.search() method.
Afraid that's out of bounds - $xwiki.search() has been restricted so
you need programming rights for that too on xwiki.com. :(
The best solution is to let Jeremy add his scripts - and don't
edit&save them else you will lose the ability to execute them.
Jeremy, by the way, how much do we have to bribe you to get
programming rights on xwiki.com? :D
Regards,
Robin.
On 17/10/06, THOMAS, BRIAN M (SBCSI) <bt0008 at att.com> wrote:
> Whoops. Forgot to ask about that.
>
> Then, you're stuck with the $xwiki.search() method. Looks something
> like this:
>
>
> #set($hql = "from BaseObject as obj, LargeStringProperty as s where
> obj.className = 'XWiki.XWikiComments' and obj.id = s.id.id")
>
> #foreach($comment in $xwiki.search($hql))
> #foreach($field in $comment)
> #if($velocityCount == 1)
> $field.name
> #else
> $field
> #end
> #end
> #end
>
> The class names from the xwp_classtype queries I gave you are the ones
> that you need to use in HQL, which is an SQL-like syntax on the object
> hierarchy persisted by Hibernate.
>
> I think the results are easier to deal with using groovy, but haven't
> done that lately. There's a better way, I think, than simply counting
> the fields and working on the values, but I've forgotten it if I ever
> knew.
>
> Of course, once you've found them, you have to remove them from their
> respective documents, which is something I haven't done, but I think
> it's XWikiDocument.addObjectsToRemove(Object) and then
> Document.saveDocument().
>
>
>
> brain[sic]
>
> > -----Original Message-----
> > From: wangwh at att.net [mailto:wangwh at att.net]
> > Sent: Tuesday, October 17, 2006 10:22 AM
> > To: xwiki-users at objectweb.org
> > Subject: RE: [xwiki-users] delete spam comments
> >
> >
> > Hi, Brian,
> > Thanks a lot.
> > My site is on Xwiki.com, can I do all these steps?
> > Is there a way just to stop showing comments right now? Wei-hsing
> >
>
>
>
>
> --
> You receive this message as a subscriber of the xwiki-users at objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-users-unsubscribe at objectweb.org
> For general help: mailto:sympa at objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>
More information about the users
mailing list