adoro wrote:
Hallo again,
Actually I need to mark some pages as "certified" if they passed through the
quality control.
"Quality control signature" should disappear if any changes would been made
on the document and shown again if user rollback to the last "certified
version"
I thought the easiest way to do it was just to write e.g. QC in the comment
field and show the QC signature if this version has QC there. It works for
the actual doc version, but I have no clue, how can I get the version number
from the version to which I rolled back to query the comments from there.
This is easy, but is not safe, unless you trust your users, since
anybody can write that in the comment.
Perhaps there is a better solution for my problem. Can
someone give me some
idea how to solve it?
Thanks,
Alla
You could change the code that sets the comment when reverting. This
means that you must use a custom-build com.xpn.xwiki.XWiki class.
Another solution is to make use of the notification mechanism and set
the comment from the history right before the restored document is sent
to the database. See
http://platform.xwiki.org/xwiki/bin/view/DevGuide/Notifications
After obtaining the target version number, you can use this query:
select info.comment from XWikiRCSNodeInfo as info where info.id.docId =
55068893 and info.id.version1=2 and info.id.version2=1
where 55068893 is the document numerical ID, which you can get with
$doc.getId(), version1 is the first (major) part of the version, and
version2 is the second (minor) part of the version, in this example the
full version string is "2.1".
adoro wrote:
Hallo,
What HQL can I use to show in current document the comment from the
revision version if I do rollback to someone version (not the "Rollback to
version...")
Best Regards,
adoro
--
Sergiu Dumitriu
http://purl.org/net/sergiu/