Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    12.0p server.properties export.format.default.date not applied for fields of type creatorTimestamp / modifierTimestamp

    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):
    • 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")
    In the 1st export, nextShipment will be formatted, in the 2nd export, it won't be.


    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();
        }
    }

    #2
    Your stack trace looks like some kind of weird classloader issue, perhaps caused by duplicate or conflicting .jars. It's as if the JVM correctly loaded and used the XML parser classes, then for some reason decided to try to load them again, and now there are two different versions in memory that don't work together.

    Definitely doesn't look like our bug, but we'll check out the other two.

    Comment


      #3
      On the "kk" in the format string: this is a server-side only format, so it's not a SmartGWT FormatString, it's a standard Java SimpleDateFormat.

      Comment


        #4
        Hi Isomorphic,

        could you reproduce the issue with the export.format.default.date not being applied for fields of type creatorTimestamp / modifierTimestamp?

        Best regards
        Blama

        Comment


          #5
          Thanks to your clear explanation format issue was reproduced no problem. It is fixed and will be available for download in nightly builds since April 25 (tomorrow).

          Comment


            #6
            Hi Isomorphic,

            this looks still the same to me in the export ("Do Apr 16 2020 00:00:00") when using creatorTimestamp / modifierTimestamp in v12.0p_2020-04-25.

            Best regards
            Blama

            Comment


              #7
              Apologies, the original fix was incomplete. Please download April 28 (tomorrow) nightly build and check it out.

              Comment


                #8
                Hi Isomorphic,

                sorry, this is still the same using v12.0p_2020-04-29.
                Click image for larger version

Name:	Next shipment.PNG
Views:	94
Size:	31.7 KB
ID:	262264

                Best regards
                Blama

                Comment


                  #9
                  Apologies once again. There're several code paths that affect this behaviour and we accidentally were reproducing this in combination with exportDatesAsFormattedString setting, which is not the case in your scenario. This is fixed now and is available for download in nightly builds since May 3. Please let us know how it worked for you.

                  Comment


                    #10
                    Hi Isomorphic,

                    this is looking good now in the testcase using v12.0p_2020-05-03. I assume my application will be the same.

                    Thank you & Best regards
                    Blama

                    Comment

                    Working...
                    X