revisited the API doc
This commit is contained in:
parent
db870b5d75
commit
dba18685f6
35
pom.xml
35
pom.xml
|
@ -202,20 +202,6 @@
|
|||
<scope>compile</scope>
|
||||
</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>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
|
@ -345,27 +331,6 @@
|
|||
</executions>
|
||||
</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>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -26,9 +26,6 @@ import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
|
|||
/**
|
||||
* 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
|
||||
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#Analytics_Resolver
|
||||
*
|
||||
|
|
|
@ -75,9 +75,6 @@ public class CatalogueResolver {
|
|||
/**
|
||||
* 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 entityName the entity name
|
||||
* @param vreName the vre name
|
||||
|
|
|
@ -38,9 +38,6 @@ import com.google.common.cache.CacheLoader.InvalidCacheLoadException;
|
|||
* stored in D4Science 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
|
||||
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#GIS_Resolver
|
||||
*
|
||||
|
|
|
@ -26,9 +26,6 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* 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
|
||||
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#KNIME_Resolver
|
||||
*
|
||||
|
|
|
@ -22,9 +22,6 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* 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
|
||||
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#SMP-ID_Resolver
|
||||
*
|
||||
|
|
|
@ -22,9 +22,6 @@ import org.slf4j.LoggerFactory;
|
|||
/**
|
||||
* 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
|
||||
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#SMP_Resolver
|
||||
*
|
||||
|
|
|
@ -28,9 +28,6 @@ import org.slf4j.LoggerFactory;
|
|||
* The StorageHubResolver provides the methods either to download a gCube
|
||||
* Workspace file or to get its metadata.
|
||||
*
|
||||
* Request format
|
||||
* [URI_RESOLVER_SERVICE_ENDPOINT]/shub/[STORAGE_HUB_FILE_ID]
|
||||
*
|
||||
* See more at
|
||||
* https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#STORAGE-HUB_Resolver
|
||||
*
|
||||
|
|
|
@ -45,7 +45,7 @@ public class UriResolverDocs {
|
|||
logger.info("pathInfo {}", pathInfo);
|
||||
try {
|
||||
|
||||
if (pathInfo.equals("/docs/"))
|
||||
if (pathInfo.endsWith("/docs/"))
|
||||
pathInfo += "index.html";
|
||||
|
||||
logger.info("redirecting to {}", pathInfo);
|
||||
|
@ -65,36 +65,4 @@ public class UriResolverDocs {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue