Subversion Repositories eFlore/Applications.cel

Rev

Rev 1293 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1293 Rev 1918
Line 3... Line 3...
3
import org.tela_botanica.client.interfaces.Rafraichissable;
3
import org.tela_botanica.client.interfaces.Rafraichissable;
4
import org.tela_botanica.client.modeles.objets.Configuration;
4
import org.tela_botanica.client.modeles.objets.Configuration;
5
import org.tela_botanica.client.modeles.objets.Utilisateur;
5
import org.tela_botanica.client.modeles.objets.Utilisateur;
Line 6... Line 6...
6
 
6
 
7
import com.google.gwt.http.client.Request;
7
import com.google.gwt.http.client.Request;
8
import com.google.gwt.http.client.RequestBuilder;
8
import org.tela_botanica.client.util.RequestBuilderWithCredentials;
9
import com.google.gwt.http.client.RequestCallback;
9
import com.google.gwt.http.client.RequestCallback;
10
import com.google.gwt.http.client.RequestException;
10
import com.google.gwt.http.client.RequestException;
11
import com.google.gwt.http.client.Response;
11
import com.google.gwt.http.client.Response;
12
import com.google.gwt.json.client.JSONArray;
12
import com.google.gwt.json.client.JSONArray;
Line 40... Line 40...
40
	 * @param r
40
	 * @param r
41
	 *            le rafraichissable qui demande les données
41
	 *            le rafraichissable qui demande les données
42
	 */
42
	 */
43
	public void obtenirListeMotsCles(final Rafraichissable r) {
43
	public void obtenirListeMotsCles(final Rafraichissable r) {
44
		// on demande tous les mots clés associés à l'utilisateur
44
		// on demande tous les mots clés associés à l'utilisateur
45
		RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
45
		RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.GET, Configuration.getServiceBaseUrl()
46
				+ "/InventoryKeyWordList/"+mode+"/"+identifiant+"/");
46
				+ "/InventoryKeyWordList/"+mode+"/"+identifiant+"/");
Line 47... Line 47...
47
 
47
 
48
		try {
48
		try {
Line 90... Line 90...
90
	public void ajouterBaseDeDonnees(String motcle) {
90
	public void ajouterBaseDeDonnees(String motcle) {
91
		if (!motcle.equals("")) {
91
		if (!motcle.equals("")) {
92
			String postData = motcle+"&mode="+mode;
92
			String postData = motcle+"&mode="+mode;
Line 93... Line 93...
93
 
93
 
94
			// on fait un post asynchrone
94
			// on fait un post asynchrone
95
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
95
			RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.POST, Configuration.getServiceBaseUrl()
96
					+ "/InventoryKeyWordList/");
96
					+ "/InventoryKeyWordList/");
97
			try {
97
			try {
Line 98... Line 98...
98
				rb.sendRequest(postData, new RequestCallback() {
98
				rb.sendRequest(postData, new RequestCallback() {
Line 136... Line 136...
136
	public void supprimerBaseDeDonnees(String motcle) {
136
	public void supprimerBaseDeDonnees(String motcle) {
137
		if (!motcle.equals("")) {
137
		if (!motcle.equals("")) {
138
			String postData = "";
138
			String postData = "";
139
			postData += "&action=DELETE";
139
			postData += "&action=DELETE";
Line 140... Line 140...
140
 
140
 
141
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
141
			RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.POST, Configuration.getServiceBaseUrl()
142
					+ "/InventoryKeyWordList/"
142
					+ "/InventoryKeyWordList/"
143
					+ mode+"/"
143
					+ mode+"/"
144
					+ identifiant
144
					+ identifiant
145
					+ "/"
145
					+ "/"
Line 188... Line 188...
188
		if (!motcle.equals("")) {
188
		if (!motcle.equals("")) {
Line 189... Line 189...
189
 
189
 
190
			String postData = "";
190
			String postData = "";
Line 191... Line 191...
191
			postData += "&action=modification"+motcle;
191
			postData += "&action=modification"+motcle;
192
 
192
 
193
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
193
			RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.POST, Configuration.getServiceBaseUrl()
194
					+ "/InventoryKeyWordList/"+mode+"/"+ identifiant);
194
					+ "/InventoryKeyWordList/"+mode+"/"+ identifiant);
Line 195... Line 195...
195
			try {
195
			try {
Line 236... Line 236...
236
		if (!motcle.equals("")) {
236
		if (!motcle.equals("")) {
Line 237... Line 237...
237
 
237
 
238
			String postData = "";
238
			String postData = "";
Line 239... Line 239...
239
			postData += "&action=deplacement"+motcle;
239
			postData += "&action=deplacement"+motcle;
240
 
240
 
241
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, Configuration.getServiceBaseUrl()
241
			RequestBuilderWithCredentials rb = new RequestBuilderWithCredentials(RequestBuilderWithCredentials.POST, Configuration.getServiceBaseUrl()
242
					+ "/InventoryKeyWordList/"+mode+"/"+identifiant);
242
					+ "/InventoryKeyWordList/"+mode+"/"+identifiant);
Line 243... Line 243...
243
			try {
243
			try {