1 /*******************************************************************************
2 * Copyright (c) 2012-2013,2015 University of Stuttgart.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * and the Apache License 2.0 which both accompany this distribution,
6 * and are available at http://www.eclipse.org/legal/epl-v10.html
7 * and http://www.apache.org/licenses/LICENSE-2.0
10 * Oliver Kopp - initial API and implementation
11 *******************************************************************************/
12 package org.eclipse.winery.repository.resources.entitytypes;
14 import java.util.Collection;
16 import javax.ws.rs.GET;
17 import javax.ws.rs.Produces;
18 import javax.ws.rs.core.MediaType;
19 import javax.ws.rs.core.Response;
21 import org.eclipse.winery.common.ids.Namespace;
22 import org.eclipse.winery.common.ids.definitions.TopologyGraphElementEntityTypeId;
23 import org.eclipse.winery.repository.resources.admin.NamespacesResource;
25 import com.sun.jersey.api.view.Viewable;
28 * specifies the methods required by implementations.jsp
30 public abstract class ImplementationsOfOneType {
32 private final TopologyGraphElementEntityTypeId typeId;
35 public ImplementationsOfOneType(TopologyGraphElementEntityTypeId typeId) {
39 public TopologyGraphElementEntityTypeId getTypeId() {
44 @Produces(MediaType.TEXT_HTML)
45 public Response getHTML() {
46 Viewable viewable = new Viewable("/jsp/entitytypes/implementations.jsp", this);
47 return Response.ok().entity(viewable).build();
51 @Produces(MediaType.APPLICATION_JSON)
52 public abstract Response getJSON();
54 public Collection<Namespace> getNamespaceAutocompletionList() {
55 return NamespacesResource.getNamespaces();
59 * @return a list of type implementations implementing the associated node
62 public abstract String getImplementationsTableData();
65 * The string used as URL part
67 public abstract String getType();
70 * The string displayed to the user
72 public abstract String getTypeStr();