From fc0e181c0b429b13ae4b389eddd37382733aec2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20Jim=C3=A9nez=20Carrasco?= Date: Thu, 7 Oct 2021 17:57:01 -0500 Subject: [PATCH 1/2] Get catalogUrl for Configuration Management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding the section to look for the catalogUrl endpoint of the Configuration Management service from the Rootservices. Signed-off-by: Mario Jiménez Carrasco --- .../lyo/client/RootServicesHelper.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java b/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java index 418fa215c..3915659b5 100644 --- a/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java +++ b/client/oslc-client/src/main/java/org/eclipse/lyo/client/RootServicesHelper.java @@ -108,16 +108,19 @@ public RootServicesHelper (String url, String catalogDomain, OslcClient client) this.catalogNamespace = OSLCConstants.OSLC_AM_V2; this.catalogProperty = RootServicesConstants.AM_ROOTSERVICES_CATALOG_PROP; - } - else if (this.catalogDomain.equalsIgnoreCase(OSLCConstants.OSLC_AUTO)) { + } else if (this.catalogDomain.equalsIgnoreCase(OSLCConstants.OSLC_AUTO)) { - this.catalogNamespace = OSLCConstants.OSLC_AUTO; - this.catalogProperty = RootServicesConstants.AUTO_ROOTSERVICES_CATALOG_PROP; + this.catalogNamespace = OSLCConstants.OSLC_AUTO; + this.catalogProperty = RootServicesConstants.AUTO_ROOTSERVICES_CATALOG_PROP; - } - else { - logger.error("Jazz rootservices only supports CM, RM, QM, and Automation catalogs"); - } + } else if (this.catalogDomain.equalsIgnoreCase(OSLCConstants.OSLC_CONFIG)) { + + this.catalogNamespace = OSLCConstants.OSLC_CONFIG; + this.catalogProperty = RootServicesConstants.CM_ROOTSERVICES_CATALOG_PROP; + + } else { + logger.error("Jazz rootservices only supports CM, RM, QM, GC and Automation catalogs"); + } processRootServices(client); } From 21803f912f8b4ebda06969abbafd88d563c8ee8d Mon Sep 17 00:00:00 2001 From: isccarrasco Date: Fri, 21 Jan 2022 18:53:04 -0600 Subject: [PATCH 2/2] Fix the Dialog URL Use the URI used on the creation of the dialog to use the correct URL that contains the genericBaseURI which represents the context. Close #235 Signed-off-by: isccarrasco --- .../eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java index a33fbe169..4a349a4b8 100644 --- a/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java +++ b/core/oslc4j-core/src/main/java/org/eclipse/lyo/oslc4j/core/model/ServiceProviderFactory.java @@ -44,7 +44,7 @@ private ServiceProviderFactory() { public static ServiceProvider createServiceProvider(final String baseURI, final String genericBaseURI, final String title, final String description, final Publisher publisher, final Class[] resourceClasses) throws OslcCoreApplicationException, URISyntaxException { return initServiceProvider(new ServiceProvider(), baseURI, genericBaseURI, title, description, publisher, resourceClasses, null); } - + public static ServiceProvider createServiceProvider(final String baseURI, final String genericBaseURI, final String title, final String description, final Publisher publisher, final Class[] resourceClasses, final Map pathParameterValues) throws OslcCoreApplicationException, URISyntaxException { return initServiceProvider(new ServiceProvider(), baseURI, genericBaseURI, title, description, publisher, resourceClasses, pathParameterValues); } @@ -270,7 +270,7 @@ private static Dialog createDialog(final String baseURI, final String genericBas { // TODO: Do we chop off everything after the port and then append the dialog URI? // For now just assume that the dialog URI builds on top of the baseURI. - uri = resolvePathParameters(baseURI, null, dialogURI, pathParameterValues); + uri = resolvePathParameters(genericBaseURI, null, dialogURI, pathParameterValues); } else {