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
11 * Oliver Kopp - initial API and implementation and/or initial documentation
12 *******************************************************************************/
14 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
15 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
16 <%@taglib prefix="w" uri="http://www.eclipse.org/winery/repository/functions" %>
18 <%-- TODO: source (external documentation) and lang attributes not yet supported --%>
20 <c:if test="${empty it}">
21 <div class="form-group">
22 <div class="form-control" id="documentation"></div>
25 $("#documentation").editable({
28 success: function(response, newValue) {
33 "url": "documentation/",
35 contentType: "text/html",
36 error: function(jqXHR, textStatus, errorThrown) {
37 vShowAJAXError("Could not create documentation", jqXHR, errorThrown);
39 success: function(resData, textStatus, jqXHR) {
40 vShowSuccess("Successfully created the documentation");
50 <c:if test="${not empty it}">
51 <script>var documentationURL = {};</script>
52 <c:forEach var="documentation" items="${it}" varStatus="status">
53 <div class="form-group">
54 <%-- we only print a heading if we have multiple documentations. Otherwise, the documentation itself should be displayed --%>
55 <c:if test="${fn:length(it) > 1}"><label class="label-form">Documentation ${status.index}</label></c:if>
56 <div class="form-control" id="documentation${status.index}">
57 <c:forEach items="${documentation.content}" var="content">${content}</c:forEach>
60 <c:set var="text" value="${w:XML(documentation)}"></c:set><!-- required to calculate the hashCode -->
61 <c:set var="hash" value="<%=pageContext.getAttribute(\"text\").hashCode()%>"></c:set>
63 documentationURL[${status.index}] = "documentation/${hash}";
64 $("#documentation${status.index}").editable({
67 success: function(response, newValue) {
72 "url": documentationURL[${status.index}],
74 contentType: "text/html",
75 error: function(jqXHR, textStatus, errorThrown) {
76 vShowAJAXError("Could not update documentation", jqXHR, errorThrown);
78 success: function(resData, textStatus, jqXHR) {
79 vShowSuccess("Successfully updated the documentation");
80 documentationURL[${status.index}] = "documentation/" + resData;