35
June 5–9 Orlando, Florida Keys to Building and Consuming Open Services for Lifecycle Collaboration (OSLC) Providers in Support of Open Lifecycle Integrations Steve Speicher STSM, IBM Rational [email protected] TJI-1072

Innovate2011 Keys to Building OSLC Integrations

Embed Size (px)

DESCRIPTION

IBM Innovate 2011 general session on hints and tips to building OSLC-based integrations

Citation preview

June 5–9 Orlando, Florida

Keys to Building and Consuming Open Services for Lifecycle Collaboration (OSLC) Providers in Support of Open Lifecycle Integrations

Steve SpeicherSTSM, IBM [email protected]

The Premier Event for Software and Systems Innovation

2© 2011 IBM Corporation

2

OSLC Technical Foundation - Linked Lifecycle DataData Integration for the 21st Century

Inspired by Internet principles, implemented with Internet technologies: simple interfaces for exchange of resources

Loosely coupled: everything is a “resource” linked together with URLs

Technology neutral: treats all implementations equally

Minimalist: defines no more than necessary for exchange of resources

Incremental: deliver value now, add more value over time

Openly published standards: free to implement and irrevocable

If the entire Web can connect like this, would the same idea work for ALM?

The Premier Event for Software and Systems Innovation

3© 2011 IBM Corporation

OSLC Community

Eleven workgroups operating at open-services.net

Domain focused workgroups (e.g. CM, QM, RM) Common issues and patterns (Core) Solution oriented workgroups (e.g. PLM/ALM)

Range of interests, expertise, involvement 400+ registered community members (up from

70 people at RSC 2009)

Individuals from 34+ different companies have participated in OSLC workgroups (up from 5 companies at RSC 2009)

Worthy of note PLM/ALM Workgroup

Siemens leadership Open source

Eclipse Lyo Project Proposal Eclipse Mylyn project restructuring and

positioning of OSLC Mantis, Forges

Customer and integrator involvement GM, Northrop Grumman, Tieto, Integrate

Systems

AccentureAPG

Black DuckBoeing

BSD GroupCitigroup

EADSEmphasys Group

EmpulsysFokus Fraunhofer

GalorathGeneral Motors

Health Care Services CorpIBM

Institut TELECOMIntegrate Systems

Lender Processing ServicesNorthrop Grumman

OracleQSM

Rally SoftwareRavenflow

ShellSiemensSogeti

SourceGear/TeampriseState Street

Tasktop (Eclipse Mylyn)ThalesTieto

TOPIC Embedded SystemsUrbanCodeWebLayers

3

The Premier Event for Software and Systems Innovation

4© 2011 IBM Corporation

Key first questions to ask:

What scenarios do you want to support? Are these well-known scenarios at open-services.net?

Do I need to define new scenarios?

What tools are involved with this scenario? What versions and what level of OSLC do they support?

Can I leverage their support or will I need to extend/adapt it?

What specifications should I support?

Do I need to do both consumers and providers?

The Premier Event for Software and Systems Innovation

5© 2011 IBM Corporation

What scenarios do you want to support?

Understand existing scenarios their pattens to see how closely they align: Find and fix a defect

Related change requests We’ll dig into this one

Change Management of Requirements

Traceability

Requirements are implemented, delivered and validated

....

Where to find these? Each domain WG publishes their scenarios

The Premier Event for Software and Systems Innovation

6© 2011 IBM Corporation

Planning our work

Project 123Project 123 Product ABCProduct ABC

Product DEFProduct DEF

Task 14 Bug 76

Link CR

Link SP

Product GHIProduct GHIProject 789Project 789

Link Servers

Rational Team Concert

The Premier Event for Software and Systems Innovation

7© 2011 IBM Corporation

www.ibm.com/software/rational

The Premier Event for Software and Systems Innovation

8© 2011 IBM Corporation

What tools are involved with this scenario?

Understand what tools are involved

What technologies are these based on?

Do you have access to the source code?

Can you influence the tool owner support OSLC directly?

Does the tool already have a REST or SOAP API?

Does the tool have a Web UI?

The Premier Event for Software and Systems Innovation

9© 2011 IBM Corporation

Understand what tools you are integrating with

The Premier Event for Software and Systems Innovation

10© 2011 IBM Corporation

What does your scenario require?

What qualities does these scenarios have… Read-only?

UI-only?

Query-dependent?

Create and update?

One direction, consuming or providing services only?

Reporting and/or query across multiple tool repositories?

The Premier Event for Software and Systems Innovation

11© 2011 IBM Corporation

What specifications should I support?

This would require an analysis of what resources are involved in the scenarios

Let's say you decide consume and provide CM is what you need (Connecting to IBM Rational Team Concert and Rational Quality Manager)

Domain Workgroup Resources

Change Management Change Request (work item, defect, task, …)

Quality Management Test Plan, Test Case, Test Script, Test Execution Record, Test Result

Requirements Management Requirement, RequirementCollection

Asset Management Asset, Artifact

Architecture Management AM Resource (UML class, business process diagram, use case)

Software Configuration Management

Change Set, Baseline, Configuration, Directory/File/Symlink Version

Estimation and Metrics Baseline, Measurement, Project, Scenario

PLM/ALM TBD – Product?, Context?, Baseline?

Automation TBD – AutomationResult?

Core ServiceProvider, ResourceShape, Discussion, ...

The Premier Event for Software and Systems Innovation

12© 2011 IBM Corporation

Providing OSLC-CMDetermine what capabilities are needed

The Premier Event for Software and Systems Innovation

13© 2011 IBM Corporation

Service Description and Discovery

oslc:ServiceProvider – service discovery endpoint, with service definitions within a given context

oslc:publisher – basic information about the supplier of the service provider implementation

oslc:service – definition of a service provided within the configuration context, a oslc:Service

oslc:domain – the specification that this service supports

oslc:creationFactory – the resource creation service

oslc:queryCapability – the entry point for simple query syntax based queries

oslc:selectionDialog – dialog URL and sizing information

oslc:creationDialog – dialog URL and sizing information

oslc:ServiceProviderCatalog – contain either more catalogs or service providers. These are optional

Creation and query capabilities have optional support for resource descriptions (shapes)

The Premier Event for Software and Systems Innovation

14© 2011 IBM Corporation

Delegated UI Explained

#1 Click to launch delegated UI

#2 iframe's src set to delegated UI's URL

#3 Selection made

#4 OK pressed – sends message (link+label) to parent window

The Premier Event for Software and Systems Innovation

15© 2011 IBM Corporation

Delegated UI's key points

Supports both creation and selection of resources

Two communication protocols are supported for iframes:Best practice: Use HTML5 postMessage() whenever possible

Supported in most modern browers

Window object's window.name

Supported in older browsers and Eclipse embedded web widget

Consumer selects which protocol to use, informs provider via fragment identifier

Tremendous value for resource creationTraditionally most service logic was communicated to client and new dialog built

Now the rules for creation and dialog change as needed

Prefilling of creation dialog done by “creating” a dialog resourceHTTP POST of resource format to creation dialog URL, response is URL of dialog

prefilled

This does NOT require a provider to store this draft, it can respond with a URL with query parameters that the dialog can understand

The Premier Event for Software and Systems Innovation

16© 2011 IBM Corporation

UI Preview

Cache, don’t copy information from the other end of the link

As a consumer, provide a direct link to the resource <a href=“…” />

As a consumer, be prepared for delayed loading

The Premier Event for Software and Systems Innovation

17© 2011 IBM Corporation

Resource retrieval

HTTP GET and standard HTTP content negotiationClient uses HTTP Accept request header to specify desired resource formats

Be sure to handle full definition of Accept header RFC2616

Use standard content(MIME) typesWell, we did create just one for UI preview format

Partial representations via HTTP URL key=value pair as ?oslc.properties=Allows for minimal retrieval of properties

Get Defect 123 (all properties)

Get Defect 123 (just title and status)

Accept: application/json, application/xml

GET http://bugs/123

GET http://bugs/123?oslc.properties=dcterms:title,oslc_cm:status

Accept: application/json, application/xml;q=0.8

The Premier Event for Software and Systems Innovation

18© 2011 IBM Corporation

Resource representations

OSLC providers should be open to any type of resourceNot just those defined by OSLC

Resources defined by OSLC use RDF data modeltherefore are simply defined by their set of properties

OSLC services MUST produce and consume RDF/XML representationsClients and services MUST NOT assume any subset of RDF/XML

Other representations are allowed such as:XML: OSLC defined format that allows for consistent formats and is RDF/XML valid

JSON: Rules for representing namespaces and QName properties

Turtle: No constraints, use as-is

Atom Syndication Format: <atom:content> SHOULD be RDF/XML

The Premier Event for Software and Systems Innovation

19© 2011 IBM Corporation

Resource modification

Use HTTP GET to get resource properties to be updated You’ll get an ETag back

Change only the property values you need to change Clients must preserve unknown content

Use HTTP PUT to send updated resource Use If-Match HTTP request header with ETag, services may reject your request without

it HTTP PUT will completely replace the resource representation

We are moving towards PATCH – new HTTP verb http://tools.ietf.org/html/rfc5789

Possible to update only selected properties

The Premier Event for Software and Systems Innovation

20© 2011 IBM Corporation

Resource creation

Create a resource using HTTP POST and content being resource format of choiceURI for doing the POST is defined in the oslc:ServiceProvider in the oslc:creationFactory service

Response is a 201-Created with Location HTTP header indicating URI for resource

Don’t forget to send eTag

Sending a response content is optional (per HTTP)

Request may be rejected for any number of reasonsInsufficient permissions

Missing required values

Invalid data choices

...and … and ...

Valid resource formats for creation are defined by:domain specifications

service provider may define its own resources and formats

optionally, by resource shape associated with creation factory

The Premier Event for Software and Systems Innovation

21© 2011 IBM Corporation

Resource linking

Links are just properties: whose property values are just URIs

Don't make assumptions about the target of linksOSLC supports an open model

Needed to achieve goal of “loosely coupled” integrations

Clients need to be flexible and expect anything

Sometimes we need to provide additional data about links: label, owners, etc.

Special cases where links need more representation

Turtle format for a bug resource (abbrev)<http://example.com/bugs/2314> a oslc_cm:ChangeRequest ; dcterms:relation <http://server/app/bugs/1235> ;

The Premier Event for Software and Systems Innovation

22© 2011 IBM Corporation

Resource representations

OSLC services should handle any type of resourceNot just those defined by OSLC

Resources defined by OSLC use RDF data modeltherefore are simply defined by their set of properties

OSLC services MUST produce and consume RDF/XML representationsClients and services MUST NOT assume any subset of RDF/XML

Other representations are allowed such as:XML: OSLC defined format that allows for consistent formats and is RDF/XML valid

JSON: Rules for representing namespaces and QName properties

Turtle: No constraints, use as-is

Atom Syndication Format: <atom:content> SHOULD be RDF/XML

The Premier Event for Software and Systems Innovation

23© 2011 IBM Corporation

Querying for resources

Each service may specify one or more Query Capabilities

Best practice: Recommend to only supply one

Query Capability has base URI

Best practice: Make this URI the same as the Creation Factory

Clients form query URI and HTTP GET the results

OSLC services MAY support OSLC Query Syntaxhttp://open-services.net/bin/view/Main/OSLCCoreSpecQuery

The Premier Event for Software and Systems Innovation

24© 2011 IBM Corporation

Query Syntax Overview

Filter results by appending oslc.where= with query clause to query base URI

Only boolean operation allowed is and which represents conjunction

"or" for disjunction is not defined in the interests of keeping the syntax simple.

Retrieve just what you want withoslc.select=

Defined ordering using oslc.orderBy=

Full-text search via oslc.searchTerms=

Comparison Operators= test for equality!= test for inequality< test less-than> test greater-than<= test less-than or equal>= test greater-than or equal

'in' operator:Test for equality to any of the values in a list. The list is a comma-separated sequence of values, enclosed in square brackets: in [“high”,”critical”]

The Premier Event for Software and Systems Innovation

25© 2011 IBM Corporation

Query syntax example

Find high severity bugs created after April fools day

Find bugs related to test case 31459

Find all bugs created by John Smith

http://example.com/bugs?oslc.where= cm:severity="high" and dcterms:created>"2010-04-01"

http://example.com/bugs?oslc.where= dcterms:creator{foaf:givenName="John" and foaf:familyName="Smith"}

http://example.com/bugs?oslc.prefix=qm=<http://qm.example.com/ns>& oslc.where=qm:testcase=<http://example.com/tests/31459>

The Premier Event for Software and Systems Innovation

26© 2011 IBM Corporation

And more...

Common property and resource definitions coveringResource shapes

Resource typical properties: title, description, identification, …

Leveraging Dublin Core and FOAF

Discussion/comments

OSLC services MAY offer OAuth 1.0aBest practice: Support three legged OAuth for webapp to webapp authentication

Two legged OAuth for client to webapp authentication

The Premier Event for Software and Systems Innovation

27© 2011 IBM Corporation

What resources are there to help?

Tutorials

Workshop - too late :(

Reference implementation

Sample code

Where to find these things? Start at http://open-services.net

SourceForge oslc-tools project

finding a new home….Eclipse Lyo project proposal

The Premier Event for Software and Systems Innovation

28© 2011 IBM Corporation

Consuming OSLC-CMHTTP REST only

Determine language library For HTTP:

Java - Apache HTTP Client and/or Wink

For content formats:

Java – Jena RDF API (RDF/XML)

Java – Apache Wink JSON4J

For OAuth:

Java - http://oauth.net/code

Find some samples SourceForge oslc-tools

Coming “Eclipse Lyo” project proposal phase

The Premier Event for Software and Systems Innovation

29© 2011 IBM Corporation

Key take-aways

Consumers… Don’t assume anything

Don’t do URI-building

Do leverage sample service provider

Do test against > 1 implementations

Providers… Have a common URI strategy

Leverage test suite

Provide sample code with scenarios supported

Validate (during development) your response formats

Keep things simple -- minimalist

June 5–9 Orlando, Florida

Jazz Interoperability Jazz Interoperability CenterCenter

{ In collaboration with… }

Exhibit HallJune 6: 5 - 8 PM June 7: 11 AM - 2 PM & 4:30 - 7:30 PM June 8: 11 AM - 2 PM

Come see Jazz and OSLC at play integrating IBM, 3rd party, and home-grown tools across the lifecycle!

Go there now!!!

The Premier Event for Software and Systems Innovation

31© 2011 IBM Corporation

Resources

OSLC Primer http://open-services.net

OSLC Tutorial http://open-services.net

Open source - Eclipse Lyo Project & SourceForge OSLC-Tools http://sourceforge.net/projects/oslc-tools/

RTC Work Item REST API https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2

Getting to know OSLC-CM http://tinyurl.com/knowoslc

The Premier Event for Software and Systems Innovation

32© 2011 IBM Corporation

Summary

No single answer, all depends on your scenario

Use your resources, look to http://open-services.net Open source projects

Reference implementations

Samples

Software Services for Rational can help as well

Check out OSLC-based integrations in the Exhibit Hall

The Premier Event for Software and Systems Innovation

33© 2011 IBM Corporation

www.ibm.com/software/rational

The Premier Event for Software and Systems Innovation

34© 2011 IBM Corporation

Daily iPod Touch giveaway

Complete your session surveys online each day at a conference kiosk or on your Innovate 2011 Portal!

Each day that you complete all of that day’s session surveys, your name will be entered to win the daily IPOD touch!

On Wednesday be sure to complete your full conference evaluation to receive your free conference t-shirt!

SPONSORED BY

The Premier Event for Software and Systems Innovation

35© 2011 IBM Corporation

© Copyright IBM Corporation 2011. All rights reserved. The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. IBM, the IBM logo, Rational, the Rational logo, Telelogic, the Telelogic logo, and other IBM products and services are trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.

www.ibm.com/software/rational