

UpdateDataSet Sample

====================



This sample specifies a default AppServer URL "AppServer://localhost/asbroker1",

and a default set of Order records (and their OrderLine records) to retrieve.  

It then calls the 4GL procedure StaticDS() and receives an ProDataGraph that 

contains two tables (Order and OrderLine) as well as the data relation between 

them.  The schema and original row data is then displayed on the console.



Next, a few of the row's data are changed. Then the sample code calls the 

ProChangeSummary method getChanges() which returns a ProDataGraph that only 

contains the rows that have been changed. This is sent across to the AppServer 

with the 4GL procedure UpdateDS(). UpdateDS() is defined with an INPUT-OUTPUT 

DataSet parameter so that the ProDataGraph can be sent over to the AppServer, 

and the AppServer can then return it back with any further changes or errors.



The client code then inspects the returned ProDataGraph for any errors and 

finally merges any changes back into the original ProDataGraph. The final 

datagraph with all its changes is then displayed on the console.



The application uses the Progress Java Open Client to obtain Orders and 

OrderLines records from an Progress AppServer that is connected to a sports2000 

database.





Steps to run the sample:  

======================== 



1) Run ProxyGen (Start->Programs->OpenEdge->Proxy Generator)

   a) Open the file UpdateDataSet.xpxg found in:

		<yourInstallDir>\samples\open4gl\java\AppService\UpdateDataSet



   b) Select File->Generate and press OK. 

      This will generate the Java class files in 

		<yourInstallDir>\samples\open4gl\java\UpdateDataSet\UpdateProxy



   	If your install directory is different than c:\Progress\OpenEdge, you 

        need to do the following changes before generating:



	- Select Tools->Change Propath

	  Change the propath component

		c:\Progress\OpenEdge\src\samples\java\AppService

	  to:

		<yourInstallDir>\samples\open4gl\java\AppService



   	- Change the Output dir on the General tab of the Generate dialog to

		<yourInstallDir>\samples\open4gl\java\UpdateDataSet



   c) Check the .log file to verify the generate was successful, a WARNING

      message may indicate a problem.



2) Setup a Progress AppServer that is connected to a sports2000 database.



3) Copy the two .p files from the above AppService\UpdateDataSet directory

   into a "UpdateDataSet" directory under the AppServer's work directory 

   - typically C:\OpenEdge\WRK.  



4) On the client system, make sure that the CLASSPATH contains the Open Client 

    Runtime Package (ex. <yourInstallDir>/java/o4glrt.jar). The CLASSPATH should

    also contain the current directory ".".



    The CLASSPATH also needs to contain:

		<yourInstallDir>/java/ext/common.jar

		<yourInstallDir>/java/ext/commonj.sdo.jar

		<yourInstallDir>/java/ext/ecore.jar

		<yourInstallDir>/java/ext/ecore.sdo.jar

		<yourInstallDir>/java/ext/ecore.change.jar

		<yourInstallDir>/java/ext/ecore.xmi.jar

		<yourInstallDir>/java/ext/ecore.resources.jar

		

	

5) Go to <yourInstallDir>\samples\open4gl\java\UpdateDataSet directory.

   Compile the sample client code. The default AppServer supplied in the client 

   code is asbroker1. If this is not your AppServer, you may change it in 

   UpdateDSClient.java.

	

   > javac UpdateDSClient.java



6) You are now ready to run the client application.  



   > java UpdateDSClient





