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:
Francesco Mangiacrapa 2016-06-24 13:26:58 +00:00
parent 3dfbc38af0
commit cc96a64745
7 changed files with 76 additions and 164 deletions

22
pom.xml
View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>uri-resolver-manager</artifactId>
<version>1.1.1-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>uri-resolver-manager</name>
<description>The URI Resolver Manager</description>
@ -30,19 +30,6 @@
</developer>
</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>
<distroDirectory>${project.basedir}/distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
@ -68,7 +55,7 @@
<dependency>
<groupId>org.gcube.resources.discovery</groupId>
<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>
</dependency>
<!-- END FWS -->
@ -119,16 +106,19 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>compile</scope>
<version>1.2.16</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
<scope>compile</scope>
</dependency>

View File

@ -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>

View File

@ -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>

View File

@ -1,3 +0,0 @@
File touchFile = new File( basedir, "target/touch.txt" );
assert touchFile.isFile()

View File

@ -37,6 +37,8 @@ public class UriResolverMapReader {
public static final String URIRESOLVERMAP_SECONDARY_TYPE = "UriResolverMap";
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 String secondaryType;
private String scope;
@ -78,24 +80,33 @@ public class UriResolverMapReader {
logger.info(queryString);
try {
logger.info("Getting Infrastructure Name...: ");
String infra = ScopeUtil.getInfrastructureNameFromScope(this.scope);
logger.info("Infrastructure Name returned: "+infra);
ScopeProvider.instance.set(infra);
logger.info("scope provider set instance: "+infra);
Query q = new QueryBox(queryString);
logger.info("new query box works");
DiscoveryClient<String> client = client();
logger.info("submitting query is: "+queryString);
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");
else {
}else {
logger.info("Building new DocumentBuilder..");
String elem = appUriResolverMap.get(0);
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Node node = docBuilder.parse(new InputSource(new StringReader(elem))).getDocumentElement();
logger.info("Building new XPathHelper..");
XPathHelper helper = new XPathHelper(node);
List<String> currValue = null;
logger.info("Evaluating XPath..");
currValue = helper.evaluate("/Resource/Profile/Body/access_point/application_type/text()");
if (currValue != null && currValue.size() > 0) {
logger.info("Application Types are: "+currValue.size());
@ -120,6 +131,9 @@ public class UriResolverMapReader {
} catch (Exception 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");
}finally{
ScopeProvider.instance.reset();
}
}

View File

@ -24,7 +24,7 @@ public class ScopeUtil {
}
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;
logger.warn("Tentative as scope: "+scope);
}

View File

@ -22,7 +22,7 @@ public class UriResolverManagerTest {
public void testUriResolverManger(){
UriResolverManager manager;
try {
ScopeProvider.instance.set("/gcube/devsec/devVRE");
ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab");
manager = new UriResolverManager();
System.out.println(manager.getCapabilities());
System.out.println(manager.getApplicationTypes());
@ -36,7 +36,7 @@ public class UriResolverManagerTest {
}
@Test
// @Test
public void testGIS() {
try {
@ -81,7 +81,7 @@ public class UriResolverManagerTest {
/**
* Thread safe
*/
@Test
// @Test
public void testSMPID(){
try {