utilized xstrem in green integration

Post on 24-May-2015

738 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

© 2006 PTC5

Where to launch

New Part Application Workflow

New BOM Workflow

Active BOM Workflow

Export BOM to GSM xml

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

People.javaname=albertbirthplace=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)

Example1.rar

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

top related