ui sketch
authorEugene Petrenko <eugene.petrenko@gmail.com>
Wed, 10 Aug 2011 21:19:13 +0000 (01:19 +0400)
committerEugene Petrenko <eugene.petrenko@gmail.com>
Wed, 10 Aug 2011 21:19:13 +0000 (01:19 +0400)
nuget-server/resources/tool/tools.jsp [new file with mode: 0644]
nuget-server/src/META-INF/build-server-plugin-nuget.xml
nuget-server/src/jetbrains/buildServer/nuget/server/toolRegistry/impl/NuGetToolManagerImpl.java [new file with mode: 0644]
nuget-server/src/jetbrains/buildServer/nuget/server/toolRegistry/tab/ServerSettingsController.java
nuget-server/src/jetbrains/buildServer/nuget/server/toolRegistry/tab/ToolsModel.java [new file with mode: 0644]

diff --git a/nuget-server/resources/tool/tools.jsp b/nuget-server/resources/tool/tools.jsp
new file mode 100644 (file)
index 0000000..b1a5461
--- /dev/null
@@ -0,0 +1,52 @@
+<%--\r
+  ~ Copyright 2000-2011 JetBrains s.r.o.\r
+  ~\r
+  ~ Licensed under the Apache License, Version 2.0 (the "License");\r
+  ~ you may not use this file except in compliance with the License.\r
+  ~ You may obtain a copy of the License at\r
+  ~\r
+  ~ http://www.apache.org/licenses/LICENSE-2.0\r
+  ~\r
+  ~ Unless required by applicable law or agreed to in writing, software\r
+  ~ distributed under the License is distributed on an "AS IS" BASIS,\r
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  ~ See the License for the specific language governing permissions and\r
+  ~ limitations under the License.\r
+  --%>\r
+<%@ include file="/include-internal.jsp" %>\r
+<jsp:useBean id="tools" type="jetbrains.buildServer.nuget.server.toolRegistry.tab.ToolsModel" scope="request"/>\r
+\r
+<h3>Installed NuGet Versions</h3>\r
+<c:choose>\r
+  <c:when test="${fn:length(tools.installed) eq 0}">\r
+    No NuGet packages installed\r
+  </c:when>\r
+  <c:otherwise>\r
+    <c:forEach var="tool" items="${tools.installed}">\r
+      <div>\r
+        NuGet version: <c:out value="${tool.version}"/>\r
+      </div>\r
+    </c:forEach>\r
+  </c:otherwise>\r
+</c:choose>\r
+<div class="addNew"><a href="#">Download NuGet</a></div>\r
+<div class="addNew"><a href="#">Install custom NuGet.exe</a></div>\r
+\r
+\r
+<%--\r
+<h3>Available NuGet Versions</h3>\r
+<c:choose>\r
+  <c:when test="${tools.toolsToInstallComputed}">\r
+    <c:forEach var="tool" items="${tools.toolsToInstall}">\r
+      <div>\r
+        NuGet version: <c:out value="${tool.version}"/> <a href="#" class="addNew">Install</a>\r
+      </div>\r
+    </c:forEach>\r
+  </c:when>\r
+  <c:otherwise>\r
+\r
+  </c:otherwise>\r
+</c:choose>\r
+\r
+\r
+--%>\r
index 55053c94901460975e58a65d647c7d953228a810..743841ad1f847f477da3bd45a95048a4de508b42 100644 (file)
@@ -35,4 +35,6 @@
   <bean class="jetbrains.buildServer.nuget.server.toolRegistry.tab.PermissionChecker"/>\r
   <bean class="jetbrains.buildServer.nuget.server.toolRegistry.tab.ServerSettingsTab"/>\r
   <bean class="jetbrains.buildServer.nuget.server.toolRegistry.tab.ServerSettingsController"/>\r
+\r
+  <bean class="jetbrains.buildServer.nuget.server.toolRegistry.impl.NuGetToolManagerImpl"/>\r
 </beans>
\ No newline at end of file
diff --git a/nuget-server/src/jetbrains/buildServer/nuget/server/toolRegistry/impl/NuGetToolManagerImpl.java b/nuget-server/src/jetbrains/buildServer/nuget/server/toolRegistry/impl/NuGetToolManagerImpl.java
new file mode 100644 (file)
index 0000000..f19bb7f
--- /dev/null
@@ -0,0 +1,47 @@
+/*\r
+ * Copyright 2000-2011 JetBrains s.r.o.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package jetbrains.buildServer.nuget.server.toolRegistry.impl;\r
+\r
+import jetbrains.buildServer.nuget.server.toolRegistry.*;\r
+import org.jetbrains.annotations.NotNull;\r
+\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+\r
+/**\r
+ * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * Date: 11.08.11 1:07\r
+ */\r
+public class NuGetToolManagerImpl implements NuGetToolManager {\r
+  @NotNull\r
+  public Collection<NuGetInstalledTool> getInstalledTools() {\r
+    return Collections.emptyList();\r
+  }\r
+\r
+  @NotNull\r
+  public Collection<NuGetTool> getAvailableTools() {\r
+    return Collections.emptyList();\r
+  }\r
+\r
+  public void installTool(@NotNull NuGetTool tool, @NotNull ActionProgress progress) {\r
+\r
+  }\r
+\r
+  public void registerCustomTool(@NotNull NuGetUserTool tool, @NotNull ActionProgress progress) {\r
+\r
+  }\r
+}\r
index 19bd79baa3e0c94a678cfdf5356846400f96c20d..af6fd930b65ab2c1918c9ba68a98cb431e7c8926 100644 (file)
@@ -19,6 +19,7 @@ package jetbrains.buildServer.nuget.server.toolRegistry.tab;
 import jetbrains.buildServer.controllers.AuthorizationInterceptor;\r
 import jetbrains.buildServer.controllers.BaseController;\r
 import jetbrains.buildServer.controllers.RequestPermissionsChecker;\r
+import jetbrains.buildServer.nuget.server.toolRegistry.NuGetToolManager;\r
 import jetbrains.buildServer.serverSide.SBuildServer;\r
 import jetbrains.buildServer.serverSide.auth.AccessDeniedException;\r
 import jetbrains.buildServer.serverSide.auth.AuthorityHolder;\r
@@ -36,13 +37,18 @@ import javax.servlet.http.HttpServletResponse;
  */\r
 public class ServerSettingsController extends BaseController {\r
   private final String myPath;\r
+  private final NuGetToolManager myToolsManager;\r
+  private final PluginDescriptor myDescriptor;\r
 \r
   public ServerSettingsController(@NotNull final SBuildServer server,\r
                                   @NotNull final AuthorizationInterceptor auth,\r
                                   @NotNull final PermissionChecker checker,\r
                                   @NotNull final WebControllerManager web,\r
+                                  @NotNull final NuGetToolManager toolsManager,\r
                                   @NotNull final PluginDescriptor descriptor) {\r
     super(server);\r
+    myToolsManager = toolsManager;\r
+    myDescriptor = descriptor;\r
     myPath = descriptor.getPluginResourcesPath("tool/nuget-server-tab.html");\r
     auth.addPathBasedPermissionsChecker(myPath, new RequestPermissionsChecker() {\r
       public void checkPermissions(@NotNull AuthorityHolder authorityHolder, @NotNull HttpServletRequest request) throws AccessDeniedException {\r
@@ -59,6 +65,8 @@ public class ServerSettingsController extends BaseController {
 \r
   @Override\r
   protected ModelAndView doHandle(HttpServletRequest request, HttpServletResponse response) throws Exception {\r
-    return simpleView("Empty nuget tab content");\r
+    ModelAndView mv = new ModelAndView(myDescriptor.getPluginResourcesPath("tool/tools.jsp"));\r
+    mv.getModelMap().put("tools", new ToolsModel());\r
+    return mv;\r
   }\r
 }\r
diff --git a/nuget-server/src/jetbrains/buildServer/nuget/server/toolRegistry/tab/ToolsModel.java b/nuget-server/src/jetbrains/buildServer/nuget/server/toolRegistry/tab/ToolsModel.java
new file mode 100644 (file)
index 0000000..2221b9a
--- /dev/null
@@ -0,0 +1,43 @@
+/*\r
+ * Copyright 2000-2011 JetBrains s.r.o.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package jetbrains.buildServer.nuget.server.toolRegistry.tab;\r
+\r
+import jetbrains.buildServer.nuget.server.toolRegistry.NuGetInstalledTool;\r
+import jetbrains.buildServer.nuget.server.toolRegistry.NuGetTool;\r
+import org.jetbrains.annotations.NotNull;\r
+\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+\r
+/**\r
+ * Created by Eugene Petrenko (eugene.petrenko@gmail.com)\r
+ * Date: 11.08.11 0:58\r
+ */\r
+public class ToolsModel {\r
+  @NotNull\r
+  public Collection<NuGetInstalledTool> getInstalled() {\r
+    return Collections.emptyList();\r
+  }\r
+\r
+  public boolean isToolsToInstallComputed() {\r
+    return false;\r
+  }\r
+\r
+  public Collection<NuGetTool> getToolsToInstall() {\r
+    return Collections.emptyList();\r
+  }\r
+}\r