FI with JS document.observe("xwiki:actions:save"). method my script doesn't
work well...
When I save and close my page: my tag is added OR my field are update OR the script going
well OR I obtain a nice error message:
Information détaillée:
Error number 3201 in 3: Exception while saving document
xwiki:FormSMQ.SMQ-P3-FPIAC-Jolie Fiche
com.xpn.xwiki.XWikiException: Error number 3201 in 3: Exception while saving document
xwiki:FormSMQ.SMQ-P3-FPIAC-Jolie Fiche
at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:780)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:178)
at com.xpn.xwiki.store.XWikiCacheStore.saveXWikiDoc(XWikiCacheStore.java:171)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.hibernate.HibernateException: Failed to commit or rollback transaction.
Root cause []
at
com.xpn.xwiki.store.XWikiHibernateBaseStore.endTransaction(XWikiHibernateBaseStore.java:1022)
at com.xpn.xwiki.store.XWikiHibernateStore.saveXWikiDoc(XWikiHibernateStore.java:770)
... 69 more
Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count
from update [1]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:85)
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:70)
--------------------------------------------
En date de : Ven 3.4.15, Pascal BASTIEN <pbasnews-xwiki(a)yahoo.fr> a écrit :
Objet: Re : [xwiki-users] A way to add some tags on saved page with class
À: "XWiki Users" <users(a)xwiki.org>
Date: Vendredi 3 avril 2015, 11h00
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)