Upload
spartez
View
540
Download
0
Embed Size (px)
Citation preview
PAWEL MURAWSKI • TEAM LEADER • SPARTEZ • [email protected]
One Code To Rule Them All
How to use the same codebase for JIRA Server and Cloud plugins
From the Server to the Cloud…
and back again.
JIRA Server plugin again
Cards created in Java - PDF file.
JIRA Cloud pluginCards created using JS, HTML and CSS.
JIRA Server plugin
Reused code from JIRA Cloud plugin.
One little problem left..Our photo scanning algorithm has been written in JAVA and is only available on JIRA Server. Let’s rewrite it in JavaScript!
One MavenProject
Frontend code
Standard P2 plugin.
JIRA Cloud pluginJava Spring application - Connect plugin.
JIRA Server plugin
Copied during build process as resource to Server and Cloud plugin modules.
Outside iframe - showView()
method
Sets URL on iframe
Inside passed DOM element.
Resizes iframeTimer FTW!
Creates iframe
Parameters like ac-view, context path, locale, user name etc.
Inside iframe - wrapper for the
AP library
Current location
Standard AJAX calls.
MessagesAJS from parent is used.
JIRA requests
window.parent.location.href
AC plugin servlet
HTML template - showView()
Iframe - different index.html for Server and Cloud
App router - ac-view parameter
Final app view
Rendering the view in iframe on JIRA Server
Pros go to the left, cons to the right
No interference with JIRA frontend code
Which means less bugs
Same codebase for JIRA Server and Cloud plugins
Write once, run everywhere
Build process is a little bit more complicatedAnd you need file watchers
Plugin has to be written in JSAnd sometimes you just want Java
Some Connect functionalities have to be implemented for P2 pluginAlso you need to keep your plugin inside
an iframe
Virtually no limits in choosing frontend technologies
Any hipstery JS framework can be used