page delete hook.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

page delete hook.

kgardas

Hello,

I'm curious if there is any kind of hook or script or code executed when
the page from the XWiki is deleted and which might be easily enhanced.
I'm asking since during the page creation I also modify external
database (page template do this) and if page is deleted the data in
external db shall be also deleted to be consistent.

Thanks!
Karel
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: page delete hook.

Paul Libbrecht-2
I would look into the XWiki-notification mechanism, that tracks page saves and deletes nicely.

XWikiDocChangeNotificationInterface and XWikiActionNotificationInterface are the interface names which can also be implemented in Groovy (I have one page that does both) and which you register with
        xwiki.getNotificationManager().addGeneralRule

In my current environment it could not hook automatically at startup, I had to invoke a page right after which is acceptable.

I believe the notification system is an unknown glory with which one could implement a zillion intelligent distributed behaviours (I think I would know how to implement an expert system and probably parts of a multi-agent system).

Hope it helps.

paul


Le 8 août 2011 à 10:43, Karel Gardas a écrit :

>
> Hello,
>
> I'm curious if there is any kind of hook or script or code executed when
> the page from the XWiki is deleted and which might be easily enhanced.
> I'm asking since during the page creation I also modify external
> database (page template do this) and if page is deleted the data in
> external db shall be also deleted to be consistent.
>
> Thanks!
> Karel
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs

_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: page delete hook.

Thomas Mortagne
Administrator
On Mon, Aug 8, 2011 at 10:50 AM, Paul Libbrecht <[hidden email]> wrote:
> I would look into the XWiki-notification mechanism, that tracks page saves and deletes nicely.
>
> XWikiDocChangeNotificationInterface and XWikiActionNotificationInterface are the interface names which can also be implemented in Groovy (I have one page that does both) and which you register with
>        xwiki.getNotificationManager().addGeneralRule

Please don't use that, it's very old API. See
http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial
for how to use the new observation system in your use case.

>
> In my current environment it could not hook automatically at startup, I had to invoke a page right after which is acceptable.
>
> I believe the notification system is an unknown glory with which one could implement a zillion intelligent distributed behaviours (I think I would know how to implement an expert system and probably parts of a multi-agent system).
>
> Hope it helps.
>
> paul
>
>
> Le 8 août 2011 à 10:43, Karel Gardas a écrit :
>
>>
>> Hello,
>>
>> I'm curious if there is any kind of hook or script or code executed when
>> the page from the XWiki is deleted and which might be easily enhanced.
>> I'm asking since during the page creation I also modify external
>> database (page template do this) and if page is deleted the data in
>> external db shall be also deleted to be consistent.
>>
>> Thanks!
>> Karel
>> _______________________________________________
>> devs mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/devs
>
> _______________________________________________
> devs mailing list
> [hidden email]
> http://lists.xwiki.org/mailman/listinfo/devs
>



--
Thomas Mortagne
_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs
Reply | Threaded
Open this post in threaded view
|

Re: page delete hook.

kgardas

Hi Paul & Thomas,

thanks a lot for your suggestions. Indeed, XWiki notification framework
is nice and easy to use. Now, there are no more dangling deleted page's
semantics properties inside another DB anymore...

Thanks!
Karel

On 08/ 8/11 11:46 AM, Thomas Mortagne wrote:

> On Mon, Aug 8, 2011 at 10:50 AM, Paul Libbrecht<[hidden email]>  wrote:
>> I would look into the XWiki-notification mechanism, that tracks page saves and deletes nicely.
>>
>> XWikiDocChangeNotificationInterface and XWikiActionNotificationInterface are the interface names which can also be implemented in Groovy (I have one page that does both) and which you register with
>>         xwiki.getNotificationManager().addGeneralRule
>
> Please don't use that, it's very old API. See
> http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial
> for how to use the new observation system in your use case.
>
>>
>> In my current environment it could not hook automatically at startup, I had to invoke a page right after which is acceptable.
>>
>> I believe the notification system is an unknown glory with which one could implement a zillion intelligent distributed behaviours (I think I would know how to implement an expert system and probably parts of a multi-agent system).
>>
>> Hope it helps.
>>
>> paul
>>
>>
>> Le 8 août 2011 à 10:43, Karel Gardas a écrit :
>>
>>>
>>> Hello,
>>>
>>> I'm curious if there is any kind of hook or script or code executed when
>>> the page from the XWiki is deleted and which might be easily enhanced.
>>> I'm asking since during the page creation I also modify external
>>> database (page template do this) and if page is deleted the data in
>>> external db shall be also deleted to be consistent.
>>>
>>> Thanks!
>>> Karel
>>> _______________________________________________
>>> devs mailing list
>>> [hidden email]
>>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>> _______________________________________________
>> devs mailing list
>> [hidden email]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>
>
>

_______________________________________________
devs mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/devs