Author: chatellier Date: 2011-01-12 09:20:31 +0000 (Wed, 12 Jan 2011) New Revision: 496 Log: Add creationDate, dataAllowed, and mapsReferenceResult attribute on rsufi result Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractDataContainer.java trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractEntity.java trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Control.java trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Project.java trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractDataContainer.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractDataContainer.java 2011-01-10 17:52:00 UTC (rev 495) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractDataContainer.java 2011-01-12 09:20:31 UTC (rev 496) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractEntity.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractEntity.java 2011-01-10 17:52:00 UTC (rev 495) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/AbstractEntity.java 2011-01-12 09:20:31 UTC (rev 496) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Control.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Control.java 2011-01-10 17:52:00 UTC (rev 495) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Control.java 2011-01-12 09:20:31 UTC (rev 496) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Project.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Project.java 2011-01-10 17:52:00 UTC (rev 495) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Project.java 2011-01-12 09:20:31 UTC (rev 496) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2011-01-10 17:52:00 UTC (rev 495) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/RSufiResult.java 2011-01-12 09:20:31 UTC (rev 496) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2010 Codelutin, Chatellier Eric + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -25,6 +25,7 @@ package fr.ifremer.coser.bean; +import java.util.Date; import java.util.Properties; /** @@ -41,10 +42,14 @@ /** serialVersionUID. */ private static final long serialVersionUID = -1337710082675120199L; + // FIXME echatellier 20110111 compabilité avec les projets beta (a retirer pour la v1) + protected Date creationDate = new Date(0); + protected String name; protected String rsufiVersion; + /** Zone d'application du resultat. */ protected String zone; /** Utilisé seulement pour la validation (sinon, non valorisé). */ @@ -63,6 +68,20 @@ /** Result selected for web publication. */ protected boolean publishResult; + /** Result flaged as maps result. */ + protected boolean mapsReferenceResult; + + /** Data download allowed. */ + protected boolean dataAllowed; + + public Date getCreationDate() { + return creationDate; + } + + public void setCreationDate(Date creationDate) { + this.creationDate = creationDate; + } + public String getName() { return name; } @@ -142,7 +161,7 @@ public String getMapsPath() { return mapsPath; } - + public void setPublishResult(boolean publishResult) { boolean oldValue = this.publishResult; this.publishResult = publishResult; @@ -153,8 +172,31 @@ return publishResult; } + public boolean isMapsReferenceResult() { + return mapsReferenceResult; + } + + public void setMapsReferenceResult(boolean mapsReferenceResult) { + boolean oldValue = this.mapsReferenceResult; + this.mapsReferenceResult = mapsReferenceResult; + getPropertyChangeSupport().firePropertyChange("mapsReferenceResult", oldValue, mapsReferenceResult); + } + + public boolean isDataAllowed() { + return dataAllowed; + } + + public void setDataAllowed(boolean dataAllowed) { + boolean oldValue = this.dataAllowed; + this.dataAllowed = dataAllowed; + getPropertyChangeSupport().firePropertyChange("dataAllowed", oldValue, dataAllowed); + } + public Properties toProperties() { Properties props = new Properties(); + if (getCreationDate() != null) { + props.setProperty("result.creationdate", String.valueOf(creationDate.getTime())); + } if (getRsufiVersion() != null) { props.setProperty("result.rsufiversion", getRsufiVersion()); } @@ -168,10 +210,16 @@ props.setProperty("result.estPopIndName", getEstPopIndName()); } props.setProperty("result.publishResult", String.valueOf(isPublishResult())); + props.setProperty("result.dataAllowed", String.valueOf(isDataAllowed())); + props.setProperty("result.mapsReferenceResult", String.valueOf(isMapsReferenceResult())); return props; } - + public void fromProperties(Properties props) { + if (props.containsKey("result.creationdate")) { + Date date = new Date(Long.parseLong(props.getProperty("result.creationdate"))); + setCreationDate(date); + } if (props.containsKey("result.rsufiversion")) { setRsufiVersion(props.getProperty("result.rsufiversion")); } @@ -187,5 +235,11 @@ if (props.containsKey("result.publishResult")) { setPublishResult(Boolean.parseBoolean(props.getProperty("result.publishResult"))); } + if (props.containsKey("result.dataAllowed")) { + setDataAllowed(Boolean.parseBoolean(props.getProperty("result.dataAllowed"))); + } + if (props.containsKey("result.mapsReferenceResult")) { + setMapsReferenceResult(Boolean.parseBoolean(props.getProperty("result.mapsReferenceResult"))); + } } } Modified: trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java =================================================================== --- trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java 2011-01-10 17:52:00 UTC (rev 495) +++ trunk/coser-business/src/main/java/fr/ifremer/coser/bean/Selection.java 2011-01-12 09:20:31 UTC (rev 496) @@ -5,7 +5,7 @@ * $Id$ * $HeadURL$ * %% - * Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric + * Copyright (C) 2010 - 2011 Ifremer, Codelutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as
participants (1)
-
chatellier@users.labs.libre-entreprise.org