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 <%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
16 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
17 <%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
19 <h4>General Repository Commands</h4>
21 <a href="repository/?dump" class="btn btn-primary">Dump Repository</a>
22 <button class="btn btn-danger" onclick="clearRepository();" id="btnclearrepository" data-loading-text="Deleting...">Clear Repository</button>
23 <button class="btn btn-default" onclick="$('#upRepoZipDiag').modal('show');">Import Repository</button>
27 org.eclipse.winery.repository.backend.IRepository rep;
28 rep = org.eclipse.winery.repository.Prefs.INSTANCE.getRepository();
29 boolean isGitBasedRepo = (rep instanceof org.eclipse.winery.repository.backend.filebased.GitBasedRepository);
31 org.eclipse.winery.repository.backend.filebased.GitBasedRepository repo = null;
33 repo = (org.eclipse.winery.repository.backend.filebased.GitBasedRepository) rep;
36 // We only support the commit and reset buttons if we can authenticate at the repository
37 // This is a hack to offer different versions of winery at dev.winery.opentosca.org and winery.opentosca.org
38 isGitBasedRepo = isGitBasedRepo && (repo.authenticationInfoAvailable());
44 <button id="commitBtn" class="btn btn-default" onclick="doCommit();" data-loading-text="committing...">Commit</button>
45 <button id="resetBtn" class="btn btn-danger" onclick="doReset();" data-loading-text="resetting...">Reset</button>
50 $("#commitBtn").button("loading");
52 url: "repository/?commit",
54 error: function(jqXHR, textStatus, errorThrown) {
55 $("#commitBtn").button("reset");
56 vShowAJAXError("Could not commit", jqXHR, errorThrown);
58 success: function(data, textSTatus, jqXHR) {
59 $("#commitBtn").button("reset");
60 vShowSuccess("Successfully committed changes.");
66 $("#resetBtn").button("loading");
68 url: "repository/?reset",
70 error: function(jqXHR, textStatus, errorThrown) {
71 $("#resetBtn").button("reset");
72 vShowAJAXError("Could not reset", jqXHR, errorThrown);
74 success: function(data, textSTatus, jqXHR) {
75 $("#resetBtn").button("reset");
76 vShowSuccess("Successfully reset to last known state.");
85 <t:simpleSingleFileUpload
86 title="Upload Repository Content"
87 text="Repository dump file"
91 accept="application/zip" />
94 function clearRepository() {
95 deleteResource('the complete repository', 'repository/',
96 function() {$("#btnclearrepository").button("reset");},
97 function() {$("#btnclearrepository").button("reset");},
98 function() {$("#btnclearrepository").button("loading");}