atlascamp 2010: implementing a custom jira ui using plugins 2.0 - andreas knecht

28
Implementing a custom JIRA UI using plugins 2.0 Andreas Knecht Plugins 2 & REST Tuesday, November 2, 2010

Upload: atlassian

Post on 31-Oct-2014

2.319 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Implementing a custom JIRA UI using plugins 2.0Andreas Knecht

Plugins 2 & RESTTuesday, November 2, 2010

Page 2: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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)

“”

Tuesday, November 2, 2010

Page 3: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Custom UI

• Why?• Building BlocksoServlet FiltersoWebwork actionsoHTML/JS + REST

Tuesday, November 2, 2010

Page 4: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

This is not a talk about REST!Tuesday, November 2, 2010

Page 5: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 6: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Plugin structure

Tuesday, November 2, 2010

Page 7: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Some stats

• 2000+ downloads since November 09

• ~7000 LOC• 20 20% days to

develop• 8 features

0

85

170

255

340

11/0902/1005/10 08/10

Downloads

Tuesday, November 2, 2010

Page 8: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Custom UI - Filters

• Redirect certain users• Inject content into pages

Tuesday, November 2, 2010

Page 9: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Custom UI - Define a Filter

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

before-dispatch

Tuesday, November 2, 2010

Page 10: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Custom UI - Webwork• Full MVC UI framework• Views, Commands, Validation, Templating

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

Tuesday, November 2, 2010

Page 11: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 12: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

REST

• Simple for small data

• What about 100000 issues?

vs

Tuesday, November 2, 2010

Page 13: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 14: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 15: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 16: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 17: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 18: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 19: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

Tuesday, November 2, 2010

Page 20: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

How do expands work?• Lists vs Objects

Tuesday, November 2, 2010

Page 21: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

How to expand lists!

Tuesday, November 2, 2010

Page 22: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

How to expand objects!

Tuesday, November 2, 2010

Page 23: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

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

...

Tuesday, November 2, 2010

Page 24: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

REST

• Backend doesnʼt always support expands• Tricky to implement expands• #protip: Use services

Tuesday, November 2, 2010

Page 25: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Services keep you safe!

Tuesday, November 2, 2010

Page 26: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Demo

• Implement ʻAdd Commentʼ feature• Requires some client side JS• Server side REST resource• Tools

Tuesday, November 2, 2010

Page 27: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Summary

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

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

Tuesday, November 2, 2010

Page 28: AtlasCamp 2010: Implementing a custom JIRA UI using plugins 2.0 - Andreas Knecht

Questions

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

Tuesday, November 2, 2010