Changeset 4752


Ignore:
Timestamp:
03/18/14 17:09:43 (11 years ago)
Author:
olhsha@mpi.nl
Message:

getting zipped cachedrepresentations and updating a jsp page. Welcome -api

Location:
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/CachedRepresentationResource.java

    r4735 r4752  
    100100   
    101101    @GET
    102     @Produces({"text/plain", "text/html", "text/xml"})
     102    @Produces({"text/plain", "text/html", "text/xml", "application/zip"})
    103103    @Path("{cachedid: " + BackendConstants.regExpIdentifier + "}/stream")
    104104    @Transactional(readOnly = true)
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/ResourceResource.java

    r4671 r4752  
    1818package eu.dasish.annotation.backend.rest;
    1919
     20import eu.dasish.annotation.backend.BackendConstants;
     21import eu.dasish.annotation.backend.Resource;
    2022import eu.dasish.annotation.backend.dao.DBIntegrityService;
    2123import java.io.IOException;
     24import java.io.InputStream;
     25import java.sql.SQLException;
     26import java.util.UUID;
    2227import javax.servlet.ServletContext;
    2328import javax.servlet.http.HttpServletRequest;
    2429import javax.servlet.http.HttpServletResponse;
     30import javax.ws.rs.GET;
     31import javax.ws.rs.Path;
     32import javax.ws.rs.PathParam;
     33import javax.ws.rs.Produces;
    2534import javax.ws.rs.core.Context;
    2635import javax.ws.rs.core.UriInfo;
     
    2938import org.slf4j.LoggerFactory;
    3039import org.springframework.beans.factory.annotation.Autowired;
     40import org.springframework.stereotype.Component;
     41import org.springframework.transaction.annotation.Transactional;
    3142
    3243/**
     
    3445 * @author olhsha
    3546 */
     47@Component
     48@Path("")
     49@Transactional(rollbackFor = {Exception.class})
    3650public class ResourceResource {
    3751
     
    7286
    7387    }
     88
     89    @GET
     90    @Produces({"text/html"})
     91    @Path("")
     92    @Transactional(readOnly = true)
     93    public String welcome() throws IOException {
     94        Number remoteUserID = this.getUserID();
     95        if (remoteUserID != null) {
     96            String welcome = "<!DOCTYPE html><body>"
     97                    + "<h3>Welcome to DASISH Webannotator (DWAN)</h3><br>"
     98                    +"<a href=\"../\"> to DWAN's test jsp page</a>"
     99                    + "</body>";
     100            return welcome;
     101        }
     102        return null;
     103    }
    74104}
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/webapp/index.jsp

    r4689 r4752  
    2525     
    2626        <br>
    27         new:  <a href="api/authentication/login">api/authentication/login  (Login/check)</a> <br>
     27        <a href="api/authentication/login"> login  (Login/check)</a> <br>
    2828         <br>
    29         new: <a href="api/authentication/logout"> api/authentication/logout</a> <br>
     29        <a href="api/authentication/logout"> logout</a> <br>
    3030        <br>
     31        <a href="api/"> Bienvenue </a> <br>
     32        <br>
    3133       
    3234        <b>Test URI-s</b><br>
    3335        <b>All output xml-s are valid w.r.t. the schema</b><br>
    34         new: GET <a href="api/authentication/user">api/authentication/user</a> ticket 500<br>
    35         new: GET <a href="api/users/admin">api/users/admin   ticket 501</a> <br>
     36        GET <a href="api/authentication/user">api/authentication/user</a> <br>
     37        GET <a href="api/users/admin">api/users/admin</a><br>
    3638        GET <a href="api/users/00000000-0000-0000-0000-0000000000112">api/users/00000000-0000-0000-0000-0000000000112</a> <br>
    3739        GET <a href="api/users/00000000-0000-0000-0000-0000000000112/current">api/users/00000000-0000-0000-0000-0000000000112/current</a>  !Problem: how to ask the servlet if the given user is logged in, may be by some other running somewhere client<br>
     
    3941        GET <a href="api/annotations?link=Sagrada">api/annotations/info?link=Sagrada</a>  <br>
    4042        GET <a href="api/annotations?link=Gaud">api/annotations/info?link=Gaud</a>  <br>
    41         GET <a href="api/annotations?after=2014-02-04 15:57:58.046908&before=2014-02-06 10:08:16.213186">api/annotations?after=2014-02-04 15:57:58.046908&before=2014-02-06 10:08:16.213186</a> <br>
     43        GET <a href="api/annotations?after=2014-02-04 15:57:58.046908&before=2014-02-06 10:08:16.213186">api/annotations?after=2014-02-04 15:57:58.046908&before=2014-04-06 10:08:16.213186</a>
    4244        !Comment: What is "namespace" query parameter? Must be implemented and tested <br>
    4345        GET <a href="api/annotations/00000000-0000-0000-0000-000000000021">api/annotations/00000000-0000-0000-0000-000000000021</a>  </br>
     
    4749        GET <a href="api/targets/00000000-0000-0000-0000-000000000032/versions">api/targets/00000000-0000-0000-0000-000000000032/versions</a>   <br>
    4850        GET <a href="api/cached/00000000-0000-0000-0000-000000000051/metadata">api/cached/00000000-0000-0000-0000-000000000051/metadata</a><br>
    49         GET <a href="api/cached/00000000-0000-0000-0000-000000000051/content">api/cached/00000000-0000-0000-0000-000000000051/content</a> !Problem: works only on image.jpeg, end maps png-blobs to jpegs.<br>
    50         updated (Stephanie's request): POST annotation with arbitrary temporary id-s for targets.<br>
     51        GET <a href="api/cached/00000000-0000-0000-0000-000000000051/content">api/cached/00000000-0000-0000-0000-000000000051/content</a><br>
     52        GET <a href="api/cached/00000000-0000-0000-0000-000000000511/stream">api/cached/00000000-0000-0000-0000-000000000511/stream</a>
     53       
    5154        <br>
    5255        <br>
Note: See TracChangeset for help on using the changeset viewer.