implementing a custom jira ui using plugins 2.0 andreas knecht plugins 2 & rest

28
Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Upload: lorraine-barber

Post on 11-Jan-2016

229 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Implementing a custom JIRA UI using plugins 2.0Andreas Knecht

Plugins 2 & REST

Page 2: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Overview

• How to implement a custom UI

• How to implement a REST resource

• Demo

• svn co https://labs.atlassian.com/svn/IPHONE/trunk

Excellent resource - This is a great app, not just because it looks good. It's also a great resource for JIRA 4.0 REST plugin development. Matt Doar (PAC - 2 Dec 09)

Excellent resource - This is a great app, not just because it looks good. It's also a great resource for JIRA 4.0 REST plugin development. Matt Doar (PAC - 2 Dec 09)

““””

Page 3: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Custom UI

• Why?

• Building BlocksoServlet FiltersoWebwork actionsoHTML/JS + REST

Page 4: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

This is not a talk about REST!

Page 5: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

JIRA Web-Interface for the iPhone

• Easy to use interface on the iPhone

• Plugins 2 plugin

• Most of the work done client-side

• Custom REST interface

Page 6: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Plugin structure

Page 7: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Some stats

• 2000+ downloads since November 09

• ~7000 LOC

• 20 20% days to develop

• 8 features

Page 8: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Custom UI - Filters

• Redirect certain users

• Inject content into pages

Page 9: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Custom UI - Define a Filter

• URL-Pattern

• Locationoafter-encoding, before-login, before-decoration,

before-dispatch

Page 10: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Custom UI - Webwork• Full MVC UI framework

• Views, Commands, Validation, Templating

• /secure/* is not secure• roles-required=”admin” does not work• /secure/* is not secure• roles-required=”admin” does not work

Page 11: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Securing Webworkhttp://localhost:2990/jira/OrderForm!default.jspa?id=10001http://localhost:2990/jira/OrderForm.jspa?id=10001

Page 12: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

REST

• Simple for small data

• What about 100000 issues?

vs

Page 13: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Expands to the Rescue.../rest/iphone/1.0/filter/10000.json

Page 14: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2]

Page 15: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2]

Page 16: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details

Page 17: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details

Page 18: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details.comments[1]

Page 19: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details.comments[1]

Page 20: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

How do expands work?• Lists vs Objects

Page 21: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

How to expand lists

Page 22: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

How to expand objects

Page 23: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

How to expand objects• REST provides com.atlassian.plugins.rest.common.expand.EntityExpanders

...

Page 24: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

REST

• Backend doesn’t always support expands

• Tricky to implement expands

• #protip: Use services

Page 25: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Services keep you safe!

Page 26: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Demo

• Implement ‘Add Comment’ feature

• Requires some client side JS

• Server side REST resource

• Tools

Page 27: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Summary

• Use HTML/JS as much as possibleoFaster development turnaroundoGood frameworks (jQuery, GWT, jQTouch...)

• If our REST API doesn’t do it for you...

Page 28: Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST

Questions

https://labs.atlassian.com/browse/IPHONE