cancel
Showing results for 
Search instead for 
Did you mean: 

Access Web Script Config file from Java B.E. Web Scripts

cris_cc
Champ in-the-making
Champ in-the-making
Hello everyone,
I'm writing a Java back-end web script and I'd like to leverage the Web Script Configuration (the one at Script level) in order to make my AbstractWebScript more flexible.
I looked at http://wiki.alfresco.com/wiki/Web_Scripts#Web_Script_Configuration
however there are no examples/explanation about how to access the configuration file from the Java back-end.

Does anyone can suggest some specific example or documentation about that.

Thanks in advance,
Cris
5 REPLIES 5

toze
Champ in-the-making
Champ in-the-making
what configuration file are you talknig?

cris_cc
Champ in-the-making
Champ in-the-making
Hi,
I'm talking about the Web Script XML configuration file which can be located in the same folder as the Web Script description document.
for example:
helloworld.get.config.xml
(as mentioned in the link of my previous post)

in that post is mentioned that to read the config file you have to use this command :
var s = new XML(config.script);
So the config.script is available for JavaScript Web Scripts…
I was trying to figure out how to achieve the same result from a Java Back-end Web Scripts.

Thanks,
Cris

toze
Champ in-the-making
Champ in-the-making
why you need that? i dont understand why you need that.
With Java Back-end Web Scripts you register the web-script in web-scripts-application-context.xml

then you got access to Java Back-end Web Scripts

cris_cc
Champ in-the-making
Champ in-the-making
Hi Toze,
there are two reasons 'cause I need that:

1. I can reuse the same configuration file across Web Script and Java Back-end Web Script
2. I can apply the configuration change just Refreshing the Web Script rather than a full server restart

However I've implemented what you mentioned so far.
I configured the bean into web-scripts-application-context.xml
it works but it doesn't cover any of the points mentioned above.

Thanks,
Cris

checco
Champ in-the-making
Champ in-the-making
Hi Cris,
were you able to access the web script configuration from java?

Thanks,
Francesco