Well, my annotation plugin is in progress.
I join my new version.
Now i can add annotation to doc but this is not permanent. :'(
I have another problem, i did annotations.vm and annotationsinline.vm
templates to list annotations of a document.
Well, i don't understand how to acces attributes of my annotations to
display them.
If someone can help, please.
antoine SEILLES a écrit :
Hi
i'm doing an annotation plugin and i need some help.
An annotation is a comment linked to a document (like a XWikiComment).
More precisely, an annotation is linked to a selected part of a document.
My objective is to get something like in attached picture (.jpg).
I have created three classes for my plugin (view attached pieces)
inspired of helloworldplugin and XWikiComment class.
What i need is:
* to create an annotation.
* to add an annotation to a document
* to modify an annotation
* to delete an annotation
* to list annotations linked to a document
If someone had some advices.
Thank
------------------------------------------------------------------------
--
Antoine SEILLES
Doctorant (phd student)
Pikko software
Cap Omega - Rond Point Benjamin Franklin
CS 39521
34960 Montpellier Cedex 2
FRANCE
LIRMM CNRS
UMR 5506 - 161 rue Ada
34392 Montpellier Cedex 5
FRANCE
Tel: +33 (0)6 10 192 055
http://www.pikko-software.com
http://www.lirmm.fr
###
### Annotations page in the "view" mode
###
###
<h2>$xwiki.parseMessage("viewannotationstitle")</h2>
#template("annotationsinline.vm")
###
### List document annotations
###
### TODO: web service?
###
#if($xwiki.getWebPreferenceAsInt("commentsorder",1)==1)
#set($annotations = $xwiki.annotation.getAnnotations($doc))
#end
<div id="annotationscontent" class="xwikiintracontent">
#if($inline && ($inline == true)) <div class="xwikititlewrapper"
onclick="toggleClass($('annotations'), 'hidden');
toggleClass($('annotationscontent'), 'exp')"><h3
class="xwikiintratitle">$msg.get("annotations")<span
class="hidden">:</span> <span
class="annotationsno"><span>$annotations.size()</span></span></h3></div>#end
<div id="annotations">
#if($annotations.size()>0)
#foreach($annotation in $annotations)
#if($velocityCount > 1) <hr class="annotationspacer"/>
#end
<div id="xwikiannotation_${velocityCount}" class="xwikiannotation
#if($velocityCount % 2 == 1) odd #else even #end">
## <div
class="annotationavatar">#useravatar($annotation.getAuthor())</div>
<div class="annotationheader"><span
class="annotationauthor">$!xwiki.getLocalUserName($doc.display('author','view',
$annotation))</span>
## #set($date = $doc.display("date","view",$annotation))
#set($date = $xwiki.annotation.getCreationDate($annotation).value)
#if($date)
| <span class="annotationdate">$xwiki.formatDate($date,
"dd.MM.yyyy") $msg.get("at") $xwiki.formatDate($date, "hh:mm
a")</span>
#end
#if($hasedit) <span class="annotationdelete"><a
class="annotationremove" href="$doc.getURL("objectremove" ,
"classname=XWiki.XWikiAnnotations&classid=${annotation.number}&xredirect=${request.getRequestURL()}")"
onclick="return
confirm('$msg.get("confirmannotationremove")')">[$msg.get("removethisannotation")]</a></span>#end
</div>
<div
class="annotationcontent">$doc.getRenderedContent($doc.display("content","view",$annotation))
</div>
</div>
#end
#else
$msg.get("noannotations")
#end
</div> ## annotations
</div> ## annotationscontent
#if($inline && ($inline == true))
<script type="text/javascript">
//<!--
if(document.getElementById("annotationform")) {
document.getElementById("annotationform").className = "collapsed";
}
document.getElementById("annotations").className += " hidden";
//-->
</script>
#end