revisited the API doc

This commit is contained in:
Francesco Mangiacrapa 2022-03-31 18:30:19 +02:00
parent db870b5d75
commit dba18685f6
9 changed files with 1 additions and 89 deletions

35
pom.xml
View File

@ -202,20 +202,6 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- REMOVE THIS ON RELESE, IT IS NEEDED TO compile 'geonetwork' -->
<!-- <dependency> -->
<!-- <groupId>org.opengis</groupId> -->
<!-- <artifactId>geoapi</artifactId> -->
<!-- <version>3.0.0</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>org.geotoolkit</groupId> -->
<!-- <artifactId>geotk-xml-base</artifactId> -->
<!-- <version>3.20-geoapi-3.0</version> -->
<!-- </dependency> -->
<dependency> <dependency>
<groupId>commons-lang</groupId> <groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId> <artifactId>commons-lang</artifactId>
@ -345,27 +331,6 @@
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>descriptor.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>servicearchive</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -26,9 +26,6 @@ import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
/** /**
* The AnalyticsGetResolver to resolve an Analytics URL * The AnalyticsGetResolver to resolve an Analytics URL
* *
* Request format
* [URI_RESOLVER_SERVICE_ENDPOINT]/analytics/get/[VRE_NAME]?dim=[PUBLIC_URL_TO_DATAMIER_INVOCATION_FILE_GENERATED_BY_POST_REQUEST]
*
* See more at * See more at
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#Analytics_Resolver * https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#Analytics_Resolver
* *

View File

@ -74,9 +74,6 @@ public class CatalogueResolver {
/** /**
* Resolve an entity of the Catalogue * Resolve an entity of the Catalogue
*
* Request format:
* [URI_RESOLVER_SERVICE_ENDPOINT]/[ctlg|ctlg-d|ctlg-o|ctlg-g]/[VRE_NAME]/[entity_name]
* *
* @param req the req * @param req the req
* @param entityName the entity name * @param entityName the entity name

View File

@ -37,9 +37,6 @@ import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
* Application) in order to display and navigate on web-map the gis layers * Application) in order to display and navigate on web-map the gis layers
* stored in D4Science Geonetwork * stored in D4Science Geonetwork
* (e.g. http://wiki.i-marine.eu/index.php/Blue_Hackathon_iMarine_Data_Challenges#iMarine_GeoNetwork) * (e.g. http://wiki.i-marine.eu/index.php/Blue_Hackathon_iMarine_Data_Challenges#iMarine_GeoNetwork)
*
* Request format
* [URI_RESOLVER_SERVICE_ENDPOINT]/gis?gis-UUID=[UUID]&scope=[SCOPE]
* *
* See more at * See more at
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#GIS_Resolver * https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#GIS_Resolver

View File

@ -26,9 +26,6 @@ import org.slf4j.LoggerFactory;
/** /**
* The KnimeCreateResolver is able to create a KNIME URL. * The KnimeCreateResolver is able to create a KNIME URL.
* *
* Request format
* [URI_RESOLVER_SERVICE_ENDPOINT]/knime/create?[QUERY_STRING_TO_INVOKE_A_KNIME_MODEL]
*
* See more at * See more at
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#KNIME_Resolver * https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#KNIME_Resolver
* *

View File

@ -22,9 +22,6 @@ import org.slf4j.LoggerFactory;
/** /**
* The SMPIDResolver is able to give HTTP resolution to storage resource by ID. * The SMPIDResolver is able to give HTTP resolution to storage resource by ID.
* *
* Request format
* [URI_RESOLVER_SERVICE_ENDPOINT]/id?smp-id=[STORAGE_SMP_ID]&fileName=[FILENAME]&contentType=[CONTENT_TYPE]
*
* See more at * See more at
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#SMP-ID_Resolver * https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#SMP-ID_Resolver
* *

View File

@ -22,9 +22,6 @@ import org.slf4j.LoggerFactory;
/** /**
* The SMPResolver is able to give HTTP resolution to SMP protocol URIs * The SMPResolver is able to give HTTP resolution to SMP protocol URIs
* *
* Request format
* [URI_RESOLVER_SERVICE_ENDPOINT]/smp?smp-uri=smp://.....
*
* See more at * See more at
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#SMP_Resolver * https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#SMP_Resolver
* *

View File

@ -28,9 +28,6 @@ import org.slf4j.LoggerFactory;
* The StorageHubResolver provides the methods either to download a gCube * The StorageHubResolver provides the methods either to download a gCube
* Workspace file or to get its metadata. * Workspace file or to get its metadata.
* *
* Request format
* [URI_RESOLVER_SERVICE_ENDPOINT]/shub/[STORAGE_HUB_FILE_ID]
*
* See more at * See more at
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#STORAGE-HUB_Resolver * https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#STORAGE-HUB_Resolver
* *

View File

@ -45,7 +45,7 @@ public class UriResolverDocs {
logger.info("pathInfo {}", pathInfo); logger.info("pathInfo {}", pathInfo);
try { try {
if (pathInfo.equals("/docs/")) if (pathInfo.endsWith("/docs/"))
pathInfo += "index.html"; pathInfo += "index.html";
logger.info("redirecting to {}", pathInfo); logger.info("redirecting to {}", pathInfo);
@ -65,36 +65,4 @@ public class UriResolverDocs {
throw (WebApplicationException) e; throw (WebApplicationException) e;
} }
} }
/**
* Index.
*
* @param req the req
* @return the input stream
* @throws WebApplicationException the web application exception
*/
@GET
// @Produces({ MediaType.TEXT_HTML })
@Path("")
public InputStream index(@Context HttpServletRequest req) throws WebApplicationException {
logger.info(UriResolverDocs.class.getSimpleName() + " index called");
String pathInfo = "/docs/index.html";
try {
String realPath = req.getServletContext().getRealPath(pathInfo);
return new FileInputStream(new File(realPath));
} catch (Exception e) {
if (!(e instanceof WebApplicationException)) {
// UNEXPECTED EXCEPTION managing it as WebApplicationException
String error = pathInfo + " not found. Please, contact the support!";
throw ExceptionManager.internalErrorException(req, error, this.getClass(), null);
}
// ALREADY MANAGED AS WebApplicationException
logger.error("Exception:", e);
throw (WebApplicationException) e;
}
}
} }