Author: sletellier Date: 2011-11-16 18:33:28 +0100 (Wed, 16 Nov 2011) New Revision: 88 Url: http://forge.codelutin.com/repositories/revision/echobase/88 Log: Fix import/export for modifications Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ImportTable.java Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml trunk/echobase-ui/src/main/resources/config/struts-user.xml trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp trunk/echobase-ui/src/main/webapp/css/screen.css Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java =================================================================== --- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfiguration.java 2011-11-16 17:33:28 UTC (rev 88) @@ -111,6 +111,12 @@ return file; } + public File getModifExportDirectory() { + File file = applicationConfig.getOptionAsFile(EchoBaseConfigurationOption.MODIF_EXPORT_DIRECTORY.key); + Preconditions.checkNotNull(file); + return file; + } + public Version getApplicationVersion() { String versionStr = applicationConfig.getOption(EchoBaseConfigurationOption.VERSION.key); @@ -168,5 +174,4 @@ "Could not create directory " + directory, e); } } - } Modified: trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java =================================================================== --- trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-entities/src/main/java/fr/ifremer/echobase/EchoBaseConfigurationOption.java 2011-11-16 17:33:28 UTC (rev 88) @@ -53,6 +53,9 @@ WAR_DIRECTORY("war.directory", "Répertoire où est stoqué le war", "${data.directory}/war", File.class), + MODIF_EXPORT_DIRECTORY("motif.export.directory", + "Répertoire où sont stoqué les exports", + "${data.directory}/modifExport", File.class), WAR_LOCATION("war.location", "Chemin complêt d'accès au war", "${war.directory}/echobase-ui-${project.version}.war", Modified: trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java =================================================================== --- trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-services/src/main/java/fr/ifremer/echobase/services/DbEditorService.java 2011-11-16 17:33:28 UTC (rev 88) @@ -24,7 +24,9 @@ package fr.ifremer.echobase.services; import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import fr.ifremer.echobase.EchoBaseConfiguration; import fr.ifremer.echobase.EchoBaseTechnicalException; import fr.ifremer.echobase.entities.EchoBaseDAOHelper; import fr.ifremer.echobase.entities.EchoBaseEntityEnum; @@ -46,6 +48,11 @@ import org.nuiton.util.beans.BeanMonitor; import org.nuiton.util.beans.PropertyDiff; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -62,6 +69,9 @@ /** Logger. */ private static final Log log = LogFactory.getLog(DbEditorService.class); + private static final String EXPORT_FILE_PREFIX = "modifExport-"; + private static final String SCV_EXT = ".csv"; + protected DecoratorService decoratorService; protected DecoratorService getDecoratorService() { @@ -92,12 +102,24 @@ return result; } + public Map<?, ?>[] getAllDatas(String tableName, boolean addDecorated) { + return getDatas(tableName, null, null, null, addDecorated); + } + //TODO Use an object to filter datas public Map<?, ?>[] getDatas(String tableName, Pager pager, String sidx, Boolean ascendantOrder) { + return getDatas(tableName, pager, sidx, ascendantOrder, true); + } + public Map<?, ?>[] getDatas(String tableName, + Pager pager, + String sidx, + Boolean ascendantOrder, + boolean addDecorated) { + DbMeta dbMeta = getDbMeta(); TableMeta tableMeta = dbMeta.getTable(tableName); EchoBaseEntityEnum entityEnum = tableMeta.getEntityEnum(); @@ -110,37 +132,48 @@ countQuery.addSelect("count(*)"); int count = dao.countByQuery(countQuery); - pager.setRecords(count); - pager.computeIndexesAndPageCount(); + List<?> all; + int resultSize; + if (pager != null) { + pager.setRecords(count); + pager.computeIndexesAndPageCount(); - int from = pager.getStartIndex(); - int to = pager.getEndIndex(); + int from = pager.getStartIndex(); + int to = pager.getEndIndex(); - if (log.isDebugEnabled()) { - log.debug("Count = " + count); - log.debug("page = " + pager.getPageNumber()); - log.debug("pageSize = " + pager.getPageSize()); - log.debug("from = " + from); - log.debug("to = " + to); - log.debug("pageCount= " + pager.getPageCount()); - } + resultSize = to - from; - TopiaQuery query = dao.createQuery("e"); - if (StringUtils.isNotEmpty(sidx)) { - if (ascendantOrder) { - query.addOrder(sidx); - } else { - query.addOrderDesc(sidx); + if (log.isDebugEnabled()) { + log.debug("Count = " + count); + log.debug("page = " + pager.getPageNumber()); + log.debug("pageSize = " + pager.getPageSize()); + log.debug("from = " + from); + log.debug("to = " + to); + log.debug("pageCount= " + pager.getPageCount()); } + + TopiaQuery query = dao.createQuery("e"); + if (StringUtils.isNotEmpty(sidx)) { + if (ascendantOrder) { + query.addOrder(sidx); + } else { + query.addOrderDesc(sidx); + } + } + query.setLimit(from, to - 1); + all = dao.findAllByQuery(query); + } else { + + // Get all + all = dao.findAll(); + resultSize = count; } - query.setLimit(from, to - 1); - List<?> all = dao.findAllByQuery(query); - Map<?, ?>[] rows = new Map[to - from]; + Map<?, ?>[] rows = new Map[resultSize]; int i = 0; for (Object o : all) { TopiaEntity entity = (TopiaEntity) o; - Map<String, Object> row = loadRow(tableMeta, entity); + Map<String, Object> row = loadRow(tableMeta, entity, addDecorated); rows[i++] = row; } return rows; @@ -159,7 +192,7 @@ try { TopiaDAO dao = EchoBaseDAOHelper.getDAO(getTransaction(), contract); TopiaEntity entity = dao.findByTopiaId(topiaId); - return loadRow(tableMeta, entity); + return loadRow(tableMeta, entity, true); } catch (TopiaException eee) { throw new EchoBaseTechnicalException("Could not obtain data", eee); } @@ -170,6 +203,15 @@ Map<String, String> properties, EchoBaseUser user) { + return saveEntity(tableMeta, id, properties, user, true); + } + + public PropertyDiff[] saveEntity(TableMeta tableMeta, + String id, + Map<String, String> properties, + EchoBaseUser user, + boolean commit) { + Class<? extends TopiaEntity> entityType = tableMeta.getEntityType(); String[] columnNames = tableMeta.getColumnNamesAsArray(); BeanMonitor monitor = new BeanMonitor(columnNames); @@ -202,9 +244,7 @@ value = daoFK.findByTopiaId(propertyValue); } else if (Date.class.equals(columnMeta.getType())) { - - // Parse date - value = SimpleDateFormat.getInstance().parse(propertyValue); + value = new SimpleDateFormat("dd/MM/yyyy").parse(propertyValue); } else { value = propertyValue; } @@ -267,7 +307,9 @@ EntityModificationLog.PROPERTY_MODIFICATION_TEXT, buffer.toString() ); - getTransaction().commitTransaction(); + if (commit) { + getTransaction().commitTransaction(); + } } return propertyDiffs; } catch (Exception eee) { @@ -278,7 +320,8 @@ } protected Map<String, Object> loadRow(TableMeta tableMeta, - TopiaEntity entity) { + TopiaEntity entity, + boolean addDecorated) { Map<String, Object> row = Maps.newLinkedHashMap(); EntityOperator<TopiaEntity> operator = (EntityOperator<TopiaEntity>) tableMeta.getOperator(); @@ -293,18 +336,123 @@ // this is a foreign key, just keep the topiaid String topiaId = ((TopiaEntity) property).getTopiaId(); - // decorate the entity - String decorate = getDecoratorService().decorate( - getLocale(), property, null); + if (addDecorated) { + // decorate the entity + String decorate = getDecoratorService().decorate( + getLocale(), property, null); - // keep the decorate value - row.put(propertyName + "_lib", decorate); + // keep the decorate value + row.put(propertyName + "_lib", decorate); + } // use as the property his topiaid property = topiaId; } + + // FIXME : tempory hack for export + if (property != null && Date.class.equals(columnMeta.getType())) { + property = new SimpleDateFormat("dd/MM/yyyy").format((Date)property); + } row.put(propertyName, property); } return row; } + + public List<PropertyDiff[]> importDatas(String tableName, + File importFile, + EchoBaseUser user) { + + TableMeta tableMeta = getTableMetas(tableName); + + BufferedReader bf = null; + List<PropertyDiff[]> result = Lists.newArrayList(); + try { + bf = new BufferedReader(new FileReader(importFile)); + String csvHeader = bf.readLine(); + String[] properties = csvHeader.split(";"); + + String line = bf.readLine(); + while (line != null) { + + Map<String, String> valuesMap = Maps.newLinkedHashMap(); + + String[] values = line.split(";"); + + String id = values[0]; + for (int i=1;i<values.length;i++) { + valuesMap.put(properties[i], values[i]); + } + + // Save entity + PropertyDiff[] propertyDiffs = saveEntity(tableMeta, id, valuesMap, user, false); + result.add(propertyDiffs); + + line = bf.readLine(); + } + + } catch (Exception eee) { + log.error("Failled to read import file " + importFile.getName(), eee); + throw new EchoBaseTechnicalException(eee); + } finally { + if (bf != null) { + try { + bf.close(); + } catch (IOException eee) { + log.error("Failled to close import file " + importFile.getName(), eee); + throw new EchoBaseTechnicalException(eee); + } + } + } + return result; + } + + public File exportDatas(String tableName) { + + Map<?, ?>[] datas = getAllDatas(tableName, false); + + StringBuilder csvContent = new StringBuilder(); + + // Build csv + boolean headerCompleted = false; + for (Map<?, ?> data : datas) { + if (!headerCompleted) { + String keys = StringUtils.join(data.keySet(), ";"); + csvContent.append(keys); + csvContent.append("\n"); + headerCompleted = true; + } + + String values = StringUtils.join(data.values(), ";"); + csvContent.append(values); + csvContent.append("\n"); + } + + // Write export file + EchoBaseConfiguration configuration = getConfiguration(); + File modifExportDirectory = configuration.getModifExportDirectory(); + + SimpleDateFormat format = new SimpleDateFormat("yyMMddHHmm"); + String now = format.format(new Date()); + + File file = new File(modifExportDirectory, EXPORT_FILE_PREFIX + now + SCV_EXT); + + FileWriter writer = null; + try { + writer = new FileWriter(file, true); + writer.write(csvContent.toString()); + } catch (IOException eee) { + log.error("Failled to write modif export file", eee); + throw new EchoBaseTechnicalException(eee); + } finally { + if (writer != null) { + try { + writer.close(); + } catch (IOException eee) { + log.error("Failled to close modif export file", eee); + throw new EchoBaseTechnicalException(eee); + } + } + } + return file; + } } Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ExportTable.java 2011-11-16 17:33:28 UTC (rev 88) @@ -0,0 +1,91 @@ +/* + * #%L + * EchoBase :: UI + * + * $Id: GetEntities.java 51 2011-11-13 16:20:45Z tchemit $ + * $HeadURL: http://svn.forge.codelutin.com/svn/echobase/trunk/echobase-ui/src/main/java/... $ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.ui.actions.dbeditor; + +import fr.ifremer.echobase.services.DbEditorService; +import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; + +/** + * To export datas for the given request. + * + * @author sletellier <letellier@codelutin.com> + * @since 0.1 + */ +public class ExportTable extends EchoBaseActionSupport { + + private static final long serialVersionUID = 1L; + + /** Logger. */ + private static final Log log = LogFactory.getLog(ImportTable.class); + + /** Name of the table to load. */ + protected String tableName; + + /** Default file name to create. */ + protected String fileName; + protected InputStream inputStream; + protected long contentLength; + protected String contentType; + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public InputStream getInputStream() { + return inputStream; + } + + public long getContentLength() { + return contentLength; + } + + public String getContentType() { + return contentType; + } + + public String getFileName() { + return fileName; + } + + @Override + public String execute() throws Exception { + + DbEditorService dbEditorService = newService(DbEditorService.class); + + File file = dbEditorService.exportDatas(tableName); + + contentType = "text/csv"; + fileName = file.getName(); + contentLength = file.length(); + inputStream = new FileInputStream(file); + + return SUCCESS; + } +} Modified: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/GetEntities.java 2011-11-16 17:33:28 UTC (rev 88) @@ -42,7 +42,7 @@ private static final long serialVersionUID = 1L; /** Logger. */ - private static final Log log = LogFactory.getLog(GetEntities.class); + private static final Log log = LogFactory.getLog(ImportTable.class); /** Name of the table to load. */ protected String tableName; Added: trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ImportTable.java =================================================================== --- trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ImportTable.java (rev 0) +++ trunk/echobase-ui/src/main/java/fr/ifremer/echobase/ui/actions/dbeditor/ImportTable.java 2011-11-16 17:33:28 UTC (rev 88) @@ -0,0 +1,113 @@ +/* + * #%L + * EchoBase :: UI + * + * $Id: GetEntities.java 51 2011-11-13 16:20:45Z tchemit $ + * $HeadURL: http://svn.forge.codelutin.com/svn/echobase/trunk/echobase-ui/src/main/java/... $ + * %% + * Copyright (C) 2011 Ifremer, Codelutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * #L% + */ +package fr.ifremer.echobase.ui.actions.dbeditor; + +import fr.ifremer.echobase.services.DbEditorService; +import fr.ifremer.echobase.ui.actions.EchoBaseActionSupport; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.nuiton.util.beans.PropertyDiff; + +import java.io.File; +import java.util.List; + +/** + * To import datas from import file. + * + * @author sletellier <letellier@codelutin.com> + * @since 0.1 + */ +public class ImportTable extends EchoBaseActionSupport { + + private static final long serialVersionUID = 1L; + + /** Logger. */ + private static final Log log = LogFactory.getLog(ImportTable.class); + + /** Name of the table to load. */ + protected String tableName; + + protected File upfile; + protected String upfileContentType; + protected String upfileFileName; + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public File getUpfile() { + return upfile; + } + + public void setUpfile(File upfile) { + this.upfile = upfile; + } + + public String getUpfileContentType() { + return upfileContentType; + } + + public void setUpfileContentType(String upfileContentType) { + this.upfileContentType = upfileContentType; + } + + public String getUpfileFileName() { + return upfileFileName; + } + + public void setUpfileFileName(String upfileFileName) { + this.upfileFileName = upfileFileName; + } + + @Override + public String execute() throws Exception { + + if (upfile == null || !upfile.exists()) { + addActionError(_("echobase.error.fileNotFound")); + return ERROR; + } + + DbEditorService dbEditorService = newService(DbEditorService.class); + + List<PropertyDiff[]> propertyDiffs = + dbEditorService.importDatas(tableName, + upfile, + getEchoBaseSession().getEchoBaseUser()); + + for (PropertyDiff[] diffs : propertyDiffs) { + for (PropertyDiff diff : diffs) { + String msg = _("echobase.message.modified.property", + diff.getSourceProperty(), + diff.getSourceValue(), + diff.getTargetValue()); + + log.info(msg); + + addActionMessage(msg); + } + } + + return SUCCESS; + } +} Modified: trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-ui/src/main/resources/config/struts-dbeditor.xml 2011-11-16 17:33:28 UTC (rev 88) @@ -57,10 +57,25 @@ <!-- save the modified entity (no result as a grid json edit action)--> <action name="editTableData" - class="fr.ifremer.echobase.ui.actions.dbeditor.SaveEntity"> - <result type="redirectAction">/dbeditor</result> + class="fr.ifremer.echobase.ui.actions.dbeditor.SaveEntity"/> + + <!-- save the modified entity (no result as a grid json edit action)--> + <action name="doImport" + class="fr.ifremer.echobase.ui.actions.dbeditor.ImportTable"> + <interceptor-ref name="paramsPrepareParamsStackLoggued"/> </action> + <!-- save the modified entity (no result as a grid json edit action)--> + <action name="doExport" + class="fr.ifremer.echobase.ui.actions.dbeditor.ExportTable"> + <interceptor-ref name="paramsPrepareParamsStackLoggued"/> + <result type="stream"> + <param name="contentType">${contentType}</param> + <param name="contentLength">${contentLength}</param> + <param name="contentDisposition">filename="${fileName}"</param> + </result> + </action> + </package> </struts> Modified: trunk/echobase-ui/src/main/resources/config/struts-user.xml =================================================================== --- trunk/echobase-ui/src/main/resources/config/struts-user.xml 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-ui/src/main/resources/config/struts-user.xml 2011-11-16 17:33:28 UTC (rev 88) @@ -89,7 +89,7 @@ <!-- Get modification logs entries --> <action name="getEntityModificationLogs" method="entityModificationLogs" - class="fr.ifremer.echobase.ui.actions.dbeditor.GetEntities"> + class="fr.ifremer.echobase.ui.actions.dbeditor.ImportTable"> <result type="json"/> </action> 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 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-ui/src/main/resources/i18n/echobase-ui_fr_FR.properties 2011-11-16 17:33:28 UTC (rev 88) @@ -33,9 +33,12 @@ echobase.common.user=Utilisateur echobase.common.voyage=Voyage echobase.common.voyagesToSelect=Voyage à exporter +echobase.dbeditor.export=Exporter +echobase.dbeditor.import=Importer echobase.embeddedApplication.configuration=Configuration de l'application embarquée echobase.error.bad.password=Mot de passe incorrrect echobase.error.email.already.used= +echobase.error.fileNotFound= echobase.error.importArgument= echobase.error.login.unknown=Utilisateur inconnu echobase.error.required.email=L'email est obligatoire Modified: trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp =================================================================== --- trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-ui/src/main/webapp/WEB-INF/jsp/dbeditor/dbeditor.jsp 2011-11-16 17:33:28 UTC (rev 88) @@ -29,10 +29,10 @@ <s:url id="reloadUrl" action="dbeditor" namespace="/dbeditor"/> <s:url id="getTableData" action="getTableData" namespace="/dbeditor"/> +<s:set name="tableSelected" value="%{tableName == null}"/> + <title><s:text name="echobase.title.dbEditor"/></title> -<%--<script type="text/javascript" src="/echobase/struts/js/base/jquery.ui.datepicker.min.js"></script>--%> -<script type="text/javascript" src="/echobase/struts/js/base/jquery.ui.datepicker.js"></script> <script type="text/javascript"> jQuery(document).ready(function () { @@ -114,9 +114,26 @@ } </script> -<div> +<div class="inline"> <s:select key="tableName" label='%{getText("echobase.common.tableName")}' list="tableNames" headerKey="" headerValue=""/> + + <s:form id="importForm" action="doImport" namespace="/dbeditor" method="post" + enctype="multipart/form-data" theme="simple" cssClass="floatLeft"> + + <s:hidden key="tableName"/> + <s:file name="upfile" + required="true" + key="echobase.dbeditor.importFile" + disabled="%{tableSelected}"/> + <s:submit key="echobase.dbeditor.import" disabled="%{tableSelected}"/> + </s:form> + + <s:form id="exportForm" action="doExport" namespace="/dbeditor" theme="simple" cssClass="floatRight"> + + <s:hidden key="tableName"/> + <s:submit key="echobase.dbeditor.export" disabled="%{tableSelected}"/> + </s:form> </div> <br class="clearBoth"/> @@ -167,7 +184,7 @@ title="%{getText(#meta.i18nKey)}" edittype='%{getEditType(#meta)}' formatter='%{getFormatter(#meta)}' - formatoptions="{newformat : 'd/m/Y H:i:s'}" + formatoptions="{newformat : 'd/m/Y'}" sortable="true" editable="true"/> </s:else> @@ -186,8 +203,6 @@ <s:hidden id="id" key="id"/> <s:hidden key="tableName"/> <s:iterator value="columnMetas" var="meta" status="status"> - <%-- TODO sletellier 20111115 : try to refactor with table url --%> - <s:set name="urlName">getForeignEntitiesUrl_<s:property value="%{#meta.typeSimpleName}"/></s:set> <s:url id="urlName" action="getForeignEntities" namespace="/dbeditor" @@ -218,9 +233,6 @@ <s:elseif test='#meta.columnType == "date"'> <sj:datepicker id="%{#meta.name}" name="%{#meta.name}" - timepicker="true" - timepickerShowSecond="true" - timepickerFormat="hh:mm:ss" label="%{getText(#meta.i18nKey)}"/> </s:elseif> </s:else> @@ -229,7 +241,7 @@ </fieldset> <ul class="toolbar floatRight"> <li><s:reset key="echobase.common.reset"/></li> - <li><s:submit key="echobase.action.save" theme="simple"/></li> + <li><s:submit name="submit" key="echobase.action.save" theme="simple"/></li> </ul> </s:form> Modified: trunk/echobase-ui/src/main/webapp/css/screen.css =================================================================== --- trunk/echobase-ui/src/main/webapp/css/screen.css 2011-11-16 13:12:32 UTC (rev 87) +++ trunk/echobase-ui/src/main/webapp/css/screen.css 2011-11-16 17:33:28 UTC (rev 88) @@ -25,6 +25,10 @@ font-family: sans-serif; } +.inline { + display:inline; +} + .fontsize11 { font-size: 11px; }