Hi Isomorphic,
the server.properties settings export.format.default.date, export.format.default.time, export.format.default.datetime you doc here, and for which you also set reasonable defaults in framework.properties, are not applied for fields of type creatorTimestamp / modifierTimestamp.
I'd expect them to be applied here as well, because otherwise one would have to set this for all of these metadata fields in all .ds.xml manually.
Testcase (v12.0p_2020-03-11, code below):
Minor other issues:
1) This is in framework.properties - I assume the "kk" should be HH? It's also not in FormatString.
export.format.datetime: yyyy-MM-dd kk:mm:ss
export.format.date: yyyy-MM-dd
export.format.time: HH:mm:ss
2) After running the export once, I get this for a 2nd export, so that I have to restart SuperDevMode instead. I'm sure it's not really SmartGWT problem, but do you know the solution anyway? Searching the internet did not really help.
Best regards
Blama
BuildInDS.java:
the server.properties settings export.format.default.date, export.format.default.time, export.format.default.datetime you doc here, and for which you also set reasonable defaults in framework.properties, are not applied for fields of type creatorTimestamp / modifierTimestamp.
I'd expect them to be applied here as well, because otherwise one would have to set this for all of these metadata fields in all .ds.xml manually.
Testcase (v12.0p_2020-03-11, code below):
- Run sample
- Edit nextShipment
- Click Export
- Edit supplyItem.ds.xml and switch nextShipment date-> creatorTimestamp
- Rerun sample
- Click Export (field looks like this in Excel: "Do Apr 09 2020 00:00:00")
Minor other issues:
1) This is in framework.properties - I assume the "kk" should be HH? It's also not in FormatString.
export.format.datetime: yyyy-MM-dd kk:mm:ss
export.format.date: yyyy-MM-dd
export.format.time: HH:mm:ss
2) After running the export once, I get this for a 2nd export, so that I have to restart SuperDevMode instead. I'm sure it's not really SmartGWT problem, but do you know the solution anyway? Searching the internet did not really help.
Code:
java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source) at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source) at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setFeature(Unknown Source) at com.isomorphic.xml.XML.parseXML(XML.java:216) at com.isomorphic.xml.XML.parseRestrictedXML(XML.java:149) at com.isomorphic.xml.XML.toDSRecords(XML.java:497) at com.isomorphic.xml.XML.toDSRecords(XML.java:493) at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2431) at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:398) at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:378) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:147) at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
Best regards
Blama
BuildInDS.java:
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.Version; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.DSRequest; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.types.ExportFormat; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS implements EntryPoint { private VLayout mainLayout; private IButton recreateBtn; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); mainLayout = new VLayout(20); mainLayout.setWidth100(); mainLayout.setHeight100(); recreateBtn = new IButton("Recreate"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { recreate(); } }); mainLayout.addMember(recreateBtn); recreate(); mainLayout.draw(); } private void recreate() { Window w = new Window(); w.setWidth("95%"); w.setHeight("95%"); w.setMembersMargin(0); w.setModalMaskOpacity(70); w.setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); w.setTitle("server.properties export.format.default.date not applied for fields of type creatorTimestamp / modifierTimestamp" + w.getTitle()); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); final ListGrid supplyItemGrid = new ListGrid(DataSource.get("supplyItem")); supplyItemGrid.setAutoFetchData(true); supplyItemGrid.setExportFieldWidths(true); supplyItemGrid.setExportWidthScale(0.18); supplyItemGrid.setCanEdit(true); supplyItemGrid.setShowFilterEditor(true); IButton exportDataBtn = new IButton("exportData()", new ClickHandler() { @Override public void onClick(ClickEvent event) { final DSRequest exportRequest = new DSRequest(); exportRequest.setExportAs(ExportFormat.OOXML); exportRequest.setExportFilename("myExport"); supplyItemGrid.exportData(exportRequest); } }); VLayout vLayout = new VLayout() { { addMembers(supplyItemGrid, exportDataBtn); } }; w.addItem(vLayout); w.show(); } }
Comment