SlideShare uma empresa Scribd logo
1 de 58
Plugins on OnDemand with
Remote Apps


Don Brown
Architect, Atlassian
Five years ago. . .
And now. . .
• Over 12k active, 9k paid OnDemand accounts
• 5 out of 10 add Greenhopper
• 1.5 out of 10 add Bonfire
• 1 out of 10 add Team Calendars

                                . . . Instances
The Fine Print
But isn‟t it just a copy?
Plugin Problems: Security
<% String eid = request.getParameter("eid"); %>
...
Employee ID: <%= eid %>
Plugin Problems: Performance
java.lang.OutOfMemoryError: Java heap space
   at org.apache.xerces.dom.DeferredDocumentImpl.createChunk(Unknown Source)
   at org.apache.xerces.dom.DeferredDocumentImpl.ensureCapacity(Unknown Source)
   at org.apache.xerces.dom.DeferredDocumentImpl.createNode(Unknown Source)
   at org.apache.xerces.dom.DeferredDocumentImpl.createDeferredEntityReference(Unknown Source)
   at org.apache.xerces.parsers.AbstractDOMParser.startGeneralEntity(Unknown Source)
   at org.apache.xerces.impl.dtd.XMLDTDValidator.startGeneralEntity(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.startEntity(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)
   at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source
Plugin Problems: Upgrades
Product Dev

QA
        Everyone‟s Angry

                    Admins
 Plugin Dev
Introducing Remote Apps
This is a Remote App             key: app1
                                 name: Remote App - app1
                                 version: 1
• A single descriptor file       display-url: http://example.com
                                 description: This app
                                 vendor:
• Can be in XML, YAML, or JSON    name: Atlassian
                                  url: http://atlassian.com
• Contains
                                 permissions:
                                  permission:
 • App metadata                    - scope: browse_projects
 • Permissions                   general-page:
                                  - key: first
 • Extension points                 name: First
                                    url: /first
Examples: General Page
Plugin Steps                      Remote App Steps
 1. Add web-item config            1. Add general-page config
 2. Add servlet config             2. Implement URL
 3. Code servlet
 4. Try to get output decorated
Examples: React to Event
Plugin Steps                   Remote App Steps
 1. Add component config        1. Add web-hook config
 2. Dig through code to find    2. Implement URL
    event to listen for
 3. Register for events
 4. Handle event
 5. Make sure to unregister
Examples: Custom Macro Editor
Plugin Steps                      Remote App Steps
 1. Add web-resource and rest      1. Add custom-macro-editor
    config                            config
 2. Find and call JavaScript       2. Implement URL
    API to override edit button
 3. Create AUI dialog
 4. Implement REST
    resources
Shipping….Now.
Apps: Dropbox by AppFusions
• Share your documents
• Written in Java, deployed
  at Contegix
• Provides a custom page
  macro, and macro editor
  with MS Office edit
Apps: TFS4JIRA by Spartez
• Integrate JIRA with your
  Team Foundation Server
• Written in Java, deployed
  at Heroku
• Uses project and issue
  tabs, and an admin page
Apps: Lucidchart by . . .
Steps to create Lucidchart app
• Establish Trust
• Register App
• Implement General Page
• Implement macro
Establish Trust
Steps to create Lucidchart app
• Establish Trust
• Register App
• Implement General Page
• Implement macro
Register the app
• Receive from OnDemand as Request params:
 • OAuth consumer key
 • OAuth RSA public key
 • Base URL
Register the app
• Return to OnDemand description of the remote app
 • Can be in XML, JSON or YAML
Provide OAuth consumer key and
RSA public key
<remote-app key=“xxxxxxx"
    name="Lucidchart"
    version="1"
    icon-url="http://www.lucidchart.com/favicon.ico"
    display-url="https://www.lucidchart.com/ondemand">
  <vendor name="Lucidchart" url="http://www.lucidchart.com" />
  <description>Lucidchart example</description>
  <oauth …>
    <public-key>yyyyyy</public-key>
  </oauth>
...
Request permissions
...
<permissions>
  <permission scope="read_users_and_groups" />
  <permission scope="read_content" />
  <permission scope="modify_attachments" />
  <permission scope="modify_content" />
</permissions>
...
General Page
...
<general-page
    section="system.content.add/space"
    key="lucidAppGeneral"
    link-name="Lucidchart Diagram"
    name="Select or create a diagram"
    url="/doclist"
    width="1200"
    height="800"
    icon-url="/icon">
  <description>Insert or Create a Lucidchart Diagram</description>
  <context-param name="page_id" />
</general-page>
...
General Page
...
<general-page
   section="system.content.add/space"
    key="lucidAppGeneral"
    link-name="Lucidchart Diagram"
    name="Select or create a diagram"
    url="/doclist"
    width="1200"
    height="800"
    icon-url="/icon">
  <description>Insert or Create a Lucidchart Diagram</description>
  <context-param name="page_id" />
</general-page>
...
General Page
...
<general-page
    section="system.content.add/space"
    key="lucidAppGeneral"
    link-name="Lucidchart Diagram"
    name="Select or create a diagram"
   url="/doclist"
    width="1200"
    height="800"
    icon-url="/icon">
  <description>Insert or Create a Lucidchart Diagram</description>
  <context-param name="page_id" />
</general-page>
...
General Page
...
<general-page
    section="system.content.add/space"
    key="lucidAppGeneral"
    link-name="Lucidchart Diagram"
    name="Select or create a diagram"
    url="/doclist"
    width="1200"
    height="800"
    icon-url="/icon">
  <description>Insert or Create a Lucidchart Diagram</description>
  <context-param name="page_id" />
</general-page>
...
Macro
...
<macro key="lucidchart" url="/macro" output-type="block" body-type="none">
  <description>Create a Lucidchart Diagram</description>
  <category name="development" />
  <image-placeholder url="/imagePlaceHolder" width="140" height="140" apply-
chrome="true"/>
  <parameters>
    <parameter name="width" title="Width" type="string" default=“700"/>
    <parameter name="height" title="Height (if blank, image ratio is
preserved)" type="string" />
    <parameter name="align" type="enum" default="Left">
        <value name="Left"/>
        <value name="Right" />
    </parameter>
  </parameters>
</macro>
Macro
...
<macro key="lucidchart" url="/macro" output-type="block" body-type="none">
  <description>Create a Lucidchart Diagram</description>
  <category name="development" />
  <image-placeholder url="/imagePlaceHolder" width="140" height="140" apply-
chrome="true"/>
  <parameters>
    <parameter name="width" title="Width" type="string" default=“700"/>
    <parameter name="height" title="Height (if blank, image ratio is
preserved)" type="string" />
    <parameter name="align" type="enum" default="Left">
        <value name="Left"/>
        <value name="Right" />
    </parameter>
  </parameters>
</macro>
Macro
...
<macro key="lucidchart" url="/macro" output-type="block" body-type="none">
  <description>Create a Lucidchart Diagram</description>
  <category name="development" />
  <image-placeholder url="/imagePlaceHolder" width="140" height="140"
apply-chrome="true"/>
  <parameters>
    <parameter name="width" title="Width" type="string" default=“700"/>
    <parameter name="height" title="Height (if blank, image ratio is
preserved)" type="string" />
    <parameter name="align" type="enum" default="Left">
        <value name="Left"/>
        <value name="Right" />
    </parameter>
  </parameters>
</macro>
Macro
...
<macro key="lucidchart" url="/macro" output-type="block" body-type="none">
  <description>Create a Lucidchart Diagram</description>
  <category name="development" />
  <image-placeholder url="/imagePlaceHolder" width="140" height="140"/>
  <parameters>
    <parameter name="width" title="Width" type="string"
default=“700"/>
    <parameter name="height" title="Height" type="string" />
    <parameter name="align" type="enum" default="Left">
        <value name="Left"/>
        <value name="Right" />
    </parameter>
  </parameters>
</macro>
Steps to create Lucidchart app
• Establish Trust
• Register App
• Implement General Page
• Implement macro
Any language can be used
• Lucidchart is using PHP
Add Diagram (general page)
function doclist() {
  if (!$this->_hasValidOAuthSignature()) {
    $this->set("oauthValid", false);
    return;
  }

    $userId = @$_REQUEST['user_id'];
    $pageId = @$_REQUEST['page_id'];

  $redirectURL = "https://" . $_SERVER['SERVER_NAME'] .
'/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId;

    $this->layout = „ondemand';
    $this->set("baseUrl", $this->_getBaseURL());
    $this->set("callback", urlencode($redirectURL));
}
Add Diagram (general page)
function doclist() {
    if (!$this->_hasValidOAuthSignature()) {
      $this->set("oauthValid", false);
      return;
    }

    $userId = @$_REQUEST['user_id'];
    $pageId = @$_REQUEST['page_id'];

  $redirectURL = "https://" . $_SERVER['SERVER_NAME'] .
'/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId;

    $this->layout = „ondemand';
    $this->set("baseUrl", $this->_getBaseURL());
    $this->set("callback", urlencode($redirectURL));
}
Add Diagram (general page)
function doclist() {
  if (!$this->_hasValidOAuthSignature()) {
    $this->set("oauthValid", false);
    return;
  }

    $userId = @$_REQUEST['user_id'];
    $pageId = @$_REQUEST['page_id'];

  $redirectURL = "https://" . $_SERVER['SERVER_NAME'] .
'/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId;

    $this->layout = „ondemand';
    $this->set("baseUrl", $this->_getBaseURL());
    $this->set("callback", urlencode($redirectURL));
}
Add Diagram (general page)
function doclist() {
  if (!$this->_hasValidOAuthSignature()) {
    $this->set("oauthValid", false);
    return;
  }

    $userId = @$_REQUEST['user_id'];
    $pageId = @$_REQUEST['page_id'];

  $redirectURL = "https://" . $_SERVER['SERVER_NAME'] .
'/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId;

    $this->layout = „ondemand';
    $this->set("baseUrl", $this->_getBaseURL());
    $this->set("callback", urlencode($redirectURL));
}
Make API calls to attach diagram
function attachDocument() {
...
    $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId;
    $auth_header = $this->_getAuthHeader($fullUrl);
    xmlrpc_set_type($imageBytes, "base64");
    $attachmentMetaData = array("fileName"=>$attachmentName,
        "contentType"=>"image/png",
        "comment"=>"Imported from Lucidchart (do not deleted)");
    $addAttachmentBody= xmlrpc_encode_request(
        "confluence2.addAttachment",
        array("", $pageId, $attachmentMetaData ,$imageBytes));
     $this->_sendXMLRPCRequest($fullUrl, array(
        "Content-Type: text/xml",
        $auth_header),
        $addAttachmentBody);
...
}
Make API calls to attach diagram
function attachDocument() {
...
      $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId;
    $auth_header = $this->_getAuthHeader($fullUrl);
    xmlrpc_set_type($imageBytes, "base64");
    $attachmentMetaData = array("fileName"=>$attachmentName,
        "contentType"=>"image/png",
        "comment"=>"Imported from Lucidchart (do not deleted)");
    $addAttachmentBody= xmlrpc_encode_request(
        "confluence2.addAttachment",
        array("", $pageId, $attachmentMetaData ,$imageBytes));
     $this->_sendXMLRPCRequest($fullUrl, array(
        "Content-Type: text/xml",
        $auth_header),
        $addAttachmentBody);
...
}
Make API calls to attach diagram
function attachDocument() {
...
    $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId;
      $auth_header = $this->_getAuthHeader($fullUrl);
    xmlrpc_set_type($imageBytes, "base64");
    $attachmentMetaData = array("fileName"=>$attachmentName,
        "contentType"=>"image/png",
        "comment"=>"Imported from Lucidchart (do not deleted)");
    $addAttachmentBody= xmlrpc_encode_request(
        "confluence2.addAttachment",
        array("", $pageId, $attachmentMetaData ,$imageBytes));
     $this->_sendXMLRPCRequest($fullUrl, array(
        "Content-Type: text/xml",
        $auth_header),
        $addAttachmentBody);
...
}
Make API calls to attach diagram
function attachDocument() {
...
    $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId;
    $auth_header = $this->_getAuthHeader($fullUrl);
    xmlrpc_set_type($imageBytes, "base64");
    $attachmentMetaData = array("fileName"=>$attachmentName,
        "contentType"=>"image/png",
        "comment"=>"Imported from Lucidchart (do not deleted)");
    $addAttachmentBody= xmlrpc_encode_request(
        "confluence2.addAttachment",
        array("", $pageId, $attachmentMetaData ,$imageBytes));
     $this->_sendXMLRPCRequest($fullUrl, array(
        "Content-Type: text/xml",
        $auth_header),
        $addAttachmentBody);
...
}
Steps to create Lucidchart app
• Establish Trust
• Register App
• Implement General Page
• Implement macro
Macro
• Receive macro params
• Return HTML
 • Will be cached (caching header can be returned)
 • No CSS, inline styles or JavaScript
Macro : Receive macro params
function macro() {

  $userId = $_REQUEST['user_id'];
  $name = $_REQUEST['name'];
  $pageId = $_REQUEST['pageId'];
  $docId = $_REQUEST['id'];
  $width= $_REQUEST['width'];
  $height = $_REQUEST['height'];
  $align = $_REQUEST['align'];
  $outputType = $_REQUEST['ctx_output_type'];
...
Macro: Return HTML
<div style="float: “ . $align . "; margin: 0 auto; width: " . (intVal($width)
+ 2) . "px;">
    <img
      src=“$pageAttachment['url']”
      width=“$width”
      height=“$height”/>
    <div style="text-align: center">
      <a href='sign://"$host/editDocument/$docId?attachment= $name'>Edit
Diagram</a> |
      <a href=$baseUrl/plugins/servlet/remoteapps/lucidchart-
app/lucidAppRemove?page_id=$pageId&doc_id=$docId&attachment=$name'>Remove
Diagram</a>
    </div>
</div>
That‟s it!

Straightforward approach to get your
    app available for OnDemand
We‟re taking Apps to the next level
What if you could . . .
• Tap into our 12k+
  OnDemand customer base
• Register your app with one
  click
• Have full control over your
  app
If you want to integrate, call us!
• Currently targeted towards
  SaaS integrations
• Feature set in early stages   Diagram here
• Working on solution for
  “extensions”
You can finally integrate your site into OnDemand
with Remote Apps




     #summit12
Thank you!
Getting started


    https://remoteapps.jira.com

Mais conteúdo relacionado

Mais procurados

QuickConnect
QuickConnectQuickConnect
QuickConnect
Annu G
 
Rest Security with JAX-RS
Rest Security with JAX-RSRest Security with JAX-RS
Rest Security with JAX-RS
Frank Kim
 
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
Atlassian
 
Templates
TemplatesTemplates
Templates
soon
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
SPTechCon
 

Mais procurados (20)

AtlasCamp 2015: Connect everywhere - Cloud and Server
AtlasCamp 2015: Connect everywhere - Cloud and ServerAtlasCamp 2015: Connect everywhere - Cloud and Server
AtlasCamp 2015: Connect everywhere - Cloud and Server
 
Api Doc
Api DocApi Doc
Api Doc
 
Api Doc
Api DocApi Doc
Api Doc
 
JSF 2.0 Preview
JSF 2.0 PreviewJSF 2.0 Preview
JSF 2.0 Preview
 
Jsp
JspJsp
Jsp
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
QuickConnect
QuickConnectQuickConnect
QuickConnect
 
Rest Security with JAX-RS
Rest Security with JAX-RSRest Security with JAX-RS
Rest Security with JAX-RS
 
JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011JavaServer Faces 2.0 - JavaOne India 2011
JavaServer Faces 2.0 - JavaOne India 2011
 
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
Oleh Zasadnyy "Progressive Web Apps: line between web and native apps become ...
 
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
 
AtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using nowAtlasCamp 2015: Web technologies you should be using now
AtlasCamp 2015: Web technologies you should be using now
 
Presentation
PresentationPresentation
Presentation
 
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
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
 
The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)The Role of Python in SPAs (Single-Page Applications)
The Role of Python in SPAs (Single-Page Applications)
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
 
Templates
TemplatesTemplates
Templates
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
 

Destaque

Kahuna Corporate Profile
Kahuna Corporate ProfileKahuna Corporate Profile
Kahuna Corporate Profile
kahunasystems
 
Wayne’s Front Yard
Wayne’s Front YardWayne’s Front Yard
Wayne’s Front Yard
Linda Record
 
Strategies for Growth for Zenefits
Strategies for Growth for ZenefitsStrategies for Growth for Zenefits
Strategies for Growth for Zenefits
Abhishek Dale
 
Corporate Overview
Corporate OverviewCorporate Overview
Corporate Overview
Mike Peck
 

Destaque (18)

Jazz + Zenefits - Steps to a Successful Onboarding Process
Jazz + Zenefits - Steps to a Successful Onboarding Process Jazz + Zenefits - Steps to a Successful Onboarding Process
Jazz + Zenefits - Steps to a Successful Onboarding Process
 
Kahuna Corporate Profile
Kahuna Corporate ProfileKahuna Corporate Profile
Kahuna Corporate Profile
 
Lucidchart AWS Tools [Case Study]
Lucidchart AWS Tools [Case Study]Lucidchart AWS Tools [Case Study]
Lucidchart AWS Tools [Case Study]
 
Tkcis Corp Overview 2010
Tkcis Corp Overview 2010Tkcis Corp Overview 2010
Tkcis Corp Overview 2010
 
Mobi hub - Mobile Application Development Practice @ Kahuna Systems
Mobi hub - Mobile Application Development Practice @ Kahuna SystemsMobi hub - Mobile Application Development Practice @ Kahuna Systems
Mobi hub - Mobile Application Development Practice @ Kahuna Systems
 
Wayne’s Front Yard
Wayne’s Front YardWayne’s Front Yard
Wayne’s Front Yard
 
Lucidchart
LucidchartLucidchart
Lucidchart
 
Magenta Pigment Isolation From Fungus
Magenta Pigment Isolation From FungusMagenta Pigment Isolation From Fungus
Magenta Pigment Isolation From Fungus
 
Five Ways To Increase Email Engagement With Mobile Behavioral Data
Five Ways To Increase Email Engagement With Mobile Behavioral DataFive Ways To Increase Email Engagement With Mobile Behavioral Data
Five Ways To Increase Email Engagement With Mobile Behavioral Data
 
Strategies for Growth for Zenefits
Strategies for Growth for ZenefitsStrategies for Growth for Zenefits
Strategies for Growth for Zenefits
 
Sales Hacker Conference San Francisco - Sam Blond - What I Learned Scaling fr...
Sales Hacker Conference San Francisco - Sam Blond - What I Learned Scaling fr...Sales Hacker Conference San Francisco - Sam Blond - What I Learned Scaling fr...
Sales Hacker Conference San Francisco - Sam Blond - What I Learned Scaling fr...
 
The Future of Work – Workfront Leap 2016
The Future of Work – Workfront Leap 2016The Future of Work – Workfront Leap 2016
The Future of Work – Workfront Leap 2016
 
Corporate Overview
Corporate OverviewCorporate Overview
Corporate Overview
 
Nokia Corporate Overview 01jul08
Nokia Corporate Overview 01jul08Nokia Corporate Overview 01jul08
Nokia Corporate Overview 01jul08
 
Staco Energy: Corporate Overview
Staco Energy: Corporate OverviewStaco Energy: Corporate Overview
Staco Energy: Corporate Overview
 
SplunkLive! Customer Presentation--ServiceNow
SplunkLive! Customer Presentation--ServiceNowSplunkLive! Customer Presentation--ServiceNow
SplunkLive! Customer Presentation--ServiceNow
 
ZENworks 2017 - Overview
ZENworks 2017 - OverviewZENworks 2017 - Overview
ZENworks 2017 - Overview
 
App dynamics and servicenow v5
App dynamics and servicenow   v5App dynamics and servicenow   v5
App dynamics and servicenow v5
 

Semelhante a Plugins on OnDemand with Remote Apps - Atlassian Summit 2012

An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
Gavin Roy
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
Yared Ayalew
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & Extensions
Varun Raj
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 Platform
WSO2
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
Robert Nyman
 

Semelhante a Plugins on OnDemand with Remote Apps - Atlassian Summit 2012 (20)

An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Google app engine by example
Google app engine by exampleGoogle app engine by example
Google app engine by example
 
Parse Apps with Ember.js
Parse Apps with Ember.jsParse Apps with Ember.js
Parse Apps with Ember.js
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
Android networking-2
Android networking-2Android networking-2
Android networking-2
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
Chrome Devtools Protocol via Selenium/Appium (English)
Chrome Devtools Protocol via Selenium/Appium (English)Chrome Devtools Protocol via Selenium/Appium (English)
Chrome Devtools Protocol via Selenium/Appium (English)
 
Chrome Apps & Extensions
Chrome Apps & ExtensionsChrome Apps & Extensions
Chrome Apps & Extensions
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Daniel Kachakil - Android's Download Provider: Discovering and exploiting thr...
Daniel Kachakil - Android's Download Provider: Discovering and exploiting thr...Daniel Kachakil - Android's Download Provider: Discovering and exploiting thr...
Daniel Kachakil - Android's Download Provider: Discovering and exploiting thr...
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Rapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 PlatformRapid Application Development with WSO2 Platform
Rapid Application Development with WSO2 Platform
 
Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overview
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Web APIs & Apps - Mozilla
Web APIs & Apps - MozillaWeb APIs & Apps - Mozilla
Web APIs & Apps - Mozilla
 
20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final20141002 delapsley-socalangularjs-final
20141002 delapsley-socalangularjs-final
 
Building iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360FlexBuilding iPad apps with Flex - 360Flex
Building iPad apps with Flex - 360Flex
 
The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009The Open & Social Web - Kings of Code 2009
The Open & Social Web - Kings of Code 2009
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 

Mais de Atlassian

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
Atlassian
 

Mais de 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
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Plugins on OnDemand with Remote Apps - Atlassian Summit 2012

  • 1.
  • 2. Plugins on OnDemand with Remote Apps Don Brown Architect, Atlassian
  • 4. And now. . . • Over 12k active, 9k paid OnDemand accounts • 5 out of 10 add Greenhopper • 1.5 out of 10 add Bonfire • 1 out of 10 add Team Calendars . . . Instances
  • 6. But isn‟t it just a copy?
  • 7. Plugin Problems: Security <% String eid = request.getParameter("eid"); %> ... Employee ID: <%= eid %>
  • 8. Plugin Problems: Performance java.lang.OutOfMemoryError: Java heap space at org.apache.xerces.dom.DeferredDocumentImpl.createChunk(Unknown Source) at org.apache.xerces.dom.DeferredDocumentImpl.ensureCapacity(Unknown Source) at org.apache.xerces.dom.DeferredDocumentImpl.createNode(Unknown Source) at org.apache.xerces.dom.DeferredDocumentImpl.createDeferredEntityReference(Unknown Source) at org.apache.xerces.parsers.AbstractDOMParser.startGeneralEntity(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.startGeneralEntity(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.startEntity(Unknown Source) at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source
  • 10. Product Dev QA Everyone‟s Angry Admins Plugin Dev
  • 12. This is a Remote App key: app1 name: Remote App - app1 version: 1 • A single descriptor file display-url: http://example.com description: This app vendor: • Can be in XML, YAML, or JSON name: Atlassian url: http://atlassian.com • Contains permissions: permission: • App metadata - scope: browse_projects • Permissions general-page: - key: first • Extension points name: First url: /first
  • 13. Examples: General Page Plugin Steps Remote App Steps 1. Add web-item config 1. Add general-page config 2. Add servlet config 2. Implement URL 3. Code servlet 4. Try to get output decorated
  • 14. Examples: React to Event Plugin Steps Remote App Steps 1. Add component config 1. Add web-hook config 2. Dig through code to find 2. Implement URL event to listen for 3. Register for events 4. Handle event 5. Make sure to unregister
  • 15. Examples: Custom Macro Editor Plugin Steps Remote App Steps 1. Add web-resource and rest 1. Add custom-macro-editor config config 2. Find and call JavaScript 2. Implement URL API to override edit button 3. Create AUI dialog 4. Implement REST resources
  • 17. Apps: Dropbox by AppFusions • Share your documents • Written in Java, deployed at Contegix • Provides a custom page macro, and macro editor with MS Office edit
  • 18.
  • 19.
  • 20. Apps: TFS4JIRA by Spartez • Integrate JIRA with your Team Foundation Server • Written in Java, deployed at Heroku • Uses project and issue tabs, and an admin page
  • 21.
  • 23. Steps to create Lucidchart app • Establish Trust • Register App • Implement General Page • Implement macro
  • 25. Steps to create Lucidchart app • Establish Trust • Register App • Implement General Page • Implement macro
  • 26. Register the app • Receive from OnDemand as Request params: • OAuth consumer key • OAuth RSA public key • Base URL
  • 27. Register the app • Return to OnDemand description of the remote app • Can be in XML, JSON or YAML
  • 28. Provide OAuth consumer key and RSA public key <remote-app key=“xxxxxxx" name="Lucidchart" version="1" icon-url="http://www.lucidchart.com/favicon.ico" display-url="https://www.lucidchart.com/ondemand"> <vendor name="Lucidchart" url="http://www.lucidchart.com" /> <description>Lucidchart example</description> <oauth …> <public-key>yyyyyy</public-key> </oauth> ...
  • 29. Request permissions ... <permissions> <permission scope="read_users_and_groups" /> <permission scope="read_content" /> <permission scope="modify_attachments" /> <permission scope="modify_content" /> </permissions> ...
  • 30. General Page ... <general-page section="system.content.add/space" key="lucidAppGeneral" link-name="Lucidchart Diagram" name="Select or create a diagram" url="/doclist" width="1200" height="800" icon-url="/icon"> <description>Insert or Create a Lucidchart Diagram</description> <context-param name="page_id" /> </general-page> ...
  • 31. General Page ... <general-page section="system.content.add/space" key="lucidAppGeneral" link-name="Lucidchart Diagram" name="Select or create a diagram" url="/doclist" width="1200" height="800" icon-url="/icon"> <description>Insert or Create a Lucidchart Diagram</description> <context-param name="page_id" /> </general-page> ...
  • 32. General Page ... <general-page section="system.content.add/space" key="lucidAppGeneral" link-name="Lucidchart Diagram" name="Select or create a diagram" url="/doclist" width="1200" height="800" icon-url="/icon"> <description>Insert or Create a Lucidchart Diagram</description> <context-param name="page_id" /> </general-page> ...
  • 33. General Page ... <general-page section="system.content.add/space" key="lucidAppGeneral" link-name="Lucidchart Diagram" name="Select or create a diagram" url="/doclist" width="1200" height="800" icon-url="/icon"> <description>Insert or Create a Lucidchart Diagram</description> <context-param name="page_id" /> </general-page> ...
  • 34. Macro ... <macro key="lucidchart" url="/macro" output-type="block" body-type="none"> <description>Create a Lucidchart Diagram</description> <category name="development" /> <image-placeholder url="/imagePlaceHolder" width="140" height="140" apply- chrome="true"/> <parameters> <parameter name="width" title="Width" type="string" default=“700"/> <parameter name="height" title="Height (if blank, image ratio is preserved)" type="string" /> <parameter name="align" type="enum" default="Left"> <value name="Left"/> <value name="Right" /> </parameter> </parameters> </macro>
  • 35. Macro ... <macro key="lucidchart" url="/macro" output-type="block" body-type="none"> <description>Create a Lucidchart Diagram</description> <category name="development" /> <image-placeholder url="/imagePlaceHolder" width="140" height="140" apply- chrome="true"/> <parameters> <parameter name="width" title="Width" type="string" default=“700"/> <parameter name="height" title="Height (if blank, image ratio is preserved)" type="string" /> <parameter name="align" type="enum" default="Left"> <value name="Left"/> <value name="Right" /> </parameter> </parameters> </macro>
  • 36. Macro ... <macro key="lucidchart" url="/macro" output-type="block" body-type="none"> <description>Create a Lucidchart Diagram</description> <category name="development" /> <image-placeholder url="/imagePlaceHolder" width="140" height="140" apply-chrome="true"/> <parameters> <parameter name="width" title="Width" type="string" default=“700"/> <parameter name="height" title="Height (if blank, image ratio is preserved)" type="string" /> <parameter name="align" type="enum" default="Left"> <value name="Left"/> <value name="Right" /> </parameter> </parameters> </macro>
  • 37. Macro ... <macro key="lucidchart" url="/macro" output-type="block" body-type="none"> <description>Create a Lucidchart Diagram</description> <category name="development" /> <image-placeholder url="/imagePlaceHolder" width="140" height="140"/> <parameters> <parameter name="width" title="Width" type="string" default=“700"/> <parameter name="height" title="Height" type="string" /> <parameter name="align" type="enum" default="Left"> <value name="Left"/> <value name="Right" /> </parameter> </parameters> </macro>
  • 38. Steps to create Lucidchart app • Establish Trust • Register App • Implement General Page • Implement macro
  • 39. Any language can be used • Lucidchart is using PHP
  • 40. Add Diagram (general page) function doclist() { if (!$this->_hasValidOAuthSignature()) { $this->set("oauthValid", false); return; } $userId = @$_REQUEST['user_id']; $pageId = @$_REQUEST['page_id']; $redirectURL = "https://" . $_SERVER['SERVER_NAME'] . '/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId; $this->layout = „ondemand'; $this->set("baseUrl", $this->_getBaseURL()); $this->set("callback", urlencode($redirectURL)); }
  • 41. Add Diagram (general page) function doclist() { if (!$this->_hasValidOAuthSignature()) { $this->set("oauthValid", false); return; } $userId = @$_REQUEST['user_id']; $pageId = @$_REQUEST['page_id']; $redirectURL = "https://" . $_SERVER['SERVER_NAME'] . '/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId; $this->layout = „ondemand'; $this->set("baseUrl", $this->_getBaseURL()); $this->set("callback", urlencode($redirectURL)); }
  • 42. Add Diagram (general page) function doclist() { if (!$this->_hasValidOAuthSignature()) { $this->set("oauthValid", false); return; } $userId = @$_REQUEST['user_id']; $pageId = @$_REQUEST['page_id']; $redirectURL = "https://" . $_SERVER['SERVER_NAME'] . '/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId; $this->layout = „ondemand'; $this->set("baseUrl", $this->_getBaseURL()); $this->set("callback", urlencode($redirectURL)); }
  • 43. Add Diagram (general page) function doclist() { if (!$this->_hasValidOAuthSignature()) { $this->set("oauthValid", false); return; } $userId = @$_REQUEST['user_id']; $pageId = @$_REQUEST['page_id']; $redirectURL = "https://" . $_SERVER['SERVER_NAME'] . '/ondemand/attachDocument?page_id=' . $pageId . "&user_id=" . $userId; $this->layout = „ondemand'; $this->set("baseUrl", $this->_getBaseURL()); $this->set("callback", urlencode($redirectURL)); }
  • 44. Make API calls to attach diagram function attachDocument() { ... $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId; $auth_header = $this->_getAuthHeader($fullUrl); xmlrpc_set_type($imageBytes, "base64"); $attachmentMetaData = array("fileName"=>$attachmentName, "contentType"=>"image/png", "comment"=>"Imported from Lucidchart (do not deleted)"); $addAttachmentBody= xmlrpc_encode_request( "confluence2.addAttachment", array("", $pageId, $attachmentMetaData ,$imageBytes)); $this->_sendXMLRPCRequest($fullUrl, array( "Content-Type: text/xml", $auth_header), $addAttachmentBody); ... }
  • 45. Make API calls to attach diagram function attachDocument() { ... $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId; $auth_header = $this->_getAuthHeader($fullUrl); xmlrpc_set_type($imageBytes, "base64"); $attachmentMetaData = array("fileName"=>$attachmentName, "contentType"=>"image/png", "comment"=>"Imported from Lucidchart (do not deleted)"); $addAttachmentBody= xmlrpc_encode_request( "confluence2.addAttachment", array("", $pageId, $attachmentMetaData ,$imageBytes)); $this->_sendXMLRPCRequest($fullUrl, array( "Content-Type: text/xml", $auth_header), $addAttachmentBody); ... }
  • 46. Make API calls to attach diagram function attachDocument() { ... $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId; $auth_header = $this->_getAuthHeader($fullUrl); xmlrpc_set_type($imageBytes, "base64"); $attachmentMetaData = array("fileName"=>$attachmentName, "contentType"=>"image/png", "comment"=>"Imported from Lucidchart (do not deleted)"); $addAttachmentBody= xmlrpc_encode_request( "confluence2.addAttachment", array("", $pageId, $attachmentMetaData ,$imageBytes)); $this->_sendXMLRPCRequest($fullUrl, array( "Content-Type: text/xml", $auth_header), $addAttachmentBody); ... }
  • 47. Make API calls to attach diagram function attachDocument() { ... $fullUrl = $baseURL . "/rpc/xmlrpc?user_id=" . $userId; $auth_header = $this->_getAuthHeader($fullUrl); xmlrpc_set_type($imageBytes, "base64"); $attachmentMetaData = array("fileName"=>$attachmentName, "contentType"=>"image/png", "comment"=>"Imported from Lucidchart (do not deleted)"); $addAttachmentBody= xmlrpc_encode_request( "confluence2.addAttachment", array("", $pageId, $attachmentMetaData ,$imageBytes)); $this->_sendXMLRPCRequest($fullUrl, array( "Content-Type: text/xml", $auth_header), $addAttachmentBody); ... }
  • 48. Steps to create Lucidchart app • Establish Trust • Register App • Implement General Page • Implement macro
  • 49. Macro • Receive macro params • Return HTML • Will be cached (caching header can be returned) • No CSS, inline styles or JavaScript
  • 50. Macro : Receive macro params function macro() { $userId = $_REQUEST['user_id']; $name = $_REQUEST['name']; $pageId = $_REQUEST['pageId']; $docId = $_REQUEST['id']; $width= $_REQUEST['width']; $height = $_REQUEST['height']; $align = $_REQUEST['align']; $outputType = $_REQUEST['ctx_output_type']; ...
  • 51. Macro: Return HTML <div style="float: “ . $align . "; margin: 0 auto; width: " . (intVal($width) + 2) . "px;"> <img src=“$pageAttachment['url']” width=“$width” height=“$height”/> <div style="text-align: center"> <a href='sign://"$host/editDocument/$docId?attachment= $name'>Edit Diagram</a> | <a href=$baseUrl/plugins/servlet/remoteapps/lucidchart- app/lucidAppRemove?page_id=$pageId&doc_id=$docId&attachment=$name'>Remove Diagram</a> </div> </div>
  • 52. That‟s it! Straightforward approach to get your app available for OnDemand
  • 53. We‟re taking Apps to the next level
  • 54. What if you could . . . • Tap into our 12k+ OnDemand customer base • Register your app with one click • Have full control over your app
  • 55. If you want to integrate, call us! • Currently targeted towards SaaS integrations • Feature set in early stages Diagram here • Working on solution for “extensions”
  • 56. You can finally integrate your site into OnDemand with Remote Apps #summit12
  • 58. Getting started https://remoteapps.jira.com