Finally I added some CSS Id on my inline form (in my Sheet) and getProperty value with JS
and document.observe("xwiki:actions:save").
I call my TagUpdater Page with AJAX
var request=$.ajax({method: "POST",
url: Url,
data: UrlParams,
dataType: "html",
async: false});
My Ajax requests are sent synchronous if not sometimes my page is recorded before Tag
added, and sometimes not, ...
I know it is ugly way but I haven't choice.
(Anyway, I will schedule some batch to fix my tags)
--------------------------------------------
En date de : Jeu 2.4.15, Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr> a écrit :
Objet: [xwiki-users] A way to add some tags on saved page with class
À: "XWiki Users" <users(a)xwiki.org>
Date: Jeudi 2 avril 2015, 15h51
Hello,
I'm looking for advice about a way to add some tags on saved
page with class.
What I have:
- a sheet page with an object Class ( with an object class +
properties) + a template page
- a velocity code in a page AddMyTag to add some tags
on some page with this URL parameters:
$!request.PageSource, $!request.ClassName
What I'm trying to do, is: when a user save a page, a tag is
added. The tag to add is coming from a properties value
(last character on property name is _Tag).
If I call my 'AddMyTag' page, tags are correctly added on
PageSource.
To resume:
- the user save HisPage
- HisPage add tags from a properties value (name xxx_Tag)
My problem is "how can I launch" automaticelly my 'AddMyTag'
page when a user record PageSource?
I tried with Ajax with
document.observe("xwiki:actions:save", function(event){
(
http://platform.xwiki.org/xwiki/bin/view/DevGuide/JavaScriptAPI#HActioneven…)
but the problem is: sometime xxx_Tag property value is
updated after my AJAX call (and the old tag is attached on
page).
A the moment, I'm looking for another way, I read
http://extensions.xwiki.org/xwiki/bin/view/Extension/WikiComponent+Module
But documentation indicate: "The goal is to listen ...
DocumentUpdatingEvent events (note that these events are
fired before the page is saved and thus our code doesn't
need to perform the save itself ..."
Then I can not use this method either because I must add tag
from new value from my _Tag properties.
How can I launch a velocity script on a document after
document is saved (to add some tag from the document
itself)?
Thxs for any help
Pascal B
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users