Antoine,
antoine SEILLES wrote:
All these considerations are interesting.
I agree we should think a bit more about capabilities of the plugin but
i'had like to do a demo of what it could look like on wednesday 12
december.
Timing is short.
Well, i have new difficulties every day.
I don't understand why but i have difficulties to include javascript.
When i do
<script language="javascript" type="text/javascript">
alert("toto");</script> no pbs.
but when i do:
<script language="javascript" type="text/javascript"
src="getSelection.js"></script>
<script language="javascript" type="text/javascript">
getSelection();</script>
with getSelection.js :
function getSelection(){
alert("toto");
}
I have an error in my console: getSelection is not define.
that's because you don't specify the path where your javascript file is
located. You need to use the following syntax: (see the file
"javascript.vm"):
<script type="text/javascript"
src="$xwiki.getSkinFile("skin.js")"></script>
Another point is, how to get the values of a form in
velocity?
I have an addannotation.vm :
#if($xwiki.hasAccessLevel("comment"))
#set($cclass = $xwiki.getDocument("XWiki.AnnotationClass").getxWikiClass())
#set($annotation = $cclass.newObject())
<form action="XXXXXXXXX" method="post"
id="myForm">
<fieldset class="expanded" id="commentform">
<legend
onclick="toggleForm(this.form)">$msg.get("addannotationcomment")<span
class="expands">...</span></legend>
<input type="hidden" name="xredirect"
value="${doc.getURL("view")}" />
<input type="hidden" name="AnnotationClass_author"
value="$context.user"/>
<input type="hidden" name="AnnotationClass_begin"
value=0/>
<input type="hidden" name="AnnotationClass_end"
value=0/>
<input type="hidden" name="AnnotationClass_selection"
value="blablabla pour le moment"/>
<div><textarea id='XWiki.XWikiComments_comment' rows='5'
cols="80" name='XWiki.Annotation_comment' style="width:
100%;"></textarea></div>
<div>
<span class="buttonwrapper"><input type="submit"
value="$msg.get("addannotation")"
class="button"/></span>
<span class="buttonwrapper"><input type="reset"
value="$msg.get("cancel")" onclick="hideForm(this.form);"
class="button"/></span>
</div>
</fieldset>
</form>
#end
</div> ## comments
</div> ## commentscontent
I'd like to have a link to a page in "<form action=" that would print
"your annotation has been added" and that would call my function
$xwiki.annotation.addNewAnnotation($doc, $AnnotationClass_selection,
$AnnotationClass_begin, $AnnotationClass_end,
$AnnotationClass_selection, $AnnotationClass_author)
(where $AnnotationClass_begin is the value of AnnotationClass_begin field).
the value of the attribute "action" in the form element of
"addannotation.vm" is incorrect: you're trying to call a Java method
directly ("$xwiki.annotation.addNewAnnotation"), whereas you should put
a URL there, just like in the commentsinline.vm: something like
"$doc.getURL("annotationadd")" (but then you have to define that
action
in struts-config.xml etc. as I said previously).
Stéphane Laurière a écrit :
If you want to code the annotation feature
exactly as the comment
feature, you need to have to look at the "commentadd" action in
"WEB-INF/struts-config.xml" and at the related classes like
"CommentAddAction" and the places where they show up, like
XWikiRightServiceImpl.java, and then to introduce the same elements for
the Annotation classes.
That's not necessarily the simplest thing to do, though. Another option
is to use Groovy or Velocity scripts directly in wiki pages for
introducing the annotation feature. For example, for the help desk we're
developing, the answers to questions asked are added as XWiki objects
through Groovy scripts, even though the feature is similar to the
XWikiComment feature as well. The main advantage I see in using scripts
in wiki pages instead of external templates is that it's then easier to
evolve those scripts collaboratively. You can see the way it's coded
from [1], and the add "?viewer=code" at the end of the URLs for
viewing the code.
I agrre, it's a bit hard for a xwiki beginner.
[1]
http://club.mandriva.com/xwiki/bin/view/ITS/
Introducing annotation capabilities to XWiki is very relevant in various
contexts. I would say we should think about the capabilities of the
plugin a bit more before developing it.
Here are some considerations:
1) do we want to have the possibility to annotate annotations? And also
to tag annotations? If yes, having each annotation in a separate
document would probably be a better design. Personally, I think that'd
be a good feature to support tagging for annotations, letting users
describe some annotations as "critique" for instance, or rating some
annotations through the rating plugin when one will be available.
We want to have the possibility to tag and annotate annotations. But we
want to have the possiblility to list for a doc all the annotations
linked to.
ok. Putting annotations in documents that are distinct from the main one
won't prevent you to link all annotations of each document: we can for
instance use the "parent" attribute for that, or an attribute of the
annotation class.
2) what about rights? That may be handy to have
various access rights
for annotations? Imagine a teacher and her students annotating a
document. The teacher may wish to keep her annotation private while the
students collaboratively annotate the same piece of document...
OK
3) choosing a name would help packaging the
plugin into a unique Space
(not sure about the guidelines we chose there eventually, but having all
the wiki pages for a given feature in a single space increases
lisibility, I think)
I'm not sure to understand.
I have named my plugin: annotation.
And i want to be able to annotate any docs in any space.
My point was just about packaging the documents that comprise the
Annotation application itself. In case you use XWiki templates and
sheets for manipulating annotations (instead of Velocity pages in the
skin folder like you're doing currently, which is another possibility
indeed), you will need to store those documents in a space. I was
speaking about such a space.
4) how will we
manage annotations on evolving documents? If the
structure remains the same, that may be ok, but what will happen when a
user moves an entire paragraph to a different position? Do you know if
there has been some work on this?
Arf. I don't know.
In this case, to localise annotation using tag should be better than
using references.
I propose we use the following page for refining
the design of the
feature:
http://www.xwiki.org/xwiki/bin/view/Design/AnnotationFeature
Great idea but i can't edit the page.
The platform is being upgraded currently. You should get edit rights
again later on as soon as the upgrade process is entirely done.
That may be
easier to give input to the plugin development once we'll
have a common view on what we aim at.
Of course.
Note that annotation capabilities also share some
aspects with the PSEW
prototype, that allows for external annotations of wiki pages (external
in the sense that annotations are then stored in a completely distinct
database):
http://nepomuk-eclipse.semanticdesktop.org/xwiki/bin/view/Main/PSEW
Cheers
Stéphane
Thank you.
And thank for your help.
you're welcome
Stéphane
PS: my plugin and templates are attached.
addannotation.vm doesn't work
cause of the form action.
------------------------------------------------------------------------
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Stéphane Laurière
slauriere(a)xwiki.com
XWiki
http://www.xwiki.com
http://concerto.xwiki.com
http://nepomuk.semanticdesktop.org