46ef5a8cba5dc48fab1e0c3612ca94884c289677
[vfc/nfvo/wfengine.git] / winery / org.eclipse.winery.repository / src / main / webapp / jsp / entitytypes / implementations.jsp
1 <%--
2 /*******************************************************************************
3  * Copyright (c) 2012-2013 University of Stuttgart.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * and the Apache License 2.0 which both accompany this distribution,
7  * and are available at http://www.eclipse.org/legal/epl-v10.html
8  * and http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Contributors:
11  *    Oliver Kopp - initial API and implementation and/or initial documentation
12  *    Yves Schubert - switch to bootstrap 3
13  *******************************************************************************/
14 --%>
15 <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
16
17 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
18 <%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
19
20 <t:addComponentInstance
21         label="${it.typeStr} Implementation"
22         URL="${pageContext.request.contextPath}/${it.type}implementations/"
23         onSuccess="implementationsTableInfo.table.fnAddData([$(\"#addComponentInstanceForm :input[name='namespace']\").val(), $(\"#addComponentInstanceForm :input[name='name']\").val()]);"
24         type="${it.typeId.QName}"
25         openinnewwindow="false"
26         />
27
28 <script>
29 var implementationsTableInfo = {
30         id: '#implementationsTable'
31 };
32
33 require(["winery-support"], function(ws) {
34         ws.initTable(implementationsTableInfo, {
35                 "aoColumns": [
36                                                 { "sTitle": "namespace" },
37                                                 { "sTitle": "name" }
38                                         ],
39                 "aaData" : ${it.implementationsTableData}
40         });
41 });
42
43         function openImplementationEditor() {
44                 var namespace = implementationsTableInfo.table.fnGetData(implementationsTableInfo.selectedRow,0);
45                 var id = implementationsTableInfo.table.fnGetData(implementationsTableInfo.selectedRow,1);
46                 window.open("${pageContext.request.contextPath}/${it.type}implementations/" + encodeID(namespace) + "/" + encodeID(id), "_self");
47         }
48
49 </script>
50
51 <p>
52 This page shows implementations available for this type.
53 Go to <a href="${pageContext.request.contextPath}/other/">Other Elements</a> to get an overview on all implementations stored in this repository.
54 </p>
55
56         <div id="implementations">
57
58                 <button class="rightbutton btn btn-danger btn-xs" type="button" onclick="deleteOnServerAndInTable(implementationsTableInfo, '${it.typeStr} Implementation', '${pageContext.request.contextPath}/${it.type}implementations/', 1, 1, 0);">Remove</button>
59                 <button class="rightbutton btn btn-primary btn-xs" type="button" onclick="openNewCIdiag();">Add</button>
60                 <button class="rightbutton btn btn-default btn-xs" type="button" onclick="openImplementationEditor();">Edit</button>
61
62                 <table cellpadding="0" cellspacing="0" border="0" class="display" id="implementationsTable"></table>
63         </div>