SlideShare a Scribd company logo
Connect Add-ons for
Cloud & Server
PATRICK STREULE • ARCHITECT • ATLASSIAN • @PSTREULE
Connect
Overview
Cloud
Browser
Product – Cloud Add-On Service
Connect Plugin
Connect JS
Add-On UI
Add-On JS
AssetsAPI
Browser
Product – Cloud Add-On Service
Connect Plugin
Connect JS
Add-On UI
Add-On JS
AssetsAPI
Cloud Create iFrame,
XDM bridge
Browser
Product – Cloud Add-On Service
Connect Plugin
Connect JS
Add-On UI
Add-On JS
AssetsAPI
Cloud
Expose
Host API
Browser
Product – Cloud Add-On Service
Connect Plugin
Connect JS
Add-On UI
Add-On JS
AssetsAPI
Cloud
Lifecycle,
Webhooks
Browser
Product – Cloud Add-On Service
Connect Plugin
Connect JS
Add-On UI
Add-On JS
AssetsAPI
Cloud
REST API
Browser
Product – Cloud Add-On Service
Connect Plugin
Connect JS
Add-On UI
Add-On JS
AssetsAPI
REST API
Bridge
Cloud
Now in Server
Server
Product – Server v1
Product – Server v2
Browser
Add-On Service
?
Add-On UI
Add-On JS
AssetsAPI
Product – Server v3
?
Server
Product – Server v1
Product – Server v2
Browser
Add-On Service
?
Add-On UI
Add-On JS
AssetsAPI
Product – Server v3
?
iFrame setup?
XDM?
API Version?
Server
Product – Server v1
Product – Server v2
Browser
Add-On Service
?
Add-On UI
Add-On JS
AssetsAPI
Product – Server v3
?
Auth?

Privacy?
Connectivity?
Server
Product – Server v1
Product – Server v2
Browser
Add-On Service
?
Add-On UI
Add-On JS
AssetsAPI
Product – Server v3
?
Connectivity?
API Version?
Auth?
Example
Sequence Diagram Add-On
• Purely client-side
• No server-side rendering
• Javascript & SVG
• No data stored by the add-on
• Uses macro body for storage
• Uses REST API to fetch the macro
body
• However: The Connect version
stores the installation payload
Browser
Product – Cloud Add-On Service
Connect Plugin
Connect JS
Add-On UI
Add-On JS
Assets
Design Choices
ConnectP2
Browser
Product – Server
P2 Plugin
Add-On UI
Add-On JS
Assets
Connect JS Shim
Show me code
Plugin XML
<web-resource key="sequence-diagram-resources" name="sequence-diagram Web Resources">
<resource type="download" name="blueprint.css" location="/css/blueprint.css"/>
<resource type="download" name="confluence.css" location="/css/confluence.css"/>
<resource type="download" name="napkin.css" location="/css/napkin.css"/>
<resource type="download" name="plain.css" location="/css/plain.css"/>
<resource type="download" name="sequence-diagrams.js" location="/js/sequence-diagrams.743cf0e5.js"/>
<resource type="download" name="connect-api.js" location="/js/connect-api.js"/>
<resource type="download" name="addon.js" location="/js/addon.js"/>
</web-resource>
<servlet name="Diagram IFrame Servlet" key="sequence-diagram-servlet" class="com.pstreule.SequenceDiagramIFrame">
<url-pattern>/sequence-diagram</url-pattern>
</servlet>
<xhtml-macro name="sequence-diagram" class="com.pstreule.SequenceDiagramMacro" key="sequence-diagram-macro">
<parameters>
<parameter name="theme" type="enum" required="true">
<value name="Confluence"/>
<value name="Blueprint"/>
<value name="Napkin"/>
<value name="Plain"/>
</parameter>
<parameter name="width" type="string"/>
</parameters>
</xhtml-macro>
Render the iFrame
public SequenceDiagramMacro(TemplateRenderer renderer, ApplicationProperties applicationProperties)
{
this.renderer = renderer;
this.applicationProperties = applicationProperties;
}
@Override
public String execute(Map<String, String> parameters, String storageFormatBody, ConversionContext conversionContext)
throws MacroExecutionException
{
ContentEntityObject entity = conversionContext.getEntity();
String baseUrl = applicationProperties.getBaseUrl();
URI uri = UriBuilder.fromPath(baseUrl + "/plugins/servlet/sequence-diagram")
.queryParam("pid", entity.getIdAsString())
.queryParam("pv", entity.getVersion())
.queryParam("mh", DigestUtils.md5Hex(storageFormatBody))
.queryParam("theme", parameters.get("theme"))
.build();
Map<String, Object> context = new HashMap<>();
context.put("url", uri.toString());
context.put("name", "preview".equals(conversionContext.getOutputType()) ? storageFormatBody : "");
return render("/templates/iframe.vm", context);
}
<iframe src="$url" name="$name" frameborder="0"
rel="nofollow" scrolling="no"></iframe>
Render the iFrame Content
public class SequenceDiagramIFrame extends HttpServlet
{
private final TemplateRenderer renderer;
private final PageBuilderService pageBuilderService;
public SequenceDiagramIFrame(TemplateRenderer renderer, PageBuilderService pageBuilderService)
{
this.renderer = renderer;
this.pageBuilderService = pageBuilderService;
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
resp.setStatus(HttpServletResponse.SC_OK);
resp.setContentType("text/html");
StringWriter writer = new StringWriter();
WebResourceAssembler assembler = pageBuilderService.assembler();
assembler.assembled().drainIncludedResources();
assembler.resources().requireWebResource("com.pstreule.sequence-diagram:sequence-diagram-resources");
WebResourceSet set = assembler.assembled().drainIncludedResources();
set.writeHtmlTags(writer, UrlMode.RELATIVE);
renderer.render("/templates/sequence-diagram.vm",
Collections.singletonMap("resourcesWithHtml", writer.toString()), resp.getWriter());
}
}
<html>
<head>
$resourcesWithHtml
</head>
<body>
<div id="sequence-diagram"></div>
<script type="application/javascript">
renderSequenceDiagram("sequence-diagram", window.name)
</script>
</body>
</html>
Add-On JavaScript Code
function renderSequenceDiagram(id, previewMacroBody) {
function render(diagramCode) {
function onRenderSuccess(dimensions) {
AP.resize(dimensions.w + 10, dimensions.h + 10);
}
var themeName = Loader.getUrlParameter("theme");
var theme = SequenceDiagramThemes.byName(themeName);
var controller = new SequenceDiagramController(id);
controller.renderSequenceDiagram(diagramCode, theme, null, onRenderSuccess, onRenderError);
}
function loadMacroAndRender() {
function onLoadSuccess(responseBody) {
var diagramCode = JSON.parse(responseBody).body;
render(diagramCode);
}
AP.require(['request'], function (request) {
var pageId = Loader.getUrlParameter("pid");
var pageVersion = Loader.getUrlParameter("pv");
var macroHash = Loader.getUrlParameter("mh");
request({
url: "/rest/api/content/" + pageId + "/history/" + pageVersion + "/macro/hash/" + macroHash,
success: onLoadSuccess
});
});
}
loadMacroAndRender();
}
Connect JS Shim
var AP = {};
(function (AP) {
var AJS = window.parent.AJS;
var $ = AJS.$;
_modules = {
'request': function (url, args) {
…
$.ajax({
url: url,
…
}).then(done, fail);
}
};
AP.require = function (modules, callback) {
var requiredModules = Array.isArray(modules) ? modules : [modules];
var args = requiredModules.map(function (module) {
return _modules[module];
});
callback.apply(window, args);
};
AP.resize = function (width, height) {
AJS.$(window.frameElement).css({width: width, height: height});
};
})(AP);
Best Practices
Make it 

Self-Contained
Run in Process
Browser
Product – Server
P2 Plugin
Add-On UI
Add-On JS
AssetsAPI
Connect JS Shim
Adapter
Run in Process
Browser
Product – Server
P2 Plugin
Add-On UI
Add-On JS
AssetsAPI
Connect JS Shim
Adapter
No cross-domain
bridge needed
Run in Process
Browser
Product – Server
P2 Plugin
Add-On UI
Add-On JS
AssetsAPI
Connect JS Shim
AdapterEvent Handling,
Storage
Run in Process
Browser
Product – Server
P2 Plugin
Add-On UI
Add-On JS
AssetsAPI
Connect JS Shim
Adapter
100% Reusable
100% Reusable
Run in Process
Browser
Product – Server
P2 Plugin
Add-On UI
Add-On JS
AssetsAPI
Connect JS Shim
Adapter
100% reusable
(maybe)
Use Client-Side
Rendering as much
as Possible
Shrink the server-side
Browser
Product – Server
P2 Plugin
Add-On UI
Add-On JS
AssetsAPI
Connect JS Shim
Use In-Product 

Data Storage
Use Entity Properties for Data Storage
POST /rest/api/content/{content_ID}/property
Content-Type: application/json
{
"key" : "attachment",
"value" : {
"size": 234374,
"description": "My description"
...
}
}
GET /rest/api/content/{content_ID}/propertyGET /rest/api/2/issue/{key}/properties/
PUT /rest/api/2/issue/{key}/properties/
attachment
Content-Type: application/json
{
"size": 234374,
"description": "My description"
...
}
Use Entity Properties for Data Storage
{
"jiraEntityProperties": [
{
"keyConfigurations": [
{
"propertyKey": "attachment",
"extractions": [
{
"objectName": "attachment.size",
"type": "number",
"alias": "attachmentSize"
}
]
}
],
"entityType": "issue",
"name": {
"value": "Attachment Index Document"
}
}
]
}
{
"confluenceContentProperties": [
{
"keyConfigurations": [
{
"propertyKey": "attachment",
"extractions": [
{
"objectName": "attachment.size",
"type": "number"
}
]
}
],
"name": {
"value": "Attachment Index Document"
}
}
]
}
Use client-side REST Calls
// Get the content properties of an issue
AP.require(['request'], function(request){
request({
url: '/rest/api/2/issue/' + issueKey + '/properties/',
success: function(responseText){
var properties = JSON.parse(responseText);
…
}
});
});
Expose REST API
for Server-Side
Logic
JAX-RS/Jersey
@Path("my-resource")
public class MyResource
{
@GET
@Produces("application/json")
public Response getSomething(@Context HttpServletRequest request)
{
// ...
return Response.ok();
}
}
Tools*
*currently in planning
Thank you!
PATRICK STREULE • ARCHITECT • ATLASSIAN • @PSTREULE
Connect everywhere - Cloud and Server
Submit your feedback:
go.atlassian.com/acconnectcloud

More Related Content

What's hot

Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?Steve Taylor
 
AtlasCamp 2013: Modernizing your Plugin UI
AtlasCamp 2013: Modernizing your Plugin UI AtlasCamp 2013: Modernizing your Plugin UI
AtlasCamp 2013: Modernizing your Plugin UI colleenfry
 
ILUG 2010 - Deploying plug-ins to the enterprise
ILUG 2010 - Deploying plug-ins to the enterpriseILUG 2010 - Deploying plug-ins to the enterprise
ILUG 2010 - Deploying plug-ins to the enterpriseRené Winkelmeyer
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerRob Dodson
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular UJoonas Lehtinen
 
Ajax Rails
Ajax RailsAjax Rails
Ajax Railshot
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Hendrik Ebbers
 
All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...Caelum
 
Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Djangofool2nd
 
SPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking GlassSPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking GlassBrian Caauwe
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application DevelopmentFITC
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction DjangoWade Austin
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleKaty Slemon
 
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces Skills Matter
 
Course CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.jsCourse CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.jsVinícius de Moraes
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web ComponentsAndrew Rota
 
Integrate CI/CD Pipelines with Jira Software Cloud
Integrate CI/CD Pipelines with Jira Software CloudIntegrate CI/CD Pipelines with Jira Software Cloud
Integrate CI/CD Pipelines with Jira Software CloudAtlassian
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSmurtazahaveliwala
 

What's hot (20)

Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?Orchard Harvest 2014 - The Future of Widgets?
Orchard Harvest 2014 - The Future of Widgets?
 
AtlasCamp 2013: Modernizing your Plugin UI
AtlasCamp 2013: Modernizing your Plugin UI AtlasCamp 2013: Modernizing your Plugin UI
AtlasCamp 2013: Modernizing your Plugin UI
 
ILUG 2010 - Deploying plug-ins to the enterprise
ILUG 2010 - Deploying plug-ins to the enterpriseILUG 2010 - Deploying plug-ins to the enterprise
ILUG 2010 - Deploying plug-ins to the enterprise
 
Unlock the next era of UI design with Polymer
Unlock the next era of UI design with PolymerUnlock the next era of UI design with Polymer
Unlock the next era of UI design with Polymer
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
Ajax Rails
Ajax RailsAjax Rails
Ajax Rails
 
Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)Web Components & Polymer 1.0 (Webinale Berlin)
Web Components & Polymer 1.0 (Webinale Berlin)
 
All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...All you need to know about JavaScript loading and execution in the browser - ...
All you need to know about JavaScript loading and execution in the browser - ...
 
Vaadin Components
Vaadin ComponentsVaadin Components
Vaadin Components
 
Gae Meets Django
Gae Meets DjangoGae Meets Django
Gae Meets Django
 
SPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking GlassSPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSSTL - PowerShell - Through the SharePoint Looking Glass
 
Angular vs React for Web Application Development
Angular vs React for Web Application DevelopmentAngular vs React for Web Application Development
Angular vs React for Web Application Development
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction Django
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
Laravel 8 export data as excel file with example
Laravel 8 export data as excel file with exampleLaravel 8 export data as excel file with example
Laravel 8 export data as excel file with example
 
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
 
Course CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.jsCourse CodeSchool - Shaping up with Angular.js
Course CodeSchool - Shaping up with Angular.js
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
 
Integrate CI/CD Pipelines with Jira Software Cloud
Integrate CI/CD Pipelines with Jira Software CloudIntegrate CI/CD Pipelines with Jira Software Cloud
Integrate CI/CD Pipelines with Jira Software Cloud
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 

Similar to AtlasCamp 2015: Connect everywhere - Cloud and Server

Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsSami Ekblad
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'sAntônio Roberto Silva
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Atlassian
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0Eugenio Romano
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
Integrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteIntegrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteAtlassian
 
EdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the Edge
EdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the EdgeEdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the Edge
EdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the EdgeAkamai Developers & Admins
 
Aurelia Meetup Paris
Aurelia Meetup ParisAurelia Meetup Paris
Aurelia Meetup ParisAhmed Radjdi
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Eliran Eliassy
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastAtlassian
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015Pushkar Chivate
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.jsPagepro
 
The wild wild west of Selenium Capabilities
The wild wild west of Selenium CapabilitiesThe wild wild west of Selenium Capabilities
The wild wild west of Selenium CapabilitiesAdi Ofri
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesWindows Developer
 

Similar to AtlasCamp 2015: Connect everywhere - Cloud and Server (20)

Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
 
Workshop: Building Vaadin add-ons
Workshop: Building Vaadin add-onsWorkshop: Building Vaadin add-ons
Workshop: Building Vaadin add-ons
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
Plugins on OnDemand with Remote Apps - Atlassian Summit 2012
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
Integrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code SuiteIntegrating Jira Software Cloud With the AWS Code Suite
Integrating Jira Software Cloud With the AWS Code Suite
 
EdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the Edge
EdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the EdgeEdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the Edge
EdgeWorkers: Enabling Autonomous, Developer Friendly Programming at the Edge
 
WebGUI Developers Workshop
WebGUI Developers WorkshopWebGUI Developers Workshop
WebGUI Developers Workshop
 
Aurelia Meetup Paris
Aurelia Meetup ParisAurelia Meetup Paris
Aurelia Meetup Paris
 
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component DevelopmentEVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
EVOLVE'14 | Enhance | Gabriel Walt | Sightly Component Development
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
Deploying SharePoint @ Cloud
Deploying SharePoint @ CloudDeploying SharePoint @ Cloud
Deploying SharePoint @ Cloud
 
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fastHow Bitbucket Pipelines Loads Connect UI Assets Super-fast
How Bitbucket Pipelines Loads Connect UI Assets Super-fast
 
Vaadin & Web Components
Vaadin & Web ComponentsVaadin & Web Components
Vaadin & Web Components
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
The wild wild west of Selenium Capabilities
The wild wild west of Selenium CapabilitiesThe wild wild west of Selenium Capabilities
The wild wild west of Selenium Capabilities
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devices
 

More from Atlassian

International Women's Day 2020
International Women's Day 2020International Women's Day 2020
International Women's Day 2020Atlassian
 
10 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 202010 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 2020Atlassian
 
Forge App Showcase
Forge App ShowcaseForge App Showcase
Forge App ShowcaseAtlassian
 
Let's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UILet's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UIAtlassian
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge RuntimeAtlassian
 
Forge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceAtlassian
 
Take Action with Forge Triggers
Take Action with Forge TriggersTake Action with Forge Triggers
Take Action with Forge TriggersAtlassian
 
Observability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeObservability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeAtlassian
 
Trusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelAtlassian
 
Designing Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI SystemDesigning Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI SystemAtlassian
 
Forge: Under the Hood
Forge: Under the HoodForge: Under the Hood
Forge: Under the HoodAtlassian
 
Access to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIsAccess to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIsAtlassian
 
Design Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch PluginDesign Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch PluginAtlassian
 
Tear Up Your Roadmap and Get Out of the Building
Tear Up Your Roadmap and Get Out of the BuildingTear Up Your Roadmap and Get Out of the Building
Tear Up Your Roadmap and Get Out of the BuildingAtlassian
 
Nailing Measurement: a Framework for Measuring Metrics that Matter
Nailing Measurement: a Framework for Measuring Metrics that MatterNailing Measurement: a Framework for Measuring Metrics that Matter
Nailing Measurement: a Framework for Measuring Metrics that MatterAtlassian
 
Building Apps With Color Blind Users in Mind
Building Apps With Color Blind Users in MindBuilding Apps With Color Blind Users in Mind
Building Apps With Color Blind Users in MindAtlassian
 
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...Atlassian
 
Beyond Diversity: A Guide to Building Balanced Teams
Beyond Diversity: A Guide to Building Balanced TeamsBeyond Diversity: A Guide to Building Balanced Teams
Beyond Diversity: A Guide to Building Balanced TeamsAtlassian
 
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed TeamThe Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed TeamAtlassian
 
Building Apps With Enterprise in Mind
Building Apps With Enterprise in MindBuilding Apps With Enterprise in Mind
Building Apps With Enterprise in MindAtlassian
 

More from Atlassian (20)

International Women's Day 2020
International Women's Day 2020International Women's Day 2020
International Women's Day 2020
 
10 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 202010 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 2020
 
Forge App Showcase
Forge App ShowcaseForge App Showcase
Forge App Showcase
 
Let's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UILet's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UI
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge Runtime
 
Forge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User Experience
 
Take Action with Forge Triggers
Take Action with Forge TriggersTake Action with Forge Triggers
Take Action with Forge Triggers
 
Observability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeObservability and Troubleshooting in Forge
Observability and Troubleshooting in Forge
 
Trusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy Model
 
Designing Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI SystemDesigning Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI System
 
Forge: Under the Hood
Forge: Under the HoodForge: Under the Hood
Forge: Under the Hood
 
Access to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIsAccess to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIs
 
Design Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch PluginDesign Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch Plugin
 
Tear Up Your Roadmap and Get Out of the Building
Tear Up Your Roadmap and Get Out of the BuildingTear Up Your Roadmap and Get Out of the Building
Tear Up Your Roadmap and Get Out of the Building
 
Nailing Measurement: a Framework for Measuring Metrics that Matter
Nailing Measurement: a Framework for Measuring Metrics that MatterNailing Measurement: a Framework for Measuring Metrics that Matter
Nailing Measurement: a Framework for Measuring Metrics that Matter
 
Building Apps With Color Blind Users in Mind
Building Apps With Color Blind Users in MindBuilding Apps With Color Blind Users in Mind
Building Apps With Color Blind Users in Mind
 
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
 
Beyond Diversity: A Guide to Building Balanced Teams
Beyond Diversity: A Guide to Building Balanced TeamsBeyond Diversity: A Guide to Building Balanced Teams
Beyond Diversity: A Guide to Building Balanced Teams
 
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed TeamThe Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
 
Building Apps With Enterprise in Mind
Building Apps With Enterprise in MindBuilding Apps With Enterprise in Mind
Building Apps With Enterprise in Mind
 

Recently uploaded

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»QADay
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
 

Recently uploaded (20)

Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

AtlasCamp 2015: Connect everywhere - Cloud and Server

  • 1. Connect Add-ons for Cloud & Server PATRICK STREULE • ARCHITECT • ATLASSIAN • @PSTREULE
  • 2.
  • 4.
  • 6. Cloud Browser Product – Cloud Add-On Service Connect Plugin Connect JS Add-On UI Add-On JS AssetsAPI
  • 7. Browser Product – Cloud Add-On Service Connect Plugin Connect JS Add-On UI Add-On JS AssetsAPI Cloud Create iFrame, XDM bridge
  • 8. Browser Product – Cloud Add-On Service Connect Plugin Connect JS Add-On UI Add-On JS AssetsAPI Cloud Expose Host API
  • 9. Browser Product – Cloud Add-On Service Connect Plugin Connect JS Add-On UI Add-On JS AssetsAPI Cloud Lifecycle, Webhooks
  • 10. Browser Product – Cloud Add-On Service Connect Plugin Connect JS Add-On UI Add-On JS AssetsAPI Cloud REST API
  • 11. Browser Product – Cloud Add-On Service Connect Plugin Connect JS Add-On UI Add-On JS AssetsAPI REST API Bridge Cloud
  • 13. Server Product – Server v1 Product – Server v2 Browser Add-On Service ? Add-On UI Add-On JS AssetsAPI Product – Server v3 ?
  • 14. Server Product – Server v1 Product – Server v2 Browser Add-On Service ? Add-On UI Add-On JS AssetsAPI Product – Server v3 ? iFrame setup? XDM? API Version?
  • 15. Server Product – Server v1 Product – Server v2 Browser Add-On Service ? Add-On UI Add-On JS AssetsAPI Product – Server v3 ? Auth?
 Privacy? Connectivity?
  • 16. Server Product – Server v1 Product – Server v2 Browser Add-On Service ? Add-On UI Add-On JS AssetsAPI Product – Server v3 ? Connectivity? API Version? Auth?
  • 18.
  • 19. • Purely client-side • No server-side rendering • Javascript & SVG • No data stored by the add-on • Uses macro body for storage • Uses REST API to fetch the macro body • However: The Connect version stores the installation payload Browser Product – Cloud Add-On Service Connect Plugin Connect JS Add-On UI Add-On JS Assets Design Choices ConnectP2 Browser Product – Server P2 Plugin Add-On UI Add-On JS Assets Connect JS Shim
  • 21. Plugin XML <web-resource key="sequence-diagram-resources" name="sequence-diagram Web Resources"> <resource type="download" name="blueprint.css" location="/css/blueprint.css"/> <resource type="download" name="confluence.css" location="/css/confluence.css"/> <resource type="download" name="napkin.css" location="/css/napkin.css"/> <resource type="download" name="plain.css" location="/css/plain.css"/> <resource type="download" name="sequence-diagrams.js" location="/js/sequence-diagrams.743cf0e5.js"/> <resource type="download" name="connect-api.js" location="/js/connect-api.js"/> <resource type="download" name="addon.js" location="/js/addon.js"/> </web-resource> <servlet name="Diagram IFrame Servlet" key="sequence-diagram-servlet" class="com.pstreule.SequenceDiagramIFrame"> <url-pattern>/sequence-diagram</url-pattern> </servlet> <xhtml-macro name="sequence-diagram" class="com.pstreule.SequenceDiagramMacro" key="sequence-diagram-macro"> <parameters> <parameter name="theme" type="enum" required="true"> <value name="Confluence"/> <value name="Blueprint"/> <value name="Napkin"/> <value name="Plain"/> </parameter> <parameter name="width" type="string"/> </parameters> </xhtml-macro>
  • 22. Render the iFrame public SequenceDiagramMacro(TemplateRenderer renderer, ApplicationProperties applicationProperties) { this.renderer = renderer; this.applicationProperties = applicationProperties; } @Override public String execute(Map<String, String> parameters, String storageFormatBody, ConversionContext conversionContext) throws MacroExecutionException { ContentEntityObject entity = conversionContext.getEntity(); String baseUrl = applicationProperties.getBaseUrl(); URI uri = UriBuilder.fromPath(baseUrl + "/plugins/servlet/sequence-diagram") .queryParam("pid", entity.getIdAsString()) .queryParam("pv", entity.getVersion()) .queryParam("mh", DigestUtils.md5Hex(storageFormatBody)) .queryParam("theme", parameters.get("theme")) .build(); Map<String, Object> context = new HashMap<>(); context.put("url", uri.toString()); context.put("name", "preview".equals(conversionContext.getOutputType()) ? storageFormatBody : ""); return render("/templates/iframe.vm", context); } <iframe src="$url" name="$name" frameborder="0" rel="nofollow" scrolling="no"></iframe>
  • 23. Render the iFrame Content public class SequenceDiagramIFrame extends HttpServlet { private final TemplateRenderer renderer; private final PageBuilderService pageBuilderService; public SequenceDiagramIFrame(TemplateRenderer renderer, PageBuilderService pageBuilderService) { this.renderer = renderer; this.pageBuilderService = pageBuilderService; } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.setStatus(HttpServletResponse.SC_OK); resp.setContentType("text/html"); StringWriter writer = new StringWriter(); WebResourceAssembler assembler = pageBuilderService.assembler(); assembler.assembled().drainIncludedResources(); assembler.resources().requireWebResource("com.pstreule.sequence-diagram:sequence-diagram-resources"); WebResourceSet set = assembler.assembled().drainIncludedResources(); set.writeHtmlTags(writer, UrlMode.RELATIVE); renderer.render("/templates/sequence-diagram.vm", Collections.singletonMap("resourcesWithHtml", writer.toString()), resp.getWriter()); } } <html> <head> $resourcesWithHtml </head> <body> <div id="sequence-diagram"></div> <script type="application/javascript"> renderSequenceDiagram("sequence-diagram", window.name) </script> </body> </html>
  • 24. Add-On JavaScript Code function renderSequenceDiagram(id, previewMacroBody) { function render(diagramCode) { function onRenderSuccess(dimensions) { AP.resize(dimensions.w + 10, dimensions.h + 10); } var themeName = Loader.getUrlParameter("theme"); var theme = SequenceDiagramThemes.byName(themeName); var controller = new SequenceDiagramController(id); controller.renderSequenceDiagram(diagramCode, theme, null, onRenderSuccess, onRenderError); } function loadMacroAndRender() { function onLoadSuccess(responseBody) { var diagramCode = JSON.parse(responseBody).body; render(diagramCode); } AP.require(['request'], function (request) { var pageId = Loader.getUrlParameter("pid"); var pageVersion = Loader.getUrlParameter("pv"); var macroHash = Loader.getUrlParameter("mh"); request({ url: "/rest/api/content/" + pageId + "/history/" + pageVersion + "/macro/hash/" + macroHash, success: onLoadSuccess }); }); } loadMacroAndRender(); }
  • 25. Connect JS Shim var AP = {}; (function (AP) { var AJS = window.parent.AJS; var $ = AJS.$; _modules = { 'request': function (url, args) { … $.ajax({ url: url, … }).then(done, fail); } }; AP.require = function (modules, callback) { var requiredModules = Array.isArray(modules) ? modules : [modules]; var args = requiredModules.map(function (module) { return _modules[module]; }); callback.apply(window, args); }; AP.resize = function (width, height) { AJS.$(window.frameElement).css({width: width, height: height}); }; })(AP);
  • 28. Run in Process Browser Product – Server P2 Plugin Add-On UI Add-On JS AssetsAPI Connect JS Shim Adapter
  • 29. Run in Process Browser Product – Server P2 Plugin Add-On UI Add-On JS AssetsAPI Connect JS Shim Adapter No cross-domain bridge needed
  • 30. Run in Process Browser Product – Server P2 Plugin Add-On UI Add-On JS AssetsAPI Connect JS Shim AdapterEvent Handling, Storage
  • 31. Run in Process Browser Product – Server P2 Plugin Add-On UI Add-On JS AssetsAPI Connect JS Shim Adapter 100% Reusable 100% Reusable
  • 32. Run in Process Browser Product – Server P2 Plugin Add-On UI Add-On JS AssetsAPI Connect JS Shim Adapter 100% reusable (maybe)
  • 33. Use Client-Side Rendering as much as Possible
  • 34. Shrink the server-side Browser Product – Server P2 Plugin Add-On UI Add-On JS AssetsAPI Connect JS Shim
  • 36. Use Entity Properties for Data Storage POST /rest/api/content/{content_ID}/property Content-Type: application/json { "key" : "attachment", "value" : { "size": 234374, "description": "My description" ... } } GET /rest/api/content/{content_ID}/propertyGET /rest/api/2/issue/{key}/properties/ PUT /rest/api/2/issue/{key}/properties/ attachment Content-Type: application/json { "size": 234374, "description": "My description" ... }
  • 37. Use Entity Properties for Data Storage { "jiraEntityProperties": [ { "keyConfigurations": [ { "propertyKey": "attachment", "extractions": [ { "objectName": "attachment.size", "type": "number", "alias": "attachmentSize" } ] } ], "entityType": "issue", "name": { "value": "Attachment Index Document" } } ] } { "confluenceContentProperties": [ { "keyConfigurations": [ { "propertyKey": "attachment", "extractions": [ { "objectName": "attachment.size", "type": "number" } ] } ], "name": { "value": "Attachment Index Document" } } ] }
  • 38. Use client-side REST Calls // Get the content properties of an issue AP.require(['request'], function(request){ request({ url: '/rest/api/2/issue/' + issueKey + '/properties/', success: function(responseText){ var properties = JSON.parse(responseText); … } }); });
  • 39. Expose REST API for Server-Side Logic
  • 40. JAX-RS/Jersey @Path("my-resource") public class MyResource { @GET @Produces("application/json") public Response getSomething(@Context HttpServletRequest request) { // ... return Response.ok(); } }
  • 42. Thank you! PATRICK STREULE • ARCHITECT • ATLASSIAN • @PSTREULE
  • 43. Connect everywhere - Cloud and Server Submit your feedback: go.atlassian.com/acconnectcloud