Commits

Anonymous committed 6a9df8c

initial post of all the code

Comments (0)

Files changed (21)

+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
+  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.2/jaxb-api-2.2.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.2/jaxb-api-2.2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar" sourcepath="M2_REPO/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/plugins/atlassian-plugins-webresource/2.9.2/atlassian-plugins-webresource-2.9.2.jar" sourcepath="M2_REPO/com/atlassian/plugins/atlassian-plugins-webresource/2.9.2/atlassian-plugins-webresource-2.9.2-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/atlassian/plugins/atlassian-plugins-webresource/2.9.2/atlassian-plugins-webresource-2.9.2-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/plugins/atlassian-plugins-webfragment/2.13.2/atlassian-plugins-webfragment-2.13.2.jar" sourcepath="M2_REPO/com/atlassian/plugins/atlassian-plugins-webfragment/2.13.2/atlassian-plugins-webfragment-2.13.2-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/atlassian/plugins/atlassian-plugins-webfragment/2.13.2/atlassian-plugins-webfragment-2.13.2-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/plugins/atlassian-plugins-core/2.13.2/atlassian-plugins-core-2.13.2.jar" sourcepath="M2_REPO/com/atlassian/plugins/atlassian-plugins-core/2.13.2/atlassian-plugins-core-2.13.2-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/atlassian/plugins/atlassian-plugins-core/2.13.2/atlassian-plugins-core-2.13.2-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/org/slf4j/slf4j-api/1.6.4/slf4j-api-1.6.4-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/commons-lang/commons-lang/2.5/commons-lang-2.5-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/2.4/commons-io-2.4.jar" sourcepath="M2_REPO/commons-io/commons-io/2.4/commons-io-2.4-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.4/dom4j-1.4.jar" sourcepath="M2_REPO/dom4j/dom4j/1.4/dom4j-1.4-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/event/atlassian-event/2.2.1/atlassian-event-2.2.1.jar" sourcepath="M2_REPO/com/atlassian/event/atlassian-event/2.2.1/atlassian-event-2.2.1-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/atlassian/event/atlassian-event/2.2.1/atlassian-event-2.2.1-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/util/concurrent/atlassian-util-concurrent/2.4.1/atlassian-util-concurrent-2.4.1.jar" sourcepath="M2_REPO/com/atlassian/util/concurrent/atlassian-util-concurrent/2.4.1/atlassian-util-concurrent-2.4.1-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/atlassian/util/concurrent/atlassian-util-concurrent/2.4.1/atlassian-util-concurrent-2.4.1-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/10.0.1/guava-10.0.1.jar" sourcepath="M2_REPO/com/google/guava/guava/10.0.1/guava-10.0.1-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.3/commons-codec-1.3-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/templaterenderer/atlassian-template-renderer-api/1.3.1/atlassian-template-renderer-api-1.3.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/junit/junit/4.10/junit-4.10.jar" sourcepath="M2_REPO/junit/junit/4.10/junit-4.10-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/junit/junit/4.10/junit-4.10-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/sal/sal-api/2.7.1/sal-api-2.7.1.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.jar" sourcepath="M2_REPO/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/atlassian/plugins/atlassian-plugins-osgi-testrunner/1.1/atlassian-plugins-osgi-testrunner-1.1.jar" sourcepath="M2_REPO/com/atlassian/plugins/atlassian-plugins-osgi-testrunner/1.1/atlassian-plugins-osgi-testrunner-1.1-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/atlassian/plugins/atlassian-plugins-osgi-testrunner/1.1/atlassian-plugins-osgi-testrunner-1.1-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/org/apache/wink/wink-client/1.1.3-incubating/wink-client-1.1.3-incubating.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/wink/wink-common/1.1.3-incubating/wink-common-1.1.3-incubating.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.2.1.1/jaxb-impl-2.2.1.1.jar" sourcepath="M2_REPO/com/sun/xml/bind/jaxb-impl/2.2.1.1/jaxb-impl-2.2.1.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/geronimo/specs/geronimo-annotation_1.1_spec/1.0/geronimo-annotation_1.1_spec-1.0.jar" sourcepath="M2_REPO/org/apache/geronimo/specs/geronimo-annotation_1.1_spec/1.0/geronimo-annotation_1.1_spec-1.0-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/org/apache/geronimo/specs/geronimo-annotation_1.1_spec/1.0/geronimo-annotation_1.1_spec-1.0-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/com/google/code/gson/gson/2.2.2-atlassian-1/gson-2.2.2-atlassian-1.jar" sourcepath="M2_REPO/com/google/code/gson/gson/2.2.2-atlassian-1/gson-2.2.2-atlassian-1-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/com/google/code/gson/gson/2.2.2-atlassian-1/gson-2.2.2-atlassian-1-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.1/httpcore-4.1-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar">
+    <attributes>
+      <attribute value="jar:file:/Users/manthony/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-javadoc.jar!/" name="javadoc_location"/>
+    </attributes>
+  </classpathentry>
+  <classpathentry kind="var" path="M2_REPO/org/mockito/mockito-all/1.8.5/mockito-all-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-all/1.8.5/mockito-all-1.8.5-sources.jar"/>
+</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+  <name>helloAui</name>
+  <comment>This is the com.atlassian.tutorial:helloAui plugin for Atlassian Refapp. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>

.settings/org.eclipse.jdt.core.prefs

+#Sun Feb 03 13:32:06 PST 2013
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+To avoid future confusion, we recommend that you include a license with your plugin.
+This file is simply a reminder.
+
+For a template license you can have a look at: http://www.opensource.org/licenses/
+
+Atlassian releases most of its modules under the Apache2 license: http://opensource.org/licenses/Apache-2.0
+You have successfully created an Atlassian Plugin!
+
+Here are the SDK commands you'll use immediately:
+
+* atlas-run   -- installs this plugin into the product and starts it on localhost
+* atlas-debug -- same as atlas-run, but allows a debugger to attach at port 5005
+* atlas-cli   -- after atlas-run or atlas-debug, opens a Maven command line window:
+                 - 'pi' reinstalls the plugin into the running product instance
+* atlas-help  -- prints description for all commands in the SDK
+
+Full documentation is always available at:
+
+https://developer.atlassian.com/display/DOCS/Introduction+to+the+Atlassian+Plugin+SDK
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.atlassian.tutorial</groupId>
+	<artifactId>helloAui</artifactId>
+	<version>1.0-SNAPSHOT</version>
+	<organization>
+		<name>Example Company</name>
+		<url>http://www.example.com/</url>
+	</organization>
+	<name>helloAui</name>
+	<description>This is the com.atlassian.tutorial:helloAui plugin for Atlassian Refapp.</description>
+	<packaging>atlassian-plugin</packaging>
+	<dependencies>
+		<dependency>
+			<groupId>com.atlassian.plugins</groupId>
+			<artifactId>atlassian-plugins-webresource</artifactId>
+			<version>2.9.2</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.atlassian.templaterenderer</groupId>
+			<artifactId>atlassian-template-renderer-api</artifactId>
+			<version>1.3.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.10</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.4</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.atlassian.sal</groupId>
+			<artifactId>sal-api</artifactId>
+			<version>2.7.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-simple</artifactId>
+			<version>1.5.8</version>
+		</dependency>
+		<!-- WIRED TEST RUNNER DEPENDENCIES -->
+		<dependency>
+			<groupId>com.atlassian.plugins</groupId>
+			<artifactId>atlassian-plugins-osgi-testrunner</artifactId>
+			<version>${plugin.testrunner.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.ws.rs</groupId>
+			<artifactId>jsr311-api</artifactId>
+			<version>1.1.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>com.google.code.gson</groupId>
+			<artifactId>gson</artifactId>
+			<version>2.2.2-atlassian-1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.httpcomponents</groupId>
+			<artifactId>httpclient</artifactId>
+			<version>4.1.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mockito</groupId>
+			<artifactId>mockito-all</artifactId>
+			<version>1.8.5</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>com.atlassian.refapp</groupId>
+				<artifactId>atlassian-platform</artifactId>
+				<version>${refapp.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>com.atlassian.maven.plugins</groupId>
+				<artifactId>maven-refapp-plugin</artifactId>
+				<version>${amps.version}</version>
+				<extensions>true</extensions>
+				<configuration>
+					<productVersion>${refapp.version}</productVersion>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.6</source>
+					<target>1.6</target>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<properties>
+		<refapp.version>2.20.0-m2</refapp.version>
+		<amps.version>4.1.4</amps.version>
+		<plugin.testrunner.version>1.1</plugin.testrunner.version>
+	</properties>
+</project>

src/main/java/com/atlassian/tutorial/helloaui/MyPluginComponent.java

+package com.atlassian.tutorial.helloaui;
+
+public interface MyPluginComponent
+{
+    String getName();
+}

src/main/java/com/atlassian/tutorial/helloaui/MyPluginComponentImpl.java

+package com.atlassian.tutorial.helloaui;
+
+import com.atlassian.sal.api.ApplicationProperties;
+
+public class MyPluginComponentImpl implements MyPluginComponent
+{
+    private final ApplicationProperties applicationProperties;
+
+    public MyPluginComponentImpl(ApplicationProperties applicationProperties)
+    {
+        this.applicationProperties = applicationProperties;
+    }
+
+    public String getName()
+    {
+        if(null != applicationProperties)
+        {
+            return "myComponent:" + applicationProperties.getDisplayName();
+        }
+        
+        return "myComponent";
+    }
+}

src/main/java/com/atlassian/tutorial/servlet/MyServlet.java

+package com.atlassian.tutorial.servlet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+import com.atlassian.templaterenderer.TemplateRenderer;
+import com.atlassian.plugin.webresource.WebResourceManager;
+
+public class MyServlet extends HttpServlet{
+    private static final Logger log = LoggerFactory.getLogger(MyServlet.class);
+    private final TemplateRenderer templateRenderer;
+
+    private final WebResourceManager webResourceManager;
+	
+    public MyServlet(TemplateRenderer templateRenderer, WebResourceManager webResourceManager)
+        {
+            this.templateRenderer = templateRenderer;
+            this.webResourceManager = webResourceManager;
+        }
+
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+    {
+      this.webResourceManager.requireResource("com.atlassian.tutorial.helloAui:helloAui-resources");
+    	resp.setContentType("text/html;charset=utf-8");
+        templateRenderer.render("admin.vm", resp.getWriter());
+    }
+}

src/main/resources/admin.vm

+
+<html>
+  <head>
+    <title>MyServlet Admin</title>
+    <meta name="decorator" content="atl.general">
+  </head>
+
+<body class="aui-layout aui-theme-default">
+  			<header class="aui-page-header">
+  				<div class="aui-page-header-inner">
+  				  <div class="aui-page-header-main">
+  					<h1>Plugin Form</h1>
+  				 </div>
+  			  </div>
+  			</header>
+  <nav id="main-nav" class="aui-navgroup aui-navgroup-horizontal">
+	<div class="aui-navgroup-inner">
+		<div class="aui-navgroup-primary">
+		<ul class="aui-nav">
+			<li id="general-nav-item" class="aui-nav-selected"><a href="#">General</a></li>
+			<li id="advanced-nav-item"><a href="#">Advanced</a></li>
+		</ul>
+		</div>
+	</div>	
+</nav>
+<div class="aui-page-panel">
+	<div class="aui-page-panel-inner">
+		<section class="aui-page-panel-content">
+			<div class="nav-content" id="content-1">
+			<div id="aui-message-bar"></div>
+					<form class="aui" action="">
+	<div class="field-group">
+		<label class="label">First Name</label>
+		<input class="text" type="text">   
+	</div>
+	<div class="field-group">
+		<input class="text" type="text">
+		<label class="label">Last Name</label>
+	</div>
+	<div class="buttons-container">
+		<div class="buttons">
+			<input class="aui-button" id="submit-form" type="submit">
+		</div>
+	</div>
+</form>     
+			</div>
+			<div class="nav-content" id="content-2">
+					<div class="aui-message info">
+    <span class="aui-icon aui-icon-info">Info</span> 
+    This screen has not been built. This is a placeholder.
+</div>
+			</div>
+		</section>
+	</div>
+</div>
+  </body>
+</html>

src/main/resources/atlassian-plugin.xml

+<?xml version="1.0" encoding="UTF-8"?>
+
+<atlassian-plugin key="${project.groupId}.${project.artifactId}" name="${project.name}" plugins-version="2">
+  <plugin-info>
+    <description>${project.description}</description>
+    <version>${project.version}</version>
+    <vendor name="${project.organization.name}" url="${project.organization.url}"/>
+    <param name="plugin-icon">images/pluginIcon.png</param>
+    <param name="plugin-logo">images/pluginLogo.png</param>
+  </plugin-info>
+  <!-- add our i18n resource -->
+  <resource type="i18n" name="i18n" location="helloAui"/>
+  <!-- add our web resources -->
+  <web-resource key="helloAui-resources" name="helloAui Web Resources">
+    <dependency>com.atlassian.auiplugin:ajs</dependency>
+    <resource type="download" name="helloAui.css" location="/css/helloAui.css"/>
+    <resource type="download" name="helloAui.js" location="/js/helloAui.js"/>
+    <resource type="download" name="images/" location="/images"/>
+    <context>helloAui</context>
+  </web-resource>
+  <!-- publish our component -->
+  <component key="myPluginComponent" class="com.atlassian.tutorial.helloaui.MyPluginComponentImpl" public="true">
+    <interface>com.atlassian.tutorial.helloaui.MyPluginComponent</interface>
+  </component>
+  <!-- import from the product container -->
+  <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties"/>
+   <component-import key="templateRenderer" interface="com.atlassian.templaterenderer.TemplateRenderer" filter=""/>
+  <servlet name="My Servlet" i18n-name-key="my-servlet.name" key="my-servlet" class="com.atlassian.tutorial.servlet.MyServlet">
+    <description key="my-servlet.description">The My Servlet Plugin</description>
+    <url-pattern>/myservlet</url-pattern>
+  </servlet>
+</atlassian-plugin>
Add a comment to this file

src/main/resources/css/helloAui.css

Empty file added.

src/main/resources/helloAui.properties

+#put any key/value pairs here
+my.plugin.name=MyPlugin
+my-servlet.name=My Servlet
+my-servlet.description=The My Servlet Plugin
Add a comment to this file

src/main/resources/images/pluginIcon.png

Added
New image
Add a comment to this file

src/main/resources/images/pluginLogo.png

Added
New image

src/main/resources/js/helloAui.js

+AJS.$(function(){
+    AJS.$("#content-2").hide();
+    AJS.$("#general-nav-item").click(function(e){
+        navigateTo(e.target, "content-1");
+    });
+    AJS.$("#advanced-nav-item").click(function(e){
+        navigateTo(e.target, "content-2");
+    });
+    function navigateTo(trigger, contentId){
+        AJS.$("#main-nav li").removeClass("aui-nav-selected");
+        AJS.$(trigger).parent().addClass("aui-nav-selected");
+        AJS.$(".nav-content").hide();
+        AJS.$("#" + contentId).show();
+    }
+})
+
+AJS.$(function(){
+  AJS.$("#submit-form").click(function(e){    
+  e.preventDefault();
+    AJS.messages.success({
+       title: "Saved!",
+       body: "That was great fun! Thank you."
+    }); 
+  });
+});

src/test/java/it/com/atlassian/tutorial/helloaui/MyComponentWiredTest.java

+package it.com.atlassian.tutorial.helloaui;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import com.atlassian.plugins.osgi.test.AtlassianPluginsTestRunner;
+import com.atlassian.tutorial.helloaui.MyPluginComponent;
+import com.atlassian.sal.api.ApplicationProperties;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(AtlassianPluginsTestRunner.class)
+public class MyComponentWiredTest
+{
+    private final ApplicationProperties applicationProperties;
+    private final MyPluginComponent myPluginComponent;
+
+    public MyComponentWiredTest(ApplicationProperties applicationProperties,MyPluginComponent myPluginComponent)
+    {
+        this.applicationProperties = applicationProperties;
+        this.myPluginComponent = myPluginComponent;
+    }
+
+    @Test
+    public void testMyName()
+    {
+        assertEquals("names do not match!", "myComponent:" + applicationProperties.getDisplayName(),myPluginComponent.getName());
+    }
+}

src/test/java/it/com/atlassian/tutorial/servlet/MyServletFuncTest.java

+package it.com.atlassian.tutorial.servlet;
+
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.ResponseHandler;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.BasicResponseHandler;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.junit.Test;
+import org.junit.After;
+import org.junit.Before;
+
+import java.io.IOException;
+
+import static org.junit.Assert.*;
+
+
+public class MyServletFuncTest {
+
+    HttpClient httpClient;
+    String baseUrl;
+    String servletUrl;
+
+    @Before
+    public void setup() {
+        httpClient = new DefaultHttpClient();
+        baseUrl = System.getProperty("baseurl");
+        servletUrl = baseUrl + "/plugins/servlet/myservlet";
+    }
+
+    @After
+    public void tearDown() {
+        httpClient.getConnectionManager().shutdown();
+    }
+
+    @Test
+    public void testSomething() throws IOException {
+        HttpGet httpget = new HttpGet(servletUrl);
+
+        // Create a response handler
+        ResponseHandler<String> responseHandler = new BasicResponseHandler();
+        String responseBody = httpClient.execute(httpget, responseHandler);
+        assertTrue(null != responseBody && !"".equals(responseBody));
+    }
+}

src/test/java/ut/com/atlassian/tutorial/helloaui/MyComponentUnitTest.java

+package ut.com.atlassian.tutorial.helloaui;
+
+import org.junit.Test;
+import com.atlassian.tutorial.helloaui.MyPluginComponent;
+import com.atlassian.tutorial.helloaui.MyPluginComponentImpl;
+
+import static org.junit.Assert.assertEquals;
+
+public class MyComponentUnitTest
+{
+    @Test
+    public void testMyName()
+    {
+        MyPluginComponent component = new MyPluginComponentImpl(null);
+        assertEquals("names do not match!", "myComponent",component.getName());
+    }
+}

src/test/java/ut/com/atlassian/tutorial/servlet/MyServletTest.java

+package ut.com.atlassian.tutorial.servlet;
+
+import org.junit.Test;
+import org.junit.After;
+import org.junit.Before;
+import org.mockito.Mockito;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+public class MyServletTest {
+
+    HttpServletRequest mockRequest;
+    HttpServletResponse mockResponse;
+
+    @Before
+    public void setup() {
+        mockRequest = mock(HttpServletRequest.class);
+        mockResponse = mock(HttpServletResponse.class);
+    }
+
+    @After
+    public void tearDown() {
+
+    }
+
+    @Test
+    public void testSomething() {
+        String expected = "test";
+        when(mockRequest.getParameter(Mockito.anyString())).thenReturn(expected);
+        assertEquals(expected,mockRequest.getParameter("some string"));
+
+    }
+}

src/test/resources/atlassian-plugin.xml

+<atlassian-plugin key="${project.groupId}.${project.artifactId}-tests" name="${project.name}" plugins-version="2">
+    <plugin-info>
+        <description>${project.description}</description>
+        <version>${project.version}</version>
+        <vendor name="${project.organization.name}" url="${project.organization.url}" />
+    </plugin-info>
+
+    <!-- from our base plugin -->
+    <component-import key="myComponent" interface="com.atlassian.tutorial.helloaui.MyPluginComponent"/>
+
+    <!-- from the product container -->
+    <component-import key="applicationProperties" interface="com.atlassian.sal.api.ApplicationProperties" />
+    
+</atlassian-plugin>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.