SlideShare a Scribd company logo
7
Most read
13
Most read
14
Most read
Using ActiveObjects in Atlassian Plugins
Using ActiveObjects in Atlassian Plugins
Using ActiveObjects in
Atlassian Plugins
We don’t like databases either.




Ben Speakmon
Developer Relations, Atlassian

                                  2
Agenda

• What is ActiveObjects?
• Example
• Using it in your plugins
• Resources



                             3
What is ActiveObjects?
• Implements the Active Record pattern
• Models an object (entity) as a database table:
 • Object class name is the table name

 • Object field names are column names

 • Any single object instance is one row

• Exposes state methods -- persist object changes to
  database                                             4
Entity objects
import net.java.ao.Entity;   // adds getID() for primary key

public interface Page extends Entity {
  String getTitle();
  void setTitle(String title);

    ContentWrapper getBody();
    void setBody(ContentWrapper content);
}

                                                               5
ActiveObjects EntityManager
import com.atlassian.activeobjects.external.ActiveObjects as
ao;

// create an active object
Page page = ao.create(Page.class);
// retrieve an object from the DB by primary key
Page dbPage = ao.get(Page.class, 843);
// update the object
page.setTitle(“new title”);
// save the object, persisting properties to DB
page.save();
// make it go away                                             6
ao.delete(page);
More interesting things
// count all pages
int totalPages = ao.count(Page.class);
// find and retrieve all pages as objects
Page[] allPages = ao.find(Page.class);
// find pages based on title
Page[] filteredPages = ao.find(Page.class,
   Query.select().where(“title ~ ?”, “Documentation”));
// migrate DB schema based on updated object
Task dbMigrationTask = new PluginUpgradeTask() {
   ao.migrate(Page.class, BlogPost.class, Issue.class);
}
                                                          7
“   But I'm losing my edge to better-looking people
    with better ideas and more talent.

                                           ”
    And they're actually really, really nice.


                                        LCD Soundsystem,
                                         articulating our #1 fear




                                                                    8
ActiveObjects details
• Open source project on java.net
• Packaged as plugin for Atlassian products
 • ActiveObjects services imported as components

• Currently supports JIRA and Confluence
 • Bundled in JIRA 4.4, Confluence 4.0


                                                   9
Ego: Integration with
Atlassian products
• Uses the same DB the product uses; no additional
  configuration
• Transparent backup/restore
 • Tables are backed up/restored by same process as rest of
   product

• Each plugin client has a private table “space”
 • Plugins can’t share tables; use components instead         10
ActiveObjects in your plugin
<component-import key="ao" name="Active Objects service"
interface="com.atlassian.activeobjects.external.ActiveObjects"
>
  <description>Component to access Active Objects
functionality from the plugin</description>
</component-import>

<ao key="ao-module">
  <description>The module configuring the Active Objects
service used by this plugin</description>
  <entity>com.atlassian.summit.Page</entity>
</ao>                                                            11
ActiveObjects in your plugin
<dependency>
  <groupId>com.atlassian.activeobjects</groupId>
  <artifactId>activeobjects-plugin</artifactId>
  <version>0.9.7</version>
  <scope>provided</scope>
</dependency>




                                                   12
Wrap-up
• In-depth tutorial:
  atlss.in/AOGettingStarted
• Documentation:
  atlss.in/AODocumentation
• Plugin SDK:
  atlss.in/PluginSDK

                              13

More Related Content

KEY
All your data belong to us - The Active Objects Plugin
PDF
Build Amazing Add-ons for Atlassian JIRA and Confluence
PPTX
04 integrate entityframework
PPTX
02 integrate highchart
PPTX
06 integrate elasticsearch
PDF
Gradle - Build System
PPTX
OpenStack Horizon: Controlling the Cloud using Django
PPTX
01 startoff angularjs
All your data belong to us - The Active Objects Plugin
Build Amazing Add-ons for Atlassian JIRA and Confluence
04 integrate entityframework
02 integrate highchart
06 integrate elasticsearch
Gradle - Build System
OpenStack Horizon: Controlling the Cloud using Django
01 startoff angularjs

What's hot (20)

PDF
Apache Cayenne for WO Devs
PDF
COScheduler
PDF
Deployment of WebObjects applications on FreeBSD
PPT
Java EE revisits design patterns
PPTX
More Cache for Less Cash (DevLink 2014)
PPTX
Powershell For Developers
PDF
Practical ERSync
PPTX
Inside Azure Diagnostics (DevLink 2014)
PDF
Scala play-framework
PPTX
Windows Azure Mobile Services - The Perfect Partner
PPTX
SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...
PDF
Play framework
PPTX
Quick and Easy Development with Node.js and Couchbase Server
PPTX
Spring boot Introduction
PPTX
Apache Cayenne: a Java ORM Alternative
PDF
High-Performance Hibernate Devoxx France 2016
PPTX
More Cache for Less Cash
PDF
Google app-engine-cloudcamplagos2011
PDF
Advanced moduledevelopment d6_slideshare
PDF
Visualize Solr Data with Banana: Presented by Andrew Thanalertvisuti, Lucidworks
Apache Cayenne for WO Devs
COScheduler
Deployment of WebObjects applications on FreeBSD
Java EE revisits design patterns
More Cache for Less Cash (DevLink 2014)
Powershell For Developers
Practical ERSync
Inside Azure Diagnostics (DevLink 2014)
Scala play-framework
Windows Azure Mobile Services - The Perfect Partner
SenchaCon 2016: Upgrading an Ext JS 4.x Application to Ext JS 6.x - Mark Linc...
Play framework
Quick and Easy Development with Node.js and Couchbase Server
Spring boot Introduction
Apache Cayenne: a Java ORM Alternative
High-Performance Hibernate Devoxx France 2016
More Cache for Less Cash
Google app-engine-cloudcamplagos2011
Advanced moduledevelopment d6_slideshare
Visualize Solr Data with Banana: Presented by Andrew Thanalertvisuti, Lucidworks
Ad

Similar to Using ActiveObjects in Atlassian Plugins (20)

PDF
Using Atlassian UAL and ActiveObjects for Rapid Plugin Development - AtlasCam...
PDF
Rewriting a Plugin Architecture 3 Times to Harness the API Economy
PPTX
Developing for the Atlassian Ecosystem
PDF
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
PDF
Key points of good software programming
PDF
Oracle ADF Architecture TV - Development - Programming Best Practices
PDF
Java Tools and Techniques for Solving Tricky Problem
PDF
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
PDF
CollabSphere 2020 - ANA101 - Domino Application Strategy Key insights for suc...
PPTX
Introduction to DDD
PDF
Spring Persistence With Hibernate Ahmad Seddighi
PDF
State of the Ecosystem - Atlassian Summit 2010
PDF
SenthilkumarA_7
PPT
01 persistence and domain modeling
PPT
Importance Of Being Driven
PDF
Tips for Building your First XPages Java Application
PPT
Metamorphosis from Forms to Java: A technical lead's perspective, part II
PDF
Scaling Plugins in Critical Systems - Jon Mort
PDF
PPTX
A Beard, An App, A Blender
Using Atlassian UAL and ActiveObjects for Rapid Plugin Development - AtlasCam...
Rewriting a Plugin Architecture 3 Times to Harness the API Economy
Developing for the Atlassian Ecosystem
A Persistence Service for the OSGi Framework - Carl Rosenberger, Chief Softwa...
Key points of good software programming
Oracle ADF Architecture TV - Development - Programming Best Practices
Java Tools and Techniques for Solving Tricky Problem
How To Maintain Million Lines Of Open Source Code And Remain Sane or The Stor...
CollabSphere 2020 - ANA101 - Domino Application Strategy Key insights for suc...
Introduction to DDD
Spring Persistence With Hibernate Ahmad Seddighi
State of the Ecosystem - Atlassian Summit 2010
SenthilkumarA_7
01 persistence and domain modeling
Importance Of Being Driven
Tips for Building your First XPages Java Application
Metamorphosis from Forms to Java: A technical lead's perspective, part II
Scaling Plugins in Critical Systems - Jon Mort
A Beard, An App, A Blender
Ad

More from Atlassian (20)

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

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
cuic standard and advanced reporting.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
cuic standard and advanced reporting.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Electronic commerce courselecture one. Pdf

Using ActiveObjects in Atlassian Plugins

  • 3. Using ActiveObjects in Atlassian Plugins We don’t like databases either. Ben Speakmon Developer Relations, Atlassian 2
  • 4. Agenda • What is ActiveObjects? • Example • Using it in your plugins • Resources 3
  • 5. What is ActiveObjects? • Implements the Active Record pattern • Models an object (entity) as a database table: • Object class name is the table name • Object field names are column names • Any single object instance is one row • Exposes state methods -- persist object changes to database 4
  • 6. Entity objects import net.java.ao.Entity; // adds getID() for primary key public interface Page extends Entity { String getTitle(); void setTitle(String title); ContentWrapper getBody(); void setBody(ContentWrapper content); } 5
  • 7. ActiveObjects EntityManager import com.atlassian.activeobjects.external.ActiveObjects as ao; // create an active object Page page = ao.create(Page.class); // retrieve an object from the DB by primary key Page dbPage = ao.get(Page.class, 843); // update the object page.setTitle(“new title”); // save the object, persisting properties to DB page.save(); // make it go away 6 ao.delete(page);
  • 8. More interesting things // count all pages int totalPages = ao.count(Page.class); // find and retrieve all pages as objects Page[] allPages = ao.find(Page.class); // find pages based on title Page[] filteredPages = ao.find(Page.class, Query.select().where(“title ~ ?”, “Documentation”)); // migrate DB schema based on updated object Task dbMigrationTask = new PluginUpgradeTask() { ao.migrate(Page.class, BlogPost.class, Issue.class); } 7
  • 9. But I'm losing my edge to better-looking people with better ideas and more talent. ” And they're actually really, really nice. LCD Soundsystem, articulating our #1 fear 8
  • 10. ActiveObjects details • Open source project on java.net • Packaged as plugin for Atlassian products • ActiveObjects services imported as components • Currently supports JIRA and Confluence • Bundled in JIRA 4.4, Confluence 4.0 9
  • 11. Ego: Integration with Atlassian products • Uses the same DB the product uses; no additional configuration • Transparent backup/restore • Tables are backed up/restored by same process as rest of product • Each plugin client has a private table “space” • Plugins can’t share tables; use components instead 10
  • 12. ActiveObjects in your plugin <component-import key="ao" name="Active Objects service" interface="com.atlassian.activeobjects.external.ActiveObjects" >   <description>Component to access Active Objects functionality from the plugin</description> </component-import> <ao key="ao-module">   <description>The module configuring the Active Objects service used by this plugin</description>   <entity>com.atlassian.summit.Page</entity> </ao> 11
  • 13. ActiveObjects in your plugin <dependency>   <groupId>com.atlassian.activeobjects</groupId>   <artifactId>activeobjects-plugin</artifactId>   <version>0.9.7</version>   <scope>provided</scope> </dependency> 12
  • 14. Wrap-up • In-depth tutorial: atlss.in/AOGettingStarted • Documentation: atlss.in/AODocumentation • Plugin SDK: atlss.in/PluginSDK 13

Editor's Notes