Permalink
Browse files

Gestion du put

  • Loading branch information...
1 parent 26228be commit 7ecfbcfbcc1b5d04027d4d6310e56fdaac9947c1 sdaclin committed Apr 25, 2011
View
@@ -0,0 +1 @@
+/target/
View
@@ -1,29 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<actions>
- <action>
- <actionName>CUSTOM-Jetty Run</actionName>
- <displayName>Jetty Run</displayName>
- <goals>
- <goal>jetty:run</goal>
- </goals>
- </action>
- <action>
- <actionName>run</actionName>
- <goals>
- <goal>jetty:stop</goal>
- <goal>jetty:run</goal>
- </goals>
- </action>
- <action>
- <actionName>debug</actionName>
- <goals>
- <goal>package</goal>
-
- </goals>
- <properties>
-
-
- <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>
- </properties>
- </action>
- </actions>
+<?xml version="1.0" encoding="UTF-8"?>
+<actions>
+ <action>
+ <actionName>CUSTOM-Jetty Run</actionName>
+ <displayName>Jetty Run</displayName>
+ <goals>
+ <goal>jetty:run</goal>
+ </goals>
+ </action>
+ <action>
+ <actionName>run</actionName>
+ <goals>
+ <goal>jetty:stop</goal>
+ <goal>jetty:run</goal>
+ </goals>
+ </action>
+ <action>
+ <actionName>debug</actionName>
+ <goals>
+ <goal>jetty:stop</goal>
+ <goal>jetty:run</goal>
+
+ </goals>
+ <properties>
+
+
+ <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>
+
+
+ <jpda.listen>maven</jpda.listen>
+ </properties>
+ </action>
+ </actions>
@@ -1,33 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package fr.astek.gex.model;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author sdaclin
- */
-@XmlRootElement
-public class JsonElt {
- private String name="Durand";
- private String firstName="Pierre";
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-}
@@ -3,7 +3,9 @@
import fr.astek.gex.model.Node;
import fr.astek.gex.server.service.AgexService;
import java.util.List;
+import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
+import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
@@ -13,18 +15,23 @@
* @author sdaclin
*/
@Path("/node")
+@Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
+@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
public class NodeResource {
+ @POST
+ public void addNode(Node node){
+ AgexService.addNode(node);
+ }
+
@GET
@Path("/list/{nodeId}")
- @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
- public List<Node> getNodeContent(@PathParam("nodeId") String nodeId) {
+ public List<Node> getNodeList(@PathParam("nodeId") String nodeId) {
return AgexService.listNode(nodeId);
}
@GET
@Path("/id/{nodeId}")
- @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
public Node getNode(@PathParam("nodeId") String nodeId) {
return AgexService.getNode(nodeId);
}
@@ -19,5 +19,10 @@
public static Node getNode(String nodeId) {
return new Node("Modification du libelle");
}
+
+ public static void addNode(Node node) {
+ System.out.println("Node" + node);
+ return;
+ }
}

0 comments on commit 7ecfbcf

Please sign in to comment.