Commits

Anonymous committed ffb7e34

updating with new vm naming

Comments (0)

Files changed (6)

.DS_Store

Binary file added.
 	<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>

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

 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.atlassian.templaterenderer.TemplateRenderer;
+import com.atlassian.plugin.webresource.WebResourceManager;
+
 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;
 
-public class MyServlet extends HttpServlet{
-    private static final Logger log = LoggerFactory.getLogger(MyServlet.class);
-    private final TemplateRenderer templateRenderer;
+	private final WebResourceManager webResourceManager;
 
-    private final WebResourceManager webResourceManager;
-	
-    public MyServlet(TemplateRenderer templateRenderer, WebResourceManager webResourceManager)
-        {
-            this.templateRenderer = templateRenderer;
-            this.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());
-    }
+	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("helloaui.vm", resp.getWriter());
+	}
 }

src/main/resources/atlassian-plugin.xml

   </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=""/>
+     <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>

src/main/resources/helloaui.vm

+<html>
+<head>
+    <title>MyServlet Admin</title>
+    <meta name="decorator" content="atl.general">
+</head>
+<body>
+    <header class="aui-page-header">
+        <div class="aui-page-header-inner">
+            <h2>Plugin Page</h2>
+        </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/js/helloAui.js

 AJS.$(function(){
+  AJS.$("#submit-form").click(function(e){    
+  e.preventDefault();
+    AJS.messages.success({
+       title: "Saved!",
+       body: "That was great fun! Thank you."
+    }); 
+  });
+});
+AJS.$(function(){
     AJS.$("#content-2").hide();
     AJS.$("#general-nav-item").click(function(e){
         navigateTo(e.target, "content-1");
         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."
-    }); 
-  });
-});
+})