utilized xstrem in green integration

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

Upload: guo-albert

Post on 24-May-2015

736 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Utilized XStrem in Green Integration

Utilized XStrem in Green Integration– Take CMCS Project for Example

Albert Guo

Page 2: Utilized XStrem in Green Integration

© 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

Page 3: Utilized XStrem in Green Integration

Scenario

Page 4: Utilized XStrem in Green Integration

© 2006 PTC4

System Architecture

CIS

Green

Windchill

Project Management

Document Management

Change Management

Pro/EWildfire

Pro/E

Wo

rk S

pa

ce

Pro/E

PDMLink

Supplier Management

GSM/GCM

Product Management

(Part /BOM)

Interfac

e T

ab

leSAPERP

ProjectLinkO

DB

C

xml

Page 5: Utilized XStrem in Green Integration

© 2006 PTC5

Where to launch

New Part Application Workflow

New BOM Workflow

Active BOM Workflow

Export BOM to GSM xml

Page 6: Utilized XStrem in Green Integration

© 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>

Page 7: Utilized XStrem in Green Integration

XStream

Page 8: Utilized XStrem in Green Integration

© 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 objectsXML

People.javaname=albertbirthplace=Jia-Yi

People.xml<people> <name>albert</name> <birthplace>Jia-Yi</birthplace></people>

Page 9: Utilized XStrem in Green Integration

© 2006 PTC9

XStream Architecture

Page 10: Utilized XStrem in Green Integration

© 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

Page 11: Utilized XStrem in Green Integration

© 2006 PTC11

Quick Start

Page 12: Utilized XStrem in Green Integration

© 2006 PTC12

XStream FAQ

Page 13: Utilized XStrem in Green Integration

How to Implement

Page 14: Utilized XStrem in Green Integration

© 2006 PTC14

Steps

Page 15: Utilized XStrem in Green Integration

Example1

Page 16: Utilized XStrem in Green Integration

© 2006 PTC16

Example1 (1/2)

People (name, tel, fax, email)

Page 17: Utilized XStrem in Green Integration

© 2006 PTC17

Example1 (2/2)

Example1.rar

Page 18: Utilized XStrem in Green Integration

Example2

Page 19: Utilized XStrem in Green Integration

© 2006 PTC19

Analysis XSD or TLD

Attribute for BOM

POJO within BOM

POJO with BOM

Attribute for ProductLocationMapping

POJO within ProductLocationMapping

Page 20: Utilized XStrem in Green Integration

© 2006 PTC20

Analysis XSD or TLD

Attribute for ProductStructure

Attribute for Line

Page 21: Utilized XStrem in Green Integration

© 2006 PTC21

Generate POJO

Page 22: Utilized XStrem in Green Integration

© 2006 PTC22

Set data into POJO (1/3)

Enclosed by <Line> tag

Enclosed by <ProductLocationMapping> tag

Page 23: Utilized XStrem in Green Integration

Set data into POJO (2/3)

© 2006 PTC23

Page 24: Utilized XStrem in Green Integration

Set data into POJO (3/3)

© 2006 PTC24

Page 25: Utilized XStrem in Green Integration

© 2006 PTC25

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

Page 26: Utilized XStrem in Green Integration

Summary

Page 27: Utilized XStrem in Green Integration

© 2006 PTC27

Summary

Digester only have unmarshal function

Betwixt/XStream have both marshal and unmarshal function

Utilized JAXB to generate Java class from XSD