Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 227 Rev 229
Line 38... Line 38...
38
	private Mediateur mediateur = null;
38
	private Mediateur mediateur = null;
Line 39... Line 39...
39
	
39
	
Line 40... Line 40...
40
	FormPanel panel = null ;
40
	FormPanel panel = null ;
-
 
41
	
-
 
42
	private String idStructureEdition = "" ; 
-
 
43
	private String idPublication = "" ;
Line 41... Line 44...
41
	
44
	private String idProjet = "" ;
Line 42... Line 45...
42
	private String idStructureEdition = "" ; 
45
	private String metaPubli = "" ;
43
	
46
	
Line 183... Line 186...
183
			}
186
			}
Line 184... Line 187...
184
			
187
			
185
		});
188
		});
Line -... Line 189...
-
 
189
		panel.addButton(validerBtn);
186
		panel.addButton(validerBtn);
190
		
Line 187... Line 191...
187
		
191
		mediateur.clicObtenirListeEditeurs(this);
Line 188... Line 192...
188
	}
192
	}
Line 205... Line 209...
205
			datePub.setRawValue(publi.getDateParution());
209
			datePub.setRawValue(publi.getDateParution());
206
			tomPub.setValue(publi.getIndicationNvt());
210
			tomPub.setValue(publi.getIndicationNvt());
207
			fasciculePub.setValue(publi.getFascicule());
211
			fasciculePub.setValue(publi.getFascicule());
208
			pagesPub.setValue(publi.getPages());
212
			pagesPub.setValue(publi.getPages());
Line -... Line 213...
-
 
213
			
209
			
214
			idPublication = publi.getId();
210
			idStructureEdition = publi.getEditeur();
-
 
211
			
215
			idStructureEdition = publi.getEditeur();
Line 212... Line 216...
212
			mediateur.clicObtenirListeEditeurs(this);
216
			idProjet = publi.getProjet() ;
213
			
217
			
Line 214... Line 218...
214
			panel.setHeading("Modification d'une publication");
218
			panel.setHeading("Modification d'une publication");
Line 222... Line 226...
222
			for(Iterator<String> it = listeStructureSet.iterator() ; it.hasNext() ;) {
226
			for(Iterator<String> it = listeStructureSet.iterator() ; it.hasNext() ;) {
223
				storeEditeurs.add(listeStructure.get(it.next()));
227
				storeEditeurs.add(listeStructure.get(it.next()));
224
			}
228
			}
Line 225... Line 229...
225
			
229
			
226
			if(mode.equals("MODIF")) {	
-
 
227
				//Window.alert(""+idStructureEdition);
230
			if(mode.equals("MODIF")) {	
228
				comboListeEditeurs.setValue(listeStructure.get(idStructureEdition));
231
				comboListeEditeurs.setValue(listeStructure.get(idStructureEdition));
229
			}
232
			}
230
			comboListeEditeurs.expand();
233
			comboListeEditeurs.expand();
231
		}
234
		}
Line 242... Line 245...
242
		}
245
		}
243
		String nomArt = nomArticle.getValue();
246
		String nomArt = nomArticle.getValue();
244
		String pub = nomPub.getValue();
247
		String pub = nomPub.getValue();
245
		String collPub = intituleCollPub.getValue();
248
		String collPub = intituleCollPub.getValue();
246
		String uri = uriPub.getValue();
249
		String uri = uriPub.getValue();
247
		String editeur = comboListeEditeurs.getRawValue();
250
		String editeur = comboListeEditeurs.getValue().getId();
248
		String datePar = datePub.getRawValue();
251
		String datePar = datePub.getRawValue();
249
		String tome = tomPub.getValue();
252
		String tome = tomPub.getValue();
250
		String fascicule = fasciculePub.getValue();
253
		String fascicule = fasciculePub.getValue();
251
		String pages = pagesPub.getValue();
254
		String pages = pagesPub.getValue();
Line 252... Line -...
252
		
-
 
253
		Publication publi = new Publication(pub,uri,auteur,collPub,nomArt,editeur,datePar,tome,fascicule,pages);
-
 
254
		
-
 
255
		Window.alert(auteur);
-
 
256
		
255
		
-
 
256
		if (mode.equals("AJOUT")) {
257
		if (mode.equals("AJOUT")) {
257
			Publication publi = new Publication(pub,uri,auteur,collPub,nomArt,editeur,datePar,tome,fascicule,pages);
258
			mediateur.ajouterPublication(this, publi);
258
			mediateur.ajouterPublication(this, publi);
-
 
259
		} else if (mode.equals("MODIF")) {
259
		} else if (mode.equals("MODIF")) {
260
			Publication publi = new Publication(idPublication,idProjet,pub,uri,auteur,collPub,nomArt,editeur,datePar,tome,fascicule,pages);
260
			mediateur.modifierPublication(this, publi);
261
			mediateur.modifierPublication(this, publi);
261
		}
262
		}
Line 262... Line 263...
262
	}
263
	}
Line 263... Line 264...
263
	
264
	
264
	private void genererChampsAuteur(String auteursStr, boolean ajouter) {
265
	private void genererChampsAuteur(String auteursStr, boolean ajouter) {
Line 265... Line -...
265
				
-
 
266
		String[] auteurs = auteursStr.split("\\|");
-
 
267
		LayoutContainer conteneurChamps = new LayoutContainer(); 
266
				
268
		
267
		String[] auteurs = auteursStr.split("\\|");
269
		Window.alert("longueur "+auteurs.length);
268
		LayoutContainer conteneurChamps = new LayoutContainer(); 
270
		
269
		
271
		if(auteurs.length != 0) {
270
		if(auteurs.length != 0) {
Line 304... Line 303...
304
					String valeurChampAuteur = listeAuteurs.get(i).getValue();
303
					String valeurChampAuteur = listeAuteurs.get(i).getValue();
305
					if(valeurChampAuteur != null)
304
					if(valeurChampAuteur != null)
306
					{
305
					{
307
						idsAuteurs += valeurChampAuteur ;
306
						idsAuteurs += valeurChampAuteur ;
308
					}
307
					}
309
					else {
-
 
310
						idsAuteurs += "" ;
308
						idsAuteurs += "|" ;
311
					}
-
 
312
					if(i != 0 && i != listeAuteurs.size() - 1) {
-
 
313
						idsAuteurs+= "|";
-
 
314
					}
-
 
315
				}
309
				}
316
				genererChampsAuteur(idsAuteurs,true);
310
				genererChampsAuteur(idsAuteurs,true);
317
			}
311
			}
Line 318... Line 312...
318
			
312
			
Line 351... Line 345...
351
					String valeurChampAuteur = listeAuteurs.get(i).getValue();
345
					String valeurChampAuteur = listeAuteurs.get(i).getValue();
352
					if(valeurChampAuteur != null & !valeurChampAuteur.equals(""))
346
					if(valeurChampAuteur != null & !valeurChampAuteur.equals(""))
353
					{
347
					{
354
						idsAuteurs += valeurChampAuteur ;
348
						idsAuteurs += valeurChampAuteur ;
355
					}
349
					}
-
 
350
					else
-
 
351
					{
-
 
352
						idsAuteurs += " " ;
-
 
353
					}
356
					if(i != listeAuteurs.size() - 1) {
354
					if(i != listeAuteurs.size() - 1) {
357
						idsAuteurs+= "|";
355
						idsAuteurs+= "|";
358
					}
356
					}
359
				}
357
				}
360
				genererChampsAuteur(idsAuteurs,false);
358
				genererChampsAuteur(idsAuteurs,false);