Announcement

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

    Configured Showcase to use MySQL data does not save on DB

    Hello,

    We are evaluating the smartgwtee-2.3:

    I have successfully configured the Mysql DB connection on the ISC Admin console and replicated the supplyItem table on our MySQL DB to test some of the functionality. In particular, the Direct Method Invocation (DMI) sample.

    With the example, I've added a record at the DB side manually in the supplyItem table. When running the DMI sample page, i am able to see the record and perform all the functions like Save, New, Clear , Filter and Fetch. However, it does NOT "Save / Update / Create" the updates at the database end for Save and New functions. Is this because it's an evaluation copy? Or Am I doing something wrong configwise? Or this is by design for demo purpose only.

    If not, can you please point me to what I might be doing wrong? MySQL DB security?

    By the way, I have deployed the showcase on Apache Tomcat6, MySQL 5.0.87

    Here's table I created on MySQL

    Code:
    CREATE  TABLE `test`.`supplyItem` (
      `itemID` INT NOT NULL AUTO_INCREMENT ,
      `itemName` VARCHAR(128) NOT NULL ,
      `SKU` VARCHAR(10) NOT NULL ,
      `description` VARCHAR(2000) NULL ,
      `category` VARCHAR(128) NULL ,
      `units` VARCHAR(5) NULL ,
      `unitCost` DECIMAL NULL ,
      `inStock` VARCHAR(5) NULL ,
      `nextShipment` VARCHAR(128) NULL ,
      PRIMARY KEY (`itemID`) );
    Sample log entry when attempting to update units from "Ea" to "Roll" :
    Code:
    === 2010-12-21 19:31:38,390 [80-2] INFO  RequestContext - URL: '/showcase/showcase/sc/IDACall', User-Agent: 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; MS-RTC LM 8; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)': MSIE with Accept-Encoding header, ready for compressed JS
    === 2010-12-21 19:31:38,406 [80-2] DEBUG XML - Parsed XML from (in memory stream): 0ms
    === 2010-12-21 19:31:38,406 [80-2] DEBUG RPCManager - Processing 1 requests.
    === 2010-12-21 19:31:38,406 [80-2] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
            itemID:1
        },
        values:{
            SKU:"58074602",
            category:"Office Paper Products",
            description:"Schwan Stabilo 808 ballpoint pens are a quality ballpoint with a non-slip grip zone. Long writing length due to the extra large refill with visible ink volume. Available in medium and fine point in four colours.",
            inStock:false,
            itemID:1,
            itemName:"Ryan Pens Stabiliner 808 Ballpoint Fine Black",
            unitCost:0,
            units:"Roll",
            _selection_11:true
        },
        operationConfig:{
            dataSource:"supplyItemDMI",
            operationType:"update"
        },
        componentId:"isc_DynamicForm_1",
        appID:"builtinApplication",
        operation:"supplyItemDMI_update",
        oldValues:{
            SKU:"58074602",
            category:"Office Paper Products",
            description:"Schwan Stabilo 808 ballpoint pens are a quality ballpoint with a non-slip grip zone. Long writing length due to the extra large refill with visible ink volume. Available in medium and fine point in four colours.",
            inStock:false,
            itemID:1,
            itemName:"Ryan Pens Stabiliner 808 Ballpoint Fine Black",
            nextShipment:null,
            unitCost:0,
            units:"Ea",
            _selection_11:true
        }
    }
    === 2010-12-21 19:31:38,406 [80-2] INFO  IDACall - Performing 1 operation(s)
    === 2010-12-21 19:31:38,421 [80-2] INFO  DataTools - setProperties: couldn't set:
    {
        _selection_11:"No such property"
    }
    === 2010-12-21 19:31:38,421 [80-2] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2010-12-21 19:31:38,421 [80-2] DEBUG RPCManager - DMI response, dropExtraFields: true
    === 2010-12-21 19:31:38,421 [80-2] INFO  Compression - /showcase/showcase/sc/IDACall: 502 -> 362 bytes


    Thanks
    Last edited by rgamo; 21 Dec 2010, 16:38.

    #2
    The DMI sample demonstrates integration with a fictional homebrew ORM system. It uses the MySQL database just to initially load some data into an in-memory cache, to provide a simple memory-only simulation of an ORM system.

    To use SmartGWT EE's SQL functionality, just create a normal SQL DataSource, and use DMI only to add additional business logic on top of the built-in SQL operations.

    In other words, before you have begun customizations such as adding business logic or overriding the automatically derived field definitions, your DataSource need only be this:

    <DataSource ID="testDS" serverType="sql" tableName="test" autoDeriveSchema="true" />

    .. and you would have no Java logic at all (yet). See the QuickStart Guide, Server Framework chapter, for further overview.

    Comment


      #3
      Thanks you I got this to work...I will now look into adding java logic...

      So, where do i add my data validation rules that now it is no longer at the datasouce.ds.xml?

      Comment


        #4
        Have you read the QuickStart Guide chapter on the Server Framework? That's where to start.

        Comment

        Working...
        X