[xwiki-dev] MASS Insertion

Roopesh P Raj roopesh at digitalglue.in
Thu May 3 06:40:54 CEST 2007


Pablo Oliveira wrote:
> Hi PHL. ,
>
> On May 02, phl wrote :
>   
>> I would like to add a lot of pages (500) into a xwiki to transfert
>> information from excel file to xwiki. 
>>
>> So I suggest to write code that : 
>> - upload an XML file, 
>> - read the XML file and create the pages. 
>>
>> How  can do it  ? (And how can I give it to xwiki ?) 
>> What is the XML file : <page> is a <title> and <body> ? other information ? 
>> How can I download a file to the server ? Is it some size limitation ? 
>> How can I put the XML page into the xwiki database ? Can I write "directly
>> into the database" or must I create a "virtual client on the server" that
>> will read the XML page and simulate a browser ? 
>>     
>
> XWiki already has a mechanism to import/export content as XML, this
> functionality is accessible, as a user, from the administrator panel, 
> or as a developper through the fromXML() and toXML() methods of
> com.xpb.xwiki.doc.XWikiDocument.
>
> To understand the XML structure I would recommend that you download 
> the default XWiki XAR file from xwiki.org, unzip it, and examine the
> xml files inside. Then you can write a converter from Excel to XWiki 
> XML's documents.
>
> Other alternatives to do a massive import are SQL queries
> run directly on the database (see xwiki.org, developpers section,
> for a document detailing the database schema), or using the XML RPC api.
>
> Kind regards,
>
> Pablo
>   
Hi Pablo,

I went through the contents of the xar file. The files like class, 
classsheet, class template and documents seems to be very big and comes 
to be nearly 1000 lines. I would like to keep the files (at least the 
files corresponding to the documents) as minimal as possible. Can anyone 
tell me what all things can be avoided from these files ? Where can I 
get info about these things ?

Regards
Roopesh

------------------
DigitalGlue, India







More information about the devs mailing list