--- /dev/null
+<%--\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
<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
--- /dev/null
+/*\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
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
*/\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
\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
--- /dev/null
+/*\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