1. #1
    Sencha User
    Join Date
    Mar 2013
    Location
    Paris
    Posts
    2
    Vote Rating
    0
    Emowpy is on a distinguished road

      0  

    Default Unanswered: Mapping a JSON message with colon in key/name

    Unanswered: Mapping a JSON message with colon in key/name


    Hi,

    I would like to know if there's a way to map a JSON message with colon ":" in keys. Here's an example on my json message:

    Code:
    {
        "succinctProperties": {
            "cmis:objectId": "35589dd4-647f-4a6d-884f-0575d8a93127",
            "cmis:name": "35589dd4-647f-4a6d-884f-0575d8a93127",
            "cmis:createdBy": "<unknown>",
            "cmis:lastModifiedBy": "Wed Jun 05 16:26:56 CEST 2013",
            "cmis:creationDate": 1370442416100,
            "cmis:lastModificationDate": 1370442416100,
            "cmis:changeToken": null,
            "cmis:baseTypeId": "cmis:document",
            "cmis:objectTypeId": "cmis:document",
            "cmis:isImmutable": false,
            "cmis:isLatestVersion": true,
            "cmis:isMajorVersion": true,
            "cmis:isLatestMajorVersion": true,
            "cmis:versionLabel": "35589dd4-647f-4a6d-884f-0575d8a93127",
            "cmis:versionSeriesId": "version_series_id",
            "cmis:isVersionSeriesCheckedOut": false,
            "cmis:versionSeriesCheckedOutBy": null,
            "cmis:versionSeriesCheckedOutId": null,
            "cmis:checkinComment": "",
            "cmis:contentStreamLength": 210028,
            "cmis:contentStreamMimeType": "application/octet-stream",
            "cmis:contentStreamFileName": "35589dd4-647f-4a6d-884f-0575d8a93127",
            "cmis:contentStreamId": null
        }
    }
    And here's the code I'm using for mapping (which is not working) :

    Code:
    Ext.define('MyApp.model.SearchDocModel', {
        extend: 'Ext.data.Model',
    
    
        fields: [{name:'OBJECTID',type:'string',mapping:'succinctProperties.cmis:objectId'},
                 {name:'NAME',type:'string',mapping:'succinctProperties.cmis:name'}
                 {name:'BASETYPEID',type:'string',mapping:'succinctProperties.cmis:baseTypeId'}  
              ] 
    });
    I used several escaping methods but none of them works.

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,508
    Answers
    528
    Vote Rating
    288
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Try:

    Code:
    {name: 'OBJECTID', type: 'string', mapping: 'succinctProperties["cmis:objectId"]'}

  3. #3
    Sencha User
    Join Date
    Mar 2013
    Location
    Paris
    Posts
    2
    Vote Rating
    0
    Emowpy is on a distinguished road

      0  

    Default


    Already tried it and it works. I found it in the Ext.data.Field source code.

    Thank you for your help.

Thread Participants: 1

Tags for this Thread