Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java @ 75:25eb2e1df106
change logging to java.util.logging.
author | casties |
---|---|
date | Fri, 21 Mar 2014 13:32:41 +0100 |
parents | 2b1e6df5e21a |
children | f2ff7de7b49d |
comparison
equal
deleted
inserted
replaced
74:e5ff09208c28 | 75:25eb2e1df106 |
---|---|
25 * #L% | 25 * #L% |
26 */ | 26 */ |
27 | 27 |
28 import java.io.UnsupportedEncodingException; | 28 import java.io.UnsupportedEncodingException; |
29 import java.net.URLDecoder; | 29 import java.net.URLDecoder; |
30 | 30 import java.util.logging.Logger; |
31 import org.apache.log4j.Logger; | 31 |
32 import org.restlet.data.Form; | 32 import org.restlet.data.Form; |
33 import org.restlet.data.MediaType; | 33 import org.restlet.data.MediaType; |
34 import org.restlet.data.Reference; | 34 import org.restlet.data.Reference; |
35 import org.restlet.data.Status; | 35 import org.restlet.data.Status; |
36 import org.restlet.representation.Representation; | 36 import org.restlet.representation.Representation; |
51 * @author casties | 51 * @author casties |
52 * | 52 * |
53 */ | 53 */ |
54 public class AnnotationResource extends ServerResource { | 54 public class AnnotationResource extends ServerResource { |
55 | 55 |
56 public static Logger logger = Logger.getLogger(AnnotationResource.class); | 56 public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.AnnotationResource"); |
57 | 57 |
58 protected AnnotationStore store; | 58 protected AnnotationStore store; |
59 | 59 |
60 protected String requestId; | 60 protected String requestId; |
61 | 61 |
64 @Override | 64 @Override |
65 protected void doInit() throws ResourceException { | 65 protected void doInit() throws ResourceException { |
66 super.doInit(); | 66 super.doInit(); |
67 // id from URI /annotations/persons/{id} | 67 // id from URI /annotations/persons/{id} |
68 requestId = (String) getRequest().getAttributes().get("id"); | 68 requestId = (String) getRequest().getAttributes().get("id"); |
69 logger.debug("annoation-id=" + requestId); | 69 logger.fine("annoation-id=" + requestId); |
70 // get store instance | 70 // get store instance |
71 if (store == null) { | 71 if (store == null) { |
72 store = ((BaseRestlet) getApplication()).getAnnotationStore(); | 72 store = ((BaseRestlet) getApplication()).getAnnotationStore(); |
73 } | 73 } |
74 // get annotation from store | 74 // get annotation from store |
146 * @param entity | 146 * @param entity |
147 * @return | 147 * @return |
148 */ | 148 */ |
149 @Put | 149 @Put |
150 public Representation doPut(Representation entity) { | 150 public Representation doPut(Representation entity) { |
151 logger.debug("AnnotationResource.doPut!"); | 151 logger.fine("AnnotationResource.doPut!"); |
152 if (annotation == null) { | 152 if (annotation == null) { |
153 // invalid id | 153 // invalid id |
154 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); | 154 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); |
155 return null; | 155 return null; |
156 } | 156 } |
183 * @param entity | 183 * @param entity |
184 * @return | 184 * @return |
185 */ | 185 */ |
186 @Delete | 186 @Delete |
187 public Representation doDelete(Representation entity) { | 187 public Representation doDelete(Representation entity) { |
188 logger.debug("AnnotationResource.doDelete!"); | 188 logger.fine("AnnotationResource.doDelete!"); |
189 if (annotation == null) { | 189 if (annotation == null) { |
190 // invalid id | 190 // invalid id |
191 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); | 191 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); |
192 return null; | 192 return null; |
193 } | 193 } |