You plugin can create the class at initialization time.. Check the CalendarPlugin in the XWiki source https://svn.xwiki.org/svnroot/xwiki/xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/plugin/calendar/CalendarPlugin.java
Ludovic antoine SEILLES wrote: > Ok > that's what i thought: i can't do without the XWiki class editor. > So if i want to add my plugin to another XWiki installation, i'll have > to create an AnnotationClass through the class editor. > > Thank you. > > Ludovic Dubost a écrit : > >> AnnotationClass should be a wiki page describing your class.. >> Check the tutorial for FAQClass as an example >> http://www.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorial >> >> Once you have a working XWiki Class storing data in your wiki, you can >> work on your plugin to create such objects programmatically. >> >> Ludovic >> >> antoine SEILLES wrote: >> >> >>> Hi, >>> Thank for your help. >>> >>> So i have changed my class Annotation into AnnotationClass (and i >>> changed debut into begin and fin into end). >>> But what does AnnotationClasses represents? Should it be the name of my >>> package? >>> >>> In AnnotationPlugin i have a method getName: >>> public String getName() { >>> return "annotation"; >>> } >>> What should it return instead of "annotation"? >>> >>> >>> >>> Ludovic Dubost a écrit : >>> >>> >>> >>>> Hi, >>>> >>>> Indeed you are lacking an AnnotationClass here >>>> You should use >>>> >>>> AnnotationClasses.AnnotationClass >>>> -> begin >>>> -> end >>>> -> selection >>>> -> author >>>> -> date >>>> >>>> Then you should make sure you persist your annotation using this object.. >>>> Once you have that you would get them by doing >>>> >>>> $doc.getObject("AnnotationClasses.AnnotationClass") >>>> or better >>>> $doc.use("AnnotationClasses.AnnotationClass") >>>> $doc.getValue("begin") >>>> >>>> >>>> Ludovic >>>> >>>> antoine SEILLES wrote: >>>> >>>> >>>> >>>> >>>>> Now my objects are persistents. But i don't know how to access their >>>>> properties. >>>>> Should i create an annotation class through the XWiki class editor? >>>>> It seems that in my database, none of the properties of my annotations >>>>> are stored. >>>>> >>>>> I define an annotation for a document: >>>>> $xwiki.annotation.addNewAnnotation($doc,"blablablaAnnotation",0,10,"blablaSelection","auteur") >>>>> >>>>> >>>>> I retrieve all annotations of a document: >>>>> #set($annots=$doc.getObjects("annotation")) >>>>> And i try to get the selection field of my annotations: >>>>> #foreach($annot in $annots) >>>>> "$annot.get("selection")" >>>>> #end >>>>> >>>>> But all i have is "". >>>>> >>>>> What should i do? >>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> _______________________________________________ >>>>> devs mailing list >>>>> [email protected] >>>>> http://lists.xwiki.org/mailman/listinfo/devs >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >> >> > > > -- Ludovic Dubost Blog: http://blog.ludovic.org/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

