cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
441
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Asher Schweigart on 22-02-2013 11:21:19 AM
I am in the process of writing a custom app that will read in variables from a config file. I'd like to do this to make changing small things about the application easy to do without redeploying the application.
I was planning on using the deploy/data/misc folder for this in each application that I use the element. I can't figure out how to reference that from java though. I thought maybe I could use current directoty or a system variable, but that will not work the way I want, as they are different in the CVP VXML server and in the studio debugger.
On my CS box, %CVP_HOME% is C:\Cisco\CallStudio\eclipse\plugins\com.audiumcorp.studio.debug.runtime_9.0.1-SNAPSHOT
On the CVP Server, %CVP_HOME% is C:\Cisco\CVP
From there, to get to the deployed applications, the path is different (AUDIUM_HOME\applications\<appname> for CS, VXMLServer\applications for the CVP server).
The current directory in java [System.getProperty("user.dir")] points to Tomcat, so that won't help either.
 
Does anyone know of a way to access the current application's Data folder within Java?
 

Subject: RE: New Message from Bill Westby in Customer Voice Portal (CVP) - CVP - All
Replied by: Asher Schweigart on 22-02-2013 11:44:35 AM
This actually was my backup plan, working on coding it that way right now.

Subject: Re: New Message from Asher Schweigart in Customer Voice Portal (CVP) - CVP
Replied by: Bill Westby on 22-02-2013 11:37:14 AM
I personally keep all my resource config files in a separate directory
off a drive on the CVP server, e.g. C:\Resources.  I'd be concerned keeping
config files in the deployment path just in case they get overwritten on a
deploy thus wiping out any changes you've made to them.

I have a utility element I use to read the key=value pairs in my properties
files, pretty simple and reliable, just pass the file name and key and it
returns the value and keeps it safe in an isolated folder.  Sorry it
doesn't answer your question but just recommending a different approach.

BW.


On Fri, Feb 22, 2013 at 9:21 AM, Cisco Developer Community Forums <
cdicuser@developer.cisco.com> wrote:

> Asher Schweigart has created a new message in the forum "CVP - All
> Versions": -------------------------------------------------------------- I
> am in the process of writing a custom app that will read in variables from
> a config file. I'd like to do this to make changing small things about the
> application easy to do without redeploying the application.
> I was planning on using the deploy/data/misc folder for this in each
> application that I use the element. I can't figure out how to reference
> that from java though. I thought maybe I could use current directoty or a
> system variable, but that will not work the way I want, as they are
> different in the CVP VXML server and in the studio debugger.
> On my CS box, %CVP_HOME% is
> C:\Cisco\CallStudio\eclipse\plugins\com.audiumcorp.studio.debug.runtime_9.0.1-SNAPSHOT
> On the CVP Server, %CVP_HOME% is C:\Cisco\CVP
> From there, to get to the deployed applications, the path is different
> (AUDIUM_HOME\applications\<appname> for CS, VXMLServer\applications for the
> CVP server).
> The current directory in java [System.getProperty("user.dir")] points to
> Tomcat, so that won't help either.
>
> Does anyone know of a way to access the current application's Data folder
> within Java?
>
> --
> To respond to this post, please click the following link:
> http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/1226614 suspicious r simply reply to this email.

Subject: RE: New Message from Asher Schweigart in Customer Voice Portal (CVP) - CVP
Replied by: Hemal Mehta on 22-02-2013 12:01:14 PM
I use this feature all the time. However I avoid using Cisco CVP related dir. What if the deployment erases what you have.  I would like to keep it independent and not interfere with Cisco installed dirs.  Also if you were to ever need that dir, you can always give full path or define system variables.
Hemal

From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Friday, February 22, 2013 11:21 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Asher Schweigart in Customer Voice Portal (CVP) - CVP - All Versions: Application Data folder

Asher Schweigart has created a new message in the forum "CVP - All Versions": -------------------------------------------------------------- I am in the process of writing a custom app that will read in variables from a config file. I'd like to do this to make changing small things about the application easy to do without redeploying the application.
I was planning on using the deploy/data/misc folder for this in each application that I use the element. I can't figure out how to reference that from java though. I thought maybe I could use current directoty or a system variable, but that will not work the way I want, as they are different in the CVP VXML server and in the studio debugger.
On my CS box, %CVP_HOME% is C:\Cisco\CallStudio\eclipse\plugins\com.audiumcorp.studio.debug.runtime_9.0.1-SNAPSHOT
On the CVP Server, %CVP_HOME% is C:\Cisco\CVP
From there, to get to the deployed applications, the path is different (AUDIUM_HOME\applications\<appname> for CS, VXMLServer\applications for the CVP server).
The current directory in java [System.getProperty("user.dir")] points to Tomcat, so that won't help either.

Does anyone know of a way to access the current application's Data folder within Java?

--
To respond to this post, please click the following link: http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/12266148 or simply reply to this email.

Subject: Re: New Message from Asher Schweigart in Customer Voice Portal (CVP) - CVP
Replied by: Janine Graves on 22-02-2013 12:26:14 PM
Sounds like the consensus is to put it in the C drive somewhere. If you
want to have different config files for different apps, you can add the
appname to the file name and then in your Java use the
getApplicationName method.


********FYI, there is a method called getApplicationDirectory that would
return the path to wherever the app is running from (e.g.,
C:/Cisco/CVP/VxmlServer/applications/appname  or
C:\Cisco\CallStudio\eclipse\plugins\com.audiumcorp.studio.debug.runtime_9.0.1-SNAPSHOT/AUDIUM_HOME)

Subject: Re: New Message from Janine Graves in Customer Voice Portal (CVP) - CVP - A
Replied by: Janine Graves on 22-02-2013 12:34:14 PM
Sorry - that last reply got chopped off at the end.

********FYI, there is a method called getApplicationDirectory that would
return the path to wherever the app is running from.


e.g., C:/Cisco/CVP/VxmlServer/applications/appname if running on VxmlServer
or

C:\Cisco\CallStudio\eclipse\plugins\com.audiumcorp.studio.debug.runtime_9.0.1-SNAPSHOT/AUDIUM_HOME/applications/appname
if running through the Debugger.)




On 2/22/2013 1:26 PM, Cisco Developer Community Forums wrote:
> Janine Graves has created a new message in the forum "CVP - All
> Versions":
> -------------------------------------------------------------- Sounds
> like the consensus is to put it in the C drive somewhere. If you
> want to have different config files for different apps, you can add the
> appname to the file name and then in your Java use the
> getApplicationName method.
>
>
> ********FYI, there is a method called getApplicationDirectory that would
> return the path to wherever the app is running from (e.g.,
> C:/Cisco/CVP/VxmlServer/applications/appname or
> C:\Cisco\CallStudio\eclipse\plugins\com.audiumcorp.studio.debug.runtime_9.0.1-SNAPSHOT/AUDIUM_HOME)
> --
> To respond to this post, please click the following link:
> http://developer.cisco.com/web/cvp/forums/-/message_boards/view_message/12269316
> or simply reply to this email.

--
Janine Graves

Subject: RE: Application Data folder
Replied by: Asher Schweigart on 22-02-2013 02:19:13 PM
Thanks Janine, that's what I was looking for. Not sure if I'll go with the data folder or not, but it's nice to know I have the option now.

I know I could have used system variables, but I wanted to make sure the element would work without any additional system config. I try to code my custom elements in such a way that if someone else comes after me and tries to use the element, they can use it just like the standard elements; without any knowledge of what the code is doing at all, or any knowledge of Java. It's a convience factor, not entirely necessary, but in our environment I think it is the right thing to do. It also allows me to share elements with others on boards like this if I want, without them having to make system changes.
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links