26f139a056a8a172da522121d0ad39f530037300
[vfc/nfvo/wfengine.git] /
1 <%--
2 /*******************************************************************************
3  * Copyright (c) 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  *******************************************************************************/
13 --%>
14 <%@tag description="Defines the javascript function createConnectorEndpoints globally. Quick hack to avoid huge hacking at the repository" pageEncoding="UTF-8"%>
15
16 <%@tag import="java.util.Collection"%>
17 <%@tag import="org.eclipse.winery.model.tosca.TRelationshipType"%>
18 <%@tag import="org.eclipse.winery.common.Util"%>
19
20 <%@attribute name="relationshipTypes" type="java.util.Collection" required="true" %>
21
22 <script>
23 function createConnectorEndpoints(nodeTemplateShapeSet) {
24 <%
25         for (TRelationshipType relationshipType: (Collection<TRelationshipType>) relationshipTypes) {
26 %>
27                 nodeTemplateShapeSet.find(".<%=Util.makeCSSName(relationshipType.getTargetNamespace(), relationshipType.getName()) %>").each(function(i,e) {
28                         var p = $(e).parent();
29                         var grandparent = $(p).parent();
30
31                         jsPlumb.makeSource($(e), {
32                                 parent:grandparent,
33                                 anchor:"Continuous",
34                                 connectionType: "{<%=relationshipType.getTargetNamespace()%>}<%=relationshipType.getName()%>",
35                                 endpoint:"Blank"
36                         });
37                 });
38 <%
39         }
40 %>
41 }
42 </script>