Changeset 93:3d1a00418b42 in AnnotationManagerN4J for src


Ignore:
Timestamp:
Feb 9, 2015, 11:55:51 AM (9 years ago)
Author:
casties
Branch:
admin_ui_rel_links
Message:

starting web admin ui with relative links. doesn't fully work yet.

Location:
src/main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java

    r78 r93  
    123123            // output person content
    124124            result = "<html><body>\n<h1>Annotation</h1>\n";
    125             result += String.format("<p><a href=\"%s\">All annotations</a></p>", this.getReference().getParentRef());
     125            result += "<p><a href=\"./\">All annotations</a></p>";
    126126            result += "<table>";
    127127            result += String.format("<tr><td><b>uri</b></td><td>%s</td></tr>\n", annotation.getUri());
     
    142142            //result += "<p><a href=\"?form=edit\">Edit annotation</a></p>\n";
    143143            // tunnel POST as DELETE
    144             result += String.format(
    145                     "<form method=\"post\" action=\"%s?method=DELETE\"><input type=\"submit\" value=\"Delete annotation\"/></form>\n",
    146                     this.getReference().getHierarchicalPart());
     144            result += "<form method=\"post\" action=\"?method=DELETE\"><input type=\"submit\" value=\"Delete annotation\"/></form>\n";
    147145            result += "</body>\n</html>";
    148146        }
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationsResource.java

    r75 r93  
    7676        List<Annotation> annotations = store.getAnnotations("id", "*");
    7777        for (Annotation annotation : annotations) {
    78             Reference url = this.getReference().clone();
    79             url.addSegment(annotation.getUrlId());
     78            String url = annotation.getUrlId();
    8079            result += String.format("<tr><td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n", url,
    8180                    annotation.getUri(), annotation.getBodyText(), annotation.getTargetBaseUri(), annotation.getTargetFragment(),
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationsUiRestlet.java

    r75 r93  
    1 /**
    2  *
    3  */
    41package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
    52
     
    4239public class AnnotationsUiRestlet extends BaseRestlet {
    4340
    44     public final String version = "AnnotationManagerN4J/AnnotationsUI 0.3";
     41    public final String version = "AnnotationManagerN4J/AnnotationsUI 0.4";
    4542
    4643    public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.AnnotationsUiRestlet");
     
    8481        }
    8582        // Create a Guard
    86         ChallengeAuthenticator guard = new ChallengeAuthenticator(getContext(), ChallengeScheme.HTTP_BASIC, "Tutorial");
     83        ChallengeAuthenticator guard = new ChallengeAuthenticator(getContext(), ChallengeScheme.HTTP_BASIC, "Annotation Server");
    8784        guard.setVerifier(verifier);
    8885        // put everything through guard
  • src/main/webapp/index.html

    r54 r93  
    2525  <h2>Admin</h2>
    2626  <ul>
    27     <li><a href="annotations/groups">View and edit groups</a></li>
    28     <li><a href="annotations/persons">View and edit persons</a></li>
    29     <li><a href="annotations/annotations">View and edit annotations</a></li>
     27    <li><a href="annotations/groups/">View and edit groups</a></li>
     28    <li><a href="annotations/persons/">View and edit persons</a></li>
     29    <li><a href="annotations/annotations/">View and edit annotations</a></li>
    3030  </ul>
    3131</body>
Note: See TracChangeset for help on using the changeset viewer.