Kbase P156822: 4GL/ABL: How to use relative paths with the Proxy Generator tool?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  02/12/2009 |
|
Status: Unverified
GOAL:
4GL/ABL: How to use relative paths with the Proxy Generator tool?
GOAL:
How to maintain a single generic project (.xpxg) file to generate proxies from multiple versions of the codebase?
GOAL:
How to edit the project (.xpxg) file generated by Proxygen to use a relative path?
GOAL:
How to add or update Procedures in the Proxy?
FIX:
When using the OpenEdge Proxy Generator graphical user interface, Proxygen will always save fully qualified paths in the project (.xpxg) file for each and every procedure that you add to the proxy. This can create problems for users that have multiple environments or versions for their code deployment, such as development, QA, and production, because in order to use the GUI Proxygen, you would have to have a completely separate .xpxg XML configuration file for each of these versions.
This document describes how to maintain a single generic project (.xpxg) file that can be used to generate the Open Client proxies and/or a Web service definitions from multiple versions of the codebase.
1. Create the initial configuration using the GUI ProxyGen development tool:
Use the GUI ProxyGen development tool to create your configuration as usual adding all the required procedures.
2. Edit the project (.xpxg) file:
First, look for the <WorkDir> element near the top of the file. Set this to a relative path from the base directory of the code version. For example, if the production code branch were in C:\OE102Awrk\testproxy\prod, and you had a directory called ?build? within that directory where you want the output of the proxy generation to go, then set it to ?./build?
Next, locate all <ProPath> elements in the file and replace them with a reference that is also relative to the main directory of your code branch. In this example, replace the directory reference: "C:\OE102Awrk\testproxy\prod" by the directory reference: ?.\?
Finally, save the project (.xpxg) file in the directory which contains ALL of the code versions. In this example, save it in the directory C:\OE102Awrk\testproxy.
3. Create a custom batch file for each version of code:
For each code version that will be compiled, create one batch file. For example, the following batch file is created for the production code branch:
cd C:\OE102Awrk\testproxy\prod
C:\OE102A\bin\bproxygen.bat -xpxgfile = ..\Helloworldapp.xpxg
Where C:\OE102Awrk\testproxy is the directory which contains ALL of the code versions or branches of the codebase. (dev, prod, and qa). ?prod? in this example is the code branch from which the proxy will be created.
4. Run the custom batch file:
To build the proxy, just locate and execute the desired custom batch file. You may want to open a command window or a Proenv command window session and run the custom batch file from the command prompt the first few times to catch any error messages that may be output.
Adding or Updating Procedures in the Proxy:
a. Make a backup copy of the project (.xpxg) file.
b. Open up the GUI ProxyGen and add the new procedure as you usual. Notice that it will display differently than the other procedures in the list, since the ProxyGen will try to store its full path.
c. Save the configuration in the GUI ProxyGen.
d. Manually edit the newly generated project (.xpxg) file before creating the new proxy.
e. Look in the XML for your new procedure, notice that it has a <ProcPath> element containing a path. Remove the contents of the <ProcPath> elem.ent using a text editor, and ensure that the new Procedure?s <ProPath> element is set correctly just like the other procedures.
Caution: When you need to update the settings for an existing procedure in your proxy, the GUI ProxyGen will not be able to find the procedure based on the relative path that you have saved, so it will DELETE the procedure from your proxy configuration. You need to remember to add it back with the correct settings, then manually edit it in the project (.xpxg) file, or simply make the edits to the .xpxg file instead of using the GUI..