Skip to content

Instantly share code, notes, and snippets.

View robertmassaioli's full-sized avatar

Robert Massaioli robertmassaioli

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<!-- jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- Atlassian User Interface (AUI) -->
<link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/5.7.0/css/aui.css" media="all">
<script src="//aui-cdn.atlassian.com/aui-adg/5.7.0/js/aui.js"></script>
</head>
{
"key": "com.atlassian.jira.static.tutorial.local",
"name": "Static Tutorial for JIRA (Local)",
"version": "1.0",
"description": "Provides a static example of an Atlassian Connect addon.",
"vendor": {
"name": "Your name",
"url": "http://www.your-site.com"
},
"baseUrl": "http://localhost:3311",
{
"generalPages": [
{
"url": "/hello-you.html",
"key": "hello-world",
"location": "system.top.navigation.bar",
"name": {
"value": "Click me"
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<!-- jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- Atlassian User Interface (AUI) -->
<link rel="stylesheet" href="//aui-cdn.atlassian.com/aui-adg/5.7.0/css/aui.css" media="all">
<script src="//aui-cdn.atlassian.com/aui-adg/5.7.0/js/aui.js"></script>
Utils = {};
Utils.getUrlParam = function (param, escape) {
try {
var regex = new RegExp(param + '=([^&]+)'),
data = regex.exec(window.location.search)[1];
// decode URI with plus sign fix.
return (escape) ? window.decodeURIComponent(data.replace(/\+/g, '%20')) : data;
} catch (e) {
return undefined;
// Verify that the request for this Atlassian Connect Web Panel has
// a valid JWT token from the Host Product
@FilterWith(JwtFilter.class)
public Result sayHello(Context context) {
// Get the tenant out of the Context (the tenant is provided by the JwtFilter)
final Tenant tenant = (Tenant) context.getAttribute(JwtFilter.ATLASSIAN_CONNECT_TENANT_ATTR);
// Pass the tenant baseUrl into the freemarker template as the variable productBaseUrl
return Results.html().render("productBaseUrl", tenant.baseUrl);
}

Definitions

Field Description
CK Exists The new client key in the lifecle event already exists in the database
BURL Missing The new base url does not exist in the database
BURL Different The new base url does exist in the database but the new client key from the request is different to the one in the database
BURL Same The new base url does exist in the database and the client key from the request is the same as the one in the database

The "CK Exists" is a boolean and the BURL is a ternary.

@robertmassaioli
robertmassaioli / hello.hs
Created March 12, 2016 22:02
A test github gist
-- Hello world
main = putStrLn "Hello World!"
@robertmassaioli
robertmassaioli / ImmutableMultimapCollector.java
Last active November 3, 2016 23:49
An ImmutableMultimapCollector in Java
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import java.util.Map;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collector;
@robertmassaioli
robertmassaioli / keybase.md
Created February 27, 2017 22:17
keybase.md

Keybase proof

I hereby claim:

  • I am robertmassaioli on github.
  • I am robertmassaioli (https://keybase.io/robertmassaioli) on keybase.
  • I have a public key ASDkmUxJumo_AiiSXiMSU8bxBjBg3o-9aR0GofRlAeM1Hwo

To claim this, I am signing this object: