|
Replies:
7
-
Pages:
1
-
Last Post:
Nov 4, 2009 11:58 PM
Last Post By: DP_SOA_Member
|
|
|
Posts:
8
Registered:
Jul 30, 2008 06:41:57 PM
|
|
|
|
Dynamically changing the process control file (Remote) location
Posted:
Oct 14, 2009 07:06:46 PM
|
|
|
|
I have the following requirement - As part of the practice followed at the customer, all the xsl file will be moved to a Http server, so these files will be referred from within the actions, like http://myserver:port/mystyle.xls. Here the problem is that, when the application gets promoted to other environments, the location of the server and port will change or I can say everything except the xls file name can change. To accommodate this change, I have to open every policy and every action and update the process control file location with the new url. This is hectic and a very bad practice, and I'm sure that there should be an easy way there. Please let me know what your thoughts are - like reading from a config file and translate the url to the right one, or using some context variable or any other easy and efficient solution. This may be a very simple requirement - but I started learning the DP only a week back... help!!!!
|
|
Posts:
8
Registered:
May 21, 2007 10:27:48 AM
|
|
|
|
Re: Dynamically changing the process control file (Remote) location
Posted:
Oct 14, 2009 07:11:20 PM
in response to: DP_SOA_Member's post
|
|
|
|
Best way to do this is with a Load Balancer.
(1) Create your Load balancer (ex: xsl-server) and assign it an IP and Port
(2) Replace all references to the http://ip:port/url with http://xsl-server/url
(3) Optionally, create a deployment policy which black lists load balancers
It's also convenient because in your production environment, you can specify multiple hosts and use its primary purpose -- load balancing.
~ Matt
|
|
Posts:
105
Registered:
Feb 03, 2006 09:47:29 AM
|
|
|
|
Re: Dynamically changing the process control file (Remote) location
Posted:
Oct 14, 2009 10:35:37 PM
in response to: DP_SOA_Member's post
|
|
|
|
For this kind of thing I put a XML file on the device, and the first action in my rules is a custom XSL that sets up context vars, that will be used by downstream actions.
|
|
Posts:
129
Registered:
Oct 18, 2005 11:26:12 AM
|
|
|
|
Re: Dynamically changing the process control file (Remote) location
Posted:
Oct 15, 2009 09:09:24 AM
in response to: kenhygh's post
|
|
|
|
You could configure a host alias in the default domain that maps to the environment specific IP of the web server with the xsls, and the application always specifies the host alias in the urls. This is a common best practice.
Regards,
Steve
|
|
Posts:
8
Registered:
Jul 30, 2008 06:41:57 PM
|
|
|
|
Re: Dynamically changing the process control file (Remote) location
Posted:
Oct 15, 2009 01:39:46 PM
in response to: kenhygh's post
|
|
|
|
If I follow as you suggested, how to do an implementation like this. Assume that for an action if I'm giving the process controll file as http://host:port/myxsl.xsl, and the I'll provide a configuration entry in the xml file some thing like <config>http://myserver:port/version/v1/</config>. And I want to have the final result like http://myserver:port/version/v1/myxsl.xsl. I hope you understand my point. I don't want to provide the comple url of each of the xsl file in the xml file, but I can provide the commmon part which is being used in the configuration file. As shown, I can give upto http://myserver:port/version/v1/ in the configuration file, which should be appended with the xsl file name, in tult in his case myxsl.xsl - which will result in http://myserver:port/version/v1/myxsl.xsl.
|
|
Posts:
68
Registered:
Nov 15, 2007 12:15:58 PM
|
|
|
|
Re: Dynamically changing the process control file (Remote) location
Posted:
Oct 16, 2009 11:08:25 AM
in response to: swlinn's post
|
|
|
Steve --
You are correct that this is a common practice, but I prefer using load balancers for two reasons:
- It allows you to abstract the port as well as the IP address from the configuration
- Host aliases are global to the device, not the domain. So if you wish to run multiple copies (environments) on a single device via domains, host aliases don't work.
~ Matt
|
|
Posts:
68
Registered:
Nov 15, 2007 12:15:58 PM
|
|
|
|
Re: Dynamically changing the process control file (Remote) location
Posted:
Oct 16, 2009 11:25:01 AM
in response to: DP_SOA_Member's post
|
|
|
|
Sounds like you have a situation where not only can the IP address, Port change from environment to environment, but you are also using a versioning system built around directory paths.
One way to do it is to create a config file which resides on the device, and on each environment.
Perhaps something like:
<xsl_lookup>
<globals>
<prefixes>
<prefix id="v1">http://load-balancer/version/v1</prefix>
<prefix id="v2">http://load-balancer/version/v2</prefix>
</prefixes>
</globals>
<entries>
<entry id="aa.b" version="v1">filename.xsl</entry>
<entry id="cc.d" version="v2">another-file.xsl</entry>
<entries>
</xsl_lookup>
Then in your processing policy, you do two things:
(1) Set a context variable, perhaps var://context/xsl-lookup/id to "aa.b" or "cc.d" as the case may be
(2) Write an XSL file which takes that variable and config xml into account and derives the correct endpoint URL from it
(3) Transform the input context using the identified XML
Points (2) and (3) could be combined into a single re-usable rule.
If you wanted, you could even generalize this function into its own lookup service. Set an HTTP header to a particular identifier value and POST it this service, perhaps a loopback xmlf, and return the transformed result. Depends on how complex your requirements are -- but you have a lot of different options.
|
|
Posts:
8
Registered:
Jul 30, 2008 06:41:57 PM
|
|
|
|
Re: Dynamically changing the process control file (Remote) location
Posted:
Nov 04, 2009 11:58:42 PM
in response to: DP_SOA_Member's post
|
|
|
|
Thanks for the responses. Finally I could resolve the issue like this. I created a MPGW, with port say 6070. In all the places where ever the process control file refered, I gave http://127.0.0.1:6070/file.xsl. And in the MPGW, http://127.0.0.1:6070/ is replaced with the actual server and port.
|
|
|
|