[EMAIL PROTECTED] wrote:
> Hi,
> What you're looking for is the createNewObject method in Document Api.
> Here's a link to javadoc:
> http://platform.xwiki.org/xwiki/bin/download/DevGuide/API/xwiki%2Dcore%2D1.3.2%2Djavadoc.zip/com/xpn/xwiki/api/Document.html#createNewObject(java.lang.String)
>
> So you can do:
> #set( $objnr = $doc.createNewObject("MySpace.MyClass"))
> or
> #set( $objnr =
> $xwiki.getDocument("MySpace.MyDocument").createNewObject("MySpace.MyClass"))
> This will return you the number of the object.
>
> Then you can do #set( $myobj = $doc.getObject("MySpace.MyClass",$objnr) )
> and this will get you the actual object
Or even directly:
#set($myobj = $doc.newObject("MySpace.MyClass"))
> Hope it helps ;)
>
> Kamna Jain wrote:
>
>> Hello,
>> Can anybody tell me how to add an object of an already created class to a
>> new page using Velocity...not the interface provided by Xwiki.
>> Which method do I need to call to achieve this!!!
>>
>> Thanks
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs