Utilized XStrem in Green Integration

junyuo 229 views 27 slides Jun 07, 2008
Slide 1
Slide 1 of 27
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27

About This Presentation

No description available for this slideshow.


Slide Content

Utilized XStrem in Green Integration–
Take CMCS Project for Example
Albert Guo

© 2006 PTC2
Agenda
Scenario
System architecture
Where to launch
XML content example
XStream
What is XStream
XStream Features
Quick Start
XStream FAQ
How to Implement
Example1
Example2
Summary

Scenario

© 2006 PTC4
System Architecture
CIS
Green
Windchill
Project
Management
Document
Management
Change
Management
Pro/E
Wildfire
Pro/E
W
o
r
k

S
p
a
c
e
Pro/E
PDMLink
Supplier
Management
GSM/GCM
Product
Management
(Part /BOM)
I
n
t
e
r
f
a
c
e

T
a
b
le
SAP
ERP
ProjectLink
O
D
B
C
xml

© 2006 PTC5
Where to launch
New Part Application Workflow
New BOM Workflow
Active BOM Workflow
Export BOM to GSMxml

© 2006 PTC6
XML content example
If the part has child,
this part will be enclosed by <ProductLocationMapping>.
If the part does not have child,
then this part will be enclosed by <Line>

XStream

© 2006 PTC8
What is XStream
http://xstream.codehaus.org/index.html
XStream is a simple library to serialize objects to XML and back again.
serialize objects
XML
People.java
name=albert
birthplace=Jia-Yi
People.xml
<people>
<name>albert</name>
<birthplace>Jia-Yi</birthplace>
</people>

© 2006 PTC9
XStream Architecture

© 2006 PTC10
XStream Features
Ease of use
A high level facade is supplied that simplifies common use cases.
No mappings required
Most objects can be serialized without need for specifying mappings.
Performance
Speed and low memory footprint are a crucial part of the design, making it
suitable for large object graphs or systems with high message throughput.
Error messages
When an exception occurs due to malformed XML, detailed diagnostics are
provided to help isolate and fix the problem

© 2006 PTC11
Quick Start

© 2006 PTC12
XStream FAQ

How to Implement

© 2006 PTC14
Steps

Example1

© 2006 PTC16
Example1 (1/2)
People (name, tel, fax, email)

© 2006 PTC17
Example1 (2/2)
Exa mple 1.ra r

Example2

© 2006 PTC19
Analysis XSD or TLD
Attribute for BOM
POJO within BOM
POJO with BOM
Attribute for ProductLocationMapping
POJO within ProductLocationMapping

© 2006 PTC20
Analysis XSD or TLD
Attribute for ProductStructure
Attribute for Line

© 2006 PTC21
Generate POJO

© 2006 PTC22
Set data into POJO (1/3)
Enclosed by <Line> tag
Enclosed by
<ProductLocationMapping>
tag

Set data into POJO (2/3)
© 2006 PTC23

Set data into POJO (3/3)
© 2006 PTC24

© 2006 PTC25
Initializing XStream Object & Serializing object to XML and write xml object
into file

Summary

© 2006 PTC27
Summary
Digester only have unmarshal function
Betwixt/XStream have both marshal and unmarshal function
Utilized JAXB to generate Java class from XSD
Tags