Author: tchemit Date: 2012-09-05 11:26:02 +0200 (Wed, 05 Sep 2012) New Revision: 615 Url: http://forge.codelutin.com/repositories/revision/echobase/615 Log: improve documentation access Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties trunk/echobase-ui/pom.xml trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java =================================================================== --- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2012-09-05 09:26:02 UTC (rev 615) @@ -34,6 +34,7 @@ import java.io.File; import java.io.IOException; +import java.net.URL; import java.util.Map; import java.util.Properties; @@ -152,13 +153,6 @@ return file; } -// public File getWarDirectory() { -// File file = applicationConfig.getOptionAsFile( -// EchoBaseConfigurationOption.WAR_DIRECTORY.key); -// Preconditions.checkNotNull(file); -// return file; -// } - public File getWarLocation() { File file = applicationConfig.getOptionAsFile( EchoBaseConfigurationOption.WAR_LOCATION.key); @@ -200,6 +194,12 @@ return result != null && result; } + public URL getDocumentationUrl() { + URL result = applicationConfig.getOptionAsURL( + EchoBaseConfigurationOption.DOCUMENTATION_URL.key); + return result; + } + public boolean getOptionAsBoolean(String propertyName) { Boolean result = applicationConfig.getOptionAsBoolean(propertyName); return result != null && result; Modified: trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java =================================================================== --- trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-domain/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java 2012-09-05 09:26:02 UTC (rev 615) @@ -26,6 +26,7 @@ import org.nuiton.util.Version; import java.io.File; +import java.net.URL; import static org.nuiton.i18n.I18n.n_; @@ -64,7 +65,11 @@ WAR_LOCATION("echobase.war.location", n_("echobase.config.war.location.description"), "${echobase.data.directory}/war/echobase-ui-${echobase.version}-embedded.war", - File.class); + File.class), + DOCUMENTATION_URL("echobase.documentationUrl", + n_("echobase.config.documentationUrl.description"), + "http://maven-site.forge.codelutin.com/echobase", + URL.class); /** Configuration key. */ protected final String key; Modified: trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties =================================================================== --- trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-domain/src/main/resources/i18n/echobase-domain_en_GB.properties 2012-09-05 09:26:02 UTC (rev 615) @@ -2,6 +2,7 @@ echobase.common.driverType.postgres=Postgresql Database echobase.config.csv.separator.description=Csv separator character echobase.config.data.directory.description=Path to application data +echobase.config.documentationUrl.description=Where to find EchoBase online documentation echobase.config.embedded.description=Flag used for embedded application (will create a h2 working db configuration to access database) echobase.config.h2Version.description=H2 jdbc driver version echobase.config.internal.db.directory.description=Directory of the internal database Modified: trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties =================================================================== --- trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-domain/src/main/resources/i18n/echobase-domain_fr_FR.properties 2012-09-05 09:26:02 UTC (rev 615) @@ -2,6 +2,7 @@ echobase.common.driverType.postgres=Base Postgresql echobase.config.csv.separator.description=Caractère séparateur pour les fichiers csv echobase.config.data.directory.description=Répertoire des données de l'application +echobase.config.documentationUrl.description=Où trouver la documentation en ligne d'EchoBase echobase.config.embedded.description=Pour créer au démarrage une configuration vers la base h2 embarquée (uniquement pour les applications embarquées) echobase.config.h2Version.description=Version du pilote jdbc H2 echobase.config.internal.db.directory.description=Répertoire de la base interne Modified: trunk/echobase-ui/pom.xml =================================================================== --- trunk/echobase-ui/pom.xml 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/pom.xml 2012-09-05 09:26:02 UTC (rev 615) @@ -81,7 +81,7 @@ </configuration> </execution> <execution> - <id>parseOthersAndGenBundle</id> + <id>parseOthersAndGen</id> <goals> <goal>parserValidation</goal> <goal>parserJava</goal> @@ -89,6 +89,15 @@ <goal>bundle</goal> </goals> </execution> + <execution> + <id>bundle</id> + <goals> + <goal>bundle</goal> + </goals> + <configuration> + <showEmpty>true</showEmpty> + </configuration> + </execution> </executions> </plugin> Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/EchoBaseActionSupport.java 2012-09-05 09:26:02 UTC (rev 615) @@ -39,6 +39,7 @@ import fr.ifremer.echobase.ui.EchoBaseSession; import fr.ifremer.echobase.ui.EchoBaseWorkingDbTransactionFilter; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.struts2.interceptor.ParameterAware; import org.apache.struts2.interceptor.SessionAware; import org.nuiton.topia.persistence.TopiaEntity; @@ -48,6 +49,7 @@ import java.util.Collection; import java.util.Date; import java.util.List; +import java.util.Locale; import java.util.Map; /** @@ -229,6 +231,26 @@ } } + public String getDocumentation(String page) { + return getDocumentation(page, null); + } + + public String getDocumentation(String page, String anchor) { + Locale locale = getLocale(); + String result = getConfiguration().getDocumentationUrl().toString(); + if (!result.endsWith("/")) { + result += "/"; + } + if (Locale.ENGLISH.getLanguage().equals(locale.getLanguage())) { + result += "en/"; + } + result += page; + if (StringUtils.isNotBlank(anchor)) { + result += "#" + anchor; + } + return result; + } + public boolean hasAnyErrors() { boolean result = super.hasErrors(); return result || hasFlashErrors(); Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties =================================================================== --- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_en_GB.properties 2012-09-05 09:26:02 UTC (rev 615) @@ -155,13 +155,13 @@ echobase.header.request.result=SQL query result echobase.info.click.to.select=You can select value with a simple click then copy it (Ctrl-C) echobase.info.dbeditor.propertyDiffsResult=Data import results +echobase.info.documentation=EchoBase online documentation echobase.info.downloadEchoBase=Download application and import files echobase.info.echoBaseForge=Project Forge +echobase.info.echoR=EchoR project echobase.info.exportDb.archive=Basebame of the archive, extension <strong>.zip</strong> will be added to it. echobase.info.import.failed=Import failed echobase.info.import.succeded=Successful import -echobase.info.lastDevDocumentation=Current documentation (will be available at next stable version) -echobase.info.lastStableDocumentation=Last stable version documentation echobase.info.new.sqlQuery.inprogress=Query creation in progress echobase.info.new.workingDbConfiguration.inprogress=New working database configuration in progress echobase.info.no.sqlQuery.saved=No saved SQL query Modified: trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties =================================================================== --- trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2012-09-05 09:26:02 UTC (rev 615) @@ -155,13 +155,13 @@ echobase.header.request.result=Résultat de la requête SQL echobase.info.click.to.select=Vous pouvez sélectionner la valeur en un simple click puis la copier (Ctrl-C) echobase.info.dbeditor.propertyDiffsResult=Résultat d'import de données +echobase.info.documentation=Documentation en ligne d'EchoBase echobase.info.downloadEchoBase=Téléchargement de l'application et des fichiers d'import echobase.info.echoBaseForge=Gestion du projet +echobase.info.echoR=Projet EchoR echobase.info.exportDb.archive=Il s'agit du nom de l'archive, l'extension <strong>.zip</strong> sera automatiquement rajoutée. echobase.info.import.failed=L'import a échoué echobase.info.import.succeded=L'import a réussi -echobase.info.lastDevDocumentation=Documentation en cours (disponible dans la prochaine version stable) -echobase.info.lastStableDocumentation=Documentation de la dernière version stable echobase.info.new.sqlQuery.inprogress=Nouvelle requête en cours de création echobase.info.new.workingDbConfiguration.inprogress=Nouvelle configuration de base de travail en cours de création echobase.info.no.sqlQuery.saved=Aucune requête d'export SQL enregistrée @@ -264,7 +264,7 @@ echobase.title.newLibreOfficeQuery=Traduire une requête SQL issue de Libre Office echobase.title.users=Administration des utilisateurs echobase.title.welcome=Bienvenue dans EchoBase -echobase.title.workingDbConfiguration=Administration des configuration de bases de travail +echobase.title.workingDbConfiguration=Administration des configurations de base de travail echobase.tooltip.disconnectWorkingDb=Changer de base de travail echobase.tooltip.logout=Se déconnecter echobase.tooltip.selectWorkingDb=Sélectionner une base de travail Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/home.jsp 2012-09-05 09:26:02 UTC (rev 615) @@ -23,6 +23,7 @@ --%> <%@ page language="java" contentType="text/html" pageEncoding="utf-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> +<%@ taglib prefix="sj" uri="/struts-jquery-tags" %> <title><s:text name="echobase.title.welcome"/></title> <div class="fontsize11"> @@ -32,24 +33,16 @@ </legend> <ul> <li> - <s:a href="http://maven-site.forge.codelutin.com/echobase" - target='#stableDoc'> - <s:text name="echobase.info.lastStableDocumentation"/> + <s:a href="%{getDocumentation('index.html')}" target='#doc'> + <s:text name="echobase.info.documentation"/> </s:a> </li> <li> - <s:a href="http://maven-site.forge.codelutin.com/echobase/SNAPSHOT" - target='#devDoc'> - <s:text name="echobase.info.lastDevDocumentation"/> + <s:a href="https://forge.ifremer.fr/www/echor" target='#doc'> + <s:text name="echobase.info.echoR"/> </s:a> </li> <li> - <s:a href="http://forge.codelutin.com/projects/echobase/files" - target='#forge'> - <s:text name="echobase.info.downloadEchoBase"/> - </s:a> - </li> - <li> <s:a href="http://forge.codelutin.com/projects/echobase" target='#forge'> <s:text name="echobase.info.echoBaseForge"/> @@ -57,4 +50,15 @@ </li> </ul> </fieldset> -</div> \ No newline at end of file +</div> + +<s:if test="!workingDbSelected"> + <s:form namespace="/workingDb" action="showList"> + <ul class="toolbar floatLeft"> + <li> + <s:submit theme="simple" action="showList" + key="echobase.action.workingDbconfiguration.connect"/> + </li> + </ul> + </s:form> +</s:if> \ No newline at end of file Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureAcousticImport.jsp 2012-09-05 09:26:02 UTC (rev 615) @@ -53,8 +53,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#acoustic" - target="doc"> + <s:a href="%{getDocumentation('imports.html','acoustic')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> </div> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCatchesImport.jsp 2012-09-05 09:26:02 UTC (rev 615) @@ -46,7 +46,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#totalsample-subs..." + <s:a href="%{getDocumentation('imports.html','totalsample-subsample-biometrysample')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureCommonImport.jsp 2012-09-05 09:26:02 UTC (rev 615) @@ -61,7 +61,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#voyage-transit-t..." + <s:a href="%{getDocumentation('imports.html','voyage-transit-transect')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> @@ -130,7 +130,7 @@ <s:hidden key="model.importMode" value="TRANSECT" label=''/> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#voyage-transit-t..." + <s:a href="%{getDocumentation('imports.html','voyage-transit-transect')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureOperationImport.jsp 2012-09-05 09:26:02 UTC (rev 615) @@ -40,7 +40,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#operation-operat..." + <s:a href="%{getDocumentation('imports.html','operation-operationmetadatavalue-gearmetadatavalue')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp 2012-09-05 07:35:48 UTC (rev 614) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/importData/configureResultsImport.jsp 2012-09-05 09:26:02 UTC (rev 615) @@ -70,7 +70,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#r-sultats-voyage" + <s:a href="%{getDocumentation('imports.html','r-sultats-voyag')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> @@ -111,7 +111,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#r-sultats-esdu" + <s:a href="%{getDocumentation('imports.html','r-sultats-esdu')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> @@ -162,8 +162,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#region" - target="doc"> + <s:a href="%{getDocumentation('imports.html','region')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> </div> @@ -203,8 +202,7 @@ </legend> <div class="cleanBoth help"> - <s:a href="http://maven-site.forge.codelutin.com/echobase/imports.html#map" - target="doc"> + <s:a href="%{getDocumentation('imports.html','map')}" target="doc"> <s:text name="echobase.action.show.import.documentation"/> </s:a> </div>