Index: projets/BCCCC/mydatabase.properties
===================================================================
--- projets/BCCCC/mydatabase.properties	(revision 5)
+++ projets/BCCCC/mydatabase.properties	(revision 6)
@@ -1,4 +0,0 @@
-#HSQL Database Engine 2.3.2
-#Wed Jun 17 09:35:19 CEST 2015
-version=2.3.2
-modified=yes
Index: projets/BCCCC/mydatabase.script
===================================================================
--- projets/BCCCC/mydatabase.script	(revision 5)
+++ projets/BCCCC/mydatabase.script	(revision 6)
@@ -1,42 +0,0 @@
-SET DATABASE UNIQUE NAME HSQLDB4E004EED72
-SET DATABASE GC 0
-SET DATABASE DEFAULT RESULT MEMORY ROWS 0
-SET DATABASE EVENT LOG LEVEL 0
-SET DATABASE TRANSACTION CONTROL LOCKS
-SET DATABASE DEFAULT ISOLATION LEVEL READ COMMITTED
-SET DATABASE TRANSACTION ROLLBACK ON CONFLICT TRUE
-SET DATABASE TEXT TABLE DEFAULTS ''
-SET DATABASE SQL NAMES FALSE
-SET DATABASE SQL REFERENCES FALSE
-SET DATABASE SQL SIZE TRUE
-SET DATABASE SQL TYPES FALSE
-SET DATABASE SQL TDC DELETE TRUE
-SET DATABASE SQL TDC UPDATE TRUE
-SET DATABASE SQL TRANSLATE TTI TYPES TRUE
-SET DATABASE SQL CONCAT NULLS TRUE
-SET DATABASE SQL UNIQUE NULLS TRUE
-SET DATABASE SQL CONVERT TRUNCATE TRUE
-SET DATABASE SQL AVG SCALE 0
-SET DATABASE SQL DOUBLE NAN TRUE
-SET FILES WRITE DELAY 500 MILLIS
-SET FILES BACKUP INCREMENT TRUE
-SET FILES CACHE SIZE 10000
-SET FILES CACHE ROWS 50000
-SET FILES SCALE 32
-SET FILES LOB SCALE 32
-SET FILES DEFRAG 0
-SET FILES NIO TRUE
-SET FILES NIO SIZE 256
-SET FILES LOG TRUE
-SET FILES LOG SIZE 50
-CREATE USER SA PASSWORD DIGEST 'd41d8cd98f00b204e9800998ecf8427e'
-ALTER USER SA SET LOCAL TRUE
-CREATE SCHEMA PUBLIC AUTHORIZATION DBA
-ALTER SEQUENCE SYSTEM_LOBS.LOB_ID RESTART WITH 1
-SET DATABASE DEFAULT INITIAL SCHEMA PUBLIC
-GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.SQL_IDENTIFIER TO PUBLIC
-GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.YES_OR_NO TO PUBLIC
-GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.TIME_STAMP TO PUBLIC
-GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CARDINAL_NUMBER TO PUBLIC
-GRANT USAGE ON DOMAIN INFORMATION_SCHEMA.CHARACTER_DATA TO PUBLIC
-GRANT DBA TO SA
Index: projets/BCCCC/src/org/ccc/bcccc/client/BrowsePanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/BrowsePanel.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/BrowsePanel.java	(revision 6)
@@ -1,210 +0,0 @@
-/*
- * Authors: Matthieu Decorde
- * 
- * COPYRIGHT 2015 ICAR - CCC
- * 
- * This software is free software: you can redistribute it 
- * and/or modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation,
- * either version 2 of the License, or (at your option) any
- * later version.
- * 
- * This software is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more
- * details.
- * 
- */
-package org.ccc.bcccc.client;
-
-import java.util.ArrayList;
-
-import org.ccc.bcccc.shared.K;
-import org.ccc.bcccc.shared.TerrainRecord;
-
-import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.ListGridFieldType;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.grid.ListGrid;
-import com.smartgwt.client.widgets.grid.ListGridField;
-import com.smartgwt.client.widgets.grid.ListGridRecord;
-import com.smartgwt.client.widgets.grid.events.ChangedEvent;
-import com.smartgwt.client.widgets.grid.events.ChangedHandler;
-import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
-import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class BrowsePanel.
- */
-public class BrowsePanel extends VLayout {
-	
-	/**
-	 * Instantiates a new browse panel.
-	 */
-	public BrowsePanel() {
-		this.setWidth100();
-		this.setHeight100();
-	}
-	
-	/** The init browse done. */
-	boolean initBrowseDone = false;
-
-	/** The values grid. */
-	private ListGrid valuesGrid;
-	
-	/** The id field. */
-	private ListGridField idField;
-	
-	/** The year field. */
-	private ListGridField yearField;
-	
-	/** The validate field. */
-	//private ListGridField editField;
-	private ListGridField validateField;
-	
-	/** The desc field. */
-	private ListGridField descField;
-	
-	/** The project field. */
-	private ListGridField projectField;
-
-	/**
-	 * Inits the.
-	 */
-	protected void init() {
-		if (!initBrowseDone) {
-			System.out.println("Initializing 'browse'...");
-			initBrowseDone = true;
-
-			valuesGrid = new ListGrid();
-			valuesGrid.setWidth100();
-			valuesGrid.setWidth100();
-			valuesGrid.setShowResizeBar(false);
-			valuesGrid.addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
-				@Override
-				public void onRecordDoubleClick(RecordDoubleClickEvent event) {
-					String UNIQID_str = event.getRecord().getAttribute(K.UNIQID);
-					Long UNIQID = Long.parseLong(UNIQID_str);
-					BCCCC.doubleClickedRecord = null;
-					for (int i = 0 ; i < BCCCC.records.size() ; i++) {
-						if (BCCCC.records.get(i).uniq_id == UNIQID) {
-							BCCCC.doubleClickedRecord = BCCCC.records.get(i);
-							continue;
-						}
-					}
-					
-					if (BCCCC.doubleClickedRecord == null) {
-						SC.warn("Current record not set: "+event.getRecord());
-					} else {
-						History.newItem(K.VIEWEDITRECORD);
-					}
-				}
-			});
-
-			System.out.println(" init fields...");
-			ArrayList<ListGridField> fields = new ArrayList<ListGridField>();
-
-			idField = new ListGridField(K.ID, "Name");
-			idField.setPrompt("identifiant");
-			idField.setType(ListGridFieldType.INTEGER);
-			fields.add(idField);
-
-			yearField = new ListGridField(K.YEAR, "Year");
-			yearField.setPrompt("Year");
-			yearField.setWidth(150);
-			yearField.setType(ListGridFieldType.INTEGER);
-			fields.add(yearField);
-
-			descField = new ListGridField(K.DESC, "Description");
-			descField.setPrompt("Short description");
-			descField.setWidth(150);
-			descField.setType(ListGridFieldType.TEXT);
-			descField.setWrap(true);
-			fields.add(descField);
-
-			projectField = new ListGridField(K.PROJECT, "Project");
-			projectField.setPrompt("Project name");
-			projectField.setWidth(150);
-			projectField.setType(ListGridFieldType.TEXT);
-			projectField.setWrap(true);
-			fields.add(projectField);
-			
-			validateField = new ListGridField(K.VALIDATE, "Waiting for publication");
-			validateField.setPrompt("is visible or not to public users");
-			validateField.setType(ListGridFieldType.BOOLEAN);
-			validateField.setWrap(true);
-			validateField.setHidden(true);
-			
-			validateField.addChangedHandler(new ChangedHandler(){
-				@Override
-				public void onChanged(ChangedEvent event) {
-					Long ID = valuesGrid.getRecord(event.getRowNum()).getAttributeAsLong(K.UNIQID);
-					Boolean newValue = (Boolean)event.getValue();
-					
-					Services.getMain().setValidateRecordValue(ID, newValue, new AsyncCallback<Boolean>() {
-						@Override
-						public void onFailure(Throwable caught) {
-							SC.warn("Error: "+caught);
-						}
-
-						@Override
-						public void onSuccess(Boolean result) {
-							if (result) {
-								SC.say("Value changed.");
-							} else {
-								SC.warn("Error: value has not been changed");
-							}
-						}
-					});
-				}
-			});
-			fields.add(validateField);
-
-			valuesGrid.setFields(yearField, idField, projectField, validateField, descField);
-			valuesGrid.setGroupByField(K.YEAR);
-			valuesGrid.setGroupStartOpen("all");
-
-			this.addMember(valuesGrid);
-			System.out.println("End of 'browse' init");
-		}
-		
-		valuesGrid.hideField("validate");
-		Services.getMain().isAdmin(new AsyncCallback<Boolean>() { // show validate field only if admin
-			@Override
-			public void onSuccess(Boolean result) {
-				if (result != null && result) {
-					validateField.setCanEdit(result);
-					valuesGrid.showField("validate");
-				}
-			}
-			
-			@Override
-			public void onFailure(Throwable caught) {
-				SC.warn("Error: "+caught);
-			}
-		});
-			
-		ListGridRecord[] listGridRecords = new ListGridRecord[BCCCC.records.size()];
-
-		int i = 0;
-		System.out.println("Records: "+BCCCC.records.size());
-		for (TerrainRecord record : BCCCC.records) {
-			//System.out.println(record);
-			listGridRecords[i] = new ListGridRecord();
-
-			listGridRecords[i].setAttribute(K.UNIQID, record.uniq_id);
-			listGridRecords[i].setAttribute(K.ID, record.name);
-			listGridRecords[i].setAttribute(K.YEAR, record.year);
-			listGridRecords[i].setAttribute(K.DESC, record.short_description);
-			listGridRecords[i].setAttribute(K.PROJECT, record.project);
-			listGridRecords[i].setAttribute(K.VALIDATE, record.mustBeValidated);
-			i++;
-		}
-
-		valuesGrid.setRecords(listGridRecords);
-	}
-}
Index: projets/BCCCC/src/org/ccc/bcccc/client/SearchPanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/SearchPanel.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/SearchPanel.java	(revision 6)
@@ -1,171 +0,0 @@
-/*
- * Authors: Matthieu Decorde
- * 
- * COPYRIGHT 2015 ICAR - CCC
- * 
- * This software is free software: you can redistribute it 
- * and/or modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation,
- * either version 2 of the License, or (at your option) any
- * later version.
- * 
- * This software is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more
- * details.
- * 
- */
-package org.ccc.bcccc.client;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import org.ccc.bcccc.shared.Dispositif;
-import org.ccc.bcccc.shared.DocumentUnit;
-import org.ccc.bcccc.shared.K;
-import org.ccc.bcccc.shared.TerrainRecord;
-
-import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.MultipleAppearance;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.SliderItem;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class SearchPanel.
- */
-public class SearchPanel extends VLayout {
-	
-	/**
-	 * Instantiates a new search panel.
-	 */
-	public SearchPanel() {
-		this.setWidth100();
-		this.setHeight100();
-	}
-	
-	/** The init search complex done. */
-	boolean initSearchComplexDone = false;
-	
-	/**
-	 * Inits the.
-	 */
-	protected void init() {
-		if (initSearchComplexDone) return;
-		initSearchComplexDone = true;
-
-		final DynamicForm form = new DynamicForm();
-		form.setWidth100();
-		form.setHeight100();
-		this.addMember(form);
-		
-		TextItem wordsField = new TextItem(K.WORDS, "Recherche par mot");
-		
-
-		SelectItem types = new SelectItem(K.TYPES);
-		types.setTitle("Terrain types");
-		types.setMultiple(true);  
-		types.setMultipleAppearance(MultipleAppearance.PICKLIST); 
-		types.setValueMap("commerce", "apprentissage", "privé", "médical", "etc.");
-
-		SelectItem projets = new SelectItem("projets");
-		projets.setTitle("Projet");
-		projets.setMultiple(true);  
-		projets.setMultipleAppearance(MultipleAppearance.PICKLIST); 
-		projets.setValueMap("projet1", "projet2", "projetN");
-
-		SliderItem participants = new SliderItem(K.NUMBEROFPARTICIPANTS);
-		participants.setTitle("More than N persons");
-		participants.setMinValue(1);  
-		participants.setMaxValue(100);  
-		//		participants.setNumValues(5);  
-		participants.setDefaultValue(1);  
-
-		SelectItem dispositifs = new SelectItem(K.DISPOSITIFS);
-		dispositifs.setTitle("Dispositifs");
-		dispositifs.setMultiple(true);  
-		dispositifs.setMultipleAppearance(MultipleAppearance.PICKLIST); 
-		dispositifs.setValueMap(Dispositif.types);
-
-
-		SelectItem supports = new SelectItem(K.SUPPORTS);
-		supports.setTitle("Supports");
-		supports.setMultiple(true);  
-		supports.setMultipleAppearance(MultipleAppearance.PICKLIST); 
-		supports.setValueMap(DocumentUnit.values);
-
-		ButtonItem validate = new ButtonItem("validate");
-		validate.setTitle("Search");
-		validate.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
-			@Override
-			public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
-
-				String words_value = form.getValueAsString(K.WORDS);
-				if (words_value == null) words_value = "";
-				else words_value = words_value.trim();
-				
-				String types_value = form.getValueAsString(K.TYPES);
-				if (types_value == null) types_value = "";
-				else types_value = types_value.trim();
-
-				String projects_value = form.getValueAsString(K.PROJECTS);
-				if (projects_value == null) projects_value = "";
-				else projects_value = projects_value.trim();
-
-				String participants_value = form.getValueAsString(K.NUMBEROFPARTICIPANTS);
-				if (participants_value == null) participants_value = "";
-				else participants_value = participants_value.trim();
-
-				String dispositifs_value = form.getValueAsString(K.DISPOSITIFS);
-				if (dispositifs_value == null) dispositifs_value = "";
-				else dispositifs_value = dispositifs_value.trim();
-
-				String supports_value = form.getValueAsString(K.SUPPORTS);
-				if (supports_value == null) supports_value = "";
-				else supports_value = supports_value.trim();
-
-				if (types_value.length() == 0 && 
-						projects_value.length() == 0 && 
-						participants_value.length() == 0 && 
-						dispositifs_value.length() == 0 && 
-						supports_value.length() == 0) return;
-
-				System.out.println("Updating records...");
-
-				HashMap<String, String> critera = new HashMap<String, String>();
-				critera.put(K.WORDS, words_value);
-				critera.put(K.TYPES, types_value);
-				critera.put(K.PROJECTS, projects_value);
-				critera.put(K.DISPOSITIFS, dispositifs_value);
-				critera.put(K.SUPPORTS, supports_value);
-				critera.put(K.NUMBEROFPARTICIPANTS, participants_value);
-				
-				Services.getMain().getRecordsWithComplexCritera(critera, new AsyncCallback<ArrayList<TerrainRecord>>() {
-					@Override
-					public void onFailure(Throwable caught) {
-						SC.warn(caught.getMessage());
-					}
-
-					@Override
-					public void onSuccess(ArrayList<TerrainRecord> result) {
-						BCCCC.searched_records = new ArrayList<TerrainRecord>();
-						if (result != null) {
-							System.out.println("Found: "+result.size());
-							BCCCC.searched_records = result;
-						}
-						History.newItem("browse_searched");
-					}
-				});
-			}
-		});
-
-		form.setItems(wordsField, types, projets, participants, dispositifs, supports, validate);
-	}
-}
Index: projets/BCCCC/src/org/ccc/bcccc/client/CreateTerrainRecordPanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/CreateTerrainRecordPanel.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/CreateTerrainRecordPanel.java	(revision 6)
@@ -1,143 +0,0 @@
-/*
- * Authors: Matthieu Decorde
- * 
- * COPYRIGHT 2015 ICAR - CCC
- * 
- * This software is free software: you can redistribute it 
- * and/or modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation,
- * either version 2 of the License, or (at your option) any
- * later version.
- * 
- * This software is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more
- * details.
- * 
- */
-package org.ccc.bcccc.client;
-
-import java.util.Date;
-
-import org.ccc.bcccc.shared.K;
-import org.ccc.bcccc.shared.TerrainRecord;
-import org.ccc.bcccc.shared.TerrainRecordAndRights;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.form.fields.DateItem;
-import com.smartgwt.client.widgets.form.fields.TextAreaItem;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class CreateTerrainRecordPanel.
- */
-public class CreateTerrainRecordPanel extends VLayout {
-
-	/**
-	 * Instantiates a new creates the terrain record panel.
-	 */
-	public CreateTerrainRecordPanel() {
-		this.setWidth100();
-		this.setHeight100();
-	}
-
-	/** The create form. */
-	private DynamicForm createForm;
-	
-	/** The id vae field. */
-	private TextItem idVAEField;
-	
-	/** The project vae field. */
-	private TextItem projectVAEField;
-	
-	/** The date vae field. */
-	private DateItem dateVAEField;
-	
-	/** The content vae field. */
-	private TextAreaItem contentVAEField;
-
-	/** The save vae button. */
-	private ButtonItem saveVAEButton;
-
-	/** The init view and edit done. */
-	boolean initViewAndEditDone;
-
-	/**
-	 * Inits the.
-	 */
-	protected void init() {
-		
-		if (!initViewAndEditDone) {
-			
-			initViewAndEditDone = true;
-
-			createForm = new DynamicForm();
-			createForm.setWidth100();
-			createForm.setHeight100();
-			this.addMember(createForm);
-
-			idVAEField = new TextItem(K.ID);
-			idVAEField.setTitle("Record name");
-			idVAEField.setRequired(true);
-			
-			contentVAEField = new TextAreaItem(K.DESC);
-			contentVAEField.setTitle("Short description");
-			contentVAEField.setRequired(true);
-			
-			dateVAEField = new DateItem(K.DATE);  
-			dateVAEField.setTitle("Date");  
-			dateVAEField.setUseTextField(false);
-			dateVAEField.setRequired(true);
-			
-			projectVAEField = new TextItem(K.PROJECT);
-			projectVAEField.setTitle("Project name");
-			projectVAEField.setRequired(true);
-			
-			saveVAEButton = new ButtonItem("save_record");
-			saveVAEButton.setTitle("Save changes");
-			saveVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
-				@Override
-				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
-					if (!createForm.validate()) return;
-					
-					TerrainRecordAndRights record = new TerrainRecordAndRights();
-					record.record = new TerrainRecord();
-					Date date = (Date)createForm.getValue(K.DATE);
-					record.record.setInfoFields(
-							createForm.getValueAsString(K.ID), 
-							createForm.getValueAsString(K.PROJECT), 
-							date, 
-							createForm.getValueAsString(K.DESC),
-							"???");
-
-					Services.getMain().createRecord(record.record, new AsyncCallback<Boolean>() {
-
-						@Override
-						public void onFailure(Throwable caught) {
-							SC.warn(caught.getMessage());
-						}
-
-						@Override
-						public void onSuccess(Boolean result) {
-							if (result) {
-								SC.warn("Record '"+createForm.getValueAsString(K.ID)+"' posted. Now wait for admin to validate the record.");
-							} else {
-								SC.warn("Record '"+createForm.getValueAsString(K.ID)+"' NOT created.");
-							}
-						}
-					});
-				}
-			});
-
-			createForm.setItems(idVAEField, contentVAEField, 
-					projectVAEField, dateVAEField, saveVAEButton);
-
-		}
-	}
-}
Index: projets/BCCCC/src/org/ccc/bcccc/client/ViewAndEditTerrainRecordPanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/ViewAndEditTerrainRecordPanel.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/ViewAndEditTerrainRecordPanel.java	(revision 6)
@@ -1,329 +0,0 @@
-/*
- * Authors: Matthieu Decorde
- * 
- * COPYRIGHT 2015 ICAR - CCC
- * 
- * This software is free software: you can redistribute it 
- * and/or modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation,
- * either version 2 of the License, or (at your option) any
- * later version.
- * 
- * This software is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more
- * details.
- * 
- */
-package org.ccc.bcccc.client;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-
-import org.ccc.bcccc.client.areas.DataRecordArea;
-import org.ccc.bcccc.client.areas.DateRecordArea;
-import org.ccc.bcccc.client.areas.DispositifsRecordArea;
-import org.ccc.bcccc.client.areas.DocumentsRecordArea;
-import org.ccc.bcccc.client.areas.DoubleStringRecordArea;
-import org.ccc.bcccc.client.areas.LongStringRecordArea;
-import org.ccc.bcccc.client.areas.PublicationsRecordArea;
-import org.ccc.bcccc.client.areas.ReportsRecordArea;
-import org.ccc.bcccc.client.areas.StringRecordField;
-import org.ccc.bcccc.shared.Data;
-import org.ccc.bcccc.shared.Dispositif;
-import org.ccc.bcccc.shared.DocumentUnit;
-import org.ccc.bcccc.shared.K;
-import org.ccc.bcccc.shared.Publication;
-import org.ccc.bcccc.shared.Report;
-import org.ccc.bcccc.shared.TerrainRecordAndRights;
-
-import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.smartgwt.client.types.TitleOrientation;
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class ViewAndEditTerrainRecordPanel.
- */
-public class ViewAndEditTerrainRecordPanel extends VLayout {
-
-	/** The record. */
-	public TerrainRecordAndRights record;
-
-	/**
-	 * Instantiates a new view and edit terrain record panel.
-	 */
-	public ViewAndEditTerrainRecordPanel() {
-		this.setWidth100();
-		this.setHeight100();
-	}
-
-	/** The init view and edit done. */
-	boolean initViewAndEditDone;
-	
-	/** The view and edit form. */
-	private DynamicForm viewAndEditForm;
-
-	/** The save vae button. */
-	private ButtonItem saveVAEButton;
-	
-	/** The delete vae button. */
-	private ButtonItem deleteVAEButton;
-	
-	/** The validate vae button. */
-	private ButtonItem validateVAEButton;
-
-	/** The name field. */
-	private StringRecordField nameField;
-	
-	/** The project field. */
-	private StringRecordField projectField;
-	
-	/** The description field. */
-	private LongStringRecordArea descriptionField;
-	
-	/** The date field. */
-	private DateRecordArea dateField;
-	
-	/** The participants field. */
-	private StringRecordField participantsField;
-	
-	/** The types field. */
-	private StringRecordField typesField;
-	
-	/** The dispositifs field. */
-	private DispositifsRecordArea dispositifsField;
-	
-	/** The data field. */
-	private DataRecordArea dataField;
-	
-	/** The documentation field. */
-	private DocumentsRecordArea documentationField;
-	
-	/** The report field. */
-	private ReportsRecordArea reportField;
-	
-	/** The publication field. */
-	private PublicationsRecordArea publicationField;
-
-	/**
-	 * Inits the.
-	 */
-	protected void init() {
-		this.hide();
-		if (!initViewAndEditDone) {
-			initViewAndEditDone = true;
-
-			viewAndEditForm = new DynamicForm();
-
-			saveVAEButton = new ButtonItem("save_record");
-			saveVAEButton.setTitle("Save changes");
-			saveVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
-				@Override
-				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
-					final String ID = viewAndEditForm.getValueAsString(K.ID);
-					if (ID == null || ID.trim().length() == 0) return;
-					
-	
-					
-//					typesField
-//					dispositifsField
-//					dataField
-//					documentationField
-//					reportField
-//					publicationField
-					
-					record.record.setInfoFields(nameField.getValue(), 
-							projectField.getValue(), 
-							dateField.getDate(), 
-							descriptionField.getValue(),
-							"???");
-					
-					record.record.setDetailFields(Integer.parseInt(participantsField.getValue()), 
-							viewAndEditForm.getValueAsString(K.PLACE), 
-							typesField.getValuesAsStringArray(), 
-							new ArrayList<String>(),
-							dispositifsField.getValues(),
-							documentationField.getValues(), 
-							dataField.getValues(),
-							reportField.getValues(),
-							publicationField.getValues());
-
-					Services.getMain().createRecord(record.record, new AsyncCallback<Boolean>() {
-						@Override
-						public void onFailure(Throwable caught) {
-							SC.warn(caught.getMessage());
-						}
-
-						@Override
-						public void onSuccess(Boolean result) {
-							if (result) {
-								SC.warn("Record '"+ID+"' saved: "+record.record);
-							} else {
-								SC.warn("Record '"+ID+"' NOT created.");
-							}
-						}
-					});
-				}
-			});
-
-			deleteVAEButton = new ButtonItem("delete_record");
-			deleteVAEButton.setTitle("Delete record");
-			deleteVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
-				@Override
-				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
-					Services.getMain().deleteRecord(record.record.uniq_id, new AsyncCallback<Boolean>() {
-						@Override
-						public void onFailure(Throwable caught) {
-							SC.warn("Error: "+caught);
-						}
-
-						@Override
-						public void onSuccess(Boolean result) {
-							if (result) {
-								SC.say("Deleted.");
-								History.newItem(K.BROWSE+"_my");
-							} else {
-								SC.say("NOT Deleted.");
-							}
-						}
-					});
-				}
-			});
-
-			validateVAEButton = new ButtonItem("validate_record");
-			validateVAEButton.setTitle("Validate record");
-			validateVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
-				@Override
-				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
-					Services.getMain().setValidateRecordValue(record.record.uniq_id, false, new AsyncCallback<Boolean>() {
-						@Override
-						public void onFailure(Throwable caught) {
-							SC.warn("Error: "+caught);
-						}
-
-						@Override
-						public void onSuccess(Boolean result) {
-							SC.say("Validated? "+result);
-						}
-					});
-				}
-			});
-
-			viewAndEditForm.setNumCols(3);
-			viewAndEditForm.setAutoWidth();
-			viewAndEditForm.setItems(deleteVAEButton, validateVAEButton, saveVAEButton);
-			viewAndEditForm.setTitleOrientation(TitleOrientation.LEFT);
-
-			nameField = new StringRecordField(this, "Name", false, true, null);	
-			projectField = new StringRecordField(this, "Project", false, true, null);	
-			dateField = new DateRecordArea(this, "Date", false, true, null);	
-			participantsField = new StringRecordField(this, "Participants", true, true, null);
-			String[] typesValues = {"privé", "commerce", "école", "etc."};
-			typesField = new StringRecordField(this, "Types", true, false, typesValues);
-			dispositifsField = new DispositifsRecordArea(this, "Dispositifs");
-			dataField = new DataRecordArea(this,  "Données");
-			documentationField = new DocumentsRecordArea(this, "Documentation");
-			reportField = new ReportsRecordArea(this,  "Rapports");
-			publicationField = new PublicationsRecordArea(this, "Publications");
-		}
-
-		if (BCCCC.doubleClickedRecord != null) { // load record informations
-			System.out.println("Reloading viewAndEdit record... "+BCCCC.doubleClickedRecord);
-			Services.getMain().getRecord(BCCCC.doubleClickedRecord.uniq_id, new AsyncCallback<TerrainRecordAndRights>() {
-				@Override
-				public void onFailure(Throwable caught) {
-					SC.warn("Error: "+caught);
-				}
-
-				@Override
-				public void onSuccess(TerrainRecordAndRights result) {
-
-					if (result == null) {
-						SC.warn("Error: no record found for ID="+BCCCC.doubleClickedRecord);
-						return;
-					}
-					record = result;
-
-					viewAndEditForm.setCanEdit(result.editable);
-					validateVAEButton.setDisabled(!result.validable);
-					validateVAEButton.setStartRow(false);
-					validateVAEButton.setEndRow(false);
-					deleteVAEButton.setDisabled(!result.deletable);
-					deleteVAEButton.setStartRow(false);
-					deleteVAEButton.setEndRow(false);
-					saveVAEButton.setDisabled(!result.editable);
-					saveVAEButton.setStartRow(false);
-					saveVAEButton.setEndRow(false);
-					
-					addMember(viewAndEditForm);
-					viewAndEditForm.setVisible(result.editable);
-
-					nameField.setCanEdit(record.editable);
-					nameField.setValue(record.record.name);
-					projectField.setCanEdit(record.editable);
-					projectField.setValue(record.record.project);
-					typesField.setCanEdit(record.editable);
-					typesField.setValues(record.record.types);
-					dateField.setCanEdit(record.editable);
-					dateField.setValue(record.record.date);
-					participantsField.setCanEdit(record.editable);
-					dispositifsField.setCanEdit(record.editable);
-					dispositifsField.setValues(record.record.dispositifs);
-					dataField.setCanEdit(record.editable);
-					dataField.setDataValues(record.record.supports);
-					documentationField.setCanEdit(record.editable);
-					documentationField.setDocumentationValues(record.record.documentations);
-					reportField.setCanEdit(record.editable);
-					reportField.setValues(record.record.reports);
-					publicationField.setCanEdit(record.editable);
-					publicationField.setPublicationValues(record.record.publications);
-					
-					addMember(viewAndEditForm);
-					addMember(nameField);
-					addMember(projectField);
-					addMember(dateField);
-					addMember(typesField);
-					addMember(participantsField);
-					addMember(dispositifsField);
-					addMember(dataField);
-					addMember(documentationField);
-					addMember(reportField);
-					addMember(publicationField);
-					show();
-				}
-			});
-		} else {
-			this.show();
-		}
-	}
-
-	/**
-	 * To string list.
-	 *
-	 * @param string the string
-	 * @return the string
-	 */
-	protected static String toStringList(String string) {
-		return string.replace("[", "").replace("]", "");
-	}
-
-	/**
-	 * Checks if is record changed.
-	 *
-	 * @return true, if is record changed
-	 */
-	public boolean isRecordChanged() {
-		if (record != null) {
-			return false;
-		} else {
-			return false;
-		}
-	}
-}
Index: projets/BCCCC/src/org/ccc/bcccc/client/HomePanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/HomePanel.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/HomePanel.java	(revision 6)
@@ -1,55 +0,0 @@
-/*
- * Authors: Matthieu Decorde
- * 
- * COPYRIGHT 2015 ICAR - CCC
- * 
- * This software is free software: you can redistribute it 
- * and/or modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation,
- * either version 2 of the License, or (at your option) any
- * later version.
- * 
- * This software is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more
- * details.
- * 
- */
-package org.ccc.bcccc.client;
-
-import com.smartgwt.client.widgets.HTMLPane;
-import com.smartgwt.client.widgets.layout.VLayout;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class HomePanel.
- */
-public class HomePanel extends VLayout {
-	
-	/**
-	 * Instantiates a new home panel.
-	 */
-	public HomePanel() {
-		this.setWidth100();
-		this.setHeight100();
-	}
-	
-	/** The init home done. */
-	boolean initHomeDone = false;
-	
-	/**
-	 * Inits the.
-	 */
-	protected void init() {
-		if (initHomeDone) return;
-		initHomeDone = true;
-
-		HTMLPane l = new HTMLPane();
-		l.setWidth100();
-		l.setHeight100();
-		l.setContentsURL("welcome.html");
-		this.addMember(l);
-		this.setMargin(10);
-	}
-}
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/DataRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/DataRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/DataRecordArea.java	(revision 6)
@@ -21,8 +21,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
 import org.ccc.bcccc.client.areas.fields.DataRecordField;
+import org.ccc.bcccc.client.panels.EditPanel;
 import org.ccc.bcccc.shared.Data;
 
 import com.smartgwt.client.widgets.Label;
@@ -43,7 +43,7 @@
 	 * @param panel the panel
 	 * @param name the name
 	 */
-	public DataRecordArea(ViewAndEditTerrainRecordPanel panel, String name) {
+	public DataRecordArea(EditPanel panel, String name) {
 		//super(panel, name, true, false, Data.values);
 		//form.setNumCols(7); // show 3 item per line
 		this.setWidth100();
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/PublicationsRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/PublicationsRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/PublicationsRecordArea.java	(revision 6)
@@ -21,40 +21,36 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
-import org.ccc.bcccc.shared.Dispositif;
+import org.ccc.bcccc.client.areas.fields.PublicationRecordField;
+import org.ccc.bcccc.client.panels.EditPanel;
 import org.ccc.bcccc.shared.Publication;
 
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.util.ValueCallback;
-import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.form.fields.CheckboxItem;
-import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.PickerIcon;
-import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.SpinnerItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
-import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
-import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
-import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.layout.VLayout;
 
 // TODO: Auto-generated Javadoc
 /**
  * The Class PublicationsRecordArea.
  */
-public class PublicationsRecordArea extends StringRecordField {
+public class PublicationsRecordArea extends VLayout {
 
+	/** The fields. */
+	ArrayList<PublicationRecordField> fields = new ArrayList<PublicationRecordField>();
+	
 	/**
 	 * Instantiates a new publications record area.
 	 *
 	 * @param panel the panel
 	 * @param name the name
 	 */
-	public PublicationsRecordArea(ViewAndEditTerrainRecordPanel panel, String name) {
-		super(panel, name, true, false, null);
-		form.setNumCols(7); // show 3 item per line
+	public PublicationsRecordArea(EditPanel panel, String name) {
+		this.setWidth100();
+		
+		Label title = new Label();
+		title.setContents("Publications");
+		this.addMember(title);
+		
+		addAField(); // create at least one entry
 	}
 
 	/** The n. */
@@ -67,115 +63,36 @@
 	 * @see org.ccc.bcccc.client.areas.StringRecordField#addAField()
 	 */
 	public void addAField() {
-		//System.out.println("N="+n);
-		String lname = name.toLowerCase().replace(" ", "");
-		
-		final StaticTextItem userItem = new StaticTextItem(lname +"user"+(n));
-		userItem.setShowTitle(false);
-		
-		final StaticTextItem urlItem = new StaticTextItem(lname +"url"+(n));
-		urlItem.setTitle("");
-		PickerIcon nameEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
-			public void onFormItemClick(FormItemIconClickEvent event) { 
-				SC.askforValue("Enter the new value of URL of "+name, new ValueCallback() {
-					@Override
-					public void execute(String value) {
-						if (value != null) {
-							urlItem.setValue(value);
-						}
-					}
-				});
-			}  
-		});
-		urlItem.setIcons(nameEditPicker);
-		
-		final SelectItem typeField = new SelectItem(lname +"type"+(n));
-		typeField.setTitle("Type");
-		typeField.setValueMap(Publication.types);
-		
-		final ButtonItem addButton = new ButtonItem(lname+"add"+n);
-		addButton.setTitle("+");
-		addButton.setStartRow(false);
-		addButton.setEndRow(true);
-
-		final ButtonItem removeButton = new ButtonItem(lname+"remove"+n);
-		removeButton.setTitle("-");
-		removeButton.setStartRow(false);
-		removeButton.setEndRow(false);
-
-		addButton.addClickHandler(new ClickHandler() {
-			@Override
-			public void onClick(ClickEvent event) {
-				addAField();
-			}
-		});
-
-		removeButton.addClickHandler(new ClickHandler() {
-			@Override
-			public void onClick(ClickEvent event) {
-				if (items.size() > NITEMPERROW) {
-					items.remove(userItem);
-					items.remove(urlItem);
-					items.remove(typeField);
-					items.remove(removeButton);
-					items.remove(addButton);
-					reloadFields();
-				}
-			}
-		});
-
-		items.add(userItem);
-		items.add(urlItem);
-		items.add(typeField);
-		items.add(removeButton);
-		items.add(addButton);
-
+		PublicationRecordField f = new PublicationRecordField(this, n);
+		this.addMember(f);
+		fields.add(f);
 		n++;
-		reloadFields();
 	}
 
 	/**
-	 * Sets the value.
-	 *
-	 * @param value the new value
-	 */
-	public void setValue(Publication value) {
-		ArrayList<Publication> values = new ArrayList<Publication>();
-		values.add(value);
-		setPublicationValues(values);
-	}
-
-	/**
 	 * Sets the publication values.
 	 *
 	 * @param values the new publication values
 	 */
-	public void setPublicationValues(List<Publication> values) {
+	public void setValues(List<Publication> values) {
 		int i = 0;
 		for (Publication d : values) {
-			if (items.size() <= 2+i*NITEMPERROW) addAField();
+			if (fields.size() <= i) addAField();
 
-			StaticTextItem userItem = (StaticTextItem) items.get(i*NITEMPERROW);
-			StaticTextItem urlField = (StaticTextItem) items.get(1+i*NITEMPERROW);
-			SelectItem typeField = (SelectItem) items.get(2+i*NITEMPERROW);
-			userItem.setValue(d.user);
-			urlField.setValue(d.url);
-			typeField.setValue(d.type);
-			
+			PublicationRecordField f = fields.get(i);
+			f.setValue(d);
 			i++;
 		}
 	}
 
-	/* (non-Javadoc)
-	 * @see org.ccc.bcccc.client.areas.StringRecordField#setCanEdit(boolean)
+	/**
+	 * Sets the can edit.
+	 *
+	 * @param v the new can edit
 	 */
 	public void setCanEdit(boolean v) {
-		form.setCanEdit(v);
-
-		for (FormItem item : items) {
-			item.setIcons();
-			if (item instanceof ButtonItem)
-				item.setVisible(v);
+		for (PublicationRecordField form : fields) {
+			form.setCanEdit(v);
 		}
 	}
 
@@ -186,13 +103,20 @@
 	 */
 	public List<Publication> getValues() {
 		List<Publication> values = new ArrayList<Publication>();
-		for (int i = 0 ; i < items.size() ; i = i+NITEMPERROW) {
-			StaticTextItem typeField = (StaticTextItem) items.get(i*NITEMPERROW);
-			StaticTextItem urlField = (StaticTextItem) items.get(1+i*NITEMPERROW);
-			SelectItem mobileItem = (SelectItem) items.get(2+i*NITEMPERROW);
-			Publication d = new Publication(typeField.getValue().toString(), urlField.getValue().toString(), mobileItem.getValueAsString());
-			values.add(d);
+		for (PublicationRecordField form : fields) {
+			values.add(form.getValue());
 		}
 		return values;
 	}
+
+	/**
+	 * Removes the.
+	 *
+	 * @param publicationRecordField the dispositifs record field
+	 */
+	public void remove(PublicationRecordField publicationRecordField) {
+		this.removeMember(publicationRecordField);
+		fields.remove(publicationRecordField);
+		publicationRecordField.destroy();
+	}
 }
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/DateRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/DateRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/DateRecordArea.java	(revision 6)
@@ -20,7 +20,7 @@
 
 import java.util.Date;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
+import org.ccc.bcccc.client.panels.EditPanel;
 
 import com.smartgwt.client.widgets.form.fields.DateItem;
 import com.smartgwt.client.widgets.form.fields.FormItem;
@@ -44,7 +44,7 @@
 	 * @param freeField the free field
 	 * @param values the values
 	 */
-	public DateRecordArea(ViewAndEditTerrainRecordPanel panel, String name, boolean multiple, boolean freeField,
+	public DateRecordArea(EditPanel panel, String name, boolean multiple, boolean freeField,
 			String[] values) {
 		super(panel, name, multiple, freeField, values);
 	}
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/IntegerRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/IntegerRecordArea.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/IntegerRecordArea.java	(revision 6)
@@ -0,0 +1,97 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.areas;
+
+import org.ccc.bcccc.client.panels.EditPanel;
+
+import com.smartgwt.client.types.TitleOrientation;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.SpinnerItem;
+import com.smartgwt.client.widgets.layout.HLayout;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DoubleStringRecordArea.
+ */
+public class IntegerRecordArea extends HLayout {
+
+	/** The name. */
+	String name;
+
+	/** The panel. */
+	protected EditPanel panel;
+
+	private SpinnerItem f;
+
+	/**
+	 * Instantiates a new string record field.
+	 *
+	 * @param panel the panel
+	 * @param name the name
+	 * @param multiple the multiple
+	 * @param freeField the free field
+	 * @param values the values
+	 */
+	public IntegerRecordArea(EditPanel panel, String name) {
+		this.panel = panel;
+		this.name = name;
+
+		DynamicForm form = new DynamicForm();
+		form.setTitleOrientation(TitleOrientation.LEFT);
+		form.setWidth100();
+
+		this.setWidth100();
+		this.addMember(form);
+
+		String lname = name.toLowerCase().replace(" ", "");
+		f = new SpinnerItem(lname);
+		f.setMin(1);
+		f.setMax(10000);
+		f.setTitle(name);
+		
+		form.setItems(f);
+	}
+
+	/**
+	 * Gets the value.
+	 *
+	 * @return the value
+	 */
+	public String getValue() {
+		return f.getValueAsString();
+	}
+
+	/**
+	 * Sets the can edit.
+	 *
+	 * @param v the new can edit
+	 */
+	public void setCanEdit(boolean v) {
+		f.setCanEdit(v);
+	}
+
+	/**
+	 * Sets the value.
+	 *
+	 * @param numberOfParticipants the new value
+	 */
+	public void setValue(int numberOfParticipants) {
+		f.setValue(numberOfParticipants);
+	}
+}

Property changes on: projets/BCCCC/src/org/ccc/bcccc/client/areas/IntegerRecordArea.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/ReportsRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/ReportsRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/ReportsRecordArea.java	(revision 6)
@@ -21,8 +21,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
 import org.ccc.bcccc.client.areas.fields.ReportRecordField;
+import org.ccc.bcccc.client.panels.EditPanel;
 import org.ccc.bcccc.shared.Report;
 
 import com.smartgwt.client.widgets.Label;
@@ -43,7 +43,7 @@
 	 * @param panel the panel
 	 * @param name the name
 	 */
-	public ReportsRecordArea(ViewAndEditTerrainRecordPanel panel, String name) {
+	public ReportsRecordArea(EditPanel panel, String name) {
 		this.setWidth100();
 		
 		Label title = new Label();
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DocumentRecordField.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DocumentRecordField.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DocumentRecordField.java	(revision 6)
@@ -0,0 +1,169 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.areas.fields;
+
+import org.ccc.bcccc.client.areas.DispositifsRecordArea;
+import org.ccc.bcccc.client.areas.DocumentsRecordArea;
+import org.ccc.bcccc.shared.Dispositif;
+import org.ccc.bcccc.shared.DocumentUnit;
+
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.util.ValueCallback;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.CheckboxItem;
+import com.smartgwt.client.widgets.form.fields.PickerIcon;
+import com.smartgwt.client.widgets.form.fields.PickerIcon.Picker;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
+import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
+import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DispositifsRecordField.
+ */
+public class DocumentRecordField extends DynamicForm {
+	
+	/** The r. */
+	DocumentUnit r = new DocumentUnit("","","");
+	
+	/** The area. */
+	DocumentsRecordArea area;
+	
+	/** The n. */
+	int n;
+	
+	/** The name field. */
+	StaticTextItem nameItem;
+	
+	/** The url field. */
+	StaticTextItem urlField;
+	
+	/** The type field. */
+	SelectItem typeField;
+	
+	/**
+	 * Instantiates a new dispositifs record field.
+	 *
+	 * @param area the area
+	 * @param n the n
+	 */
+	public DocumentRecordField(DocumentsRecordArea area, int n) {
+		
+		this.area = area;
+		this.n = n;
+		this.setNumCols(8);
+		
+		nameItem = new StaticTextItem("docname"+(n));
+		nameItem.setTitle("Name");
+		Picker EDIT = new Picker("pickers/edit.png");
+		PickerIcon nameEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
+			public void onFormItemClick(FormItemIconClickEvent event) { 
+				SC.askforValue("Enter the new value of Name of the document", new ValueCallback() {
+					@Override
+					public void execute(String value) {
+						if (value != null) {
+							nameItem.setValue(value);
+						}
+					}
+				});
+			}  
+		});
+		nameItem.setIcons(nameEditPicker);
+		
+		typeField = new SelectItem("doctype"+(n));
+		typeField.setValueMap(DocumentUnit.values);
+		typeField.setTitle("Type");
+		
+		urlField = new StaticTextItem("docurl"+(n));
+		urlField.setTitle("URL");
+		PickerIcon urlEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
+			public void onFormItemClick(FormItemIconClickEvent event) { 
+				SC.askforValue("Enter the new value of URL of the document", new ValueCallback() {
+					@Override
+					public void execute(String value) {
+						if (value != null) {
+							urlField.setValue(value);
+						}
+					}
+				});
+
+			}  
+		});
+		urlField.setIcons(urlEditPicker);
+
+		ButtonItem addButton = new ButtonItem("dispadd"+n);
+		addButton.setTitle("+");
+		addButton.setStartRow(false);
+		addButton.setEndRow(false);
+
+		ButtonItem removeButton = new ButtonItem("dispremove"+n);
+		removeButton.setTitle("-");
+		removeButton.setStartRow(false);
+		removeButton.setEndRow(false);
+
+		addButton.addClickHandler(new ClickHandler() {
+			@Override
+			public void onClick(ClickEvent event) {
+				DocumentRecordField.this.area.addAField();
+			}
+		});
+
+		removeButton.addClickHandler(new ClickHandler() {
+			@Override
+			public void onClick(ClickEvent event) {
+				DocumentRecordField.this.area.remove(DocumentRecordField.this);
+			}
+		});
+
+		this.setItems(nameItem, typeField, urlField, removeButton, addButton);
+
+	}
+	
+	/**
+	 * Sets the value.
+	 *
+	 * @param r the new value
+	 */
+	public void setValue(DocumentUnit r) {
+		typeField.setValue(r.type);
+		urlField.setValue(r.url);
+		nameItem.setValue(r.name);
+	}
+	
+	/**
+	 * Gets the value.
+	 *
+	 * @return the value
+	 */
+	public DocumentUnit getValue() {
+		r.type = typeField.getValueAsString();
+		Object o = urlField.getValue();
+		if (o != null) r.url = urlField.getValue().toString();
+		else r.url = "";
+		
+		o = nameItem.getValue();
+		if (o != null)  r.name = nameItem.getValue().toString();
+		r.name = "";
+		return r;
+	}
+}

Property changes on: projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DocumentRecordField.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DispositifsRecordField.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DispositifsRecordField.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DispositifsRecordField.java	(revision 6)
@@ -19,9 +19,7 @@
 package org.ccc.bcccc.client.areas.fields;
 
 import org.ccc.bcccc.client.areas.DispositifsRecordArea;
-import org.ccc.bcccc.client.areas.ReportsRecordArea;
 import org.ccc.bcccc.shared.Dispositif;
-import org.ccc.bcccc.shared.Report;
 
 import com.smartgwt.client.util.SC;
 import com.smartgwt.client.util.ValueCallback;
@@ -29,9 +27,9 @@
 import com.smartgwt.client.widgets.form.fields.ButtonItem;
 import com.smartgwt.client.widgets.form.fields.CheckboxItem;
 import com.smartgwt.client.widgets.form.fields.PickerIcon;
+import com.smartgwt.client.widgets.form.fields.PickerIcon.Picker;
 import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.form.fields.PickerIcon.Picker;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
 import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
 import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
 import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
@@ -56,7 +54,7 @@
 	SelectItem typeField;
 	
 	/** The url field. */
-	TextItem urlField;
+	StaticTextItem urlField;
 	
 	/** The mobile item. */
 	CheckboxItem mobileItem;
@@ -71,13 +69,13 @@
 		
 		this.area = area;
 		this.n = n;
-		this.setNumCols(7);
+		this.setNumCols(8);
 		
 		typeField = new SelectItem("dispname"+(n));
 		typeField.setValueMap(Dispositif.types);
-		typeField.setShowTitle(false);
+		typeField.setTitle("Type");
 
-		urlField = new TextItem("dispurl"+(n));
+		urlField = new StaticTextItem("dispurl"+(n));
 		urlField.setTitle("URL");
 		Picker EDIT = new Picker("pickers/edit.png");
 		PickerIcon urlEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
@@ -143,8 +141,10 @@
 	 * @return the value
 	 */
 	public Dispositif getValue() {
-		r.type = typeField.getValue().toString();
-		r.url = urlField.getValue().toString();
+		r.type = typeField.getValueAsString();
+		Object o = urlField.getValue();
+		if (o != null) r.url = urlField.getValue().toString();
+		else r.url = "";
 		r.mobile = mobileItem.getValueAsBoolean();
 		return r;
 	}
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DataRecordField.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DataRecordField.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/DataRecordField.java	(revision 6)
@@ -69,7 +69,7 @@
 		
 		typeField = new SelectItem("datatype"+(n));
 		typeField.setValueMap(Data.values);
-		typeField.setShowTitle(false);
+		typeField.setTitle("Type");
 
 		urlField = new StaticTextItem("dataurl"+(n));
 		urlField.setTitle("URL");
@@ -82,7 +82,8 @@
 		
 		Picker EDIT = new Picker("pickers/edit.png");
 		PickerIcon urlEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
-			public void onFormItemClick(FormItemIconClickEvent event) { 
+			@Override
+			public void onFormItemClick(FormItemIconClickEvent event) {
 				SC.askforValue("Enter the new value of URL of Data", new ValueCallback() {
 					@Override
 					public void execute(String value) {
@@ -91,7 +92,6 @@
 						}
 					}
 				});
-
 			}  
 		});
 		urlField.setIcons(urlEditPicker);
@@ -140,7 +140,11 @@
 	 */
 	public Data getValue() {
 		d.type = typeField.getValueAsString();
-		d.url = urlField.getValue().toString();
+		
+		Object o = urlField.getValue();
+		if (o != null) d.url = urlField.getValue().toString();
+		else d.url = "";
+		
 		return d;
 	}
 }
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/PublicationRecordField.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/PublicationRecordField.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/PublicationRecordField.java	(revision 6)
@@ -0,0 +1,152 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.areas.fields;
+
+import org.ccc.bcccc.client.areas.PublicationsRecordArea;
+import org.ccc.bcccc.shared.Publication;
+
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.util.ValueCallback;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.PickerIcon;
+import com.smartgwt.client.widgets.form.fields.PickerIcon.Picker;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
+import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
+import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Publication Record Field.
+ */
+public class PublicationRecordField extends DynamicForm {
+
+	/** The r. */
+	Publication r = new Publication("", "", "");
+
+	/** The area. */
+	PublicationsRecordArea area;
+
+	/** The n. */
+	int n;
+
+	/** The user field. */
+	StaticTextItem userField;
+
+	/** The url field. */
+	StaticTextItem urlField;
+
+	/** The type field. */
+	SelectItem typeField;
+
+	/**
+	 * Instantiates a new publication record field.
+	 *
+	 * @param publicationsRecordArea the area
+	 * @param n the n
+	 */
+	public PublicationRecordField(PublicationsRecordArea publicationsRecordArea, int n) {
+
+		this.area = area;
+		this.n = n;
+		this.setNumCols(8);
+		
+		userField = new StaticTextItem("pubuser"+(n));
+		userField.setTitle("User");
+
+		urlField = new StaticTextItem("puburl"+(n));
+		urlField.setTitle("URL");
+		Picker EDIT = new Picker("pickers/edit.png");
+		PickerIcon nameEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
+			public void onFormItemClick(FormItemIconClickEvent event) { 
+				SC.askforValue("Enter the new value of URL of the publication ", new ValueCallback() {
+					@Override
+					public void execute(String value) {
+						if (value != null) {
+							urlField.setValue(value);
+						}
+					}
+				});
+			}  
+		});
+		urlField.setIcons(nameEditPicker);
+
+		typeField = new SelectItem("pubtype"+(n));
+		typeField.setTitle("Type");
+		typeField.setValueMap(Publication.types);
+
+		ButtonItem addButton = new ButtonItem("pubadd"+n);
+		addButton.setTitle("+");
+		addButton.setStartRow(false);
+		addButton.setEndRow(false);
+
+		ButtonItem removeButton = new ButtonItem("pubremove"+n);
+		removeButton.setTitle("-");
+		removeButton.setStartRow(false);
+		removeButton.setEndRow(false);
+
+		addButton.addClickHandler(new ClickHandler() {
+			@Override
+			public void onClick(ClickEvent event) {
+				PublicationRecordField.this.area.addAField();
+			}
+		});
+
+		removeButton.addClickHandler(new ClickHandler() {
+			@Override
+			public void onClick(ClickEvent event) {
+				PublicationRecordField.this.area.remove(PublicationRecordField.this);
+			}
+		});
+
+		this.setItems(userField, urlField, typeField, removeButton, addButton);
+
+	}
+
+	/**
+	 * Sets the value.
+	 *
+	 * @param r the new value
+	 */
+	public void setValue(Publication r) {
+		typeField.setValue(r.type);
+		urlField.setValue(r.url);
+		userField.setValue(r.user);
+	}
+
+	/**
+	 * Gets the value.
+	 *
+	 * @return the value
+	 */
+	public Publication getValue() {
+		r.type = typeField.getValueAsString();
+		Object o = urlField.getValue();
+		if (o != null) r.url = urlField.getValue().toString();
+		else r.url = "";
+		
+		o = userField.getValue();
+		if (o != null) r.user = userField.getValue().toString();
+		r.user = "";
+		return r;
+	}
+}

Property changes on: projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/PublicationRecordField.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/ReportRecordField.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/ReportRecordField.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/fields/ReportRecordField.java	(revision 6)
@@ -29,6 +29,7 @@
 import com.smartgwt.client.widgets.form.fields.PickerIcon.Picker;
 import com.smartgwt.client.widgets.form.fields.SpinnerItem;
 import com.smartgwt.client.widgets.form.fields.StaticTextItem;
+import com.smartgwt.client.widgets.form.fields.TextAreaItem;
 import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
 import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
 import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
@@ -50,10 +51,10 @@
 	int n;
 	
 	/** The user item. */
-	StaticTextItem userItem;
+	StaticTextItem userField;
 	
 	/** The comment item. */
-	StaticTextItem commentItem;
+	TextAreaItem commentField;
 	
 	/** The note field. */
 	SpinnerItem noteField;
@@ -68,27 +69,28 @@
 
 		this.area = area;
 		this.n = n;
-		this.setNumCols(7);
+		this.setNumCols(8);
 		
-		userItem = new StaticTextItem("reportuser"+(n));
-		userItem.setShowTitle(false);
+		Picker EDIT = new Picker("pickers/edit.png");
 
-		commentItem = new StaticTextItem("reportcomment"+(n));
-		commentItem.setTitle("");
-		Picker EDIT = new Picker("pickers/edit.png");
+		userField = new StaticTextItem("reportuser"+(n));
+		userField.setTitle("User");
+				
+		commentField = new TextAreaItem("reportcomment"+(n));
+		commentField.setTitle("Comment");
 		PickerIcon nameEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
 			public void onFormItemClick(FormItemIconClickEvent event) { 
 				SC.askforValue("Enter the comment", new ValueCallback() {
 					@Override
 					public void execute(String value) {
 						if (value != null) {
-							commentItem.setValue(value);
+							commentField.setValue(value);
 						}
 					}
 				});
 			}  
 		});
-		commentItem.setIcons(nameEditPicker);
+		commentField.setIcons(nameEditPicker);
 
 		noteField = new SpinnerItem("reportnote"+(n));
 		noteField.setTitle("Note");
@@ -120,7 +122,7 @@
 			}
 		});
 		
-		this.setFields(userItem, commentItem, noteField, removeButton, addButton);
+		this.setFields(userField, commentField, noteField, removeButton, addButton);
 	}
 	
 	/**
@@ -129,8 +131,8 @@
 	 * @param r the new value
 	 */
 	public void setValue(Report r) {
-		userItem.setValue(r.user);
-		commentItem.setValue(r.comment);
+		userField.setValue(r.user);
+		commentField.setValue(r.comment);
 		noteField.setValue(r.note);
 	}
 	
@@ -140,8 +142,15 @@
 	 * @return the value
 	 */
 	public Report getValue() {
-		r.user = userItem.getValue().toString();
-		r.comment = commentItem.getValue().toString();
+		
+		Object o = userField.getValue();
+		if (o != null) r.user = userField.getValue().toString();
+		else r.user = "";
+
+		o = commentField.getValue();
+		if (o != null) r.comment = commentField.getValue().toString();
+		else r.comment = "";
+		
 		r.note = Integer.parseInt(noteField.getValueAsString());
 		return r;
 	}
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/DispositifsRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/DispositifsRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/DispositifsRecordArea.java	(revision 6)
@@ -21,9 +21,9 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
 import org.ccc.bcccc.client.areas.fields.DispositifsRecordField;
 import org.ccc.bcccc.client.areas.fields.ReportRecordField;
+import org.ccc.bcccc.client.panels.EditPanel;
 import org.ccc.bcccc.shared.Dispositif;
 
 import com.smartgwt.client.util.SC;
@@ -57,7 +57,7 @@
 	 * @param panel the panel
 	 * @param name the name
 	 */
-	public DispositifsRecordArea(ViewAndEditTerrainRecordPanel panel, String name) {
+	public DispositifsRecordArea(EditPanel panel, String name) {
 		this.setWidth100();
 		
 		Label title = new Label();
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/DocumentsRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/DocumentsRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/DocumentsRecordArea.java	(revision 6)
@@ -21,40 +21,37 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
-import org.ccc.bcccc.shared.Dispositif;
+import org.ccc.bcccc.client.areas.fields.DocumentRecordField;
+import org.ccc.bcccc.client.panels.EditPanel;
 import org.ccc.bcccc.shared.DocumentUnit;
 
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.util.ValueCallback;
-import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.form.fields.CheckboxItem;
-import com.smartgwt.client.widgets.form.fields.ComboBoxItem;
-import com.smartgwt.client.widgets.form.fields.FormItem;
-import com.smartgwt.client.widgets.form.fields.PickerIcon;
-import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.StaticTextItem;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
-import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
-import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler;
-import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.layout.VLayout;
 
 // TODO: Auto-generated Javadoc
 /**
  * The Class DocumentsRecordArea.
  */
-public class DocumentsRecordArea extends StringRecordField {
+public class DocumentsRecordArea extends VLayout {
 
+	/** The fields. */
+	ArrayList<DocumentRecordField> fields = new ArrayList<DocumentRecordField>();
+	
+	
 	/**
 	 * Instantiates a new documents record area.
 	 *
 	 * @param panel the panel
 	 * @param name the name
 	 */
-	public DocumentsRecordArea(ViewAndEditTerrainRecordPanel panel, String name) {
-		super(panel, name, true, false, DocumentUnit.values);
-		form.setNumCols(7); // show 3 item per line
+	public DocumentsRecordArea(EditPanel panel, String name) {
+		this.setWidth100();
+		
+		Label title = new Label();
+		title.setContents("Documents");
+		this.addMember(title);
+		
+		addAField(); // create at least one entry
 	}
 
 	/** The n. */
@@ -67,115 +64,24 @@
 	 * @see org.ccc.bcccc.client.areas.StringRecordField#addAField()
 	 */
 	public void addAField() {
-		System.out.println("N="+n);
-		String lname = name.toLowerCase().replace(" ", "");
-		
-		final StaticTextItem nameItem = new StaticTextItem(lname +"name"+(n));
-		nameItem.setTitle("");
-		PickerIcon nameEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
-			public void onFormItemClick(FormItemIconClickEvent event) { 
-				SC.askforValue("Enter the new value of Name of "+name, new ValueCallback() {
-					@Override
-					public void execute(String value) {
-						if (value != null) {
-							nameItem.setValue(value);
-						}
-					}
-				});
-			}  
-		});
-		nameItem.setIcons(nameEditPicker);
-		
-		final SelectItem typeField = new SelectItem(lname +"type"+(n));
-		typeField.setValueMap(DocumentUnit.values);
-		typeField.setShowTitle(false);
-		
-		final StaticTextItem urlField = new StaticTextItem(lname +"url"+(n));
-		urlField.setTitle("URL");
-		PickerIcon urlEditPicker = new PickerIcon(EDIT, new FormItemClickHandler() {  
-			public void onFormItemClick(FormItemIconClickEvent event) { 
-				SC.askforValue("Enter the new value of URL of "+name, new ValueCallback() {
-					@Override
-					public void execute(String value) {
-						if (value != null) {
-							urlField.setValue(value);
-						}
-					}
-				});
-
-			}  
-		});
-		urlField.setIcons(urlEditPicker);
-
-		final ButtonItem addButton = new ButtonItem(lname+"add"+n);
-		addButton.setTitle("+");
-		addButton.setStartRow(false);
-		addButton.setEndRow(true);
-
-		final ButtonItem removeButton = new ButtonItem(lname+"remove"+n);
-		removeButton.setTitle("-");
-		removeButton.setStartRow(false);
-		removeButton.setEndRow(false);
-
-		addButton.addClickHandler(new ClickHandler() {
-			@Override
-			public void onClick(ClickEvent event) {
-				addAField();
-			}
-		});
-
-		removeButton.addClickHandler(new ClickHandler() {
-			@Override
-			public void onClick(ClickEvent event) {
-				if (items.size() > NITEMPERROW) {
-					items.remove(nameItem);
-					items.remove(typeField);
-					items.remove(urlField);
-					items.remove(removeButton);
-					items.remove(addButton);
-					reloadFields();
-				}
-			}
-		});
-
-		items.add(nameItem);
-		items.add(typeField);
-		items.add(urlField);
-		items.add(removeButton);
-		items.add(addButton);
-
+		DocumentRecordField f = new DocumentRecordField(this, n);
+		this.addMember(f);
+		fields.add(f);
 		n++;
-		reloadFields();
 	}
-
+	
 	/**
-	 * Sets the value.
-	 *
-	 * @param value the new value
-	 */
-	public void setValue(DocumentUnit value) {
-		ArrayList<DocumentUnit> values = new ArrayList<DocumentUnit>();
-		values.add(value);
-		setDocumentationValues(values);
-	}
-
-	/**
 	 * Sets the documentation values.
 	 *
 	 * @param values the new documentation values
 	 */
-	public void setDocumentationValues(List<DocumentUnit> values) {
+	public void setValues(List<DocumentUnit> values) {
 		int i = 0;
 		for (DocumentUnit d : values) {
-			if (items.size() <= 2+i*NITEMPERROW) addAField();
+			if (fields.size() <= i) addAField();
 
-			StaticTextItem nameItem = (StaticTextItem) items.get(i*NITEMPERROW);
-			SelectItem typeField = (SelectItem) items.get(1+i*NITEMPERROW);
-			StaticTextItem urlItem = (StaticTextItem) items.get(2+i*NITEMPERROW);
-			nameItem.setValue(d.name);
-			typeField.setValue(d.type);
-			urlItem.setValue(d.url);
-			
+			DocumentRecordField f = fields.get(i);
+			f.setValue(d);
 			i++;
 		}
 	}
@@ -184,12 +90,8 @@
 	 * @see org.ccc.bcccc.client.areas.StringRecordField#setCanEdit(boolean)
 	 */
 	public void setCanEdit(boolean v) {
-		form.setCanEdit(v);
-
-		for (FormItem item : items) {
-			item.setIcons();
-			if (item instanceof ButtonItem)
-				item.setVisible(v);
+		for (DocumentRecordField item : fields) {
+			item.setCanEdit(v);
 		}
 	}
 
@@ -200,13 +102,20 @@
 	 */
 	public List<DocumentUnit> getValues() {
 		List<DocumentUnit> values = new ArrayList<DocumentUnit>();
-		for (int i = 0 ; i < items.size() ; i = i+NITEMPERROW) {
-			StaticTextItem nameItem = (StaticTextItem) items.get(i*NITEMPERROW);
-			SelectItem typeField = (SelectItem) items.get(1+i*NITEMPERROW);
-			StaticTextItem urlItem = (StaticTextItem) items.get(2+i*NITEMPERROW);
-			DocumentUnit d = new DocumentUnit(typeField.getValue().toString(), urlItem.getValue().toString(), nameItem.getValue().toString());
-			values.add(d);
+		for (DocumentRecordField item : fields) {
+			values.add(item.getValue());
 		}
 		return values;
 	}
+	
+	/**
+	 * Removes the.
+	 *
+	 * @param docRecordField the dispositifs record field
+	 */
+	public void remove(DocumentRecordField docRecordField) {
+		this.removeMember(docRecordField);
+		fields.remove(docRecordField);
+		docRecordField.destroy();
+	}
 }
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/DoubleStringRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/DoubleStringRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/DoubleStringRecordArea.java	(revision 6)
@@ -18,7 +18,7 @@
  */
 package org.ccc.bcccc.client.areas;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
+import org.ccc.bcccc.client.panels.EditPanel;
 
 // TODO: Auto-generated Javadoc
 /**
@@ -35,7 +35,7 @@
 	 * @param freeField the free field
 	 * @param values the values
 	 */
-	public DoubleStringRecordArea(ViewAndEditTerrainRecordPanel panel, String name, boolean multiple,
+	public DoubleStringRecordArea(EditPanel panel, String name, boolean multiple,
 			boolean freeField, String[] values) {
 		super(panel, name, multiple, freeField, values);
 	}
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/StringRecordField.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/StringRecordField.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/StringRecordField.java	(revision 6)
@@ -21,7 +21,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
+import org.ccc.bcccc.client.panels.EditPanel;
 
 import com.google.gwt.user.client.ui.Label;
 import com.smartgwt.client.types.TitleOrientation;
@@ -66,7 +66,7 @@
 	ArrayList<FormItem> items = new ArrayList<FormItem>();
 	
 	/** The panel. */
-	protected ViewAndEditTerrainRecordPanel panel;
+	protected EditPanel panel;
 	
 	/** The form. */
 	DynamicForm form;
@@ -80,7 +80,7 @@
 	 * @param freeField the free field
 	 * @param values the values
 	 */
-	public StringRecordField(ViewAndEditTerrainRecordPanel panel, String name, boolean multiple, boolean freeField, String[] values) {
+	public StringRecordField(EditPanel panel, String name, boolean multiple, boolean freeField, String[] values) {
 		this.panel = panel;
 		this.name = name;
 		this.multiple = multiple;
Index: projets/BCCCC/src/org/ccc/bcccc/client/areas/LongStringRecordArea.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/areas/LongStringRecordArea.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/areas/LongStringRecordArea.java	(revision 6)
@@ -18,7 +18,7 @@
  */
 package org.ccc.bcccc.client.areas;
 
-import org.ccc.bcccc.client.ViewAndEditTerrainRecordPanel;
+import org.ccc.bcccc.client.panels.EditPanel;
 
 import com.smartgwt.client.widgets.form.fields.FormItem;
 import com.smartgwt.client.widgets.form.fields.TextAreaItem;
@@ -41,7 +41,7 @@
 	 * @param multiple the multiple
 	 * @param freeField the free field
 	 */
-	public LongStringRecordArea(ViewAndEditTerrainRecordPanel panel, String name, boolean multiple, boolean freeField) {
+	public LongStringRecordArea(EditPanel panel, String name, boolean multiple, boolean freeField) {
 		super(panel, name, multiple, freeField, null);
 	}
 
Index: projets/BCCCC/src/org/ccc/bcccc/client/BCCCC.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/BCCCC.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/BCCCC.java	(revision 6)
@@ -20,6 +20,12 @@
 
 import java.util.ArrayList;
 
+import org.ccc.bcccc.client.panels.BrowsePanel;
+import org.ccc.bcccc.client.panels.CreatePanel;
+import org.ccc.bcccc.client.panels.EditPanel;
+import org.ccc.bcccc.client.panels.HomePanel;
+import org.ccc.bcccc.client.panels.SearchPanel;
+import org.ccc.bcccc.client.panels.ViewPanel;
 import org.ccc.bcccc.shared.K;
 import org.ccc.bcccc.shared.TerrainRecord;
 import org.ccc.bcccc.shared.TerrainRecordAndRights;
@@ -61,12 +67,15 @@
 	SearchPanel searchPanel = new SearchPanel();
 	
 	/** The create terrain record panel. */
-	CreateTerrainRecordPanel createTerrainRecordPanel = new CreateTerrainRecordPanel();
+	CreatePanel createTerrainRecordPanel = new CreatePanel();
 	
-	/** The terrain record panel. */
-	ViewAndEditTerrainRecordPanel terrainRecordPanel = new ViewAndEditTerrainRecordPanel();
+	/** The edit terrain record panel. */
+	EditPanel editTerrainRecordPanel = new EditPanel();
+	
+	/** The view terrain record panel. */
+	ViewPanel viewTerrainRecordPanel = new ViewPanel();
 
-	/** The main bar. */
+	/** The main Toolbar. */
 	ToolStrip mainBar = new ToolStrip();
 	
 	/** The center layout. */
@@ -111,7 +120,7 @@
 	/** The user name label. */
 	private Label userNameLabel;
 
-	/** The continue history change. */
+	/** The continue history change: indicate if the history change must be interrupted */
 	boolean continueHistoryChange = true;
 
 	/** The lw. */
@@ -143,7 +152,6 @@
 	 * Initialize UI.
 	 */
 	public void init() {
-
 		History.newItem(""); // reset history
 		homePanel.init();
 		mainLayout.setWidth100();
@@ -263,7 +271,7 @@
 
 				continueHistoryChange = true;
 				for (Canvas panel : centerLayout.getMembers()){
-					if (panel == terrainRecordPanel && terrainRecordPanel.isRecordChanged()) {
+					if (panel == editTerrainRecordPanel && editTerrainRecordPanel.isRecordChanged()) {
 						SC.ask("Warning: the record is not saved. Continue ?", new BooleanCallback() {
 							@Override
 							public void execute(Boolean value) {
@@ -340,7 +348,7 @@
 				} else if (hist.startsWith(K.NEWRECORD)) {
 					createTerrainRecordPanel.init();
 					centerLayout.addMember(createTerrainRecordPanel);
-				} else if (hist.startsWith(K.VIEWEDITRECORD)) {
+				} else if (hist.startsWith(K.EDITRECORD)) {
 					int idx = hist.indexOf("_") + 1;
 					if (idx > 0) { // the URL contains the record ID
 						String id = hist.substring(idx);
@@ -356,17 +364,44 @@
 								if (result != null) {
 									doubleClickedRecord = result.record;
 
-									terrainRecordPanel.init();
-									centerLayout.addMember(terrainRecordPanel);
+									editTerrainRecordPanel.init();
+									centerLayout.addMember(editTerrainRecordPanel);
 								} else {
 									SC.warn("No record found with id="+long_id);
 								}
 							}
 						});
 					} else {
-						terrainRecordPanel.init();
-						centerLayout.addMember(terrainRecordPanel);
+						editTerrainRecordPanel.init();
+						centerLayout.addMember(editTerrainRecordPanel);
 					}
+				}  else if (hist.startsWith(K.VIEWRECORD)) {
+					int idx = hist.indexOf("_") + 1;
+					if (idx > 0) { // the URL contains the record ID
+						String id = hist.substring(idx);
+						final long long_id = Long.parseLong(id);
+						Services.getMain().getRecord(long_id, new AsyncCallback<TerrainRecordAndRights>() {
+							@Override
+							public void onFailure(Throwable caught) {
+								SC.warn("Error while fetching record with id="+long_id+": "+caught);
+							}
+
+							@Override
+							public void onSuccess(TerrainRecordAndRights result) {
+								if (result != null) {
+									doubleClickedRecord = result.record;
+
+									viewTerrainRecordPanel.init();
+									centerLayout.addMember(viewTerrainRecordPanel);
+								} else {
+									SC.warn("No record found with id="+long_id);
+								}
+							}
+						});
+					} else {
+						viewTerrainRecordPanel.init();
+						centerLayout.addMember(viewTerrainRecordPanel);
+					}
 				} else {
 					homePanel.init();
 					centerLayout.addMember(homePanel);
Index: projets/BCCCC/src/org/ccc/bcccc/client/panels/BrowsePanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/panels/BrowsePanel.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/panels/BrowsePanel.java	(revision 6)
@@ -0,0 +1,231 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.panels;
+
+import java.util.ArrayList;
+
+import org.ccc.bcccc.client.BCCCC;
+import org.ccc.bcccc.client.Services;
+import org.ccc.bcccc.shared.K;
+import org.ccc.bcccc.shared.TerrainRecord;
+
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.ChangedEvent;
+import com.smartgwt.client.widgets.grid.events.ChangedHandler;
+import com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent;
+import com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class BrowsePanel.
+ */
+public class BrowsePanel extends VLayout {
+	
+	/**
+	 * Instantiates a new browse panel.
+	 */
+	public BrowsePanel() {
+		this.setWidth100();
+		this.setHeight100();
+	}
+	
+	/** The init browse done. */
+	boolean initBrowseDone = false;
+
+	/** The values grid. */
+	private ListGrid valuesGrid;
+	
+	/** The id field. */
+	private ListGridField idField;
+	
+	/** The year field. */
+	private ListGridField yearField;
+	
+	/** The validate field. */
+	//private ListGridField editField;
+	private ListGridField validateField;
+	
+	/** The desc field. */
+	private ListGridField descField;
+	
+	/** The project field. */
+	private ListGridField projectField;
+
+	private boolean isAdmin = false;
+	
+	/**
+	 * Inits the.
+	 */
+	public void init() {
+		if (!initBrowseDone) {
+			System.out.println("Initializing 'browse'...");
+			initBrowseDone = true;
+
+			valuesGrid = new ListGrid();
+			valuesGrid.setWidth100();
+			valuesGrid.setWidth100();
+			valuesGrid.setShowResizeBar(false);
+			valuesGrid.addRecordDoubleClickHandler(new RecordDoubleClickHandler() {
+				@Override
+				public void onRecordDoubleClick(RecordDoubleClickEvent event) {
+					String UNIQID_str = event.getRecord().getAttribute(K.UNIQID);
+					Long UNIQID = Long.parseLong(UNIQID_str);
+					BCCCC.doubleClickedRecord = null;
+					for (int i = 0 ; i < BCCCC.records.size() ; i++) {
+						if (BCCCC.records.get(i).uniq_id == UNIQID) {
+							BCCCC.doubleClickedRecord = BCCCC.records.get(i);
+							continue;
+						}
+					}
+					
+					if (BCCCC.doubleClickedRecord == null) {
+						SC.warn("Current record not set (no record clicked?): "+event.getRecord());
+					} else {
+						Services.getMain().isOwner(UNIQID, new AsyncCallback<Boolean>() {
+							@Override
+							public void onFailure(Throwable caught) {
+								SC.warn("Error: "+caught);
+							}
+							
+							@Override
+							public void onSuccess(Boolean result) {
+								if (result) {
+									History.newItem(K.EDITRECORD);
+								} else {
+									History.newItem(K.VIEWRECORD);
+								}
+							}
+						});
+					}
+				}
+			});
+
+			System.out.println(" init fields...");
+			ArrayList<ListGridField> fields = new ArrayList<ListGridField>();
+
+			idField = new ListGridField(K.ID, "Name");
+			idField.setPrompt("identifiant");
+			idField.setType(ListGridFieldType.INTEGER);
+			fields.add(idField);
+
+			yearField = new ListGridField(K.YEAR, "Year");
+			yearField.setPrompt("Year");
+			yearField.setWidth(150);
+			yearField.setType(ListGridFieldType.INTEGER);
+			fields.add(yearField);
+
+			descField = new ListGridField(K.DESC, "Description");
+			descField.setPrompt("Short description");
+			descField.setWidth(150);
+			descField.setType(ListGridFieldType.TEXT);
+			descField.setWrap(true);
+			fields.add(descField);
+
+			projectField = new ListGridField(K.PROJECT, "Project");
+			projectField.setPrompt("Project name");
+			projectField.setWidth(150);
+			projectField.setType(ListGridFieldType.TEXT);
+			projectField.setWrap(true);
+			fields.add(projectField);
+			
+			validateField = new ListGridField(K.VALIDATE, "Waiting for publication");
+			validateField.setPrompt("is visible or not to public users");
+			validateField.setType(ListGridFieldType.BOOLEAN);
+			validateField.setWrap(true);
+			validateField.setHidden(true);
+			
+			validateField.addChangedHandler(new ChangedHandler(){
+				@Override
+				public void onChanged(ChangedEvent event) {
+					if (!isAdmin) return; // aborting, record should not be visible...
+					
+					Long ID = valuesGrid.getRecord(event.getRowNum()).getAttributeAsLong(K.UNIQID);
+					final Boolean newValue = (Boolean)event.getValue();
+					
+					Services.getMain().setValidateRecordValue(ID, newValue, new AsyncCallback<Boolean>() {
+						@Override
+						public void onFailure(Throwable caught) {
+							SC.warn("Error: "+caught);
+						}
+
+						@Override
+						public void onSuccess(Boolean result) {
+							if (result) {
+								SC.say("Value changed to "+newValue);
+							} else {
+								SC.warn("Error: value has not been changed");
+							}
+						}
+					});
+				}
+			});
+			fields.add(validateField);
+
+			valuesGrid.setFields(yearField, idField, projectField, validateField, descField);
+			valuesGrid.setGroupByField(K.YEAR);
+			valuesGrid.setGroupStartOpen("all");
+
+			this.addMember(valuesGrid);
+			System.out.println("End of 'browse' init");
+		}
+		
+		valuesGrid.hideField("validate");
+		Services.getMain().isAdmin(new AsyncCallback<Boolean>() { // show validate field only if admin
+			@Override
+			public void onSuccess(Boolean result) {
+				if (result != null && result) {
+					validateField.setCanEdit(result);
+					valuesGrid.showField("validate");
+					isAdmin = true;
+				}
+			}
+			
+			@Override
+			public void onFailure(Throwable caught) {
+				SC.warn("Error: "+caught);
+			}
+		});
+			
+		ListGridRecord[] listGridRecords = new ListGridRecord[BCCCC.records.size()];
+
+		int i = 0;
+		System.out.println("Records: "+BCCCC.records.size());
+		for (TerrainRecord record : BCCCC.records) {
+			//System.out.println(record);
+			listGridRecords[i] = new ListGridRecord();
+
+			listGridRecords[i].setAttribute(K.UNIQID, record.uniq_id);
+			listGridRecords[i].setAttribute(K.ID, record.name);
+			listGridRecords[i].setAttribute(K.YEAR, record.year);
+			listGridRecords[i].setAttribute(K.DESC, record.short_description);
+			listGridRecords[i].setAttribute(K.PROJECT, record.project);
+			listGridRecords[i].setAttribute(K.VALIDATE, record.mustBeValidated);
+			i++;
+		}
+
+		valuesGrid.setRecords(listGridRecords);
+	}
+}
Index: projets/BCCCC/src/org/ccc/bcccc/client/panels/CreatePanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/panels/CreatePanel.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/panels/CreatePanel.java	(revision 6)
@@ -0,0 +1,144 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.panels;
+
+import java.util.Date;
+
+import org.ccc.bcccc.client.Services;
+import org.ccc.bcccc.shared.K;
+import org.ccc.bcccc.shared.TerrainRecord;
+import org.ccc.bcccc.shared.TerrainRecordAndRights;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.DateItem;
+import com.smartgwt.client.widgets.form.fields.TextAreaItem;
+import com.smartgwt.client.widgets.form.fields.TextItem;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class CreateTerrainRecordPanel.
+ */
+public class CreatePanel extends VLayout {
+
+	/**
+	 * Instantiates a new creates the terrain record panel.
+	 */
+	public CreatePanel() {
+		this.setWidth100();
+		this.setHeight100();
+	}
+
+	/** The create form. */
+	private DynamicForm createForm;
+	
+	/** The id vae field. */
+	private TextItem idVAEField;
+	
+	/** The project vae field. */
+	private TextItem projectVAEField;
+	
+	/** The date vae field. */
+	private DateItem dateVAEField;
+	
+	/** The content vae field. */
+	private TextAreaItem contentVAEField;
+
+	/** The save vae button. */
+	private ButtonItem saveVAEButton;
+
+	/** The init view and edit done. */
+	boolean initViewAndEditDone;
+
+	/**
+	 * Inits the.
+	 */
+	public void init() {
+		
+		if (!initViewAndEditDone) {
+			
+			initViewAndEditDone = true;
+
+			createForm = new DynamicForm();
+			createForm.setWidth100();
+			createForm.setHeight100();
+			this.addMember(createForm);
+
+			idVAEField = new TextItem(K.ID);
+			idVAEField.setTitle("Record name");
+			idVAEField.setRequired(true);
+			
+			contentVAEField = new TextAreaItem(K.DESC);
+			contentVAEField.setTitle("Short description");
+			contentVAEField.setRequired(true);
+			
+			dateVAEField = new DateItem(K.DATE);  
+			dateVAEField.setTitle("Date");  
+			dateVAEField.setUseTextField(false);
+			dateVAEField.setRequired(true);
+			
+			projectVAEField = new TextItem(K.PROJECT);
+			projectVAEField.setTitle("Project name");
+			projectVAEField.setRequired(true);
+			
+			saveVAEButton = new ButtonItem("save_record");
+			saveVAEButton.setTitle("Save changes");
+			saveVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
+				@Override
+				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
+					if (!createForm.validate()) return;
+					
+					TerrainRecordAndRights record = new TerrainRecordAndRights();
+					record.record = new TerrainRecord();
+					Date date = (Date)createForm.getValue(K.DATE);
+					record.record.setInfoFields(
+							createForm.getValueAsString(K.ID), 
+							createForm.getValueAsString(K.PROJECT), 
+							date, 
+							createForm.getValueAsString(K.DESC),
+							"???");
+
+					Services.getMain().createRecord(record.record, new AsyncCallback<Boolean>() {
+
+						@Override
+						public void onFailure(Throwable caught) {
+							SC.warn(caught.getMessage());
+						}
+
+						@Override
+						public void onSuccess(Boolean result) {
+							if (result) {
+								SC.warn("Record '"+createForm.getValueAsString(K.ID)+"' posted. Now wait for admin to validate the record.");
+							} else {
+								SC.warn("Record '"+createForm.getValueAsString(K.ID)+"' NOT created.");
+							}
+						}
+					});
+				}
+			});
+
+			createForm.setItems(idVAEField, contentVAEField, 
+					projectVAEField, dateVAEField, saveVAEButton);
+
+		}
+	}
+}
Index: projets/BCCCC/src/org/ccc/bcccc/client/panels/EditPanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/panels/EditPanel.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/panels/EditPanel.java	(revision 6)
@@ -0,0 +1,331 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.panels;
+
+import java.util.ArrayList;
+
+import org.ccc.bcccc.client.BCCCC;
+import org.ccc.bcccc.client.Services;
+import org.ccc.bcccc.client.areas.DataRecordArea;
+import org.ccc.bcccc.client.areas.DateRecordArea;
+import org.ccc.bcccc.client.areas.DispositifsRecordArea;
+import org.ccc.bcccc.client.areas.DocumentsRecordArea;
+import org.ccc.bcccc.client.areas.IntegerRecordArea;
+import org.ccc.bcccc.client.areas.LongStringRecordArea;
+import org.ccc.bcccc.client.areas.PublicationsRecordArea;
+import org.ccc.bcccc.client.areas.ReportsRecordArea;
+import org.ccc.bcccc.client.areas.StringRecordField;
+import org.ccc.bcccc.shared.K;
+import org.ccc.bcccc.shared.TerrainRecordAndRights;
+
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.TitleOrientation;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ViewAndEditTerrainRecordPanel.
+ */
+public class EditPanel extends VLayout {
+
+	/** The record. */
+	public TerrainRecordAndRights record;
+
+	/**
+	 * Instantiates a new view and edit terrain record panel.
+	 */
+	public EditPanel() {
+		this.setWidth100();
+		this.setHeight100();
+	}
+
+	/** The init view and edit done. */
+	boolean initViewAndEditDone;
+	
+	/** The view and edit form. */
+	private DynamicForm viewAndEditForm;
+
+	/** The save vae button. */
+	private ButtonItem saveVAEButton;
+	
+	/** The delete vae button. */
+	private ButtonItem deleteVAEButton;
+	
+	/** The validate vae button. */
+	private ButtonItem validateVAEButton;
+
+	/** The name field. */
+	private StringRecordField nameField;
+	
+	/** The project field. */
+	private StringRecordField projectField;
+	
+	/** The description field. */
+	private LongStringRecordArea descriptionField;
+	
+	/** The date field. */
+	private DateRecordArea dateField;
+
+	/** The number of participants field. */
+	private IntegerRecordArea numberOfParticipantsField;
+	
+	/** The participants field. */
+	private StringRecordField personsField;
+	
+	/** The types field. */
+	private StringRecordField typesField;
+	
+	/** The dispositifs field. */
+	private DispositifsRecordArea dispositifsField;
+	
+	/** The data field. */
+	private DataRecordArea dataField;
+	
+	/** The documentation field. */
+	private DocumentsRecordArea documentationField;
+	
+	/** The report field. */
+	private ReportsRecordArea reportField;
+	
+	/** The publication field. */
+	private PublicationsRecordArea publicationField;
+
+	/**
+	 * Inits the.
+	 */
+	public void init() {
+		this.hide();
+		if (!initViewAndEditDone) {
+			initViewAndEditDone = true;
+
+			viewAndEditForm = new DynamicForm();
+
+			saveVAEButton = new ButtonItem("save_record");
+			saveVAEButton.setTitle("Save changes");
+			saveVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
+				@Override
+				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
+//					final String ID = viewAndEditForm.getValueAsString(K.ID);
+//					if (ID == null || ID.trim().length() == 0) return;
+
+					record.record.setInfoFields(nameField.getValue(), 
+							projectField.getValue(), 
+							dateField.getDate(), 
+							descriptionField.getValue(),
+							"???");
+					
+					record.record.setDetailFields(Integer.parseInt(numberOfParticipantsField.getValue()), 
+							viewAndEditForm.getValueAsString(K.PLACE), 
+							typesField.getValuesAsStringArray(), 
+							new ArrayList<String>(),
+							personsField.getValuesAsStringArray(),
+							dispositifsField.getValues(),
+							documentationField.getValues(), 
+							dataField.getValues(),
+							reportField.getValues(),
+							publicationField.getValues());
+
+					System.out.println("Call updateRecord: "+record.record.uniq_id+", "+record.record);
+					Services.getMain().updateRecord(record.record.uniq_id, null, new AsyncCallback<Boolean>() {
+
+						@Override
+						public void onFailure(Throwable caught) {
+							SC.warn(caught.getMessage());
+							caught.printStackTrace();
+						}
+
+						@Override
+						public void onSuccess(Boolean result) {
+							if (result) {
+								SC.warn("Record '"+record.record.uniq_id+"' saved: "+record.record);
+							} else {
+								SC.warn("Record '"+record.record.uniq_id+"' NOT created.");
+							}
+						}
+					});
+				}
+			});
+
+			deleteVAEButton = new ButtonItem("delete_record");
+			deleteVAEButton.setTitle("Delete record");
+			deleteVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
+				@Override
+				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
+					Services.getMain().deleteRecord(record.record.uniq_id, new AsyncCallback<Boolean>() {
+						@Override
+						public void onFailure(Throwable caught) {
+							SC.warn("Error: "+caught);
+						}
+
+						@Override
+						public void onSuccess(Boolean result) {
+							if (result) {
+								SC.say("Deleted.");
+								History.newItem(K.BROWSE+"_my");
+							} else {
+								SC.say("NOT Deleted.");
+							}
+						}
+					});
+				}
+			});
+
+			validateVAEButton = new ButtonItem("validate_record");
+			validateVAEButton.setTitle("Validate record");
+			validateVAEButton.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
+				@Override
+				public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
+					Services.getMain().setValidateRecordValue(record.record.uniq_id, false, new AsyncCallback<Boolean>() {
+						@Override
+						public void onFailure(Throwable caught) {
+							SC.warn("Error: "+caught);
+						}
+
+						@Override
+						public void onSuccess(Boolean result) {
+							SC.say("Validated? "+result);
+						}
+					});
+				}
+			});
+
+			viewAndEditForm.setNumCols(3);
+			viewAndEditForm.setAutoWidth();
+			viewAndEditForm.setItems(deleteVAEButton, validateVAEButton, saveVAEButton);
+			viewAndEditForm.setTitleOrientation(TitleOrientation.LEFT);
+
+			nameField = new StringRecordField(this, "Name", false, true, null);	
+			projectField = new StringRecordField(this, "Project", false, true, null);	
+			descriptionField = new LongStringRecordArea(this, "Description", false, true);
+			dateField = new DateRecordArea(this, "Date", false, true, null);
+			numberOfParticipantsField = new IntegerRecordArea(this, "Number of participants");
+			personsField = new StringRecordField(this, "Participants", true, true, null);
+			String[] typesValues = {"privé", "commerce", "école", "etc."};
+			typesField = new StringRecordField(this, "Types", true, false, typesValues);
+			dispositifsField = new DispositifsRecordArea(this, "Dispositifs");
+			dataField = new DataRecordArea(this,  "Données");
+			documentationField = new DocumentsRecordArea(this, "Documentation");
+			reportField = new ReportsRecordArea(this,  "Rapports");
+			publicationField = new PublicationsRecordArea(this, "Publications");
+		}
+
+		if (BCCCC.doubleClickedRecord != null) { // load record informations
+			System.out.println("Reloading viewAndEdit record... "+BCCCC.doubleClickedRecord);
+			Services.getMain().getRecord(BCCCC.doubleClickedRecord.uniq_id, new AsyncCallback<TerrainRecordAndRights>() {
+				@Override
+				public void onFailure(Throwable caught) {
+					SC.warn("Error: "+caught);
+				}
+
+				@Override
+				public void onSuccess(TerrainRecordAndRights result) {
+
+					if (result == null) {
+						SC.warn("Error: no record found for ID="+BCCCC.doubleClickedRecord);
+						return;
+					}
+					record = result;
+					//record.record.uniq_id = BCCCC.doubleClickedRecord.uniq_id;
+					
+					viewAndEditForm.setCanEdit(result.editable);
+					validateVAEButton.setDisabled(!result.validable);
+					validateVAEButton.setStartRow(false);
+					validateVAEButton.setEndRow(false);
+					deleteVAEButton.setDisabled(!result.deletable);
+					deleteVAEButton.setStartRow(false);
+					deleteVAEButton.setEndRow(false);
+					saveVAEButton.setDisabled(!result.editable);
+					saveVAEButton.setStartRow(false);
+					saveVAEButton.setEndRow(false);
+					
+					addMember(viewAndEditForm);
+					viewAndEditForm.setVisible(result.editable);
+
+					nameField.setCanEdit(record.editable);
+					nameField.setValue(record.record.name);
+					projectField.setCanEdit(record.editable);
+					projectField.setValue(record.record.project);
+					descriptionField.setCanEdit(record.editable);
+					descriptionField.setValue(record.record.short_description);
+					typesField.setCanEdit(record.editable);
+					typesField.setValues(record.record.types);
+					dateField.setCanEdit(record.editable);
+					dateField.setValue(record.record.date);
+					numberOfParticipantsField.setCanEdit(record.editable);
+					numberOfParticipantsField.setValue(record.record.numberOfParticipants);
+					personsField.setCanEdit(record.editable);
+					dispositifsField.setCanEdit(record.editable);
+					dispositifsField.setValues(record.record.dispositifs);
+					dataField.setCanEdit(record.editable);
+					dataField.setDataValues(record.record.supports);
+					documentationField.setCanEdit(record.editable);
+					documentationField.setValues(record.record.documentations);
+					reportField.setCanEdit(record.editable);
+					reportField.setValues(record.record.reports);
+					publicationField.setCanEdit(record.editable);
+					publicationField.setValues(record.record.publications);
+					
+					addMember(viewAndEditForm);
+					addMember(nameField);
+					addMember(projectField);
+					addMember(descriptionField);
+					addMember(dateField);
+					addMember(numberOfParticipantsField);
+					addMember(typesField);
+					addMember(personsField);
+					addMember(dispositifsField);
+					addMember(dataField);
+					addMember(documentationField);
+					addMember(reportField);
+					addMember(publicationField);
+					show();
+				}
+			});
+		} else {
+			this.show();
+		}
+	}
+
+	/**
+	 * To string list.
+	 *
+	 * @param string the string
+	 * @return the string
+	 */
+	protected static String toStringList(String string) {
+		return string.replace("[", "").replace("]", "");
+	}
+
+	/**
+	 * Checks if is record changed.
+	 *
+	 * @return true, if is record changed
+	 */
+	public boolean isRecordChanged() {
+		if (record != null) {
+			return false;
+		} else {
+			return false;
+		}
+	}
+}
Index: projets/BCCCC/src/org/ccc/bcccc/client/panels/SearchPanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/panels/SearchPanel.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/panels/SearchPanel.java	(revision 6)
@@ -0,0 +1,173 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.panels;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.ccc.bcccc.client.BCCCC;
+import org.ccc.bcccc.client.Services;
+import org.ccc.bcccc.shared.Dispositif;
+import org.ccc.bcccc.shared.DocumentUnit;
+import org.ccc.bcccc.shared.K;
+import org.ccc.bcccc.shared.TerrainRecord;
+
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.MultipleAppearance;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.SliderItem;
+import com.smartgwt.client.widgets.form.fields.TextItem;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class SearchPanel.
+ */
+public class SearchPanel extends VLayout {
+	
+	/**
+	 * Instantiates a new search panel.
+	 */
+	public SearchPanel() {
+		this.setWidth100();
+		this.setHeight100();
+	}
+	
+	/** The init search complex done. */
+	boolean initSearchComplexDone = false;
+	
+	/**
+	 * Inits the.
+	 */
+	public void init() {
+		if (initSearchComplexDone) return;
+		initSearchComplexDone = true;
+
+		final DynamicForm form = new DynamicForm();
+		form.setWidth100();
+		form.setHeight100();
+		this.addMember(form);
+		
+		TextItem wordsField = new TextItem(K.WORDS, "Recherche par mot");
+		
+
+		SelectItem types = new SelectItem(K.TYPES);
+		types.setTitle("Terrain types");
+		types.setMultiple(true);  
+		types.setMultipleAppearance(MultipleAppearance.PICKLIST); 
+		types.setValueMap("commerce", "apprentissage", "privé", "médical", "etc.");
+
+		SelectItem projets = new SelectItem("projets");
+		projets.setTitle("Projet");
+		projets.setMultiple(true);  
+		projets.setMultipleAppearance(MultipleAppearance.PICKLIST); 
+		projets.setValueMap("projet1", "projet2", "projetN");
+
+		SliderItem participants = new SliderItem(K.NUMBEROFPARTICIPANTS);
+		participants.setTitle("More than N persons");
+		participants.setMinValue(1);  
+		participants.setMaxValue(100);  
+		//		participants.setNumValues(5);  
+		participants.setDefaultValue(1);  
+
+		SelectItem dispositifs = new SelectItem(K.DISPOSITIFS);
+		dispositifs.setTitle("Dispositifs");
+		dispositifs.setMultiple(true);  
+		dispositifs.setMultipleAppearance(MultipleAppearance.PICKLIST); 
+		dispositifs.setValueMap(Dispositif.types);
+
+
+		SelectItem supports = new SelectItem(K.SUPPORTS);
+		supports.setTitle("Supports");
+		supports.setMultiple(true);  
+		supports.setMultipleAppearance(MultipleAppearance.PICKLIST); 
+		supports.setValueMap(DocumentUnit.values);
+
+		ButtonItem validate = new ButtonItem("validate");
+		validate.setTitle("Search");
+		validate.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
+			@Override
+			public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
+
+				String words_value = form.getValueAsString(K.WORDS);
+				if (words_value == null) words_value = "";
+				else words_value = words_value.trim();
+				
+				String types_value = form.getValueAsString(K.TYPES);
+				if (types_value == null) types_value = "";
+				else types_value = types_value.trim();
+
+				String projects_value = form.getValueAsString(K.PROJECTS);
+				if (projects_value == null) projects_value = "";
+				else projects_value = projects_value.trim();
+
+				String participants_value = form.getValueAsString(K.NUMBEROFPARTICIPANTS);
+				if (participants_value == null) participants_value = "";
+				else participants_value = participants_value.trim();
+
+				String dispositifs_value = form.getValueAsString(K.DISPOSITIFS);
+				if (dispositifs_value == null) dispositifs_value = "";
+				else dispositifs_value = dispositifs_value.trim();
+
+				String supports_value = form.getValueAsString(K.SUPPORTS);
+				if (supports_value == null) supports_value = "";
+				else supports_value = supports_value.trim();
+
+				if (types_value.length() == 0 && 
+						projects_value.length() == 0 && 
+						participants_value.length() == 0 && 
+						dispositifs_value.length() == 0 && 
+						supports_value.length() == 0) return;
+
+				System.out.println("Updating records...");
+
+				HashMap<String, String> critera = new HashMap<String, String>();
+				critera.put(K.WORDS, words_value);
+				critera.put(K.TYPES, types_value);
+				critera.put(K.PROJECTS, projects_value);
+				critera.put(K.DISPOSITIFS, dispositifs_value);
+				critera.put(K.SUPPORTS, supports_value);
+				critera.put(K.NUMBEROFPARTICIPANTS, participants_value);
+				
+				Services.getMain().getRecordsWithComplexCritera(critera, new AsyncCallback<ArrayList<TerrainRecord>>() {
+					@Override
+					public void onFailure(Throwable caught) {
+						SC.warn(caught.getMessage());
+					}
+
+					@Override
+					public void onSuccess(ArrayList<TerrainRecord> result) {
+						BCCCC.searched_records = new ArrayList<TerrainRecord>();
+						if (result != null) {
+							System.out.println("Found: "+result.size());
+							BCCCC.searched_records = result;
+						}
+						History.newItem("browse_searched");
+					}
+				});
+			}
+		});
+
+		form.setItems(wordsField, types, projets, participants, dispositifs, supports, validate);
+	}
+}
Index: projets/BCCCC/src/org/ccc/bcccc/client/panels/HomePanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/panels/HomePanel.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/panels/HomePanel.java	(revision 6)
@@ -0,0 +1,55 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.panels;
+
+import com.smartgwt.client.widgets.HTMLPane;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class HomePanel.
+ */
+public class HomePanel extends VLayout {
+	
+	/**
+	 * Instantiates a new home panel.
+	 */
+	public HomePanel() {
+		this.setWidth100();
+		this.setHeight100();
+	}
+	
+	/** The init home done. */
+	boolean initHomeDone = false;
+	
+	/**
+	 * Inits the.
+	 */
+	public void init() {
+		if (initHomeDone) return;
+		initHomeDone = true;
+
+		HTMLPane l = new HTMLPane();
+		l.setWidth100();
+		l.setHeight100();
+		l.setContentsURL("welcome.html");
+		this.addMember(l);
+		this.setMargin(10);
+	}
+}
Index: projets/BCCCC/src/org/ccc/bcccc/client/panels/ViewPanel.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/panels/ViewPanel.java	(revision 0)
+++ projets/BCCCC/src/org/ccc/bcccc/client/panels/ViewPanel.java	(revision 6)
@@ -0,0 +1,81 @@
+/*
+ * Authors: Matthieu Decorde
+ * 
+ * COPYRIGHT 2015 ICAR - CCC
+ * 
+ * This software is free software: you can redistribute it 
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation,
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ * 
+ * This software is distributed in the hope that it will be
+ * useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ */
+package org.ccc.bcccc.client.panels;
+
+import org.ccc.bcccc.client.BCCCC;
+import org.ccc.bcccc.client.Services;
+import org.ccc.bcccc.shared.TerrainRecordAndRights;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ViewAndEditTerrainRecordPanel.
+ */
+public class ViewPanel extends VLayout {
+
+	/** The record. */
+	public TerrainRecordAndRights record;
+
+	/**
+	 * Instantiates a new view and edit terrain record panel.
+	 */
+	public ViewPanel() {
+		this.setWidth100();
+		this.setHeight100();
+	}
+
+	/** The init view and edit done. */
+	boolean initViewAndEditDone = false;
+	Label l;
+	/**
+	 * Inits the.
+	 */
+	public void init() {
+
+		if (!initViewAndEditDone) {
+			l = new Label();
+			l.setWidth100();
+			l.setHeight100();
+			l.setContents("Nothing to show...");
+			this.addMember(l);
+			
+			initViewAndEditDone = true;
+		}
+		
+		if (BCCCC.doubleClickedRecord != null) { // load record informations
+			Services.getMain().getRecord(BCCCC.doubleClickedRecord.uniq_id, new AsyncCallback<TerrainRecordAndRights>() {
+				@Override
+				public void onFailure(Throwable caught) {
+					SC.warn("Error: "+caught);
+				}
+
+				@Override
+				public void onSuccess(TerrainRecordAndRights result) {
+					record = result;
+					l.setContents(record.record.toHTML());
+					System.out.println(record.record.toHTML());
+				}
+			});
+		}
+	}
+}

Property changes on: projets/BCCCC/src/org/ccc/bcccc/client/panels/ViewPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: projets/BCCCC/src/org/ccc/bcccc/client/GreetingServiceAsync.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/GreetingServiceAsync.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/GreetingServiceAsync.java	(revision 6)
@@ -147,4 +147,6 @@
 	 * @param callback the callback
 	 */
 	void isAdmin(AsyncCallback<Boolean> callback);
+
+	void isOwner(Long ID, AsyncCallback<Boolean> callback);
 }
Index: projets/BCCCC/src/org/ccc/bcccc/client/GreetingService.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/client/GreetingService.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/client/GreetingService.java	(revision 6)
@@ -144,4 +144,6 @@
 	 * @return the boolean
 	 */
 	Boolean isAdmin();
+	
+	Boolean isOwner(Long ID);
 }
Index: projets/BCCCC/src/org/ccc/bcccc/server/GreetingServiceImpl.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/server/GreetingServiceImpl.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/server/GreetingServiceImpl.java	(revision 6)
@@ -418,6 +418,7 @@
 	 */
 	@Override
 	public Boolean updateRecord(Long ID, TerrainRecord content) {
+		System.out.println("Update record start");
 		log.info("updateRecord: "+ID+" "+content);
 		if (isLogged()) {
 			String session = this.getThreadLocalRequest().getSession().getId();
@@ -437,7 +438,7 @@
 						log.warning("updateRecord: record needs to be validatd before: "+ID);
 						return false;
 					}
-					record.setDetailFields(content.numberOfParticipants, content.place, content.types, content.keywords, content.dispositifs, content.documentations, content.supports, content.reports, content.publications);
+					record.setDetailFields(content.numberOfParticipants, content.place, content.types, content.keywords, content.persons, content.dispositifs, content.documentations, content.supports, content.reports, content.publications);
 					record.setInfoFields(content.name, content.project, content.date, content.short_description, content.user);
 					return records.save(record);
 
@@ -494,4 +495,31 @@
 			return false;
 		}
 	}
+
+	@Override
+	public Boolean isOwner(Long ID) {
+		log.info("isOwner: "+ID);
+		if (isLogged()) {
+			String session = this.getThreadLocalRequest().getSession().getId();
+			String user = connectedUsers.get(session);
+
+			log.info("isOwner: "+user);
+
+			if (!records.containsKey(ID)) {
+				log.warning("isOwner: record does not exists "+ID);
+				return false;
+			} else {
+				if (records.isRecordSetToUser(user, ID) || user.equals(ConfigDB.getAdmin())) {
+					log.info("isOwner: ok "+ID);
+					return true;
+				} else {
+					log.warning("isOwner: user has not the rigths "+user);
+					return false;
+				}
+			}
+		} else {
+			log.info("isOwner: user is NOT logged.");
+			return false;
+		}
+	}
 }
Index: projets/BCCCC/src/org/ccc/bcccc/shared/TerrainRecord.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/shared/TerrainRecord.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/shared/TerrainRecord.java	(revision 6)
@@ -28,61 +28,64 @@
  * The Class TerrainRecord.
  */
 public class TerrainRecord implements Serializable {
-	
+
 	/** The Constant serialVersionUID. */
 	private static final long serialVersionUID = 9112560460069520009L;
 
 	/** The uniq_id. */
 	// main info fields
 	public long uniq_id = 0;
-	
+
 	/** The name. */
 	public String name = "";
-	
+
 	/** The project. */
 	public String project = "";
-	
+
 	/** The date. */
 	public Date date = new Date();
-	
+
 	/** The year. */
 	public int year = 0;
-	
+
 	/** The short_description. */
 	public String short_description = "";
-	
+
 	/** The user. */
 	// manage fields
 	public String user = "";
-	
+
 	/** The must be validated. */
 	public boolean mustBeValidated = true;
-	
+
 	/** The number of participants. */
 	// detail fields
 	public int numberOfParticipants = 0;
-	
+
 	/** The place. */
 	public String place = "";
-	
+
 	/** The types. */
 	public List<String> types = new ArrayList<String>();
-	
+
 	/** The keywords. */
 	public List<String> keywords = new ArrayList<String>();
-	
+
+	/** The persons. */
+	public List<String> persons = new ArrayList<String>();
+
 	/** The dispositifs. */
 	public List<Dispositif> dispositifs = new ArrayList<Dispositif>();
-	
+
 	/** The documentations. */
 	public List<DocumentUnit> documentations = new ArrayList<DocumentUnit>();
-	
+
 	/** The supports. */
 	public List<Data> supports = new ArrayList<Data>();
-	
+
 	/** The reports. */
 	public List<Report> reports = new ArrayList<Report>();
-	
+
 	/** The publications. */
 	public List<Publication> publications = new ArrayList<Publication>();
 
@@ -90,7 +93,7 @@
 	 * Instantiates a new terrain record.
 	 */
 	public TerrainRecord() {}
-	
+
 	/**
 	 * Sets the info fields.
 	 *
@@ -113,7 +116,7 @@
 		this.user = user;
 		return this;
 	}
-	
+
 	/**
 	 * Sets the detail fields.
 	 *
@@ -129,13 +132,14 @@
 	 * @return the terrain record
 	 */
 	public TerrainRecord setDetailFields(int numberOfParticipants, String place, 
-			List<String> types, List<String> keywords, 
+			List<String> types, List<String> keywords, List<String> persons, 
 			List<Dispositif> dispositifs, List<DocumentUnit> documentations, 
 			List<Data> supports, List<Report> reports, List<Publication> publications) {
 		this.numberOfParticipants = numberOfParticipants;
 		this.place = place;
 		this.types = types;
 		this.keywords = keywords;
+		this.persons = persons;
 		this.dispositifs = dispositifs;
 		this.documentations = documentations;
 		this.supports = supports;
@@ -143,11 +147,34 @@
 		this.publications = publications;
 		return this;
 	}
-	
+
 	/* (non-Javadoc)
 	 * @see java.lang.Object#toString()
 	 */
 	public String toString() {
-		return uniq_id+"="+name+" "+project+" "+user+" "+mustBeValidated+" "+date+" "+year+" "+place+" "+numberOfParticipants+" "+types+" "+keywords+" "+dispositifs+" "+supports+" "+documentations+" "+short_description;
+		return uniq_id+"="+name+" "+project+" "+user+" "+mustBeValidated+" "+date+" "+year+" "+place+" "+numberOfParticipants+" "+types+" "+keywords+" "+" "+persons+" "+dispositifs+" "+supports+" "+documentations+" "+short_description;
 	}
+
+	/* (non-Javadoc)
+	 * @see java.lang.Object#toString()
+	 */
+	public String toHTML() {
+		return "<h3>"+name+"</h3>\n" +
+				"<h3>Informations</h3>\n" +
+				"<ul>"+
+				"<li>Project: "+project+"</li>\n" +
+				"<li>Owner: "+user+"</li>\n" +
+				"<li>Year: "+year+"</li>\n" +
+				"<li>Place: "+place+"</li>\n" +
+				"<li>Number of participants: "+numberOfParticipants+"</li>" +
+				"</ul>" +
+				"<h3>Details</h3>\n" +
+				"<p>Types: "+types+"</p>\n" +
+				"<p>Persons: "+persons+"</p>\n" +
+				"<p>Dispositifs: "+dispositifs+"</p>\n" +
+				"<p>Equipments: "+supports+"</p>\n" +
+				"<p>Documentation: "+documentations+"<p>\n" +
+				"<h3>Description</h3>\n" +
+				"<p>"+short_description;
+	}
 }
Index: projets/BCCCC/src/org/ccc/bcccc/shared/K.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/shared/K.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/shared/K.java	(revision 6)
@@ -37,8 +37,10 @@
 	public static final String NEWRECORD = "new";
 	
 	/** The Constant VIEWEDITRECORD. */
-	public static final String VIEWEDITRECORD = "viewedit";
+	public static final String EDITRECORD = "edit";
 	
+	public static final String VIEWRECORD = "view";
+	
 	/** The Constant ID. */
 	public static final String ID = "id";
 	
Index: projets/BCCCC/src/org/ccc/bcccc/shared/Dispositif.java
===================================================================
--- projets/BCCCC/src/org/ccc/bcccc/shared/Dispositif.java	(revision 5)
+++ projets/BCCCC/src/org/ccc/bcccc/shared/Dispositif.java	(revision 6)
@@ -25,10 +25,12 @@
  * The Class Dispositif.
  */
 public class Dispositif implements Serializable {
+	
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 623201999995138355L;
 
-	/** The Constant serialVersionUID. */
-	private static final long serialVersionUID = 2954507863339852772L;
-	
 	/** The type. */
 	public String type = "";
 	
