aboutsummaryrefslogtreecommitdiffstats
path: root/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes
diff options
context:
space:
mode:
authorhuangjian <huang.jian12@zte.com.cn>2016-08-31 16:47:33 +0800
committerhuangjian <huang.jian12@zte.com.cn>2016-08-31 16:47:33 +0800
commitfa49e78cc199526a9e33b59c5194f8e3bf0f0952 (patch)
tree3478e867a8f304266dbceca6e992cceca410ede4 /winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes
parent159d40f0011559c8f82338b29dca1bffd700f2c8 (diff)
Add winery source code
Change-Id: I1c5088121d79b71098c3cba1996c6f784737532e Issue-id: TOSCA-49 Signed-off-by: huangjian <huang.jian12@zte.com.cn>
Diffstat (limited to 'winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes')
-rw-r--r--winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/relationshiptype.jsp44
-rw-r--r--winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/validendings.jsp39
-rw-r--r--winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/visualappearance.jsp193
3 files changed, 276 insertions, 0 deletions
diff --git a/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/relationshiptype.jsp b/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/relationshiptype.jsp
new file mode 100644
index 0000000..ba2e6cc
--- /dev/null
+++ b/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/relationshiptype.jsp
@@ -0,0 +1,44 @@
+<%--
+/*******************************************************************************
+ * Copyright (c) 2012-2013 University of Stuttgart.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * Oliver Kopp - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+--%>
+<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
+
+<%@page import="org.eclipse.winery.repository.resources.SubMenuData"%>
+
+<%
+java.util.List<SubMenuData> subMenus = new java.util.ArrayList<SubMenuData>();
+
+SubMenuData data;
+
+data = new SubMenuData("#visualappearance", "Visual Appearance");
+subMenus.add(data);
+
+data = new SubMenuData("#instancestates", "Instance States");
+subMenus.add(data);
+
+data = new SubMenuData("#sourceinterfaces", "Source Interfaces");
+subMenus.add(data);
+
+data = new SubMenuData("#targetinterfaces", "Target Interfaces");
+subMenus.add(data);
+
+data = new SubMenuData("#validendings", "Valid Sources and Targets");
+subMenus.add(data);
+
+data = new SubMenuData("#implementations", "Implementations");
+subMenus.add(data);
+
+%>
+
+<t:entitytype cssClass="relationshipType" selected="RelationshipType" subMenus="<%=subMenus%>" twolines="true">
+</t:entitytype>
diff --git a/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/validendings.jsp b/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/validendings.jsp
new file mode 100644
index 0000000..4bf2145
--- /dev/null
+++ b/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/validendings.jsp
@@ -0,0 +1,39 @@
+<%--
+/*******************************************************************************
+ * Copyright (c) 2012-2013 University of Stuttgart.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * Oliver Kopp - initial API and implementation and/or initial documentation
+ * Yves Schubert - switch to bootstrap 3
+ *******************************************************************************/
+--%>
+<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
+<%@taglib prefix="rt" tagdir="/WEB-INF/tags/relationshiptype" %>
+
+<h4>Valid Source</h4>
+<input type="radio" name="SourceKind">Node Type:</input>
+<rt:validnodetypeendingsselect shortName="source" currentSelection="${it.validSource}" possibleValidEndings="${it.possibleValidEndings}">
+</rt:validnodetypeendingsselect>
+<br/>
+<input type="radio" name="SourceKind">Requirement Type:</input>
+<select>
+ <option>Not yet implemented. Please edit in the XML view</option>
+</select>
+
+
+<br/>
+<br/>
+<h4>Valid Target</h4>
+<input type="radio" name="TargetKind">Node Type:</input>
+<rt:validnodetypeendingsselect shortName="target" currentSelection="${it.validTarget}" possibleValidEndings="${it.possibleValidEndings}">
+</rt:validnodetypeendingsselect>
+<br/>
+<input type="radio" name="TargetKind">Capability Type:</input>
+<select>
+ <option>Not yet implemented. Please edit in the XML view</option>
+</select>
diff --git a/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/visualappearance.jsp b/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/visualappearance.jsp
new file mode 100644
index 0000000..d30ea01
--- /dev/null
+++ b/winery/org.eclipse.winery.repository/src/main/webapp/jsp/entitytypes/relationshiptypes/visualappearance.jsp
@@ -0,0 +1,193 @@
+<%--
+/*******************************************************************************
+ * Copyright (c) 2012-2013 University of Stuttgart.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and the Apache License 2.0 which both accompany this distribution,
+ * and are available at http://www.eclipse.org/legal/epl-v10.html
+ * and http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Contributors:
+ * Oliver Kopp - initial API and implementation and/or initial documentation
+ * Yves Schubert - switch to bootstrap 3
+ *******************************************************************************/
+--%>
+<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
+
+<script type='text/javascript' src='${pageContext.request.contextPath}/components/raphael/raphael.js'></script>
+<script type='text/javascript' src='${pageContext.request.contextPath}/components/colorwheel/javascripts/colorwheel.js'></script>
+
+<ul class="nav nav-tabs" id="myTab">
+ <li class="active"><a href="#icon">Icon</a></li>
+ <li><a href="#colors">Colors</a></li>
+ <li><a href="#arrow">Arrow</a></li>
+</ul>
+
+<div class="tab-content">
+ <div class="tab-pane active" id="icon">
+ <br />
+ <t:imageUpload
+ label="Icon (16x16) used in palette"
+ URL="visualappearance/16x16"
+ id="upSmall"
+ width="16px"
+ resize="16"
+ accept="image/*"/>
+ </div>
+
+ <div class="tab-pane" id="colors">
+ <br />
+ <form>
+ <fieldset>
+ <t:colorwheel label="Line Color" color="${it.color}" id="color" url="color" />
+ <t:colorwheel label="Hover Color" color="${it.hoverColor}" id="hovercolor" url="hovercolor" />
+ </fieldset>
+ </form>
+ </div>
+
+ <div class="tab-pane" id="arrow">
+ <br />
+ <form>
+ <fieldset>
+ <div class="form-group">
+ <label for="arrow">Arrow appearance</label>
+ <div style="width:100%" id="arrow">
+ <div style="float:left; width:50px;">
+ <!-- Same values as the beginning of the file names in src\main\webapp\images\relationshiptype -->
+ <select id="dropDownSourceHead">
+ <option value="none"></option>
+ <option value="PlainArrow"></option>
+ <option value="Diamond"></option>
+ <!-- not yet supported
+ <option value="simpleArrow"></option>
+ <option value="doubleArrow"></option>
+ <option value="circle"></option>
+ <option value="square"></option> -->
+ </select>
+ </div>
+ <div style="float:left; width:80px;">
+ <select id="lineSelect">
+ <option value="plain"></option>
+ <option value="dotted"></option>
+ <option value="dotted2"></option>
+ </select>
+ </div>
+ <div style="float:left; width:50px;">
+ <select id="dropDownTargetHead">
+ <option value="none"></option>
+ <option value="PlainArrow"></option>
+ <option value="Diamond"></option>
+ <!-- not yet supported
+ <option value="simpleArrow"></option>
+ <option value="doubleArrow"></option>
+ <option value="circle"></option>
+ <option value="square"></option> -->
+ </select>
+ </div>
+ </div>
+ </div>
+ </fieldset>
+ </form>
+ </div>
+</div>
+
+<script>
+$('#myTab a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+});
+
+/**
+ * @param sourceOrTarget "Source" or "Target"
+ */
+function formatArrow(config, sourceOrTarget) {
+ var path = "${pageContext.request.contextPath}/images/relationshiptype/" + config.id + sourceOrTarget + ".png";
+ return "<img src='" + path +"' />";
+}
+
+var globalAJAXParamsForSelect2VisualAppearance = {
+ type : "PUT",
+ contentType : "text/plain",
+ success : function() {
+ vShowSuccess("Successfully updated arrow appearance");
+ },
+ error : function(jqXHR, textStatus, errorThrown) {
+ vShowAJAXError("Could not supdate arrow appearance", jqXHR, errorThrown);
+ }
+}
+
+/* source arrow head */
+
+function formatArrowSource(config) {
+ return formatArrow(config, "Source");
+}
+
+// set stored value
+$("#dropDownSourceHead").val("${it.sourceArrowHead}")
+// enable storage on change of element
+.on("change", function(e) {
+ params = globalAJAXParamsForSelect2VisualAppearance;
+ params.url = "visualappearance/sourcearrowhead";
+ params.data = e.val;
+ $.ajax(params);
+})
+// make the selection box show arrows
+.select2({
+ formatResult: formatArrowSource,
+ formatSelection: formatArrowSource,
+ escapeMarkup: function(m) { return m; },
+ minimumResultsForSearch: -1
+});
+
+
+/* line */
+function formatLine(config) {
+ var path = "${pageContext.request.contextPath}/images/relationshiptype/" + config.id + "Line.png";
+ return "<img src='" + path +"' />";
+}
+
+//set stored value
+$("#lineSelect").val("${it.dash}")
+//enable storage on change of element
+.on("change", function(e) {
+ params = globalAJAXParamsForSelect2VisualAppearance;
+ params.url = "visualappearance/dash";
+ params.data = e.val;
+ $.ajax(params);
+})
+//make the selection box show arrows
+.select2({
+ formatResult: formatLine,
+ formatSelection: formatLine,
+ escapeMarkup: function(m) { return m; },
+ minimumResultsForSearch: -1
+});
+
+
+
+/* target arrow head */
+
+function formatArrowTarget(config) {
+ return formatArrow(config, "Target");
+}
+
+//set stored value
+$("#dropDownTargetHead").val("${it.targetArrowHead}")
+//enable storage on change of element
+.on("change", function(e) {
+ params = globalAJAXParamsForSelect2VisualAppearance;
+ params.url = "visualappearance/targetarrowhead";
+ params.data = e.val;
+ $.ajax(params);
+})
+//make the selection box show arrows
+.select2({
+ formatResult: formatArrowTarget,
+ formatSelection: formatArrowTarget,
+ escapeMarkup: function(m) { return m; },
+ minimumResultsForSearch: -1
+});
+
+</script>
+