Tuscany
  1. Tuscany
  2. TUSCANY-800

Introduce new DAS Sample APP to demonstrate DAS advanced features

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Java-DAS-beta1
    • Fix Version/s: Java-DAS-beta1
    • Component/s: Java DAS Samples
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Introduce a new DAS sample app to demonstrate DAS advanced features.
      This sample app uses AJAX to perform all the DAS interactions with the persistence store (e.g case derby in tomcat) and an SDO graph is returned back to UI and XSLT transformation is performed to present the data to user.
      Possible improvements to this would be to integrate OCC, and other advanced DAS features into the sample.

      1. ajaxDAS.lresende.20061005.zip
        510 kB
        Luciano Resende
      2. AjaxDasApr10.jar
        2.42 MB
        Amita Vadhavkar
      3. AjaxDasJIRA800-Apr24-Amita.jar
        150 kB
        Amita Vadhavkar
      4. AjaxDASWebSample.doc
        85 kB
        Amita Vadhavkar
      5. JIRA-800-Mar23-Amita.jar
        3.07 MB
        Amita Vadhavkar
      6. JIRA800-May17-CodeAndUT.zip
        147 kB
        Amita Vadhavkar
      7. sample-ajax-das-1.0-incubator-SNAPSHOT.war
        2.92 MB
        Amita Vadhavkar
      8. sample-ajax-das-Apr30-browser-independent.jar
        46 kB
        Amita Vadhavkar

        Activity

        Hide
        Luciano Resende added a comment -

        This is a initial work on this ajax app sample demonstrating usage of das
        Please detach and extract the zip file contents inside java/das/samples

        There are still couple of things that need to be done :

        • XSLT transformation on sdo graph returned to present SQL query
        • Implement OCC scenario
        • HTMLUnit testing integration
        • etc
        Show
        Luciano Resende added a comment - This is a initial work on this ajax app sample demonstrating usage of das Please detach and extract the zip file contents inside java/das/samples There are still couple of things that need to be done : XSLT transformation on sdo graph returned to present SQL query Implement OCC scenario HTMLUnit testing integration etc
        Hide
        Luciano Resende added a comment -

        Now that DAS is branched/taged, I think we are ready to apply this patch in the trunk and continue with developing this sample.

        Show
        Luciano Resende added a comment - Now that DAS is branched/taged, I think we are ready to apply this patch in the trunk and continue with developing this sample.
        Hide
        Amita Vadhavkar added a comment -

        Hi Luciano,
        Please see the note included in attachment for brief status.
        I tried shifting the xslt code from java to js, but does not work. Using loadXML(var)
        gives - object doesn't support this property or method - error in js. I am pasting below the last tries I had on ajax.js - relevant portion. The attachment in JIRA - is a working code where xslt work is done by servlet. Could see some issues mentioned around loadXML() on the internet, but could not get to any solution till now...
        _________________________________________________________________
        function resultHandler() {
        if (req.readystate == 4) {
        if (req.status == 200)

        { //var message = req.responseText; //WORKS WHEN java does xslt //msg.innerHTML = message; //WORKS WHEN java does xslt //BELOW, does not work - take it from req or hardcode a str //ONLY works when xml file load() is called //some problem with loadXML()??? //var message = req.responseText; var message = "<?xml version='1.0' >"+ message = message + "<root xmlns:das='http://org.apache.tuscany.das.rdb/config.xsd'xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>"; message = message + "<das:DataGraphRoot>"; message = message + "<COMPANY ID='0' NAME='Mega Corp'>"; message = message + "<EOTMID xsi:nil='true'/>"; message = message + "</COMPANY>"; message = message + "</das:DataGraphRoot>"; message = message + "</root>"; alert(message); // Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") //xml.async = false //xml.load("company.xml") //this WORKS xml.loadXML(message); // Load XSL var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("company.xsl") // Transform document.getElementById("msg").innerHTML = xml.transformNode(xsl) alert(xml.transformNode(xsl)); }

        }

        Show
        Amita Vadhavkar added a comment - Hi Luciano, Please see the note included in attachment for brief status. I tried shifting the xslt code from java to js, but does not work. Using loadXML(var) gives - object doesn't support this property or method - error in js. I am pasting below the last tries I had on ajax.js - relevant portion. The attachment in JIRA - is a working code where xslt work is done by servlet. Could see some issues mentioned around loadXML() on the internet, but could not get to any solution till now... _________________________________________________________________ function resultHandler() { if (req.readystate == 4) { if (req.status == 200) { //var message = req.responseText; //WORKS WHEN java does xslt //msg.innerHTML = message; //WORKS WHEN java does xslt //BELOW, does not work - take it from req or hardcode a str //ONLY works when xml file load() is called //some problem with loadXML()??? //var message = req.responseText; var message = "<?xml version='1.0' >"+ message = message + "<root xmlns:das='http://org.apache.tuscany.das.rdb/config.xsd'xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>"; message = message + "<das:DataGraphRoot>"; message = message + "<COMPANY ID='0' NAME='Mega Corp'>"; message = message + "<EOTMID xsi:nil='true'/>"; message = message + "</COMPANY>"; message = message + "</das:DataGraphRoot>"; message = message + "</root>"; alert(message); // Load XML var xml = new ActiveXObject("Microsoft.XMLDOM") //xml.async = false //xml.load("company.xml") //this WORKS xml.loadXML(message); // Load XSL var xsl = new ActiveXObject("Microsoft.XMLDOM") xsl.async = false xsl.load("company.xsl") // Transform document.getElementById("msg").innerHTML = xml.transformNode(xsl) alert(xml.transformNode(xsl)); } }
        Hide
        Amita Vadhavkar added a comment -

        This attachment is not a patch, as it has too many changes from the previous one. Attaching the .doc explaining the changes and showing the new look. Also, .war is attached so you can just deploy in tomcat and check it out.

        Please give your feedback , with that I will do the cleanup and attach a final patch.

        Show
        Amita Vadhavkar added a comment - This attachment is not a patch, as it has too many changes from the previous one. Attaching the .doc explaining the changes and showing the new look. Also, .war is attached so you can just deploy in tomcat and check it out. Please give your feedback , with that I will do the cleanup and attach a final patch.
        Hide
        Amita Vadhavkar added a comment -

        1)url in ajax js,is the only one place which has path for hardcoded "incubating" - will need replacement later during release.

        2)4 tables with data like below are needed - will take care of this later when JIRA-863 will get integrated - for now - the db zipped along with proj has below data

        <TableList>
        <TableName>COMPANY</TableName>
        <TableName>DEPARTMENT</TableName>
        <TableName>CUSTOMER</TableName>
        <TableName>BOOK</TableName>
        </TableList>

        <TablesData>
        <TableData TableName="COMPANY" Columns="'NAME'" SqlTypes="Types.VARCHAR">
        <TableRow>'ACME Publishing'</TableRow>
        <TableRow>'Do-rite plumbing'</TableRow>
        <TableRow>'MegaCorp'</TableRow>
        </TableData>

        <TableData TableName="DEPARTMENT" Columns="'NAME', 'LOCATION', 'DEPNUMBER' 'COMPANYID'" SqlTypes="Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER">
        <TableRow>'Advanced Technologies', 'NY', '123', '1'</TableRow>
        </TableData>

        <TableData TableName="CUSTOMER" Columns="'ID', 'LASTNAME', 'ADDRESS'" SqlTypes="Types.INTEGER, Types.VARCHAR, Types.VARCHAR">
        <TableRow>'1', 'Pavick', 'CA'</TableRow>
        <TableRow>'2', 'Williams', 'NJ'</TableRow>
        </TableData>

        <TableData TableName="BOOK" Columns="'BOOK_ID', 'NAME', 'AUTHOR','QUANTITY','OCC'" SqlTypes="Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER">
        <TableRow>'1', 'The Brothers Karamazov', 'Fyodor Dostoevsky','5', '17'</TableRow>
        </TableData>
        </TablesData>

        Show
        Amita Vadhavkar added a comment - 1)url in ajax js,is the only one place which has path for hardcoded "incubating" - will need replacement later during release. 2)4 tables with data like below are needed - will take care of this later when JIRA-863 will get integrated - for now - the db zipped along with proj has below data <TableList> <TableName>COMPANY</TableName> <TableName>DEPARTMENT</TableName> <TableName>CUSTOMER</TableName> <TableName>BOOK</TableName> </TableList> <TablesData> <TableData TableName="COMPANY" Columns="'NAME'" SqlTypes="Types.VARCHAR"> <TableRow>'ACME Publishing'</TableRow> <TableRow>'Do-rite plumbing'</TableRow> <TableRow>'MegaCorp'</TableRow> </TableData> <TableData TableName="DEPARTMENT" Columns="'NAME', 'LOCATION', 'DEPNUMBER' 'COMPANYID'" SqlTypes="Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.INTEGER"> <TableRow>'Advanced Technologies', 'NY', '123', '1'</TableRow> </TableData> <TableData TableName="CUSTOMER" Columns="'ID', 'LASTNAME', 'ADDRESS'" SqlTypes="Types.INTEGER, Types.VARCHAR, Types.VARCHAR"> <TableRow>'1', 'Pavick', 'CA'</TableRow> <TableRow>'2', 'Williams', 'NJ'</TableRow> </TableData> <TableData TableName="BOOK" Columns="'BOOK_ID', 'NAME', 'AUTHOR','QUANTITY','OCC'" SqlTypes="Types.INTEGER, Types.VARCHAR, Types.VARCHAR, Types.INTEGER, Types.INTEGER"> <TableRow>'1', 'The Brothers Karamazov', 'Fyodor Dostoevsky','5', '17'</TableRow> </TableData> </TablesData>
        Hide
        Amita Vadhavkar added a comment -

        I have attached new zip to JIRA-800(dated Apr30) for browser independent work. Tested this in
        Mozilla 1.7.2 Netscape and IE6.x.

        Working on htmlUnit(1 day max) and looking for dbsetup (JIRA-863) so as to
        integrate with it. If you think it is right, do hand over the incomplete part to me for JIRA-863
        and give details what all you have thought for it, I can take it up. After these 2 things
        (htmlUnit and auto canned DB integration), I can add more features(multi schema, compound key
        relation,write operation ordering, ) to ajax sample, if it adds any value to it and time permits.

        As we discussed, this is zip and not svn patch. As now this is stable on different browsers, will you please add it to the sandbox under ajaxDasNew, so my next changes can be on top of that.

        Show
        Amita Vadhavkar added a comment - I have attached new zip to JIRA-800(dated Apr30) for browser independent work. Tested this in Mozilla 1.7.2 Netscape and IE6.x. Working on htmlUnit(1 day max) and looking for dbsetup (JIRA-863) so as to integrate with it. If you think it is right, do hand over the incomplete part to me for JIRA-863 and give details what all you have thought for it, I can take it up. After these 2 things (htmlUnit and auto canned DB integration), I can add more features(multi schema, compound key relation,write operation ordering, ) to ajax sample, if it adds any value to it and time permits. As we discussed, this is zip and not svn patch. As now this is stable on different browsers, will you please add it to the sandbox under ajaxDasNew, so my next changes can be on top of that.
        Hide
        Amita Vadhavkar added a comment -

        Hi Luciano,
        We need to sort out the problem of ant build - for tomcat htmlunit testing
        Once we discussed, that the entries in server.xml (for datasource) get wiped off when both modules run one after another (1) companyweb, 2) sample-ajax-das). There is no problem when sample-ajax-das runs alone (or companyweb runs alone).

        Something that ant cleans up during ending of companyweb which erases the
        entry of datasource for ajaxdastest database too along with entry for dastest
        in server.xml. (server.xml from tomcat).

        For this I have at present a quick fix so that both modules get tested in sequence - in
        testing/tomcat/build.xml, testing/tomcat/datasource.xsl - which works. You can search by word "ajax" to see the fix.

        Adriano/Luciano
        Will you please see if any of you have any better solution?

        Regards,
        Amita

        Show
        Amita Vadhavkar added a comment - Hi Luciano, We need to sort out the problem of ant build - for tomcat htmlunit testing Once we discussed, that the entries in server.xml (for datasource) get wiped off when both modules run one after another (1) companyweb, 2) sample-ajax-das). There is no problem when sample-ajax-das runs alone (or companyweb runs alone). Something that ant cleans up during ending of companyweb which erases the entry of datasource for ajaxdastest database too along with entry for dastest in server.xml. (server.xml from tomcat). For this I have at present a quick fix so that both modules get tested in sequence - in testing/tomcat/build.xml, testing/tomcat/datasource.xsl - which works. You can search by word "ajax" to see the fix. Adriano/Luciano Will you please see if any of you have any better solution? Regards, Amita
        Hide
        Amita Vadhavkar added a comment -

        This attachment of May17 is not a patch but the original source code, for the svn patch creation problems
        once we discussed.

        Show
        Amita Vadhavkar added a comment - This attachment of May17 is not a patch but the original source code, for the svn patch creation problems once we discussed.
        Hide
        Luciano Resende added a comment -

        Patches from Amita applied under revision #545453. Integration tests with Tomcat passing successfully.

        Show
        Luciano Resende added a comment - Patches from Amita applied under revision #545453. Integration tests with Tomcat passing successfully.
        Hide
        ant elder added a comment -

        Closing because this has been in RESOLVED state for over one year, if it turns out to not be fixed please reopen.

        Show
        ant elder added a comment - Closing because this has been in RESOLVED state for over one year, if it turns out to not be fixed please reopen.

          People

          • Assignee:
            Luciano Resende
            Reporter:
            Luciano Resende
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development