friends;
+ if (corsFriends == null || corsFriends.isEmpty()) {
+ friends = Collections.emptySet();
+ } else {
+ friends = Arrays.stream(corsFriends.split(";"))
+ .map(String::trim)
+ .filter(s -> !s.isEmpty())
+ .collect(Collectors.toSet());
+ }
+ return new LyoAppConfiguration(baseUrl, "services", friends);
+ }
+
+ @Produces
+ @Singleton
+ public ResourcesFactory produceResourcesFactory() {
+ return new ResourcesFactory(OSLC4JUtils.getServletURI());
+ }
+}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/ServletListener.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/ServletListener.java
deleted file mode 100644
index 80864dd3..00000000
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/ServletListener.java
+++ /dev/null
@@ -1,219 +0,0 @@
-// Start of user code Copyright
-/*******************************************************************************
- * Copyright (c) 2011, 2012 IBM Corporation and others.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
- *
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- *
- * Sam Padgett - initial API and implementation
- * Michael Fiedler - adapted for OSLC4J
- * Jad El-khoury - initial implementation of code generator (https://bugs.eclipse.org/bugs/show_bug.cgi?id=422448)
- * Andrii Berezovskyi - change URL configuration logic (Bug 509767)
- *
- * This file is generated by org.eclipse.lyo.oslc4j.codegenerator
- *******************************************************************************/
-// End of user code
-
-package co.oslc.refimpl.rm.gen.servlet;
-
-// spotless:off
-import java.net.MalformedURLException;
-import java.util.NoSuchElementException;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Optional;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import jakarta.servlet.ServletContext;
-import jakarta.servlet.ServletContextEvent;
-import jakarta.servlet.ServletContextListener;
-import jakarta.servlet.ServletRegistration;
-import jakarta.ws.rs.core.UriBuilder;
-
-import org.eclipse.lyo.oslc4j.core.OSLC4JUtils;
-import co.oslc.refimpl.rm.gen.RestDelegate;
-
-// Start of user code imports
-import org.apache.jena.sys.JenaSystem;
-// End of user code
-// spotless:on
-
-/**
- * During the initialization of this ServletListener, the base URI for the OSLC resources produced by this server is configured through the OSLC4J method setPublicURI().
- *
- * See getConfigurationProperty() for the different alternatives to set this base URI.
- */
-public class ServletListener implements ServletContextListener {
- private static final Logger logger = LoggerFactory.getLogger(ServletListener.class);
-
- // Start of user code class_attributes
- // End of user code
-
- public ServletListener() {
- super();
- }
-
- @Override
- public void contextInitialized(final ServletContextEvent servletContextEvent)
- {
- //These are fallback defaults. We recommend you do not modify them. Instead, set the 'baseurl' property.
- String basePathKey = "baseurl";
- String fallbackBase = "http://localhost:8080";
- String servletName = "JAX-RS Servlet";
-
- logger.info("""
- \n
- :::::::::: :::::::: ::: ::::::::::: ::::::::: :::::::: :::::::::: ::: ::: ::: ::::::::\s
- :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:\s
- +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ \s
- +#++:++# +#+ +#+ +#+ +#++:++#+ +#++:++#++ +#++:++# +#+ +#++: +#+ +:+ \s
- +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ \s
- #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# \s
- ########## ######## ######### ########## ### ######## ########## ########## ### ######## \s
- """);
-
- // Start of user code contextInitialized_init
- JenaSystem.init();
- OSLC4JUtils.setLyoStorePagingPreciseLimit(false);
- // End of user code
-
- ServletContext servletContext = servletContextEvent.getServletContext();
- String basePathProperty = getConfigurationProperty(basePathKey, fallbackBase, servletContext, ServletListener.class);
- UriBuilder builder = UriBuilder.fromUri(basePathProperty);
- String baseUrl = builder.path(servletContext.getContextPath()).build().toString();
- String servletUrlPattern = "services/";
- try {
- servletUrlPattern = getServletUrlPattern(servletContext, servletName);
- } catch (Exception e1) {
- logger.error("servletListener encountered problems identifying the servlet URL pattern.", e1);
- }
- try {
- logger.info("Setting public URI: " + baseUrl);
- OSLC4JUtils.setPublicURI(baseUrl);
- logger.info("Setting servlet path: " + servletUrlPattern);
- OSLC4JUtils.setServletPath(servletUrlPattern);
- } catch (MalformedURLException e) {
- logger.error("servletListener encountered MalformedURLException.", e);
- } catch (IllegalArgumentException e) {
- logger.error("servletListener encountered IllegalArgumentException.", e);
- }
-
- logger.info("servletListner contextInitialized.");
-
- // Start of user code contextInitialized_mid
- // TODO Implement code to establish connection to data backbone etc ...
- // End of user code
-
- // Start of user code contextInitialized_final
- // End of user code
- }
-
- @Override
- public void contextDestroyed(ServletContextEvent servletContextEvent)
- {
- // Start of user code contextDestroyed_init
- // End of user code
-
- }
-
- // Start of user code class_methods
- private static Optional getBasePathFromSystemProperties(String basePathContextPropertyKey) {
- String base = System.getProperty(basePathContextPropertyKey);
- if (base == null || base.trim().isEmpty()) {
- return Optional.empty();
- }
- return Optional.of(base);
- }
- // End of user code
-
- /**
- * For a property 'scheme', this is the lookup priority:
- *
- *
- * - LYO_SCHEME env variable
- * - %pkg_name%.scheme JVM property, e.g. org.eclipse.lyo.oslc4j.core.servlet.scheme
- * - %pkg_name%.scheme Servlet Context parameter, e.g. org.eclipse.lyo.oslc4j.core.servlet.scheme
- *
- * @param key property key name
- * @param defaultValue default String value
- * @param klass Class of the ServletListener
- * @return value, if found, from ENV, JVM, or Servlet Context (in this order)
- */
- public static String getConfigurationProperty(String key, String defaultValue, final ServletContext servletContext, Class klass) {
- String value = getConfigurationPropertyFromEnvironment(generateEnvironmentKey(key))
- .orElseGet(() -> getConfigurationPropertyFromSystemProperties(generateFullyQualifiedKey(klass, key))
- .orElseGet(() -> getConfigurationPropertyFromContext(servletContext, generateFullyQualifiedKey(klass, key))
- .orElse(defaultValue)));
- return value;
- }
-
- /**
- * property name 'scheme' would become "org.eclipse.lyo.oslc4j.core.servlet.scheme"
- */
- private static String generateFullyQualifiedKey(Class klass, String key) {
- return klass.getPackage().getName() + '.' + key;
- }
-
- /**
- * web.xml property ending in '.scheme' would become "LYO_SCHEME"
- */
- private static String generateEnvironmentKey(String key) {
- return "LYO_" + key.toUpperCase(Locale.ROOT).replace('.', '_');
- }
-
- private static Optional getConfigurationPropertyFromEnvironment(String basePathEnvKey) {
- final Map env = System.getenv();
- if (!env.containsKey(basePathEnvKey)) {
- logger.debug("ENV variable '{}' not defined", basePathEnvKey);
- return Optional.empty();
- }
- logger.info("Found {} env variable", basePathEnvKey);
- return Optional.of(env.get(basePathEnvKey));
- }
-
- private static Optional getConfigurationPropertyFromSystemProperties(String basePathContextPropertyKey) {
- String value = System.getProperty(basePathContextPropertyKey);
- if (value == null || value.trim().isEmpty()) {
- logger.debug("System (JVM) property '{}' not defined", basePathContextPropertyKey);
- return Optional.empty();
- }
- logger.info("Found {} System (JVM) property", basePathContextPropertyKey);
- return Optional.of(value);
- }
-
- private static Optional getConfigurationPropertyFromContext(final ServletContext servletContext, String basePathContextPropertyKey) {
- String value = servletContext.getInitParameter(basePathContextPropertyKey);
- if (value == null || value.trim().isEmpty()) {
- logger.debug("Servlet Context parameter '{}' not defined", basePathContextPropertyKey);
- return Optional.empty();
- }
- logger.info("Found {} context parameter", basePathContextPropertyKey);
- return Optional.of(value);
- }
-
- static String getServletUrlPattern(final ServletContext servletContext, String servletName) throws Exception {
- ServletRegistration servletRegistration = servletContext.getServletRegistration(servletName);
- if (servletRegistration == null) {
- throw new NoSuchElementException("no servlet with name \"" + servletName + "\" is found.");
- }
- java.util.Collection mappings = servletRegistration.getMappings();
- if (mappings.size() != 1) {
- throw new NoSuchElementException("unable to identify servlet mappings for servlet with name \"" + servletName + "\".");
- }
- String mapping = (String) mappings.toArray()[0];
-
- //url patterns in most cases end with '\*'. But a url-pattern with just '\' may be found for exact matches.
- if (mapping.endsWith("*"))
- mapping = mapping.substring(0, mapping.length()-1);
- return mapping;
- }
-}
-
diff --git a/src/server-rm/src/main/resources/application.properties b/src/server-rm/src/main/resources/application.properties
new file mode 100644
index 00000000..edec14d4
--- /dev/null
+++ b/src/server-rm/src/main/resources/application.properties
@@ -0,0 +1,7 @@
+co.oslc.refimpl.rm.gen.servlet.baseurl=http://localhost:8800/
+co.oslc.refimpl.rm.gen.servlet.cors.friends=*
+quarkus.http.port=8800
+quarkus.http.root-path=/
+quarkus.resteasy.path=/services
+# Allow all origins for CORS by default if needed, but we use custom CorsFilter
+# quarkus.http.cors=true
diff --git a/src/server-rm/src/main/resources/templates/index.html b/src/server-rm/src/main/resources/templates/index.html
new file mode 100644
index 00000000..f190e0c2
--- /dev/null
+++ b/src/server-rm/src/main/resources/templates/index.html
@@ -0,0 +1,38 @@
+
+
+
+
+
+ Adaptor home
+
+
+
+
+
+
+
+
+
RM
+
This is a homepage of the RM that was generated using
+ Eclipse Lyo Toolchain Designer.
+
+
+ Service Provider
+ Catalog
+
+
Start from the Service Provider Catalog, to navigate your adaptor's services and resources, using the available Query capabilities, Selection and Creation Dialogs.
+ Note that these are end-user HTML pages, which is very useful for debugging your adaptor.
+
+ Interactive Swagger UI
+
+
Use Swagger UI To interact with the adaptor services dedicated for RDF.
+
+
You can also copy
+ this OpenAPI specification document (yaml file) of this adaptor to a Swagger
+ Editor to generate client SDK code for a number of languages and platforms.
+
+
The OSLC Root Services document is available at {servletURI}/rootservices
+
+
+
+
diff --git a/src/server-rm/src/main/webapp/WEB-INF/web.xml b/src/server-rm/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 1286b620..00000000
--- a/src/server-rm/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
- RM
-
- Base URI for the adaptor.
- co.oslc.refimpl.rm.gen.servlet.baseurl
- http://localhost:8800/
-
-
-
-
-
- CORS friends
- co.oslc.refimpl.rm.gen.servlet.cors.friends
-
-
-
- *
-
-
-
-
-
-
- Listener for ServletContext lifecycle changes
- co.oslc.refimpl.rm.gen.servlet.ServletListener
-
-
-
-
-
- JAX-RS Servlet
- org.glassfish.jersey.servlet.ServletContainer
-
- jakarta.ws.rs.Application
- co.oslc.refimpl.rm.gen.servlet.Application
-
- 1
-
-
-
-
-
- JAX-RS Servlet
- /services/*
-
-
- CredentialsFilter
- CredentialsFilter
- co.oslc.refimpl.rm.gen.servlet.CredentialsFilter
-
-
- CredentialsFilter
- /services/*
-
-
-
-
-
-
diff --git a/src/server-rm/src/main/webapp/index.jsp b/src/server-rm/src/main/webapp/index.jsp
deleted file mode 100644
index 4fc8e5af..00000000
--- a/src/server-rm/src/main/webapp/index.jsp
+++ /dev/null
@@ -1,63 +0,0 @@
-<%--To avoid the overriding of any manual code changes upon subsequent code generations, disable "Generate JSP Files" option in the Adaptor model.--%>
-
-<%--
- Copyright (c) 2022 Contributors to the Eclipse Foundation
-
- See the NOTICE file(s) distributed with this work for additional
- information regarding copyright ownership.
-
- This program and the accompanying materials are made available under the
- terms of the Eclipse Distribution License 1.0 which is available at
- http://www.eclipse.org/org/documents/edl-v10.php.
-
- SPDX-License-Identifier: BSD-3-Simple
-
- This file is generated by Lyo Designer (https://www.eclipse.org/lyo/)
---%>
-
-<%@page import="org.eclipse.lyo.oslc4j.core.OSLC4JUtils"%>
-<%@page import="jakarta.ws.rs.core.UriBuilder"%>
-<%@page import="java.net.URI"%>
-
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
-
-
-
-
-
- Adaptor home
-
-
-
-
- " rel="stylesheet">
-
-
-
-
-
<%= application.getServletContextName() %>
-
This is a homepage of the RM that was generated using
- Eclipse Lyo Toolchain Designer.
-
-
- " role="button">Service Provider
- Catalog
-
-
Start from the Service Provider Catalog, to navigate your adaptor's services and resources, using the available Query capabilities, Selection and Creation Dialogs.
- Note that these are end-user HTML pages, which is very useful for debugging your adaptor.
-
- " role="button">Interactive Swagger UI
-
-
Use Swagger UI To interact with the adaptor services dedicated for RDF.
-
-
You can also copy ">
- this OpenAPI specification document (yaml file) of this adaptor to a ">Swagger
- Editor to generate client SDK code for a number of languages and platforms.
-
-
The OSLC Root Services document is available at <%= UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path("/rootsevices").build() %>
-
-
-
-
diff --git a/src/server-rm/src/test/resources/application.properties b/src/server-rm/src/test/resources/application.properties
new file mode 100644
index 00000000..9dd1f18e
--- /dev/null
+++ b/src/server-rm/src/test/resources/application.properties
@@ -0,0 +1,3 @@
+# Application configuration
+quarkus.http.port=8800
+co.oslc.refimpl.rm.gen.servlet.baseurl=http://localhost:8800/
From 2e76319302c00cdf4d9a98c99853391af312c5a5 Mon Sep 17 00:00:00 2001
From: Andrew Berezovskyi
Date: Sat, 20 Dec 2025 19:16:34 +0100
Subject: [PATCH 2/6] fix: Quarkus running
Signed-off-by: Andrew Berezovskyi
---
.../kotlin/co/oslc/refimpl/client/Main.kt | 2 +-
src/docker-compose.yml | 2 +-
.../java/co/oslc/refimpl/tests/OslcTest.java | 2 +-
.../co/oslc/refimpl/tests/SwaggerTest.java | 7 +-
src/server-rm/Dockerfile | 19 +-
src/server-rm/pom.xml | 4 +
.../Requirement_collectionsService.java | 140 +-
.../rm/gen/services/RequirementsService.java | 158 ++-
.../rm/gen/services/ResourceShapeService.java | 45 +-
.../ServiceProviderCatalogService.java | 49 +-
.../gen/services/ServiceProviderService.java | 37 +-
.../rm/gen/services/WebServiceBasic.java | 1237 +++++++++--------
.../refimpl/rm/gen/servlet/Application.java | 3 +-
.../rm/gen/servlet/CredentialsFilter.java | 8 +-
.../rm/gen/servlet/HomePageResource.java | 42 +
.../oslc/refimpl/rm/gen/util/ServletUtil.java | 30 +
.../resources}/static/css/adaptor.css | 0
.../static/js/delegated-ui-helper.js | 0
.../resources}/static/js/delegated-ui.js | 0
.../resources}/static/js/ui-preview-helper.js | 0
.../src/main/resources/application.properties | 2 +-
.../src/main/resources/templates/index.html | 72 +-
.../templates/requirementSelector.html | 47 +
src/server-rm/tomcat.Dockerfile | 13 -
24 files changed, 1040 insertions(+), 879 deletions(-)
create mode 100644 src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/HomePageResource.java
create mode 100644 src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/util/ServletUtil.java
rename src/server-rm/src/main/{webapp => resources/META-INF/resources}/static/css/adaptor.css (100%)
rename src/server-rm/src/main/{webapp => resources/META-INF/resources}/static/js/delegated-ui-helper.js (100%)
rename src/server-rm/src/main/{webapp => resources/META-INF/resources}/static/js/delegated-ui.js (100%)
rename src/server-rm/src/main/{webapp => resources/META-INF/resources}/static/js/ui-preview-helper.js (100%)
create mode 100644 src/server-rm/src/main/resources/templates/requirementSelector.html
delete mode 100644 src/server-rm/tomcat.Dockerfile
diff --git a/src/client-toolchain/src/main/kotlin/co/oslc/refimpl/client/Main.kt b/src/client-toolchain/src/main/kotlin/co/oslc/refimpl/client/Main.kt
index b6cd321f..070b4257 100644
--- a/src/client-toolchain/src/main/kotlin/co/oslc/refimpl/client/Main.kt
+++ b/src/client-toolchain/src/main/kotlin/co/oslc/refimpl/client/Main.kt
@@ -33,7 +33,7 @@ import kotlin.collections.HashSet
import kotlin.system.measureNanoTime
-private val SPC_RM_DEFAULT = "http://localhost:8800/services/catalog/singleton"
+private val SPC_RM_DEFAULT = "http://localhost:8800/catalog/singleton"
private val SPC_CM_DEFAULT = "http://localhost:8801/services/catalog/singleton"
private val SPC_AM_DEFAULT = "http://localhost:8803/services/catalog/singleton"
private val SPC_QM_DEFAULT = "http://localhost:8802/services/catalog/singleton"
diff --git a/src/docker-compose.yml b/src/docker-compose.yml
index 86c9054a..049dd49b 100644
--- a/src/docker-compose.yml
+++ b/src/docker-compose.yml
@@ -4,7 +4,7 @@ services:
context: ./
dockerfile: server-rm/Dockerfile
ports:
- - "127.0.0.1:8800:8080"
+ - "127.0.0.1:8800:8800"
server-cm:
build:
context: ./
diff --git a/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/OslcTest.java b/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/OslcTest.java
index 87a1ed21..a49e6791 100644
--- a/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/OslcTest.java
+++ b/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/OslcTest.java
@@ -30,7 +30,7 @@ public class OslcTest {
@Container
public static ComposeContainer environment = new ComposeContainer(new File("src/test/resources/docker-compose.yml"))
.withExposedService(RM_SVC, RM_PORT,
- Wait.forLogMessage(".*main: Started oejs.Server@.*", 1)
+ Wait.forLogMessage(".*(Started oejs.Server@|Quarkus.*started in).*", 1)
.withStartupTimeout(Duration.ofSeconds(STARTUP_TIMEOUT)))
.withExposedService(CM_SVC, CM_PORT,
Wait.forLogMessage(".*main: Started oejs.Server@.*", 1)
diff --git a/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/SwaggerTest.java b/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/SwaggerTest.java
index 033e0d1b..2c55fe2e 100644
--- a/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/SwaggerTest.java
+++ b/src/refimpl-tests/src/test/java/co/oslc/refimpl/tests/SwaggerTest.java
@@ -42,7 +42,7 @@ public class SwaggerTest {
@Container
public static ComposeContainer environment = new ComposeContainer(new File("src/test/resources/docker-compose.yml"))
.withExposedService(RM_SVC, RM_PORT,
- Wait.forLogMessage(".*main: Started oejs.Server@.*", 1)
+ Wait.forLogMessage(".*(Started oejs.Server@|Quarkus.*started in).*", 1)
.withStartupTimeout(Duration.ofSeconds(STARTUP_TIMEOUT)))
.withExposedService(CM_SVC, CM_PORT,
Wait.forLogMessage(".*main: Started oejs.Server@.*", 1)
@@ -119,7 +119,10 @@ void waitForService(String url) {
void swaggerUiShouldBeAccessible(String svc) {
var serviceHost = "localhost";
var servicePort = fixedPorts.get(svc);
- var swaggerUrl = "http://%s:%d/swagger-ui/index.jsp".formatted(serviceHost, servicePort);
+ // Use /q/swagger-ui for Quarkus RM server, /swagger-ui/index.jsp for legacy Jetty servers
+ var swaggerUrl = RM_SVC.equals(svc)
+ ? "http://%s:%d/q/swagger-ui".formatted(serviceHost, servicePort)
+ : "http://%s:%d/swagger-ui/index.jsp".formatted(serviceHost, servicePort);
var expectedYamlUrl = "http://%s:%d/services/openapi.yaml".formatted(serviceHost, servicePort);
var rootServicesUrl = "http://%s:%d/services/rootservices".formatted(serviceHost, servicePort);
diff --git a/src/server-rm/Dockerfile b/src/server-rm/Dockerfile
index a2d575fe..95208e60 100644
--- a/src/server-rm/Dockerfile
+++ b/src/server-rm/Dockerfile
@@ -15,10 +15,10 @@ COPY client-toolchain/pom.xml client-toolchain/pom.xml
COPY lib-common/ lib-common/
COPY server-rm/ server-rm/
-# Build only the specific module and its dependencies
-RUN mvn -B --no-transfer-progress -DskipTests clean package -pl server-rm -am
+# Build Quarkus uber-jar (single JAR with all dependencies)
+RUN mvn -B --no-transfer-progress -DskipTests clean package -pl server-rm -am -Dquarkus.package.jar.type=uber-jar
-FROM docker.io/library/jetty:12-jre21-eclipse-temurin
+FROM registry.access.redhat.com/ubi8/openjdk-21-runtime:1.20
# Add metadata
LABEL org.opencontainers.image.title="OSLC RefImpl RM Server"
@@ -27,11 +27,14 @@ LABEL org.opencontainers.image.source="https://github.com/oslc-op/refimpl"
LABEL org.opencontainers.image.vendor="OSLC Open Project"
LABEL org.opencontainers.image.licenses="EPL-2.0"
-# WARNING DO NOT CHANGE WORKDIR or set it back to what it was before
-# $JETTY_BASE must be correct before starting Jetty
+ENV LANGUAGE='en_US:en'
-COPY --from=build /src/server-rm/target/*.war /var/lib/jetty/webapps/ROOT.war
+WORKDIR /deployments
-RUN java -jar "$JETTY_HOME/start.jar" --add-modules=ee9-deploy,ee9-jsp,ee9-jstl
+# Copy the Quarkus uber-jar
+COPY --from=build --chown=185 /src/server-rm/target/*-runner.jar /deployments/quarkus-run.jar
-EXPOSE 8080
+EXPOSE 8800
+USER 185
+
+ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar"]
diff --git a/src/server-rm/pom.xml b/src/server-rm/pom.xml
index 3dcf91cb..3ae9ca3a 100644
--- a/src/server-rm/pom.xml
+++ b/src/server-rm/pom.xml
@@ -144,6 +144,10 @@
io.quarkus
quarkus-undertow
+
+ io.quarkus
+ quarkus-resteasy-qute
+
io.quarkus
quarkus-smallrye-openapi
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java
index f9a8579e..c1247b15 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java
@@ -85,6 +85,7 @@
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.ServerConstants;
+import co.oslc.refimpl.rm.gen.util.ServletUtil;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
@@ -187,72 +188,74 @@ public RequirementCollection[] queryRequirementCollections(
return resources.toArray(new RequirementCollection [resources.size()]);
}
- @GET
- @Path("query")
- @Produces({ MediaType.TEXT_HTML })
- @Operation(
- summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "}",
- description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}" +
- ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}",
- responses = {
- @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
- }
- )
- public void queryRequirementCollectionsAsHtml(
- @PathParam("serviceProviderId") final String serviceProviderId ,
- @QueryParam("oslc.where") final String where,
- @QueryParam("oslc.prefix") final String prefix,
- @QueryParam("oslc.paging") final String pagingString,
- @QueryParam("page") final String pageString,
- @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
- {
- boolean paging=false;
- int page=0;
- int pageSize=20;
- if (null != pagingString) {
- paging = Boolean.parseBoolean(pagingString);
- }
- if (null != pageString) {
- page = Integer.parseInt(pageString);
- }
- if (null != pageSizeString) {
- pageSize = Integer.parseInt(pageSizeString);
- }
-
- // Start of user code queryRequirementCollectionsAsHtml
- // End of user code
-
- List resources = delegate.queryRequirementCollections(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
-
- if (resources!= null) {
- // Start of user code queryRequirementCollectionsAsHtml_setAttributes
- // End of user code
-
- UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
- .queryParam("oslc.paging", "true")
- .queryParam("oslc.pageSize", pageSize)
- .queryParam("page", page);
- if (null != where) {
- uriBuilder.queryParam("oslc.where", where);
- }
- if (null != prefix) {
- uriBuilder.queryParam("oslc.prefix", prefix);
- }
- httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
-
- if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
- || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
- resources = resources.subList(0, pageSize);
- uriBuilder.replaceQueryParam("page", page + 1);
- httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
- }
- httpServletRequest.setAttribute("resources", resources);
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionscollection.jsp");
- rd.forward(httpServletRequest,httpServletResponse);
- return;
- }
- throw new WebApplicationException(Status.NOT_FOUND);
- }
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("query")
+ // @Produces({ MediaType.TEXT_HTML })
+ // @Operation(
+ // summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "}",
+ // description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}" +
+ // ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}",
+ // responses = {
+ // @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
+ // }
+ // )
+ // public void queryRequirementCollectionsAsHtml(
+ // @PathParam("serviceProviderId") final String serviceProviderId ,
+ // @QueryParam("oslc.where") final String where,
+ // @QueryParam("oslc.prefix") final String prefix,
+ // @QueryParam("oslc.paging") final String pagingString,
+ // @QueryParam("page") final String pageString,
+ // @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
+ // {
+ // boolean paging=false;
+ // int page=0;
+ // int pageSize=20;
+ // if (null != pagingString) {
+ // paging = Boolean.parseBoolean(pagingString);
+ // }
+ // if (null != pageString) {
+ // page = Integer.parseInt(pageString);
+ // }
+ // if (null != pageSizeString) {
+ // pageSize = Integer.parseInt(pageSizeString);
+ // }
+ //
+ // // Start of user code queryRequirementCollectionsAsHtml
+ // // End of user code
+ //
+ // List resources = delegate.queryRequirementCollections(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
+ //
+ // if (resources!= null) {
+ // // Start of user code queryRequirementCollectionsAsHtml_setAttributes
+ // // End of user code
+ //
+ // UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
+ // .queryParam("oslc.paging", "true")
+ // .queryParam("oslc.pageSize", pageSize)
+ // .queryParam("page", page);
+ // if (null != where) {
+ // uriBuilder.queryParam("oslc.where", where);
+ // }
+ // if (null != prefix) {
+ // uriBuilder.queryParam("oslc.prefix", prefix);
+ // }
+ // httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
+ //
+ // if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
+ // || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
+ // resources = resources.subList(0, pageSize);
+ // uriBuilder.replaceQueryParam("page", page + 1);
+ // httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
+ // }
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("resources", resources);
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionscollection.jsp");
+ // rd.forward(originalRequest,httpServletResponse);
+ // return;
+ // }
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
@OslcDialog
(
@@ -301,8 +304,9 @@ public Response RequirementCollectionSelector(
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
} else {
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionselector.jsp");
- rd.forward(httpServletRequest, httpServletResponse);
+ HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionselector.jsp");
+ rd.forward(originalRequest, httpServletResponse);
return null;
}
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java
index e2d18d01..2e7bb982 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java
@@ -85,6 +85,7 @@
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.ServerConstants;
+import co.oslc.refimpl.rm.gen.util.ServletUtil;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
@@ -93,6 +94,8 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.quarkus.qute.Template;
+import io.quarkus.qute.TemplateInstance;
// Start of user code imports
// End of user code
@@ -108,6 +111,7 @@ public class RequirementsService
@Context private HttpServletResponse httpServletResponse;
@Context private UriInfo uriInfo;
@Inject private RestDelegate delegate;
+ @Inject Template requirementSelector;
private static final Logger log = LoggerFactory.getLogger(RequirementsService.class);
@@ -187,72 +191,74 @@ public Requirement[] queryRequirements(
return resources.toArray(new Requirement [resources.size()]);
}
- @GET
- @Path("query")
- @Produces({ MediaType.TEXT_HTML })
- @Operation(
- summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "}",
- description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}" +
- ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}",
- responses = {
- @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
- }
- )
- public void queryRequirementsAsHtml(
- @PathParam("serviceProviderId") final String serviceProviderId ,
- @QueryParam("oslc.where") final String where,
- @QueryParam("oslc.prefix") final String prefix,
- @QueryParam("oslc.paging") final String pagingString,
- @QueryParam("page") final String pageString,
- @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
- {
- boolean paging=false;
- int page=0;
- int pageSize=20;
- if (null != pagingString) {
- paging = Boolean.parseBoolean(pagingString);
- }
- if (null != pageString) {
- page = Integer.parseInt(pageString);
- }
- if (null != pageSizeString) {
- pageSize = Integer.parseInt(pageSizeString);
- }
-
- // Start of user code queryRequirementsAsHtml
- // End of user code
-
- List resources = delegate.queryRequirements(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
-
- if (resources!= null) {
- // Start of user code queryRequirementsAsHtml_setAttributes
- // End of user code
-
- UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
- .queryParam("oslc.paging", "true")
- .queryParam("oslc.pageSize", pageSize)
- .queryParam("page", page);
- if (null != where) {
- uriBuilder.queryParam("oslc.where", where);
- }
- if (null != prefix) {
- uriBuilder.queryParam("oslc.prefix", prefix);
- }
- httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
-
- if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
- || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
- resources = resources.subList(0, pageSize);
- uriBuilder.replaceQueryParam("page", page + 1);
- httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
- }
- httpServletRequest.setAttribute("resources", resources);
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementscollection.jsp");
- rd.forward(httpServletRequest,httpServletResponse);
- return;
- }
- throw new WebApplicationException(Status.NOT_FOUND);
- }
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("query")
+ // @Produces({ MediaType.TEXT_HTML })
+ // @Operation(
+ // summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "}",
+ // description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}" +
+ // ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}",
+ // responses = {
+ // @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
+ // }
+ // )
+ // public void queryRequirementsAsHtml(
+ // @PathParam("serviceProviderId") final String serviceProviderId ,
+ // @QueryParam("oslc.where") final String where,
+ // @QueryParam("oslc.prefix") final String prefix,
+ // @QueryParam("oslc.paging") final String pagingString,
+ // @QueryParam("page") final String pageString,
+ // @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
+ // {
+ // boolean paging=false;
+ // int page=0;
+ // int pageSize=20;
+ // if (null != pagingString) {
+ // paging = Boolean.parseBoolean(pagingString);
+ // }
+ // if (null != pageString) {
+ // page = Integer.parseInt(pageString);
+ // }
+ // if (null != pageSizeString) {
+ // pageSize = Integer.parseInt(pageSizeString);
+ // }
+ //
+ // // Start of user code queryRequirementsAsHtml
+ // // End of user code
+ //
+ // List resources = delegate.queryRequirements(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
+ //
+ // if (resources!= null) {
+ // // Start of user code queryRequirementsAsHtml_setAttributes
+ // // End of user code
+ //
+ // UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
+ // .queryParam("oslc.paging", "true")
+ // .queryParam("oslc.pageSize", pageSize)
+ // .queryParam("page", page);
+ // if (null != where) {
+ // uriBuilder.queryParam("oslc.where", where);
+ // }
+ // if (null != prefix) {
+ // uriBuilder.queryParam("oslc.prefix", prefix);
+ // }
+ // httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
+ //
+ // if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
+ // || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
+ // resources = resources.subList(0, pageSize);
+ // uriBuilder.replaceQueryParam("page", page + 1);
+ // httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
+ // }
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("resources", resources);
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementscollection.jsp");
+ // rd.forward(originalRequest,httpServletResponse);
+ // return;
+ // }
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
@OslcDialog
(
@@ -266,8 +272,9 @@ public void queryRequirementsAsHtml(
)
@GET
@Path("selector")
+ @Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.TEXT_HTML, MediaType.WILDCARD })
- public Response RequirementSelector(
+ public Object RequirementSelector(
@QueryParam("terms") final String terms
, @PathParam("serviceProviderId") final String serviceProviderId
) throws ServletException, IOException, JSONException
@@ -275,12 +282,11 @@ public Response RequirementSelector(
// Start of user code RequirementSelector_init
// End of user code
- httpServletRequest.setAttribute("selectionUri",UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString());
+ String selectionUri = UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString();
// Start of user code RequirementSelector_setAttributes
// End of user code
if (terms != null ) {
- httpServletRequest.setAttribute("terms", terms);
final List resources = delegate.RequirementSelector(httpServletRequest, serviceProviderId, terms);
if (resources!= null) {
JSONArray resourceArray = new JSONArray();
@@ -301,9 +307,8 @@ public Response RequirementSelector(
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
} else {
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementselector.jsp");
- rd.forward(httpServletRequest, httpServletResponse);
- return null;
+ // Use Qute template instead of JSP
+ return requirementSelector.data("selectionUri", selectionUri);
}
}
@@ -359,11 +364,12 @@ public Response RequirementCreator(
// Start of user code RequirementCreator
// End of user code
- httpServletRequest.setAttribute("creatorUri", UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString());
- httpServletRequest.setAttribute("serviceProviderId", serviceProviderId);
+ HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ originalRequest.setAttribute("creatorUri", UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString());
+ originalRequest.setAttribute("serviceProviderId", serviceProviderId);
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcreator.jsp");
- rd.forward(httpServletRequest, httpServletResponse);
+ RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcreator.jsp");
+ rd.forward(originalRequest, httpServletResponse);
return null;
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java
index 796f07f2..f0c21abd 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java
@@ -52,6 +52,7 @@
import io.swagger.v3.oas.annotations.Operation;
import co.oslc.refimpl.rm.gen.servlet.Application;
+import co.oslc.refimpl.rm.gen.util.ServletUtil;
// Start of user code imports
// End of user code
@@ -92,25 +93,27 @@ public ResourceShape getResourceShape(@Context final Http
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
- @GET
- @Path("{resourceShapePath}")
- @Produces({ MediaType.TEXT_HTML })
- public void getResourceShapeAsHtml(
- @PathParam("resourceShapePath") final String resourceShapePath
- ) throws ServletException, IOException, URISyntaxException, OslcCoreApplicationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
- {
- final Class> resourceClass = Application.getResourceShapePathToResourceClassMap().get(resourceShapePath);
- ResourceShape aResourceShape = null;
-
- if (resourceClass != null)
- {
- aResourceShape = (ResourceShape) resourceClass.getMethod("createResourceShape").invoke(null);
- httpServletRequest.setAttribute("aResourceShape", aResourceShape);
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/resourceshape.jsp");
- rd.forward(httpServletRequest,httpServletResponse);
- return;
- }
- throw new WebApplicationException(Status.NOT_FOUND);
- }
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("{resourceShapePath}")
+ // @Produces({ MediaType.TEXT_HTML })
+ // public void getResourceShapeAsHtml(
+ // @PathParam("resourceShapePath") final String resourceShapePath
+ // ) throws ServletException, IOException, URISyntaxException, OslcCoreApplicationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
+ // {
+ // final Class> resourceClass = Application.getResourceShapePathToResourceClassMap().get(resourceShapePath);
+ // ResourceShape aResourceShape = null;
+ //
+ // if (resourceClass != null)
+ // {
+ // aResourceShape = (ResourceShape) resourceClass.getMethod("createResourceShape").invoke(null);
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("aResourceShape", aResourceShape);
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/resourceshape.jsp");
+ // rd.forward(originalRequest,httpServletResponse);
+ // return;
+ // }
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java
index 89743c98..5002ba3a 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java
@@ -31,6 +31,8 @@
import java.net.URISyntaxException;
import jakarta.servlet.RequestDispatcher;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.ws.rs.GET;
@@ -55,6 +57,7 @@
import co.oslc.refimpl.rm.gen.ServerConstants;
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
+import co.oslc.refimpl.rm.gen.util.ServletUtil;
// Start of user code imports
// End of user code
@@ -127,30 +130,28 @@ public ServiceProviderCatalog getServiceProviderCatalog(@PathParam("serviceProvi
/**
* Return the catalog singleton as HTML
*
- * Forwards to serviceprovidercatalog_html.jsp to build the html
+ * NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported.
+ * Quarkus uses Qute templates instead. For now, only RDF representations are supported.
*
*/
- @GET
- @Path("{someId}")
- @Produces(MediaType.TEXT_HTML)
- public void getHtmlServiceProvider(@PathParam("someId") final String someId)
- {
- try {
- ServiceProviderCatalog catalog = ServiceProviderCatalogSingleton.getServiceProviderCatalog(httpServletRequest);
-
- if (catalog !=null ) {
- httpServletRequest.setAttribute("catalog",catalog);
- // Start of user code getHtmlServiceProvider_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovidercatalog.jsp");
- rd.forward(httpServletRequest, httpServletResponse);
- return;
- }
- } catch (WebApplicationException e) {
- throw e;
- } catch (Exception e) {
- throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
- }
- }
+ // @GET
+ // @Path("{someId}")
+ // @Produces(MediaType.TEXT_HTML)
+ // public void getHtmlServiceProvider(@PathParam("someId") final String someId)
+ // {
+ // try {
+ // ServiceProviderCatalog catalog = ServiceProviderCatalogSingleton.getServiceProviderCatalog(httpServletRequest);
+ //
+ // if (catalog !=null ) {
+ // httpServletRequest.setAttribute("catalog",catalog);
+ // RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovidercatalog.jsp");
+ // rd.forward(httpServletRequest, httpServletResponse);
+ // return;
+ // }
+ // } catch (WebApplicationException e) {
+ // throw e;
+ // } catch (Exception e) {
+ // throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+ // }
+ // }
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java
index adb808b5..abffe7aa 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java
@@ -52,6 +52,7 @@
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
+import co.oslc.refimpl.rm.gen.util.ServletUtil;
// Start of user code imports
// End of user code
@@ -117,21 +118,23 @@ public ServiceProvider getServiceProvider(@PathParam("serviceProviderId") final
*
* @param serviceProviderId
*/
- @GET
- @Path("{serviceProviderId}")
- @Produces(MediaType.TEXT_HTML)
- public void getHtmlServiceProvider(@PathParam("serviceProviderId") final String serviceProviderId) throws ServletException, IOException
- {
- ServiceProvider serviceProvider = ServiceProviderCatalogSingleton.getServiceProvider(httpServletRequest, serviceProviderId);
- Service [] services = serviceProvider.getServices();
-
- httpServletRequest.setAttribute("serviceProvider", serviceProvider);
- httpServletRequest.setAttribute("services", services);
- // Start of user code getHtmlServiceProvider_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovider.jsp");
- rd.forward(httpServletRequest, httpServletResponse);
- return;
- }
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("{serviceProviderId}")
+ // @Produces(MediaType.TEXT_HTML)
+ // public void getHtmlServiceProvider(@PathParam("serviceProviderId") final String serviceProviderId) throws ServletException, IOException
+ // {
+ // ServiceProvider serviceProvider = ServiceProviderCatalogSingleton.getServiceProvider(httpServletRequest, serviceProviderId);
+ // Service [] services = serviceProvider.getServices();
+ //
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("serviceProvider", serviceProvider);
+ // originalRequest.setAttribute("services", services);
+ // // Start of user code getHtmlServiceProvider_setAttributes
+ // // End of user code
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovider.jsp");
+ // rd.forward(originalRequest, httpServletResponse);
+ // return;
+ // }
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java
index 6f8d75c7..97f05cee 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java
@@ -18,633 +18,646 @@
*
* This file is generated by org.eclipse.lyo.oslc4j.codegenerator
*******************************************************************************/
-// End of user code
-
-package co.oslc.refimpl.rm.gen.services;
-
-// spotless:off
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-import java.text.ParseException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-import jakarta.inject.Inject;
-import jakarta.servlet.RequestDispatcher;
-import jakarta.servlet.ServletException;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.ws.rs.Consumes;
-import jakarta.ws.rs.DELETE;
-import jakarta.ws.rs.FormParam;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.HeaderParam;
-import jakarta.ws.rs.POST;
-import jakarta.ws.rs.PUT;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.QueryParam;
-import jakarta.ws.rs.WebApplicationException;
-import jakarta.ws.rs.core.Context;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.MultivaluedMap;
-import jakarta.ws.rs.core.Response;
-import jakarta.ws.rs.core.Response.Status;
-import jakarta.ws.rs.core.UriInfo;
-import jakarta.ws.rs.core.UriBuilder;
-
-import org.apache.wink.json4j.JSONException;
-import org.apache.wink.json4j.JSONObject;
-import org.eclipse.lyo.oslc4j.provider.json4j.JsonHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.eclipse.lyo.oslc4j.core.OSLC4JUtils;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcDialog;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcDialogs;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcQueryCapability;
-import org.eclipse.lyo.oslc4j.core.annotation.OslcService;
-import org.eclipse.lyo.oslc4j.core.model.Compact;
-import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
-import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
-import org.eclipse.lyo.oslc4j.core.model.Preview;
-import org.eclipse.lyo.oslc4j.core.model.ServiceProvider;
-import org.eclipse.lyo.oslc4j.core.model.Link;
-import org.eclipse.lyo.oslc4j.core.model.AbstractResource;
-
-import co.oslc.refimpl.rm.gen.RestDelegate;
-import co.oslc.refimpl.rm.gen.ServerConstants;
-import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
-import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
-import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
-import org.eclipse.lyo.oslc.domains.rm.Requirement;
-import org.eclipse.lyo.oslc.domains.rm.RequirementCollection;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.media.Content;
-import io.swagger.v3.oas.annotations.responses.ApiResponse;
-
+// End of user code
+
+package co.oslc.refimpl.rm.gen.services;
+
+// spotless:off
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.text.ParseException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import jakarta.inject.Inject;
+import jakarta.servlet.RequestDispatcher;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.DELETE;
+import jakarta.ws.rs.FormParam;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.HeaderParam;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.PUT;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.PathParam;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.QueryParam;
+import jakarta.ws.rs.WebApplicationException;
+import jakarta.ws.rs.core.Context;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.MultivaluedMap;
+import jakarta.ws.rs.core.Response;
+import jakarta.ws.rs.core.Response.Status;
+import jakarta.ws.rs.core.UriInfo;
+import jakarta.ws.rs.core.UriBuilder;
+
+import org.apache.wink.json4j.JSONException;
+import org.apache.wink.json4j.JSONObject;
+import org.eclipse.lyo.oslc4j.provider.json4j.JsonHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.eclipse.lyo.oslc4j.core.OSLC4JUtils;
+import org.eclipse.lyo.oslc4j.core.annotation.OslcCreationFactory;
+import org.eclipse.lyo.oslc4j.core.annotation.OslcDialog;
+import org.eclipse.lyo.oslc4j.core.annotation.OslcDialogs;
+import org.eclipse.lyo.oslc4j.core.annotation.OslcQueryCapability;
+import org.eclipse.lyo.oslc4j.core.annotation.OslcService;
+import org.eclipse.lyo.oslc4j.core.model.Compact;
+import org.eclipse.lyo.oslc4j.core.model.OslcConstants;
+import org.eclipse.lyo.oslc4j.core.model.OslcMediaType;
+import org.eclipse.lyo.oslc4j.core.model.Preview;
+import org.eclipse.lyo.oslc4j.core.model.ServiceProvider;
+import org.eclipse.lyo.oslc4j.core.model.Link;
+import org.eclipse.lyo.oslc4j.core.model.AbstractResource;
+
+import co.oslc.refimpl.rm.gen.RestDelegate;
+import co.oslc.refimpl.rm.gen.ServerConstants;
+import co.oslc.refimpl.rm.gen.util.ServletUtil;
+import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
+import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
+import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
+import org.eclipse.lyo.oslc.domains.rm.Requirement;
+import org.eclipse.lyo.oslc.domains.rm.RequirementCollection;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+
// Start of user code imports
-// End of user code
-// spotless:on
-
+// End of user code
+// spotless:on
+
// Start of user code pre_class_code
-// End of user code
-@Path("")
-public class WebServiceBasic
-{
- @Context private HttpServletRequest httpServletRequest;
- @Context private HttpServletResponse httpServletResponse;
- @Context private UriInfo uriInfo;
- @Inject private RestDelegate delegate;
-
- private static final Logger log = LoggerFactory.getLogger(WebServiceBasic.class);
-
+// End of user code
+@Path("")
+public class WebServiceBasic
+{
+ @Context private HttpServletRequest httpServletRequest;
+ @Context private HttpServletResponse httpServletResponse;
+ @Context private UriInfo uriInfo;
+ @Inject private RestDelegate delegate;
+
+ private static final Logger log = LoggerFactory.getLogger(WebServiceBasic.class);
+
// Start of user code class_attributes
- // End of user code
-
+ // End of user code
+
// Start of user code class_methods
- // End of user code
-
- public WebServiceBasic()
- {
- super();
- }
-
- @GET
- @Path("Requirement/{serviceProviderId}/{resourceId}")
- @Produces({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON})
- @Operation(
- summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
- description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public Requirement getRequirement(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws IOException, ServletException, URISyntaxException
- {
- // Start of user code getResource_init
- // End of user code
-
- final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirement != null) {
+ // End of user code
+
+ public WebServiceBasic()
+ {
+ super();
+ }
+
+ @GET
+ @Path("Requirement/{serviceProviderId}/{resourceId}")
+ @Produces({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON})
+ @Operation(
+ summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
+ description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public Requirement getRequirement(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws IOException, ServletException, URISyntaxException
+ {
+ // Start of user code getResource_init
+ // End of user code
+
+ final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirement != null) {
// Start of user code getRequirement
- // End of user code
- httpServletResponse.setHeader("ETag", delegate.getETagFromRequirement(aRequirement));
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- return aRequirement;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("Requirement/{serviceProviderId}/{resourceId}")
- @Produces({ MediaType.TEXT_HTML })
- @Operation(
- summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
- description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public void getRequirementAsHtml(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- // Start of user code getRequirementAsHtml_init
- // End of user code
-
- final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirement != null) {
- httpServletRequest.setAttribute("aRequirement", aRequirement);
- // Start of user code getRequirementAsHtml_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirement.jsp");
- rd.forward(httpServletRequest,httpServletResponse);
- return;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("Requirement/{serviceProviderId}/{resourceId}")
- @Produces({OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML})
- @Operation(
- summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
- description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public Compact getRequirementCompact(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- String iconUri = OSLC4JUtils.getPublicURI() + "/images/ui_preview_icon.gif";
- String smallPreviewHintHeight = "200px";
- String smallPreviewHintWidth = "300px";
- String largePreviewHintHeight = "400px";
- String largePreviewHintWidth = "600px";
-
+ // End of user code
+ httpServletResponse.setHeader("ETag", delegate.getETagFromRequirement(aRequirement));
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ return aRequirement;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("Requirement/{serviceProviderId}/{resourceId}")
+ // @Produces({ MediaType.TEXT_HTML })
+ // @Operation(
+ // summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
+ // description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
+ // ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
+ // responses = {@ApiResponse(description = "default response",
+ // content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ // mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ // mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ // mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ // mediaType = MediaType.TEXT_HTML), @Content(
+ // mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ // }
+ // )
+ // public void getRequirementAsHtml(
+ // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ // ) throws ServletException, IOException, URISyntaxException
+ // {
+ // // Start of user code getRequirementAsHtml_init
+ // // End of user code
+ //
+ // final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+ //
+ // if (aRequirement != null) {
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("aRequirement", aRequirement);
+ // // Start of user code getRequirementAsHtml_setAttributes
+ // // End of user code
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirement.jsp");
+ // rd.forward(originalRequest,httpServletResponse);
+ // return;
+ // }
+ //
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
+
+ @GET
+ @Path("Requirement/{serviceProviderId}/{resourceId}")
+ @Produces({OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML})
+ @Operation(
+ summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
+ description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public Compact getRequirementCompact(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ String iconUri = OSLC4JUtils.getPublicURI() + "/images/ui_preview_icon.gif";
+ String smallPreviewHintHeight = "200px";
+ String smallPreviewHintWidth = "300px";
+ String largePreviewHintHeight = "400px";
+ String largePreviewHintWidth = "600px";
+
// Start of user code getRequirementCompact_init
//TODO: adjust the preview height & width values from the default values provided above.
- // End of user code
-
- final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirement != null) {
- final Compact compact = new Compact();
-
- compact.setAbout(aRequirement.getAbout());
- compact.setTitle(aRequirement.toString());
-
- compact.setIcon(new URI(iconUri));
-
- //Create and set attributes for OSLC preview resource
- final Preview smallPreview = new Preview();
- smallPreview.setHintHeight(smallPreviewHintHeight);
- smallPreview.setHintWidth(smallPreviewHintWidth);
- smallPreview.setDocument(UriBuilder.fromUri(aRequirement.getAbout()).path("smallPreview").build());
- compact.setSmallPreview(smallPreview);
-
- final Preview largePreview = new Preview();
- largePreview.setHintHeight(largePreviewHintHeight);
- largePreview.setHintWidth(largePreviewHintWidth);
- largePreview.setDocument(UriBuilder.fromUri(aRequirement.getAbout()).path("largePreview").build());
- compact.setLargePreview(largePreview);
-
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- return compact;
- }
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("Requirement/{serviceProviderId}/{resourceId}/smallPreview")
- @Produces({ MediaType.TEXT_HTML })
- public void getRequirementAsHtmlSmallPreview(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- // Start of user code getRequirementAsHtmlSmallPreview_init
- // End of user code
-
- final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirement != null) {
- httpServletRequest.setAttribute("aRequirement", aRequirement);
- // Start of user code getRequirementAsHtmlSmallPreview_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementsmallpreview.jsp");
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- rd.forward(httpServletRequest, httpServletResponse);
- return;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("Requirement/{serviceProviderId}/{resourceId}/largePreview")
- @Produces({ MediaType.TEXT_HTML })
- public void getRequirementAsHtmlLargePreview(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- // Start of user code getRequirementAsHtmlLargePreview_init
- // End of user code
-
- final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirement != null) {
- httpServletRequest.setAttribute("aRequirement", aRequirement);
- // Start of user code getRequirementAsHtmlLargePreview_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementlargepreview.jsp");
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- rd.forward(httpServletRequest, httpServletResponse);
- return;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
- @GET
- @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
- @Produces({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON})
- @Operation(
- summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
- description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public RequirementCollection getRequirementCollection(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws IOException, ServletException, URISyntaxException
- {
- // Start of user code getResource_init
- // End of user code
-
- final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirementCollection != null) {
+ // End of user code
+
+ final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirement != null) {
+ final Compact compact = new Compact();
+
+ compact.setAbout(aRequirement.getAbout());
+ compact.setTitle(aRequirement.toString());
+
+ compact.setIcon(new URI(iconUri));
+
+ //Create and set attributes for OSLC preview resource
+ final Preview smallPreview = new Preview();
+ smallPreview.setHintHeight(smallPreviewHintHeight);
+ smallPreview.setHintWidth(smallPreviewHintWidth);
+ smallPreview.setDocument(UriBuilder.fromUri(aRequirement.getAbout()).path("smallPreview").build());
+ compact.setSmallPreview(smallPreview);
+
+ final Preview largePreview = new Preview();
+ largePreview.setHintHeight(largePreviewHintHeight);
+ largePreview.setHintWidth(largePreviewHintWidth);
+ largePreview.setDocument(UriBuilder.fromUri(aRequirement.getAbout()).path("largePreview").build());
+ compact.setLargePreview(largePreview);
+
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ return compact;
+ }
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("Requirement/{serviceProviderId}/{resourceId}/smallPreview")
+ // @Produces({ MediaType.TEXT_HTML })
+ // public void getRequirementAsHtmlSmallPreview(
+ // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ // ) throws ServletException, IOException, URISyntaxException
+ // {
+ // // Start of user code getRequirementAsHtmlSmallPreview_init
+ // // End of user code
+ //
+ // final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+ //
+ // if (aRequirement != null) {
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("aRequirement", aRequirement);
+ // // Start of user code getRequirementAsHtmlSmallPreview_setAttributes
+ // // End of user code
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementsmallpreview.jsp");
+ // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ // rd.forward(originalRequest, httpServletResponse);
+ // return;
+ // }
+ //
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
+
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("Requirement/{serviceProviderId}/{resourceId}/largePreview")
+ // @Produces({ MediaType.TEXT_HTML })
+ // public void getRequirementAsHtmlLargePreview(
+ // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ // ) throws ServletException, IOException, URISyntaxException
+ // {
+ // // Start of user code getRequirementAsHtmlLargePreview_init
+ // // End of user code
+ //
+ // final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+ //
+ // if (aRequirement != null) {
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("aRequirement", aRequirement);
+ // // Start of user code getRequirementAsHtmlLargePreview_setAttributes
+ // // End of user code
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementlargepreview.jsp");
+ // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ // rd.forward(originalRequest, httpServletResponse);
+ // return;
+ // }
+ //
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
+ @GET
+ @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
+ @Produces({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON})
+ @Operation(
+ summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
+ description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public RequirementCollection getRequirementCollection(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws IOException, ServletException, URISyntaxException
+ {
+ // Start of user code getResource_init
+ // End of user code
+
+ final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirementCollection != null) {
// Start of user code getRequirementCollection
- // End of user code
- httpServletResponse.setHeader("ETag", delegate.getETagFromRequirementCollection(aRequirementCollection));
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- return aRequirementCollection;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
- @Produces({ MediaType.TEXT_HTML })
- @Operation(
- summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
- description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public void getRequirementCollectionAsHtml(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- // Start of user code getRequirementCollectionAsHtml_init
- // End of user code
-
- final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirementCollection != null) {
- httpServletRequest.setAttribute("aRequirementCollection", aRequirementCollection);
- // Start of user code getRequirementCollectionAsHtml_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollection.jsp");
- rd.forward(httpServletRequest,httpServletResponse);
- return;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
- @Produces({OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML})
- @Operation(
- summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
- description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public Compact getRequirementCollectionCompact(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- String iconUri = OSLC4JUtils.getPublicURI() + "/images/ui_preview_icon.gif";
- String smallPreviewHintHeight = "200px";
- String smallPreviewHintWidth = "300px";
- String largePreviewHintHeight = "400px";
- String largePreviewHintWidth = "600px";
-
+ // End of user code
+ httpServletResponse.setHeader("ETag", delegate.getETagFromRequirementCollection(aRequirementCollection));
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ return aRequirementCollection;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
+ // @Produces({ MediaType.TEXT_HTML })
+ // @Operation(
+ // summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
+ // description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
+ // ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
+ // responses = {@ApiResponse(description = "default response",
+ // content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ // mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ // mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ // mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ // mediaType = MediaType.TEXT_HTML), @Content(
+ // mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ // }
+ // )
+ // public void getRequirementCollectionAsHtml(
+ // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ // ) throws ServletException, IOException, URISyntaxException
+ // {
+ // // Start of user code getRequirementCollectionAsHtml_init
+ // // End of user code
+ //
+ // final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+ //
+ // if (aRequirementCollection != null) {
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("aRequirementCollection", aRequirementCollection);
+ // // Start of user code getRequirementCollectionAsHtml_setAttributes
+ // // End of user code
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollection.jsp");
+ // rd.forward(originalRequest,httpServletResponse);
+ // return;
+ // }
+ //
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
+
+ @GET
+ @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
+ @Produces({OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML})
+ @Operation(
+ summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
+ description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public Compact getRequirementCollectionCompact(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ String iconUri = OSLC4JUtils.getPublicURI() + "/images/ui_preview_icon.gif";
+ String smallPreviewHintHeight = "200px";
+ String smallPreviewHintWidth = "300px";
+ String largePreviewHintHeight = "400px";
+ String largePreviewHintWidth = "600px";
+
// Start of user code getRequirementCollectionCompact_init
//TODO: adjust the preview height & width values from the default values provided above.
- // End of user code
-
- final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirementCollection != null) {
- final Compact compact = new Compact();
-
- compact.setAbout(aRequirementCollection.getAbout());
- compact.setTitle(aRequirementCollection.toString());
-
- compact.setIcon(new URI(iconUri));
-
- //Create and set attributes for OSLC preview resource
- final Preview smallPreview = new Preview();
- smallPreview.setHintHeight(smallPreviewHintHeight);
- smallPreview.setHintWidth(smallPreviewHintWidth);
- smallPreview.setDocument(UriBuilder.fromUri(aRequirementCollection.getAbout()).path("smallPreview").build());
- compact.setSmallPreview(smallPreview);
-
- final Preview largePreview = new Preview();
- largePreview.setHintHeight(largePreviewHintHeight);
- largePreview.setHintWidth(largePreviewHintWidth);
- largePreview.setDocument(UriBuilder.fromUri(aRequirementCollection.getAbout()).path("largePreview").build());
- compact.setLargePreview(largePreview);
-
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- return compact;
- }
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("RequirementCollection/{serviceProviderId}/{resourceId}/smallPreview")
- @Produces({ MediaType.TEXT_HTML })
- public void getRequirementCollectionAsHtmlSmallPreview(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- // Start of user code getRequirementCollectionAsHtmlSmallPreview_init
- // End of user code
-
- final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirementCollection != null) {
- httpServletRequest.setAttribute("aRequirementCollection", aRequirementCollection);
- // Start of user code getRequirementCollectionAsHtmlSmallPreview_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionsmallpreview.jsp");
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- rd.forward(httpServletRequest, httpServletResponse);
- return;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @GET
- @Path("RequirementCollection/{serviceProviderId}/{resourceId}/largePreview")
- @Produces({ MediaType.TEXT_HTML })
- public void getRequirementCollectionAsHtmlLargePreview(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws ServletException, IOException, URISyntaxException
- {
- // Start of user code getRequirementCollectionAsHtmlLargePreview_init
- // End of user code
-
- final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
-
- if (aRequirementCollection != null) {
- httpServletRequest.setAttribute("aRequirementCollection", aRequirementCollection);
- // Start of user code getRequirementCollectionAsHtmlLargePreview_setAttributes
- // End of user code
-
- RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionlargepreview.jsp");
- httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- rd.forward(httpServletRequest, httpServletResponse);
- return;
- }
-
- throw new WebApplicationException(Status.NOT_FOUND);
- }
- @DELETE
- @Path("Requirement/{serviceProviderId}/{resourceId}")
- @Operation(
- summary = "DELETE for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
- description = "DELETE for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public Response deleteRequirement(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws IOException, ServletException, URISyntaxException
- {
+ // End of user code
+
+ final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirementCollection != null) {
+ final Compact compact = new Compact();
+
+ compact.setAbout(aRequirementCollection.getAbout());
+ compact.setTitle(aRequirementCollection.toString());
+
+ compact.setIcon(new URI(iconUri));
+
+ //Create and set attributes for OSLC preview resource
+ final Preview smallPreview = new Preview();
+ smallPreview.setHintHeight(smallPreviewHintHeight);
+ smallPreview.setHintWidth(smallPreviewHintWidth);
+ smallPreview.setDocument(UriBuilder.fromUri(aRequirementCollection.getAbout()).path("smallPreview").build());
+ compact.setSmallPreview(smallPreview);
+
+ final Preview largePreview = new Preview();
+ largePreview.setHintHeight(largePreviewHintHeight);
+ largePreview.setHintWidth(largePreviewHintWidth);
+ largePreview.setDocument(UriBuilder.fromUri(aRequirementCollection.getAbout()).path("largePreview").build());
+ compact.setLargePreview(largePreview);
+
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ return compact;
+ }
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("RequirementCollection/{serviceProviderId}/{resourceId}/smallPreview")
+ // @Produces({ MediaType.TEXT_HTML })
+ // public void getRequirementCollectionAsHtmlSmallPreview(
+ // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ // ) throws ServletException, IOException, URISyntaxException
+ // {
+ // // Start of user code getRequirementCollectionAsHtmlSmallPreview_init
+ // // End of user code
+ //
+ // final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+ //
+ // if (aRequirementCollection != null) {
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("aRequirementCollection", aRequirementCollection);
+ // // Start of user code getRequirementCollectionAsHtmlSmallPreview_setAttributes
+ // // End of user code
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionsmallpreview.jsp");
+ // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ // rd.forward(originalRequest, httpServletResponse);
+ // return;
+ // }
+ //
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
+
+ // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ // @GET
+ // @Path("RequirementCollection/{serviceProviderId}/{resourceId}/largePreview")
+ // @Produces({ MediaType.TEXT_HTML })
+ // public void getRequirementCollectionAsHtmlLargePreview(
+ // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ // ) throws ServletException, IOException, URISyntaxException
+ // {
+ // // Start of user code getRequirementCollectionAsHtmlLargePreview_init
+ // // End of user code
+ //
+ // final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+ //
+ // if (aRequirementCollection != null) {
+ // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
+ // originalRequest.setAttribute("aRequirementCollection", aRequirementCollection);
+ // // Start of user code getRequirementCollectionAsHtmlLargePreview_setAttributes
+ // // End of user code
+ //
+ // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionlargepreview.jsp");
+ // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ // rd.forward(originalRequest, httpServletResponse);
+ // return;
+ // }
+ //
+ // throw new WebApplicationException(Status.NOT_FOUND);
+ // }
+ @DELETE
+ @Path("Requirement/{serviceProviderId}/{resourceId}")
+ @Operation(
+ summary = "DELETE for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
+ description = "DELETE for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public Response deleteRequirement(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws IOException, ServletException, URISyntaxException
+ {
// Start of user code deleteRequirement_init
- // End of user code
- final Requirement aResource = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
-
- if (aResource != null) {
+ // End of user code
+ final Requirement aResource = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aResource != null) {
// Start of user code deleteRequirement
- // End of user code
- boolean deleted = delegate.deleteRequirement(httpServletRequest, serviceProviderId, resourceId);
- if (deleted)
- return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
- else
- throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
- }
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @DELETE
- @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
- @Operation(
- summary = "DELETE for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
- description = "DELETE for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public Response deleteRequirementCollection(
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- ) throws IOException, ServletException, URISyntaxException
- {
+ // End of user code
+ boolean deleted = delegate.deleteRequirement(httpServletRequest, serviceProviderId, resourceId);
+ if (deleted)
+ return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
+ else
+ throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
+ }
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ @DELETE
+ @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
+ @Operation(
+ summary = "DELETE for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
+ description = "DELETE for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public Response deleteRequirementCollection(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws IOException, ServletException, URISyntaxException
+ {
// Start of user code deleteRequirementCollection_init
- // End of user code
- final RequirementCollection aResource = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
-
- if (aResource != null) {
+ // End of user code
+ final RequirementCollection aResource = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aResource != null) {
// Start of user code deleteRequirementCollection
- // End of user code
- boolean deleted = delegate.deleteRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
- if (deleted)
- return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
- else
- throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
- }
- throw new WebApplicationException(Status.NOT_FOUND);
- }
-
- @PUT
- @Path("Requirement/{serviceProviderId}/{resourceId}")
- @Consumes({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON })
- @Operation(
- summary = "PUT for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
- description = "PUT for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public Response updateRequirement(
- @HeaderParam("If-Match") final String eTagHeader,
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId ,
- final Requirement aResource
- ) throws IOException, ServletException
- {
+ // End of user code
+ boolean deleted = delegate.deleteRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+ if (deleted)
+ return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
+ else
+ throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
+ }
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ @PUT
+ @Path("Requirement/{serviceProviderId}/{resourceId}")
+ @Consumes({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON })
+ @Operation(
+ summary = "PUT for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
+ description = "PUT for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public Response updateRequirement(
+ @HeaderParam("If-Match") final String eTagHeader,
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId ,
+ final Requirement aResource
+ ) throws IOException, ServletException
+ {
// Start of user code updateRequirement_init
- // End of user code
- final Requirement originalResource = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
-
- if (originalResource != null) {
- final String originalETag = delegate.getETagFromRequirement(originalResource);
-
- if ((eTagHeader == null) || (originalETag.equals(eTagHeader))) {
+ // End of user code
+ final Requirement originalResource = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+
+ if (originalResource != null) {
+ final String originalETag = delegate.getETagFromRequirement(originalResource);
+
+ if ((eTagHeader == null) || (originalETag.equals(eTagHeader))) {
// Start of user code updateRequirement
- // End of user code
- final Requirement updatedResource = delegate.updateRequirement(httpServletRequest, aResource, serviceProviderId, resourceId);
- httpServletResponse.setHeader("ETag", delegate.getETagFromRequirement(updatedResource));
- return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
- }
- else {
- throw new WebApplicationException(Status.PRECONDITION_FAILED);
- }
- }
- else {
- throw new WebApplicationException(Status.NOT_FOUND);
- }
- }
-
- @PUT
- @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
- @Consumes({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON })
- @Operation(
- summary = "PUT for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
- description = "PUT for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
- ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
- responses = {@ApiResponse(description = "default response",
- content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_XML), @Content(
- mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- mediaType = MediaType.TEXT_HTML), @Content(
- mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- }
- )
- public Response updateRequirementCollection(
- @HeaderParam("If-Match") final String eTagHeader,
- @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId ,
- final RequirementCollection aResource
- ) throws IOException, ServletException
- {
+ // End of user code
+ final Requirement updatedResource = delegate.updateRequirement(httpServletRequest, aResource, serviceProviderId, resourceId);
+ httpServletResponse.setHeader("ETag", delegate.getETagFromRequirement(updatedResource));
+ return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
+ }
+ else {
+ throw new WebApplicationException(Status.PRECONDITION_FAILED);
+ }
+ }
+ else {
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+ }
+
+ @PUT
+ @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
+ @Consumes({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON })
+ @Operation(
+ summary = "PUT for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
+ description = "PUT for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public Response updateRequirementCollection(
+ @HeaderParam("If-Match") final String eTagHeader,
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId ,
+ final RequirementCollection aResource
+ ) throws IOException, ServletException
+ {
// Start of user code updateRequirementCollection_init
- // End of user code
- final RequirementCollection originalResource = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
-
- if (originalResource != null) {
- final String originalETag = delegate.getETagFromRequirementCollection(originalResource);
-
- if ((eTagHeader == null) || (originalETag.equals(eTagHeader))) {
+ // End of user code
+ final RequirementCollection originalResource = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+
+ if (originalResource != null) {
+ final String originalETag = delegate.getETagFromRequirementCollection(originalResource);
+
+ if ((eTagHeader == null) || (originalETag.equals(eTagHeader))) {
// Start of user code updateRequirementCollection
- // End of user code
- final RequirementCollection updatedResource = delegate.updateRequirementCollection(httpServletRequest, aResource, serviceProviderId, resourceId);
- httpServletResponse.setHeader("ETag", delegate.getETagFromRequirementCollection(updatedResource));
- return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
- }
- else {
- throw new WebApplicationException(Status.PRECONDITION_FAILED);
- }
- }
- else {
- throw new WebApplicationException(Status.NOT_FOUND);
- }
- }
-
-}
+ // End of user code
+ final RequirementCollection updatedResource = delegate.updateRequirementCollection(httpServletRequest, aResource, serviceProviderId, resourceId);
+ httpServletResponse.setHeader("ETag", delegate.getETagFromRequirementCollection(updatedResource));
+ return Response.ok().header(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2).build();
+ }
+ else {
+ throw new WebApplicationException(Status.PRECONDITION_FAILED);
+ }
+ }
+ else {
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+ }
+
+}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java
index a02786cf..7182cadb 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java
@@ -85,7 +85,7 @@
* Generated by Lyo Designer 7.0.0.qualifier
*/
-@OpenAPIDefinition(info = @Info(title = "RM", version = "1.0.0"), servers = @Server(url = "/services/"))
+@OpenAPIDefinition(info = @Info(title = "RM", version = "1.0.0"), servers = @Server(url = "/"))
public class Application extends jakarta.ws.rs.core.Application {
private static final Set> RESOURCE_CLASSES = new HashSet>();
@@ -134,6 +134,7 @@ public Set
-
- io.quarkus
- quarkus-resteasy-qute
-
io.quarkus
quarkus-smallrye-openapi
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java
index c1247b15..f5ea0116 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/Requirement_collectionsService.java
@@ -85,7 +85,6 @@
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.ServerConstants;
-import co.oslc.refimpl.rm.gen.util.ServletUtil;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
@@ -188,74 +187,72 @@ public RequirementCollection[] queryRequirementCollections(
return resources.toArray(new RequirementCollection [resources.size()]);
}
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("query")
- // @Produces({ MediaType.TEXT_HTML })
- // @Operation(
- // summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "}",
- // description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}" +
- // ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}",
- // responses = {
- // @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
- // }
- // )
- // public void queryRequirementCollectionsAsHtml(
- // @PathParam("serviceProviderId") final String serviceProviderId ,
- // @QueryParam("oslc.where") final String where,
- // @QueryParam("oslc.prefix") final String prefix,
- // @QueryParam("oslc.paging") final String pagingString,
- // @QueryParam("page") final String pageString,
- // @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
- // {
- // boolean paging=false;
- // int page=0;
- // int pageSize=20;
- // if (null != pagingString) {
- // paging = Boolean.parseBoolean(pagingString);
- // }
- // if (null != pageString) {
- // page = Integer.parseInt(pageString);
- // }
- // if (null != pageSizeString) {
- // pageSize = Integer.parseInt(pageSizeString);
- // }
- //
- // // Start of user code queryRequirementCollectionsAsHtml
- // // End of user code
- //
- // List resources = delegate.queryRequirementCollections(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
- //
- // if (resources!= null) {
- // // Start of user code queryRequirementCollectionsAsHtml_setAttributes
- // // End of user code
- //
- // UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
- // .queryParam("oslc.paging", "true")
- // .queryParam("oslc.pageSize", pageSize)
- // .queryParam("page", page);
- // if (null != where) {
- // uriBuilder.queryParam("oslc.where", where);
- // }
- // if (null != prefix) {
- // uriBuilder.queryParam("oslc.prefix", prefix);
- // }
- // httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
- //
- // if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
- // || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
- // resources = resources.subList(0, pageSize);
- // uriBuilder.replaceQueryParam("page", page + 1);
- // httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
- // }
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("resources", resources);
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionscollection.jsp");
- // rd.forward(originalRequest,httpServletResponse);
- // return;
- // }
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
+ @GET
+ @Path("query")
+ @Produces({ MediaType.TEXT_HTML })
+ @Operation(
+ summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "}",
+ description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}" +
+ ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "}",
+ responses = {
+ @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
+ }
+ )
+ public void queryRequirementCollectionsAsHtml(
+ @PathParam("serviceProviderId") final String serviceProviderId ,
+ @QueryParam("oslc.where") final String where,
+ @QueryParam("oslc.prefix") final String prefix,
+ @QueryParam("oslc.paging") final String pagingString,
+ @QueryParam("page") final String pageString,
+ @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
+ {
+ boolean paging=false;
+ int page=0;
+ int pageSize=20;
+ if (null != pagingString) {
+ paging = Boolean.parseBoolean(pagingString);
+ }
+ if (null != pageString) {
+ page = Integer.parseInt(pageString);
+ }
+ if (null != pageSizeString) {
+ pageSize = Integer.parseInt(pageSizeString);
+ }
+
+ // Start of user code queryRequirementCollectionsAsHtml
+ // End of user code
+
+ List resources = delegate.queryRequirementCollections(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
+
+ if (resources!= null) {
+ // Start of user code queryRequirementCollectionsAsHtml_setAttributes
+ // End of user code
+
+ UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
+ .queryParam("oslc.paging", "true")
+ .queryParam("oslc.pageSize", pageSize)
+ .queryParam("page", page);
+ if (null != where) {
+ uriBuilder.queryParam("oslc.where", where);
+ }
+ if (null != prefix) {
+ uriBuilder.queryParam("oslc.prefix", prefix);
+ }
+ httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
+
+ if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
+ || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
+ resources = resources.subList(0, pageSize);
+ uriBuilder.replaceQueryParam("page", page + 1);
+ httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
+ }
+ httpServletRequest.setAttribute("resources", resources);
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionscollection.jsp");
+ rd.forward(httpServletRequest,httpServletResponse);
+ return;
+ }
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
@OslcDialog
(
@@ -304,9 +301,8 @@ public Response RequirementCollectionSelector(
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
} else {
- HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionselector.jsp");
- rd.forward(originalRequest, httpServletResponse);
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionselector.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
return null;
}
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java
index 2e7bb982..b7b350f0 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/RequirementsService.java
@@ -85,7 +85,6 @@
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.ServerConstants;
-import co.oslc.refimpl.rm.gen.util.ServletUtil;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
@@ -94,8 +93,6 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
-import io.quarkus.qute.Template;
-import io.quarkus.qute.TemplateInstance;
// Start of user code imports
// End of user code
@@ -111,7 +108,6 @@ public class RequirementsService
@Context private HttpServletResponse httpServletResponse;
@Context private UriInfo uriInfo;
@Inject private RestDelegate delegate;
- @Inject Template requirementSelector;
private static final Logger log = LoggerFactory.getLogger(RequirementsService.class);
@@ -191,74 +187,72 @@ public Requirement[] queryRequirements(
return resources.toArray(new Requirement [resources.size()]);
}
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("query")
- // @Produces({ MediaType.TEXT_HTML })
- // @Operation(
- // summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "}",
- // description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}" +
- // ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}",
- // responses = {
- // @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
- // }
- // )
- // public void queryRequirementsAsHtml(
- // @PathParam("serviceProviderId") final String serviceProviderId ,
- // @QueryParam("oslc.where") final String where,
- // @QueryParam("oslc.prefix") final String prefix,
- // @QueryParam("oslc.paging") final String pagingString,
- // @QueryParam("page") final String pageString,
- // @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
- // {
- // boolean paging=false;
- // int page=0;
- // int pageSize=20;
- // if (null != pagingString) {
- // paging = Boolean.parseBoolean(pagingString);
- // }
- // if (null != pageString) {
- // page = Integer.parseInt(pageString);
- // }
- // if (null != pageSizeString) {
- // pageSize = Integer.parseInt(pageSizeString);
- // }
- //
- // // Start of user code queryRequirementsAsHtml
- // // End of user code
- //
- // List resources = delegate.queryRequirements(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
- //
- // if (resources!= null) {
- // // Start of user code queryRequirementsAsHtml_setAttributes
- // // End of user code
- //
- // UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
- // .queryParam("oslc.paging", "true")
- // .queryParam("oslc.pageSize", pageSize)
- // .queryParam("page", page);
- // if (null != where) {
- // uriBuilder.queryParam("oslc.where", where);
- // }
- // if (null != prefix) {
- // uriBuilder.queryParam("oslc.prefix", prefix);
- // }
- // httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
- //
- // if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
- // || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
- // resources = resources.subList(0, pageSize);
- // uriBuilder.replaceQueryParam("page", page + 1);
- // httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
- // }
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("resources", resources);
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementscollection.jsp");
- // rd.forward(originalRequest,httpServletResponse);
- // return;
- // }
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
+ @GET
+ @Path("query")
+ @Produces({ MediaType.TEXT_HTML })
+ @Operation(
+ summary = "Query capability for resources of type {" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "}",
+ description = "Query capability for resources of type {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}" +
+ ", with respective resource shapes {" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "}",
+ responses = {
+ @ApiResponse(description = "default response", content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(mediaType = OslcMediaType.APPLICATION_XML), @Content(mediaType = OslcMediaType.APPLICATION_JSON), @Content(mediaType = OslcMediaType.TEXT_TURTLE), @Content(mediaType = MediaType.TEXT_HTML)})
+ }
+ )
+ public void queryRequirementsAsHtml(
+ @PathParam("serviceProviderId") final String serviceProviderId ,
+ @QueryParam("oslc.where") final String where,
+ @QueryParam("oslc.prefix") final String prefix,
+ @QueryParam("oslc.paging") final String pagingString,
+ @QueryParam("page") final String pageString,
+ @QueryParam("oslc.pageSize") final String pageSizeString) throws ServletException, IOException
+ {
+ boolean paging=false;
+ int page=0;
+ int pageSize=20;
+ if (null != pagingString) {
+ paging = Boolean.parseBoolean(pagingString);
+ }
+ if (null != pageString) {
+ page = Integer.parseInt(pageString);
+ }
+ if (null != pageSizeString) {
+ pageSize = Integer.parseInt(pageSizeString);
+ }
+
+ // Start of user code queryRequirementsAsHtml
+ // End of user code
+
+ List resources = delegate.queryRequirements(httpServletRequest, serviceProviderId, where, prefix, paging, page, pageSize);
+
+ if (resources!= null) {
+ // Start of user code queryRequirementsAsHtml_setAttributes
+ // End of user code
+
+ UriBuilder uriBuilder = UriBuilder.fromUri(uriInfo.getAbsolutePath())
+ .queryParam("oslc.paging", "true")
+ .queryParam("oslc.pageSize", pageSize)
+ .queryParam("page", page);
+ if (null != where) {
+ uriBuilder.queryParam("oslc.where", where);
+ }
+ if (null != prefix) {
+ uriBuilder.queryParam("oslc.prefix", prefix);
+ }
+ httpServletRequest.setAttribute("queryUri", uriBuilder.build().toString());
+
+ if ((OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() >= pageSize)
+ || (!OSLC4JUtils.hasLyoStorePagingPreciseLimit() && resources.size() > pageSize)) {
+ resources = resources.subList(0, pageSize);
+ uriBuilder.replaceQueryParam("page", page + 1);
+ httpServletRequest.setAttribute(OSLC4JConstants.OSLC4J_NEXT_PAGE, uriBuilder.build().toString());
+ }
+ httpServletRequest.setAttribute("resources", resources);
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementscollection.jsp");
+ rd.forward(httpServletRequest,httpServletResponse);
+ return;
+ }
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
@OslcDialog
(
@@ -272,9 +266,8 @@ public Requirement[] queryRequirements(
)
@GET
@Path("selector")
- @Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.TEXT_HTML, MediaType.WILDCARD })
- public Object RequirementSelector(
+ public Response RequirementSelector(
@QueryParam("terms") final String terms
, @PathParam("serviceProviderId") final String serviceProviderId
) throws ServletException, IOException, JSONException
@@ -282,11 +275,12 @@ public Object RequirementSelector(
// Start of user code RequirementSelector_init
// End of user code
- String selectionUri = UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString();
+ httpServletRequest.setAttribute("selectionUri",UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString());
// Start of user code RequirementSelector_setAttributes
// End of user code
if (terms != null ) {
+ httpServletRequest.setAttribute("terms", terms);
final List resources = delegate.RequirementSelector(httpServletRequest, serviceProviderId, terms);
if (resources!= null) {
JSONArray resourceArray = new JSONArray();
@@ -307,8 +301,9 @@ public Object RequirementSelector(
throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
} else {
- // Use Qute template instead of JSP
- return requirementSelector.data("selectionUri", selectionUri);
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementselector.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+ return null;
}
}
@@ -364,12 +359,11 @@ public Response RequirementCreator(
// Start of user code RequirementCreator
// End of user code
- HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- originalRequest.setAttribute("creatorUri", UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString());
- originalRequest.setAttribute("serviceProviderId", serviceProviderId);
+ httpServletRequest.setAttribute("creatorUri", UriBuilder.fromUri(OSLC4JUtils.getServletURI()).path(uriInfo.getPath()).build().toString());
+ httpServletRequest.setAttribute("serviceProviderId", serviceProviderId);
- RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcreator.jsp");
- rd.forward(originalRequest, httpServletResponse);
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcreator.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
return null;
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java
index f0c21abd..745c9694 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ResourceShapeService.java
@@ -52,7 +52,6 @@
import io.swagger.v3.oas.annotations.Operation;
import co.oslc.refimpl.rm.gen.servlet.Application;
-import co.oslc.refimpl.rm.gen.util.ServletUtil;
// Start of user code imports
// End of user code
@@ -93,27 +92,25 @@ public ResourceShape getResourceShape(@Context final Http
throw new WebApplicationException(Response.Status.NOT_FOUND);
}
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("{resourceShapePath}")
- // @Produces({ MediaType.TEXT_HTML })
- // public void getResourceShapeAsHtml(
- // @PathParam("resourceShapePath") final String resourceShapePath
- // ) throws ServletException, IOException, URISyntaxException, OslcCoreApplicationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
- // {
- // final Class> resourceClass = Application.getResourceShapePathToResourceClassMap().get(resourceShapePath);
- // ResourceShape aResourceShape = null;
- //
- // if (resourceClass != null)
- // {
- // aResourceShape = (ResourceShape) resourceClass.getMethod("createResourceShape").invoke(null);
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("aResourceShape", aResourceShape);
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/resourceshape.jsp");
- // rd.forward(originalRequest,httpServletResponse);
- // return;
- // }
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
+ @GET
+ @Path("{resourceShapePath}")
+ @Produces({ MediaType.TEXT_HTML })
+ public void getResourceShapeAsHtml(
+ @PathParam("resourceShapePath") final String resourceShapePath
+ ) throws ServletException, IOException, URISyntaxException, OslcCoreApplicationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException
+ {
+ final Class> resourceClass = Application.getResourceShapePathToResourceClassMap().get(resourceShapePath);
+ ResourceShape aResourceShape = null;
+
+ if (resourceClass != null)
+ {
+ aResourceShape = (ResourceShape) resourceClass.getMethod("createResourceShape").invoke(null);
+ httpServletRequest.setAttribute("aResourceShape", aResourceShape);
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/resourceshape.jsp");
+ rd.forward(httpServletRequest,httpServletResponse);
+ return;
+ }
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java
index 5002ba3a..3c4f6c35 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderCatalogService.java
@@ -31,8 +31,6 @@
import java.net.URISyntaxException;
import jakarta.servlet.RequestDispatcher;
-import jakarta.servlet.ServletRequest;
-import jakarta.servlet.http.HttpServletRequestWrapper;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.ws.rs.GET;
@@ -57,7 +55,6 @@
import co.oslc.refimpl.rm.gen.ServerConstants;
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
-import co.oslc.refimpl.rm.gen.util.ServletUtil;
// Start of user code imports
// End of user code
@@ -130,28 +127,30 @@ public ServiceProviderCatalog getServiceProviderCatalog(@PathParam("serviceProvi
/**
* Return the catalog singleton as HTML
*
- * NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported.
- * Quarkus uses Qute templates instead. For now, only RDF representations are supported.
+ * Forwards to serviceprovidercatalog_html.jsp to build the html
*
*/
- // @GET
- // @Path("{someId}")
- // @Produces(MediaType.TEXT_HTML)
- // public void getHtmlServiceProvider(@PathParam("someId") final String someId)
- // {
- // try {
- // ServiceProviderCatalog catalog = ServiceProviderCatalogSingleton.getServiceProviderCatalog(httpServletRequest);
- //
- // if (catalog !=null ) {
- // httpServletRequest.setAttribute("catalog",catalog);
- // RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovidercatalog.jsp");
- // rd.forward(httpServletRequest, httpServletResponse);
- // return;
- // }
- // } catch (WebApplicationException e) {
- // throw e;
- // } catch (Exception e) {
- // throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
- // }
- // }
+ @GET
+ @Path("{someId}")
+ @Produces(MediaType.TEXT_HTML)
+ public void getHtmlServiceProvider(@PathParam("someId") final String someId)
+ {
+ try {
+ ServiceProviderCatalog catalog = ServiceProviderCatalogSingleton.getServiceProviderCatalog(httpServletRequest);
+
+ if (catalog !=null ) {
+ httpServletRequest.setAttribute("catalog",catalog);
+ // Start of user code getHtmlServiceProvider_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovidercatalog.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+ return;
+ }
+ } catch (WebApplicationException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+ }
+ }
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java
index abffe7aa..2c101497 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/ServiceProviderService.java
@@ -52,7 +52,6 @@
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
-import co.oslc.refimpl.rm.gen.util.ServletUtil;
// Start of user code imports
// End of user code
@@ -118,23 +117,21 @@ public ServiceProvider getServiceProvider(@PathParam("serviceProviderId") final
*
* @param serviceProviderId
*/
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("{serviceProviderId}")
- // @Produces(MediaType.TEXT_HTML)
- // public void getHtmlServiceProvider(@PathParam("serviceProviderId") final String serviceProviderId) throws ServletException, IOException
- // {
- // ServiceProvider serviceProvider = ServiceProviderCatalogSingleton.getServiceProvider(httpServletRequest, serviceProviderId);
- // Service [] services = serviceProvider.getServices();
- //
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("serviceProvider", serviceProvider);
- // originalRequest.setAttribute("services", services);
- // // Start of user code getHtmlServiceProvider_setAttributes
- // // End of user code
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovider.jsp");
- // rd.forward(originalRequest, httpServletResponse);
- // return;
- // }
+ @GET
+ @Path("{serviceProviderId}")
+ @Produces(MediaType.TEXT_HTML)
+ public void getHtmlServiceProvider(@PathParam("serviceProviderId") final String serviceProviderId) throws ServletException, IOException
+ {
+ ServiceProvider serviceProvider = ServiceProviderCatalogSingleton.getServiceProvider(httpServletRequest, serviceProviderId);
+ Service [] services = serviceProvider.getServices();
+
+ httpServletRequest.setAttribute("serviceProvider", serviceProvider);
+ httpServletRequest.setAttribute("services", services);
+ // Start of user code getHtmlServiceProvider_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/serviceprovider.jsp");
+ rd.forward(httpServletRequest, httpServletResponse);
+ return;
+ }
}
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java
index 97f05cee..fb08907c 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/services/WebServiceBasic.java
@@ -83,7 +83,6 @@
import co.oslc.refimpl.rm.gen.RestDelegate;
import co.oslc.refimpl.rm.gen.ServerConstants;
-import co.oslc.refimpl.rm.gen.util.ServletUtil;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import org.eclipse.lyo.oslc.domains.rm.Oslc_rmDomainConstants;
import co.oslc.refimpl.rm.gen.servlet.ServiceProviderCatalogSingleton;
@@ -156,45 +155,43 @@ public Requirement getRequirement(
throw new WebApplicationException(Status.NOT_FOUND);
}
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("Requirement/{serviceProviderId}/{resourceId}")
- // @Produces({ MediaType.TEXT_HTML })
- // @Operation(
- // summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
- // description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
- // ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
- // responses = {@ApiResponse(description = "default response",
- // content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- // mediaType = OslcMediaType.APPLICATION_XML), @Content(
- // mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- // mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- // mediaType = MediaType.TEXT_HTML), @Content(
- // mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- // }
- // )
- // public void getRequirementAsHtml(
- // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- // ) throws ServletException, IOException, URISyntaxException
- // {
- // // Start of user code getRequirementAsHtml_init
- // // End of user code
- //
- // final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
- //
- // if (aRequirement != null) {
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("aRequirement", aRequirement);
- // // Start of user code getRequirementAsHtml_setAttributes
- // // End of user code
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirement.jsp");
- // rd.forward(originalRequest,httpServletResponse);
- // return;
- // }
- //
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
+ @GET
+ @Path("Requirement/{serviceProviderId}/{resourceId}")
+ @Produces({ MediaType.TEXT_HTML })
+ @Operation(
+ summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "'}",
+ description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENT_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public void getRequirementAsHtml(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ // Start of user code getRequirementAsHtml_init
+ // End of user code
+
+ final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirement != null) {
+ httpServletRequest.setAttribute("aRequirement", aRequirement);
+ // Start of user code getRequirementAsHtml_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirement.jsp");
+ rd.forward(httpServletRequest,httpServletResponse);
+ return;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
@GET
@Path("Requirement/{serviceProviderId}/{resourceId}")
@@ -255,61 +252,57 @@ public Compact getRequirementCompact(
throw new WebApplicationException(Status.NOT_FOUND);
}
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("Requirement/{serviceProviderId}/{resourceId}/smallPreview")
- // @Produces({ MediaType.TEXT_HTML })
- // public void getRequirementAsHtmlSmallPreview(
- // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- // ) throws ServletException, IOException, URISyntaxException
- // {
- // // Start of user code getRequirementAsHtmlSmallPreview_init
- // // End of user code
- //
- // final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
- //
- // if (aRequirement != null) {
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("aRequirement", aRequirement);
- // // Start of user code getRequirementAsHtmlSmallPreview_setAttributes
- // // End of user code
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementsmallpreview.jsp");
- // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- // rd.forward(originalRequest, httpServletResponse);
- // return;
- // }
- //
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
-
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("Requirement/{serviceProviderId}/{resourceId}/largePreview")
- // @Produces({ MediaType.TEXT_HTML })
- // public void getRequirementAsHtmlLargePreview(
- // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- // ) throws ServletException, IOException, URISyntaxException
- // {
- // // Start of user code getRequirementAsHtmlLargePreview_init
- // // End of user code
- //
- // final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
- //
- // if (aRequirement != null) {
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("aRequirement", aRequirement);
- // // Start of user code getRequirementAsHtmlLargePreview_setAttributes
- // // End of user code
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementlargepreview.jsp");
- // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- // rd.forward(originalRequest, httpServletResponse);
- // return;
- // }
- //
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
+ @GET
+ @Path("Requirement/{serviceProviderId}/{resourceId}/smallPreview")
+ @Produces({ MediaType.TEXT_HTML })
+ public void getRequirementAsHtmlSmallPreview(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ // Start of user code getRequirementAsHtmlSmallPreview_init
+ // End of user code
+
+ final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirement != null) {
+ httpServletRequest.setAttribute("aRequirement", aRequirement);
+ // Start of user code getRequirementAsHtmlSmallPreview_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementsmallpreview.jsp");
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ rd.forward(httpServletRequest, httpServletResponse);
+ return;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ @GET
+ @Path("Requirement/{serviceProviderId}/{resourceId}/largePreview")
+ @Produces({ MediaType.TEXT_HTML })
+ public void getRequirementAsHtmlLargePreview(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ // Start of user code getRequirementAsHtmlLargePreview_init
+ // End of user code
+
+ final Requirement aRequirement = delegate.getRequirement(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirement != null) {
+ httpServletRequest.setAttribute("aRequirement", aRequirement);
+ // Start of user code getRequirementAsHtmlLargePreview_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementlargepreview.jsp");
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ rd.forward(httpServletRequest, httpServletResponse);
+ return;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
@GET
@Path("RequirementCollection/{serviceProviderId}/{resourceId}")
@Produces({OslcMediaType.APPLICATION_RDF_XML, OslcMediaType.APPLICATION_JSON_LD, OslcMediaType.TEXT_TURTLE, OslcMediaType.APPLICATION_XML, OslcMediaType.APPLICATION_JSON})
@@ -346,45 +339,43 @@ public RequirementCollection getRequirementCollection(
throw new WebApplicationException(Status.NOT_FOUND);
}
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
- // @Produces({ MediaType.TEXT_HTML })
- // @Operation(
- // summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
- // description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
- // ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
- // responses = {@ApiResponse(description = "default response",
- // content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
- // mediaType = OslcMediaType.APPLICATION_XML), @Content(
- // mediaType = OslcMediaType.APPLICATION_JSON), @Content(
- // mediaType = OslcMediaType.TEXT_TURTLE), @Content(
- // mediaType = MediaType.TEXT_HTML), @Content(
- // mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
- // }
- // )
- // public void getRequirementCollectionAsHtml(
- // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- // ) throws ServletException, IOException, URISyntaxException
- // {
- // // Start of user code getRequirementCollectionAsHtml_init
- // // End of user code
- //
- // final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
- //
- // if (aRequirementCollection != null) {
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("aRequirementCollection", aRequirementCollection);
- // // Start of user code getRequirementCollectionAsHtml_setAttributes
- // // End of user code
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollection.jsp");
- // rd.forward(originalRequest,httpServletResponse);
- // return;
- // }
- //
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
+ @GET
+ @Path("RequirementCollection/{serviceProviderId}/{resourceId}")
+ @Produces({ MediaType.TEXT_HTML })
+ @Operation(
+ summary = "GET for resources of type {'" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "'}",
+ description = "GET for resources of type {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}" +
+ ", with respective resource shapes {'" + "" + Oslc_rmDomainConstants.REQUIREMENTCOLLECTION_LOCALNAME + "" + "'}",
+ responses = {@ApiResponse(description = "default response",
+ content = {@Content(mediaType = OslcMediaType.APPLICATION_RDF_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_XML), @Content(
+ mediaType = OslcMediaType.APPLICATION_JSON), @Content(
+ mediaType = OslcMediaType.TEXT_TURTLE), @Content(
+ mediaType = MediaType.TEXT_HTML), @Content(
+ mediaType = OslcMediaType.APPLICATION_X_OSLC_COMPACT_XML)})
+ }
+ )
+ public void getRequirementCollectionAsHtml(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ // Start of user code getRequirementCollectionAsHtml_init
+ // End of user code
+
+ final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirementCollection != null) {
+ httpServletRequest.setAttribute("aRequirementCollection", aRequirementCollection);
+ // Start of user code getRequirementCollectionAsHtml_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollection.jsp");
+ rd.forward(httpServletRequest,httpServletResponse);
+ return;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
@GET
@Path("RequirementCollection/{serviceProviderId}/{resourceId}")
@@ -445,61 +436,57 @@ public Compact getRequirementCollectionCompact(
throw new WebApplicationException(Status.NOT_FOUND);
}
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("RequirementCollection/{serviceProviderId}/{resourceId}/smallPreview")
- // @Produces({ MediaType.TEXT_HTML })
- // public void getRequirementCollectionAsHtmlSmallPreview(
- // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- // ) throws ServletException, IOException, URISyntaxException
- // {
- // // Start of user code getRequirementCollectionAsHtmlSmallPreview_init
- // // End of user code
- //
- // final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
- //
- // if (aRequirementCollection != null) {
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("aRequirementCollection", aRequirementCollection);
- // // Start of user code getRequirementCollectionAsHtmlSmallPreview_setAttributes
- // // End of user code
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionsmallpreview.jsp");
- // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- // rd.forward(originalRequest, httpServletResponse);
- // return;
- // }
- //
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
-
- // NOTE: HTML representation disabled in Quarkus migration as JSP forwarding is not supported. Quarkus uses Qute templates instead. For now, only RDF representations are supported.
- // @GET
- // @Path("RequirementCollection/{serviceProviderId}/{resourceId}/largePreview")
- // @Produces({ MediaType.TEXT_HTML })
- // public void getRequirementCollectionAsHtmlLargePreview(
- // @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
- // ) throws ServletException, IOException, URISyntaxException
- // {
- // // Start of user code getRequirementCollectionAsHtmlLargePreview_init
- // // End of user code
- //
- // final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
- //
- // if (aRequirementCollection != null) {
- // HttpServletRequest originalRequest = ServletUtil.unwrapRequest(httpServletRequest);
- // originalRequest.setAttribute("aRequirementCollection", aRequirementCollection);
- // // Start of user code getRequirementCollectionAsHtmlLargePreview_setAttributes
- // // End of user code
- //
- // RequestDispatcher rd = originalRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionlargepreview.jsp");
- // httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
- // rd.forward(originalRequest, httpServletResponse);
- // return;
- // }
- //
- // throw new WebApplicationException(Status.NOT_FOUND);
- // }
+ @GET
+ @Path("RequirementCollection/{serviceProviderId}/{resourceId}/smallPreview")
+ @Produces({ MediaType.TEXT_HTML })
+ public void getRequirementCollectionAsHtmlSmallPreview(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ // Start of user code getRequirementCollectionAsHtmlSmallPreview_init
+ // End of user code
+
+ final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirementCollection != null) {
+ httpServletRequest.setAttribute("aRequirementCollection", aRequirementCollection);
+ // Start of user code getRequirementCollectionAsHtmlSmallPreview_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionsmallpreview.jsp");
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ rd.forward(httpServletRequest, httpServletResponse);
+ return;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
+
+ @GET
+ @Path("RequirementCollection/{serviceProviderId}/{resourceId}/largePreview")
+ @Produces({ MediaType.TEXT_HTML })
+ public void getRequirementCollectionAsHtmlLargePreview(
+ @PathParam("serviceProviderId") final String serviceProviderId, @PathParam("resourceId") final String resourceId
+ ) throws ServletException, IOException, URISyntaxException
+ {
+ // Start of user code getRequirementCollectionAsHtmlLargePreview_init
+ // End of user code
+
+ final RequirementCollection aRequirementCollection = delegate.getRequirementCollection(httpServletRequest, serviceProviderId, resourceId);
+
+ if (aRequirementCollection != null) {
+ httpServletRequest.setAttribute("aRequirementCollection", aRequirementCollection);
+ // Start of user code getRequirementCollectionAsHtmlLargePreview_setAttributes
+ // End of user code
+
+ RequestDispatcher rd = httpServletRequest.getRequestDispatcher("/co/oslc/refimpl/rm/gen/requirementcollectionlargepreview.jsp");
+ httpServletResponse.addHeader(ServerConstants.HDR_OSLC_VERSION, ServerConstants.OSLC_VERSION_V2);
+ rd.forward(httpServletRequest, httpServletResponse);
+ return;
+ }
+
+ throw new WebApplicationException(Status.NOT_FOUND);
+ }
@DELETE
@Path("Requirement/{serviceProviderId}/{resourceId}")
@Operation(
diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java
index 7182cadb..a02786cf 100644
--- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java
+++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/servlet/Application.java
@@ -85,7 +85,7 @@
* Generated by Lyo Designer 7.0.0.qualifier
*/
-@OpenAPIDefinition(info = @Info(title = "RM", version = "1.0.0"), servers = @Server(url = "/"))
+@OpenAPIDefinition(info = @Info(title = "RM", version = "1.0.0"), servers = @Server(url = "/services/"))
public class Application extends jakarta.ws.rs.core.Application {
private static final Set> RESOURCE_CLASSES = new HashSet>();
@@ -134,7 +134,6 @@ public Set