Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1173 Rev 1262
Line 76... Line 76...
76
				}
76
				}
77
			}
77
			}
78
		});
78
		});
79
	}
79
	}
Line 80... Line 80...
80
	
80
	
81
	public void ajouter(Collection collection) {
81
	public void ajouter(Collection collection) {		
82
		String postDonneesEncodees = construirePost(null, collection);
-
 
83
 
82
		String postDonneesEncodees = construirePost(null, collection);
84
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);	
83
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM);	
85
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
84
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
86
			@Override
85
			@Override
87
			public void surReponse(JSONValue responseValue) {
86
			public void surReponse(JSONValue responseValue) {
Line 100... Line 99...
100
			}
99
			}
101
		});
100
		});
102
	}
101
	}
Line 103... Line 102...
103
	
102
	
104
	public void modifier(Collection collection) {
-
 
105
		String postDonneesEncodees = construirePost(collection.getId(), collection);
-
 
Line -... Line 103...
-
 
103
	public void modifier(Collection collection) {
106
		GWT.log(postDonneesEncodees, null);
104
		
107
		
105
		String postDonneesEncodees = construirePost(collection.getId(), collection);		
108
		String[] parametres = {collection.getId()};
106
		String[] parametres = {collection.getId()};
109
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
107
		final JsonRestRequestBuilder rb = UtilDAO.construireRequetePost(SERVICE_NOM, parametres);
110
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
108
		rb.envoyerRequete(postDonneesEncodees, new JsonRestRequestCallback() {
Line 137... Line 135...
137
				}
135
				}
138
			}
136
			}
139
		});
137
		});
140
	}
138
	}
Line 141... Line 139...
141
	
139
	
142
	private String construirePost(String collectionId, Collection collection) {
140
	private String construirePost(String collectionId, Collection collection) {		
Line 143... Line 141...
143
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId); 
141
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId); 
144
			
142
			
145
		if (collection != null) {
143
		if (collection != null) {
146
			if (collectionId != null) {
144
			if (collectionId != null) {
147
				postDonnees += "&cc_id_collection=" + URL.encodeComponent(collectionId);
145
				postDonnees += "&cc_id_collection=" + URL.encodeComponent(collectionId);
148
			}
146
			}
149
			
-
 
150
			/*Debug.log("id projet:"+collection.getIdProjet());
147
 
151
			Debug.log("liste projet:"+((ProjetListe) Registry.get(RegistreId.PROJETS)).get(collection.getIdProjet()).toString());
148
			/*
152
			postDonnees += "&cpr_abreviation=" + URL.encodeComponent(((ProjetListe) Registry.get(RegistreId.PROJETS)).get(collection.getIdProjet()).getAbreviation());
149
			postDonnees += "&cpr_abreviation=" + URL.encodeComponent(((ProjetListe) Registry.get(RegistreId.PROJETS)).get(collection.getIdProjet()).getAbreviation());
153
			postDonnees += "&cc_ce_projet=" + URL.encodeComponent(collection.getIdProjet()) +
150
			postDonnees += "&cc_ce_projet=" + URL.encodeComponent(collection.getIdProjet()) +
154
				"&cc_ce_mere=" + URL.encodeComponent(collection.getCollectionMereId()) +
151
				"&cc_ce_mere=" + URL.encodeComponent(collection.getCollectionMereId()) +