environment variable in 5.6.0

Post any questions regarding Installing or Upgrading Ebase, including problems starting up the Ebase Xi Server or Designer

Moderators: Jon, Steve, Ian, Dave

fronsky
Ebase User
Posts: 86
Joined: Thu Mar 08, 2018 2:52 pm

environment variable in 5.6.0

#1

Postby fronsky » Wed Dec 18, 2019 7:34 pm

In 5.5.0 I use a environment variable to place and access documents in a document directory (beadocs) on a test server:
"<env-entry-value>/home/fronsky/verjioServer/UfsServer/tomcat/webapps/ebase/beadocs</env-entry-value>"

In 5.6.0 the file system changed and I have placed the directory under <userdata>/apps/ebase/webapp

In the instruction its advised to use "services.file.getUserDataApplicationPath()" to access application files in the userdata file system.

Can somebody advise how I can deal with this. Can I (and how) use an environment variable? I changed this with multiple options but it gives a 404 error so the url seems not correct.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

Re: environment variable in 5.6.0

#2

Postby Jon » Thu Dec 19, 2019 8:42 am

If you create a folder beadocs in the webapp directory, then the URL to address this is just beadocs/doc1.pdf etc. Anything in the webapp directory is accessible via URL in this way. This is a relative URL - where the base is the webapp folder.

services.file.getUserDataApplicationPath() will return you the full file path to the app folder (parent folder of webapp). You would use this if you wanted to save files into your documents folder or access the documents programmatically in any other way. Then you don't really need the environment variable. You could access this folder using:

Code: Select all

var docs = services.file.getUserDataApplicationPath() + java.io.File.separator + "webapp" + java.io.File.separator + "beadocs";
Of course, you might still want "beadocs" to be an environment variable.
1 x


Who is online

Users browsing this forum: No registered users and 9 guests