Title: DEV-11: Leveraging ProDataSets in an Open Environment
1DEV-11 Leveraging ProDataSets in an Open
Environment
Robin Brown
Principal Software Engineer
2Progress DataSets
- Business Objects
- Logical grouping of related data
- In-memory cache of data
- Data source separate from DataSet
- Data abstraction
3ProDataSets in the OpenEdge Reference
Architecture
ABL Client Progress ProDataSet
.NET Open Client ADO.NET DataSet
AppServer ABL Progress ProDataSet
4ProDataSets in the OpenEdge Reference
Architecture
AppServer ABL Progress DataSet
ABL to Database Progress DataSet
(XML)
5ProDataSets in the OpenEdge Reference
Architecture
.NET Open Client ADO.NET DataSet
This Sessions Focus
Java Open Client Java SDO
ABL READ-XML ( ) WRITE-XML( ) Progress DataSet
6Agenda
- Overview of ProDataSet and OpenClient
- .NET OpenClient / DataSet
- Java OpenClient / SDO
- ProDataSets to/from XML
7Progress DataSets Defined
- One or more Temp-Table buffers
- Default or user-defined
- Relationships defined between tables
- Field-mapping
- Custnum ?? Cust_num
- Pass as parameters
- Local
- APPEND option
- BY-REFERENCE option
- Remote
ProDataSet
Temp-Table
Fields
Indexes
Temp-Table
Data-Relations
Fields
Indexes
Temp-Table
Fields
8Open Client and ProxyGen
App Object
Proc Object
ABL Business Logic (r-code)
Sub- AppObj
Web Services Mapping file (.wsm)
Java Proxy Code
.NET Proxy Code
910.1A - OpenAPI
NEW!
- Run arbitrary procedure on AppServer without
proxy - New Classes
- Progress.Open4GL.Proxy. (.Net)
- com.progress.open4gl.javaproxy. (Java)
OpenAppObject
OpenProcObject
ParamArray
10Open Client Architecture
.NET / Java Client
OpenEdge AppServer
Client App
Proxy
Internet /Intranet
Open Client Runtime
App Object
AppServer
Proc Object
Proc Object
HTTP/S
Sub- AppObj
Name Server
Database Server
.Net Framework / JRE
Communication Protocol
11Agenda
- Overview of ProDataSet and OpenClient
- .NET OpenClient / DataSet
- Java OpenClient / SDO
- ProDataSets to/from XML
12ADO.NET DataSets Defined
ADO.NET DataSet
- One or more DataTables
- DataColumns define fields
- DataConstraints define integrity rules
- Relationships defined between tables
- Map fields between tables
- Share many features of ProDataSet
DataTable
DataColumns
DataConstraint
DataTable
DataRelations
DataColumns
DataConstraint
DataTable
DataColumns
13Mapping ProDataSets to .Net DataSets
ABL Component .Net Object
ProDataSet DataSet
Temp-Table DataTable
Buffer (record) DataRow
Before-Table GetChanges() on DataSet
Field DataColumn
Data-Relation DataRelation
Unique/Primary Index DataConstraint
1410.1A Completes the ABL-.Net Mapping
NEW!
- INITIAL Value
- XML attributes
- UNDO
- DATA-SOURCE-MODIFIED
- REJECTED
15Using ProDataSets in a .NET Open Client
environment
DataSets on both ends of the wire
16Passing DataSets in .Net
Static versus Dynamic
Progress AppServer
.NET Client
Static
.Net Typed DataSet
Static DataSet
Data Only
Dynamic
Schema Data
ADO .Net DataSet
Dynamic DataSet
17Procedure using Static ProDataSet
ABL code
/ StaticDs.p / dsOrderDef.i DEF INPUT
PARAMETER piGE AS INT. DEF INPUT PARAMETER piLE
AS INT. DEF OUTPUT PARAMETER DATASET FOR
dsOrder. DATA-SOURCE srcOrdFILL-WHERE-STRING
WHERE Order.OrderNum GE STRING(piGE)
AND Order.OrderNum LE STRING(piLE). /
Fill the dsOrder DataSet / DATASET
dsOrderFILL().
1
2
3
18Method using Static .Net DataSet
.NET C code
using nsOrderDS.StrongTypesNS dsOrderDataSet
dsOrders try appObj.StaticDS
(iLowRange, iHighRange, out dsOrders) ...
1
2
19Agenda
- Overview of ProDataSet and OpenClient
- .NET OpenClient / DataSet
- Java OpenClient / SDO
- ProDataSets to/from XML
20Overview Java Service Data Objects (SDO)
Java Specification Request (JSR) 235
- Technical description of Java SDOs published by
BEA and IBM - Java SDO Technology (JSR 235)
- http//jcp.org/en/jsr/detail?id235
- Reference Implementation
- Eclipse Modeling Framework (EMF 2.0.1)
- http//www.eclipse.org/emf/sdo.php
21Java SDO Objects
- DataObject
- Disconnected view of structured data
- Holds data as a set of properties
- Relational data
- Reference to another DataObject
- DataGraph
- Graph (or tree) of DataObjects
- Single root DataObject
- Typical unit of transfer
- Contains a ChangeSummary object
22Java SDO Objects (contd)
- ChangeSummary
- Captures changes from all DataObjects in a
DataGraph - Applied back to data source using Data Mediator
Service - Data Mediator Service NOT needed
- Data sent to/from the OpenEdge AppServer
23Java SDO Implementation Issues
- Limitations of Java SDO design
- Relationship support
- No meta data to describe relationship
- No GregorianCalendar support
- Needed to map to DATETIME(-TZ) fields
- Inefficient access to DataGraph changes
- Need changes-only DataGraph for AppServer
ProDataGraph implementation overcomes limitations
24Primary Progress Classes (extensions)
Java classes com.progress.open4gl.
- ProDataGraph
- Extends Java SDO DataGraph
- ProDataGraphMetaData
- Specifies the ProDataGraph meta data
- ProDataObject
- Extends Java SDO DataObject
- ProDataObjectMetaData
- Specifies the ProDataObject meta data
- ProChangeSummary
- Extends Java SDO ChangeSummary
- ProDataRelationMetaData
- Resolves missing relational metadata support
25Mapping ProDataSets to Java SDOs
ABL Component Java Object
ProDataSet ProDataGraph
Temp-Table List of ProDataObjects
Buffer (record) ProDataObject
Before-Table getChanges() on ProChangeSummary
Field Property in ProDataObject
Data-Relation ProDataRelationMetaData
Index ProDataObjectMetaData
26Passing DataSet Parameters in Java
Same for Static AND Dynamic
OUTPUT
INPUT-OUTPUT
INPUT
ProDataGraphHolder
27Procedure using Static ProDataSet
ABL code
/ StaticDs.p / dsOrderDef.i DEF INPUT
PARAMETER piGE AS INT. DEF INPUT PARAMETER piLE
AS INT. DEF OUTPUT PARAMETER DATASET FOR
dsOrder. DATA-SOURCE srcOrdFILL-WHERE-STRING
WHERE Order.OrderNum GE STRING(piGE)
AND Order.OrderNum LE STRING(piLE). /
Fill the dsOrder DataSet / DATASET
dsOrderFILL().
28Method using ProDataGraph
Java Client code
import com.progress.open4gl. import
commonj.sdo. ProDataGraphHolder dgHolder
new ProDataGraphHolder() ProDataGraph dg
null try appObj.StaticDS
(iLowRange, iHighRange, dgHolder) dg
dgHolder.getProDataGraphValue() List rows
dg.getProDataObjects(Order") ...
1
2
3
4
5
29Updating a DataSet
- ProChangeSummary object tracks changes
- Works similar to ProDataSet
- Tracks modified, added, deleted rows
- Keeps track of original versions
30Demo
31Temp-Table Parameters
Cannot mix ProDataGraph and java.sql.ResultSet
32New .jar files for CLASSPATH
Location ltinstall-dirgt/java/ext/
- SDO jar files
- common.jar
- commonj.sdo.jar
- ecore.jar
- ecore.change.jar
- ecore.resources.jar
- ecore.sdo.jar
- ecore.xml.jar
33Agenda
- Overview of ProDataSet and OpenClient
- .NET OpenClient / DataSet
- Java OpenClient / SDO
- ProDataSets to/from XML
34ProDataSets in the OpenEdge Reference
Architecture
NEW!
ABL READ-XML ( ) WRITE-XML( ) Progress DataSet
(XML)
35New Methods Added
ProDataSet
- WRITE-XML
- WRITE-XMLSCHEMA
- READ-XML
- READ-XMLSCHEMA
- Methods apply to
- ProDataSet
- Temp-Table
- Temp-Table Buffer
.xsd
.xml
36WRITE-XML ( )
Syntax
WRITE-XML (target-type, file stream memptr
handle longchar , formatted , encoding
, schema-location, , write-xml schema ,
min-xmlschema, write-before-image)
Example
DEFINE DATASET dsOrder... / attach datasources
and FILL / DATASET dsOrderWRITE-XML ("FILE",
dsOrder.xml",
TRUE). / formatted /
37ProDataSet XML Example
Order Row
OrderLine Row
38NESTED Attribute ProDataSet Data-Relation
Example
DEFINE DATASET dsOrder FOR eOrder,eOrderLine
DATA-RELATION OrderLine FOR eOrder,eOrderLine
RELATION-FIELDS (OrderNum,OrderNum) NESTED.
/ attach datasources and FILL / DATASET
dsOrderWRITE-XML ("FILE",
dsOrderNested.xml",
TRUE). / formatted /
39NESTED Attribute ProDataSet Data-Relation
OrderLine Records NESTED within Orders
40READ-XML ( )
Syntax
READ-XML (source-type, file memptr handle
longchar , read-mode, schema-location ,
override-default-mapping , field-type-mapping
, verify-schema-mode )
Example
DEFINE DATASET dsOrder... DATASET
dsOrderREAD-XML (FILE,
dsOrder.xml, / file /
EMPTY, / read-mode /
?, ?).
41Reading XML Into A ProDataSet
READ-XML ( )
- Reads XML containing Before-Image information
- Progress datasetChanges
- Microsoft Diffgram
- ProDataSet events DO NOT fire
- Change tracking is turned OFF
42WRITE-XMLSCHEMA ( )
Syntax
WRITE-XMLSCHEMA (target-type, file stream
memptr handle longchar , formatted ,
encoding , min-xmlschema )
- min-xmlschema
- if TRUE only write standard XML Schema structures
- if FALSE, add XML Schema extensions from
prodata namespace - Progress-specific information
- Allows round-trip of Progress definition
43Progress XML Schema Extensions
MIN-SCHEMA TRUE
XML Schema Extensions
None
Temp-Table UNDO status
Format Label Decimals Case-sensitive Read-only...
Non-unique Indexes
Non-Unique Data-Relations
Standard XML Schema
Dataset DataSet / Table names
Table Table / Field names
Field Name Data Type Extent Initial value
Index Unique Indexes
Relation Unique Data-Relations
MIN-SCHEMA FALSE
44Progress XML Schema Extensions
prodata namespace
field-level attributes
non-unique index definition
45XML Schema to ABL Tool
Syntax
xsdto4gl xml-schema-filename -output
output-directory-name filename -element
element-name -overridemapping
-fieldtypemapping field-mapping-file string
.i
.xsd
xsdto4gl
46In Summary
- The ProDataSet is key to the future of ABL
applications - Major component of the OpenEdge Reference
Architecture - Were continuing to expand ProDataSet features
47Relevant Exchange Sessions
- DEV-9 Using the ProDataSet in OpenEdge 10
- DEV-15 XML in OpenEdge Past, Present and Future
48Education / Documentation References
- Course
- Using ProDataSets
- What's New in OpenEdge 10.1 SOA Support
- Documentation
- OpenEdge Development ProDataSets
- OpenEdge Development .Net Open Clients
- OpenEdge Development Java Open Clients
- OpenEdge Development Programming Interfaces (XML)
49Questions?
50Thank you foryour time
51(No Transcript)