Hi Marc,

On Wed, May 27, 2009 at 12:21 AM, Lijour, Marc (EDU) <marc.lij...@ontario.ca
> wrote:

>
>  Hi,
>
> Would this work with objects?


Definitely. See below.

Say we have an addressbook (e.g. in XML format). If I create a class
> ContactPerson in XWiki, can I populate XWiki with instances of contact
> objects (1 per page)?


A XWiki page with objects has an XML representation (see
http://www.xwiki.org/xwiki/bin/view/Blog/XWikiEnterprise19RC1Released?xpage=xmlfor
a live example). As you can see, you've got an "object" tag with
subtags
in it (I removed some parts of the XML file in the example below for
clarity) :

<object>
<class>
<name>XWiki.ArticleClass</name>
−
<name>Blog.XWikiEnterprise19RC1Released</name>
<number>0</number>
<className>XWiki.ArticleClass</className>
<guid>89206df0-9f99-4eab-97dc-3628c27e9105</guid>
−
<content>
The XWiki development team is pleased to announce the release of XWiki
Enterprise 1.9 Release Candidate 1. First release candidate of the XWiki
Enterprise 1.9 version.
...
</content>

where <class> tells you to which class the object belongs (a blog post in
this case) and <content> defines one of the object's properties' content (in
this case the text of the blog article).

The easierst way to achieve your aim would be to create an
AddressBookContact class from the wiki interface, then create an instance of
this class (an object with dummy values) and view it as XML (append
?xpage=xml at the end of your page) -> you'll have the default fields of
your class. Then you can define how you want to map xml files from your
original address book to the XWiki one (if you defined your class according
to the original XML file it will be easy) and use XSLT to go from one file
to the next.

Please note that it's better to create one new document for each object (one
object per document) for scalability purposes, thus you would also have to
map document metadata (such as document title, author etc...). Once you've
generated all your pages, you can write a package.xml file to list them, zip
everything together, rename it as .xar and upload it to your wiki (a XAR
file is only a renamed ZIP file). Obviously you could also use the XML / RPC
API to do all this...

A nice additional thing you might want to do is to use XWiki's new livetable
to display contacts from the address book afterwards ;-)

If you come up with such an application we'll be happy to see it on
code.xwiki.org

Hope this helps,
Guillaume


> Thanks,
>
> Marc
>
> > -----Original Message-----
> > From: users-boun...@xwiki.org
> > [mailto:users-boun...@xwiki.org] On Behalf Of Guillaume Lerouge
> > Sent: February 14, 2009 12:56 PM
> > To: XWiki Users
> > Subject: Re: [xwiki-users] Migrating articles into xwiki
> >
> > Hi,
> >
> > XWiki Pages are stored as XML files. You can look at the XML
> > representation of a standard XWiki pages (export as XAR,
> > rename to ZIP, unzip, look inside the folder). Then try to
> > find which XWL fields from your original XML format could be
> > converted into XWiki document fields (especially web, name,
> > title, creation date and content).
> >
> > Once you've decided which mapping to use, write and launch
> > your XSLT script.
> > Then you'll have a bunch of XWiki pages as XML. Look at the
> > output of a XWiki XAR export to see what the description file
> > looks like and write one with the name of your pages inside.
> >
> > Put everything into a folder, zip it, rename it to .xar, try
> > importing it.
> > If the import fails, try splitting it into a number of smaller XARs.
> >
> > Hope this helps,
> >
> > Guillaume
> >
> > On Sat, Feb 14, 2009 at 12:10 PM, Gerritjan Koekkoek <
> > gerritjankoekk...@gmail.com> wrote:
> >
> > > Hi.
> > >
> > > We have a repository of articles (our Old CMS) we would
> > like to import
> > > into xwiki automatically.
> > > These Articles are in a propietary XML format, one XML file
> > per article.
> > >
> > > What would be the best approach?
> > > We have ability to restructure/transform xml into another
> > xml by means
> > > of xslt.
> > >
> > > Which approaches could we research?
> > >
> > > Gerritjan
> > > _______________________________________________
> > > users mailing list
> > > users@xwiki.org
> > > http://lists.xwiki.org/mailman/listinfo/users
> > >
> >
> >
> >
> > --
> > Guillaume Lerouge
> > Product Manager - XWiki
> > Skype ID : wikibc
> > http://guillaumelerouge.com/
> > _______________________________________________
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> >
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>



-- 
Guillaume Lerouge
Product Manager - XWiki
Skype ID : wikibc
http://guillaumelerouge.com/
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to