atlascamp 2010: implementing a custom jira ui using plugins 2.0 - andreas knecht
DESCRIPTION
TRANSCRIPT
Implementing a custom JIRA UI using plugins 2.0Andreas Knecht
Plugins 2 & RESTTuesday, November 2, 2010
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
Custom UI
• Why?• Building BlocksoServlet FiltersoWebwork actionsoHTML/JS + REST
Tuesday, November 2, 2010
This is not a talk about REST!Tuesday, November 2, 2010
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
Plugin structure
Tuesday, November 2, 2010
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
Custom UI - Filters
• Redirect certain users• Inject content into pages
Tuesday, November 2, 2010
Custom UI - Define a Filter
• URL-Pattern• Locationoafter-encoding, before-login, before-decoration,
before-dispatch
Tuesday, November 2, 2010
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
Securing Webwork!http://localhost:2990/jira/OrderForm!default.jspa?id=10001http://localhost:2990/jira/OrderForm.jspa?id=10001
Tuesday, November 2, 2010
REST
• Simple for small data
• What about 100000 issues?
vs
Tuesday, November 2, 2010
Expands to the Rescue.../rest/iphone/1.0/filter/10000.json
Tuesday, November 2, 2010
Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2]
Tuesday, November 2, 2010
Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2]
Tuesday, November 2, 2010
Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details
Tuesday, November 2, 2010
Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details
Tuesday, November 2, 2010
Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details.comments[1]
Tuesday, November 2, 2010
Expands to the Rescue.../rest/iphone/1.0/filter/10000.json?expand=result[1:2].issue.details.comments[1]
Tuesday, November 2, 2010
How do expands work?• Lists vs Objects
Tuesday, November 2, 2010
How to expand lists!
Tuesday, November 2, 2010
How to expand objects!
Tuesday, November 2, 2010
How to expand objects• REST provides com.atlassian.plugins.rest.common.expand.EntityExpanders
...
Tuesday, November 2, 2010
REST
• Backend doesnʼt always support expands• Tricky to implement expands• #protip: Use services
Tuesday, November 2, 2010
Services keep you safe!
Tuesday, November 2, 2010
Demo
• Implement ʻAdd Commentʼ feature• Requires some client side JS• Server side REST resource• Tools
Tuesday, November 2, 2010
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
Questions
https://labs.atlassian.com/browse/IPHONE
Tuesday, November 2, 2010