removed maven-portal-bom
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/uri-resolver-manager@129428 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3dfbc38af0
commit
cc96a64745
22
pom.xml
22
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>uri-resolver-manager</artifactId>
|
<artifactId>uri-resolver-manager</artifactId>
|
||||||
<version>1.1.1-SNAPSHOT</version>
|
<version>1.2.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>uri-resolver-manager</name>
|
<name>uri-resolver-manager</name>
|
||||||
<description>The URI Resolver Manager</description>
|
<description>The URI Resolver Manager</description>
|
||||||
|
@ -30,19 +30,6 @@
|
||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
|
|
||||||
|
|
||||||
<dependencyManagement>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.distribution</groupId>
|
|
||||||
<artifactId>maven-portal-bom</artifactId>
|
|
||||||
<version>LATEST</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</dependencyManagement>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
||||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||||
|
@ -68,7 +55,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.resources.discovery</groupId>
|
<groupId>org.gcube.resources.discovery</groupId>
|
||||||
<artifactId>ic-client</artifactId>
|
<artifactId>ic-client</artifactId>
|
||||||
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- END FWS -->
|
<!-- END FWS -->
|
||||||
|
@ -119,16 +106,19 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>log4j</groupId>
|
<groupId>log4j</groupId>
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>log4j</artifactId>
|
||||||
<scope>compile</scope>
|
<version>1.2.16</version>
|
||||||
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
<version>1.6.4</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>1.6.4</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
or more contributor license agreements. See the NOTICE file
|
|
||||||
distributed with this work for additional information
|
|
||||||
regarding copyright ownership. The ASF licenses this file
|
|
||||||
to you under the Apache License, Version 2.0 (the
|
|
||||||
"License"); you may not use this file except in compliance
|
|
||||||
with the License. You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing,
|
|
||||||
software distributed under the License is distributed on an
|
|
||||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
KIND, either express or implied. See the License for the
|
|
||||||
specific language governing permissions and limitations
|
|
||||||
under the License.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<settings>
|
|
||||||
<profiles>
|
|
||||||
<profile>
|
|
||||||
<id>it-repo</id>
|
|
||||||
<activation>
|
|
||||||
<activeByDefault>true</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
<repositories>
|
|
||||||
<repository>
|
|
||||||
<id>local.central</id>
|
|
||||||
<url>@localRepositoryUrl@</url>
|
|
||||||
<releases>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</releases>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
|
||||||
<pluginRepositories>
|
|
||||||
<pluginRepository>
|
|
||||||
<id>local.central</id>
|
|
||||||
<url>@localRepositoryUrl@</url>
|
|
||||||
<releases>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</releases>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</pluginRepository>
|
|
||||||
</pluginRepositories>
|
|
||||||
</profile>
|
|
||||||
</profiles>
|
|
||||||
</settings>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<groupId>org.gcube.portlets.user.it</groupId>
|
|
||||||
<artifactId>simple-it</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
|
|
||||||
<description>A simple IT verifying the basic use case.</description>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>@project.groupId@</groupId>
|
|
||||||
<artifactId>@project.artifactId@</artifactId>
|
|
||||||
<version>@project.version@</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>touch</id>
|
|
||||||
<phase>validate</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>touch</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
|
@ -1,3 +0,0 @@
|
||||||
File touchFile = new File( basedir, "target/touch.txt" );
|
|
||||||
|
|
||||||
assert touchFile.isFile()
|
|
|
@ -37,6 +37,8 @@ public class UriResolverMapReader {
|
||||||
public static final String URIRESOLVERMAP_SECONDARY_TYPE = "UriResolverMap";
|
public static final String URIRESOLVERMAP_SECONDARY_TYPE = "UriResolverMap";
|
||||||
public static final String URI_RESOLVER_MAP_RESOURCE_NAME = "Uri-Resolver-Map";
|
public static final String URI_RESOLVER_MAP_RESOURCE_NAME = "Uri-Resolver-Map";
|
||||||
|
|
||||||
|
// private Logger logger = LoggerFactory.getLogger(UriResolverMapReader.class);
|
||||||
|
//TODO TEMP SOLUTION IN ORDER TO PRINT USING ALSO LOG4J INTO GEOEXPLORER PORTLET
|
||||||
private Logger logger = LoggerFactory.getLogger(UriResolverMapReader.class);
|
private Logger logger = LoggerFactory.getLogger(UriResolverMapReader.class);
|
||||||
private String secondaryType;
|
private String secondaryType;
|
||||||
private String scope;
|
private String scope;
|
||||||
|
@ -78,24 +80,33 @@ public class UriResolverMapReader {
|
||||||
logger.info(queryString);
|
logger.info(queryString);
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
logger.info("Getting Infrastructure Name...: ");
|
||||||
String infra = ScopeUtil.getInfrastructureNameFromScope(this.scope);
|
String infra = ScopeUtil.getInfrastructureNameFromScope(this.scope);
|
||||||
|
logger.info("Infrastructure Name returned: "+infra);
|
||||||
|
|
||||||
ScopeProvider.instance.set(infra);
|
ScopeProvider.instance.set(infra);
|
||||||
logger.info("scope provider set instance: "+infra);
|
logger.info("scope provider set instance: "+infra);
|
||||||
|
|
||||||
Query q = new QueryBox(queryString);
|
Query q = new QueryBox(queryString);
|
||||||
|
logger.info("new query box works");
|
||||||
|
|
||||||
DiscoveryClient<String> client = client();
|
DiscoveryClient<String> client = client();
|
||||||
|
logger.info("submitting query is: "+queryString);
|
||||||
List<String> appUriResolverMap = client.submit(q);
|
List<String> appUriResolverMap = client.submit(q);
|
||||||
|
logger.info("submit query works");
|
||||||
|
|
||||||
if (appUriResolverMap == null || appUriResolverMap.size() == 0)
|
if (appUriResolverMap == null || appUriResolverMap.size() == 0){
|
||||||
|
logger.error("Your applicationProfile with secondaryType: "+secondaryType+" and name "+resourceName+" is not registered in the infrastructure, scope: "+ScopeProvider.instance.get());
|
||||||
throw new ApplicationProfileException("Your applicationProfile with secondaryType: "+secondaryType+" and name "+resourceName+" is not registered in the infrastructure");
|
throw new ApplicationProfileException("Your applicationProfile with secondaryType: "+secondaryType+" and name "+resourceName+" is not registered in the infrastructure");
|
||||||
else {
|
}else {
|
||||||
|
logger.info("Building new DocumentBuilder..");
|
||||||
String elem = appUriResolverMap.get(0);
|
String elem = appUriResolverMap.get(0);
|
||||||
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||||
Node node = docBuilder.parse(new InputSource(new StringReader(elem))).getDocumentElement();
|
Node node = docBuilder.parse(new InputSource(new StringReader(elem))).getDocumentElement();
|
||||||
|
logger.info("Building new XPathHelper..");
|
||||||
XPathHelper helper = new XPathHelper(node);
|
XPathHelper helper = new XPathHelper(node);
|
||||||
List<String> currValue = null;
|
List<String> currValue = null;
|
||||||
|
logger.info("Evaluating XPath..");
|
||||||
currValue = helper.evaluate("/Resource/Profile/Body/access_point/application_type/text()");
|
currValue = helper.evaluate("/Resource/Profile/Body/access_point/application_type/text()");
|
||||||
if (currValue != null && currValue.size() > 0) {
|
if (currValue != null && currValue.size() > 0) {
|
||||||
logger.info("Application Types are: "+currValue.size());
|
logger.info("Application Types are: "+currValue.size());
|
||||||
|
@ -120,6 +131,9 @@ public class UriResolverMapReader {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Error while trying to fetch applicationProfile with secondaryType: "+secondaryType+" and name "+resourceName+" from the infrastructure", e);
|
logger.error("Error while trying to fetch applicationProfile with secondaryType: "+secondaryType+" and name "+resourceName+" from the infrastructure", e);
|
||||||
throw new ApplicationProfileException("Error while trying to fetch applicationProfile with secondaryType: "+secondaryType+" and name "+resourceName+" from the infrastructure");
|
throw new ApplicationProfileException("Error while trying to fetch applicationProfile with secondaryType: "+secondaryType+" and name "+resourceName+" from the infrastructure");
|
||||||
|
}finally{
|
||||||
|
|
||||||
|
ScopeProvider.instance.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class ScopeUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!scope.startsWith(SCOPE_SEPARATOR)){
|
if(!scope.startsWith(SCOPE_SEPARATOR)){
|
||||||
logger.warn("Input scope: "+scope+" not have / is a really scope?");
|
logger.warn("Input scope: "+scope+" has not / is a really scope?");
|
||||||
scope = SCOPE_SEPARATOR+scope;
|
scope = SCOPE_SEPARATOR+scope;
|
||||||
logger.warn("Tentative as scope: "+scope);
|
logger.warn("Tentative as scope: "+scope);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class UriResolverManagerTest {
|
||||||
public void testUriResolverManger(){
|
public void testUriResolverManger(){
|
||||||
UriResolverManager manager;
|
UriResolverManager manager;
|
||||||
try {
|
try {
|
||||||
ScopeProvider.instance.set("/gcube/devsec/devVRE");
|
ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab");
|
||||||
manager = new UriResolverManager();
|
manager = new UriResolverManager();
|
||||||
System.out.println(manager.getCapabilities());
|
System.out.println(manager.getCapabilities());
|
||||||
System.out.println(manager.getApplicationTypes());
|
System.out.println(manager.getApplicationTypes());
|
||||||
|
@ -36,7 +36,7 @@ public class UriResolverManagerTest {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
// @Test
|
||||||
public void testGIS() {
|
public void testGIS() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -81,7 +81,7 @@ public class UriResolverManagerTest {
|
||||||
/**
|
/**
|
||||||
* Thread safe
|
* Thread safe
|
||||||
*/
|
*/
|
||||||
@Test
|
// @Test
|
||||||
public void testSMPID(){
|
public void testSMPID(){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue