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