Skip to main content

ObjectRealizer: How to load markup from file system?

1 reply [Last post]
Anonymous

Looks like a dumb question :-)

But when doing so repeatedly with relative path information all files
after the first are not found. A code snippet:

Object first = realizer.getObject("demo/betterTable.jdnc");
Object second = realizer.getObject("demo/simpleTable.jdnc");

will load the first and throws an Exception:

net.openmarkup.UnknownElementTypeException: Cannot open url:
file:/D:/JavaWorkspace/harvest/projects/jdnc/demo/demo/editorDemo.jdnc

looks like it has some kind of "memory" (note the duplicate "/demo"). If
I load the second by

Object second = realizer.getObject("simpleTable.jdnc")

all is okay.

I'm unsure if this behaviour is intentional (might well be - because
there's the defaultBaseURL property in ObjectRealizer) but it's a bit
unexpected. So, what's the recommended way to load the markup files?

Greetings
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rameshgupta
Offline
Joined: 2004-06-04

> Looks like a dumb question :-)
>
> But when doing so repeatedly with relative path
> information all files
> after the first are not found. A code snippet:
>
> Object first =
> realizer.getObject("demo/betterTable.jdnc");
> Object second =
> realizer.getObject("demo/simpleTable.jdnc");
>
> will load the first and throws an Exception:
>
> net.openmarkup.UnknownElementTypeException: Cannot
> open url:
> file:/D:/JavaWorkspace/harvest/projects/jdnc/demo/demo
> /editorDemo.jdnc
>
> looks like it has some kind of "memory" (note the
> duplicate "/demo"). If
> I load the second by
>
> Object second =
> realizer.getObject("simpleTable.jdnc")
>
> all is okay.
>
>
> I'm unsure if this behaviour is intentional (might
> well be - because
> there's the defaultBaseURL property in
> ObjectRealizer) but it's a bit
> unexpected. So, what's the recommended way to load
> the markup files?
>
> Greetings
> Jeanette

Hi Jeanette,

This is most definitely a bug! The code should work as you'd expect. If you don't mind, could you please enter it in our bug database? Thanks.

Ramesh