Allright I need help

10 views
Skip to first unread message

mst...@gmail.com

unread,
Feb 4, 2009, 2:33:38 PM2/4/09
to xbird-users
Ok I ran the sample code for the XML/object binding and object
persistence. I got it to work kind of....
I just added
Settings.put("xbird.database.datadir", "C:\\");
So the directory that it saves in is not in temp.

I put the search code at the bottom of the code that puts the authors
in.
It worked.
Now i tried to use that code in a separate class to load all the xml
back into objects.
It seems that the code relies on print stream for the info
I tried changing the query string to many different things
String query1 = "fn:collection('/" + COLLECTION_NAME + "/.*.xml')//
author";
to something like
String query1 = "fn:collection('c:\\" + COLLECTION_NAME + "/.*.xml')//
author";
no dice so how do I actually load the info from a file.

Thank you

Makoto YUI

unread,
Feb 6, 2009, 9:22:22 AM2/6/09
to xbird...@googlegroups.com
On 2/5/2009 4:33 AM, mst...@gmail.com wrote:
> Ok I ran the sample code for the XML/object binding and object
> persistence. I got it to work kind of....
> I just added
> Settings.put("xbird.database.datadir", "C:\\");
> So the directory that it saves in is not in temp.

Yeah.. You have to call that before xbird persistent APIs are used.
Or you can change the behavior by changing "xbird.database.datadir"
setting in xbird.properties file in your System.getProperty("user.dir").

> I put the search code at the bottom of the code that puts the authors
> in.
> It worked.
> Now i tried to use that code in a separate class to load all the xml
> back into objects.
> It seems that the code relies on print stream for the info
> I tried changing the query string to many different things
> String query1 = "fn:collection('/" + COLLECTION_NAME + "/.*.xml')//
> author";
> to something like
> String query1 = "fn:collection('c:\\" + COLLECTION_NAME + "/.*.xml')//
> author";
> no dice so how do I actually load the info from a file.

fn:collection("/xstreamTest/.*.xml")//author is correct.

When calling this query, you have to specify the right
"xbird.database.datadir" settings in xbird.properties.
System.getProperty("user.dir") is generally a directory
where your command is executed.

You can control serialization formats using Annotations.
xbird uses XStream for this purpose.

So, please see the following article for detail,
http://xstream.codehaus.org/annotations-tutorial.html

Thanks,
Makoto

Makoto YUI

unread,
Feb 6, 2009, 9:47:36 AM2/6/09
to xbird-users
> > to something like
> > String query1 = "fn:collection('c:\\" + COLLECTION_NAME + "/.*.xml')//
> > author";
> > no dice so how do I actually load the info from a file.
>
> fn:collection("/xstreamTest/.*.xml")//author is correct.

typo..
fn:collection("/COLLECTION_NAME/.*.xml")//author is correct.

Makoto
Reply all
Reply to author
Forward
0 new messages