comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java @ 93:3d1a00418b42 admin_ui_rel_links

starting web admin ui with relative links. doesn't fully work yet.
author casties
date Mon, 09 Feb 2015 12:55:51 +0100
parents e973cbf5d58f
children
comparison
equal deleted inserted replaced
92:aadf8760216d 93:3d1a00418b42
120 result += "</table>\n</form>\n</body>\n</html>"; 120 result += "</table>\n</form>\n</body>\n</html>";
121 */ 121 */
122 } else { 122 } else {
123 // output person content 123 // output person content
124 result = "<html><body>\n<h1>Annotation</h1>\n"; 124 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>";
126 result += "<table>"; 126 result += "<table>";
127 result += String.format("<tr><td><b>uri</b></td><td>%s</td></tr>\n", annotation.getUri()); 127 result += String.format("<tr><td><b>uri</b></td><td>%s</td></tr>\n", annotation.getUri());
128 result += String.format("<tr><td><b>text</b></td><td>%s</td></tr>\n", annotation.getBodyText()); 128 result += String.format("<tr><td><b>text</b></td><td>%s</td></tr>\n", annotation.getBodyText());
129 result += String.format("<tr><td><b>target</b></td><td>%s</td></tr>\n", annotation.getTargetBaseUri()); 129 result += String.format("<tr><td><b>target</b></td><td>%s</td></tr>\n", annotation.getTargetBaseUri());
130 result += String.format("<tr><td><b>fragment</b></td><td>%s</td></tr>\n", annotation.getTargetFragment()); 130 result += String.format("<tr><td><b>fragment</b></td><td>%s</td></tr>\n", annotation.getTargetFragment());
139 result += String.format("<tr><td><b>update permission</b></td><td>%s</td></tr>\n", annotation.getUpdatePermission() != null ? annotation.getUpdatePermission().getIdString() : "null"); 139 result += String.format("<tr><td><b>update permission</b></td><td>%s</td></tr>\n", annotation.getUpdatePermission() != null ? annotation.getUpdatePermission().getIdString() : "null");
140 result += String.format("<tr><td><b>read permission</b></td><td>%s</td></tr>\n", annotation.getReadPermission() != null ? annotation.getReadPermission().getIdString() : "null"); 140 result += String.format("<tr><td><b>read permission</b></td><td>%s</td></tr>\n", annotation.getReadPermission() != null ? annotation.getReadPermission().getIdString() : "null");
141 result += "</table>\n"; 141 result += "</table>\n";
142 //result += "<p><a href=\"?form=edit\">Edit annotation</a></p>\n"; 142 //result += "<p><a href=\"?form=edit\">Edit annotation</a></p>\n";
143 // tunnel POST as DELETE 143 // tunnel POST as DELETE
144 result += String.format( 144 result += "<form method=\"post\" action=\"?method=DELETE\"><input type=\"submit\" value=\"Delete annotation\"/></form>\n";
145 "<form method=\"post\" action=\"%s?method=DELETE\"><input type=\"submit\" value=\"Delete annotation\"/></form>\n",
146 this.getReference().getHierarchicalPart());
147 result += "</body>\n</html>"; 145 result += "</body>\n</html>";
148 } 146 }
149 return new StringRepresentation(result, MediaType.TEXT_HTML); 147 return new StringRepresentation(result, MediaType.TEXT_HTML);
150 } 148 }
151 149