Substitution variable file path

waclaw
centeractive people
Posts: 44
Joined: 11 Sep 2012, 20:27

Substitution variable file path

Postby waclaw » 24 Dec 2012, 10:16

Hi

I've just created a derived substitution variable like this:

Code: Select all

file:source/catalog.xml|xpath://book[price<10]/author


The file is located under PROJECT_ROOT/source directory, but Opensphere is not able to locate it. It looks like Opensphere is evaluating relative paths using its main directory as a root, because it works when I put the file in OPENSPHERE_MAIN_DIR/source directory. When I'm using absolute paths, the project breaks when it is moved from one place to another.

Shouldn't the path like in the above example relate to the project's main directory rather?

thanks
waclaw
waclaw
centeractive people
Posts: 44
Joined: 11 Sep 2012, 20:27

Re: Substitution variable file path

Postby waclaw » 24 Dec 2012, 10:20

There's a similar situation in case of JavaScript variable. When I define one like this:

Code: Select all

//@@ keep this line unchanged when no main() function is defined @@//
data = java.lang.StringBuilder();
fileReader = new java.io.FileReader("readme.txt");
bufReader = new java.io.BufferedReader(fileReader);
while ((line = bufReader.readLine()) != null) {
    data.append(line + "\n");
}
bufReader.close();

return data.toString();


OPENSPHERE_MAIN_DIR/readme.txt file is loaded.

waclaw

Return to “General Opensphere Topics”

Who is online

Users browsing this forum: No registered users and 1 guest