2 Replies Latest reply on Oct 8, 2017 4:42 AM by hendrik.tekayadi

    Custom View & Data Tiles - Section List

    hendrik.tekayadi


      I'm doing experiment on Custom Tiles development, especially with tile-sectionlist.
      I created a project template and try to simulate the functionality.

      Section List

      It only has default data configuration from definition.json.

      definition.json

          {

          "sampleData" :

          {

              "title": "spacesection tile-sectionlist",

              "content": [

                  {

                      "text": "Sample Section",

                      "items": [

                          {

                              "text": "first item"

                          },

                          {

                              "text": "second item"

                          }

                      ]

                  },

                  {

                      "text": "Sample Section 2",

                      "items": [

                          {

                              "text": "jive main website",

                              "action": {

                                  "url": "http://www.jivesoftware.com"

                              }

                          },

                          {

                              "text": "jive developer website",

                              "action": {

                                  "url": "http://developer.jivesoftware.com"

                              }

                          }

                      ]

                  }

              ],

              "style": "accordion"

          },

          "displayName" : "spacesection",

          "name" : "spacesection",

          "description" : "spacesection",

          "style" : "SECTIONLIST",

          "icons" : {

              "16": "https://developer.jivesoftware.com/DeveloperAssets/images/icons/jivedev-xsmall.png",

              "48": "https://developer.jivesoftware.com/DeveloperAssets/images/icons/jivedev-small.png",

              "128": "https://developer.jivesoftware.com/DeveloperAssets/images/icons/jivedev-med.png"

          }

      }



      Then the service got hung up when it was trying to send pushData back to Jive (in my local).

       

       

      Log DEBUG

      [2017-09-24 20:14:21.588] [DEBUG] jive-sdk - Request: http://localhost:8080/api/jivelinks/v1/tiles/1073/data, body: {"data":{"title":"spacesection tile-sectionlist : 3","content":[{"text":"Sample Section","items":[{"text":"first item"},{"text":"second item"}]},{"text":"Sample Section 2","items":[{"text":"jive main website","action":{"url":"http://www.jivesoftware.com"}},{"text":"jive developer website","action":{"url":"http://developer.jivesoftware.com"}}]}],"style":"accordion"},"status":{}}

      [2017-09-24 20:14:22.906] [DEBUG] jive-sdk - err: { statusCode: 400,

        headers:

         { server: 'Apache-Coyote/1.1',

           'x-jive-request-id': '887c58a0-a122-11e7-9346-ba86bf0e085b',

           'x-jive-flow-id': '887c58a1-a122-11e7-9346-ba86bf0e085b',

           'set-cookie': [ 'jive.login.ts=1506255534890; Path=/; HttpOnly' ],

           'x-frame-options': 'SAMEORIGIN',

           p3p: 'CP="CAO PSA OUR"',

           'x-jive-user-id': '2019',

           expires: '0',

           'cache-control': 'no-store',

           pragma: 'no-cache',

           date: 'Sun, 24 Sep 2017 12:18:54 GMT',

           'content-type': 'application/json',

           'transfer-encoding': 'chunked',

           connection: 'close' },

        entity:

         { error:

            { message: 'Invalid tile update data. Unexpected character (\'\'\' (code 39)): was expecting a colon to separate field name and value\n at [Source: java.io.InputStreamReader@431efb13; line: 75, column: 52]',

              status: 400 } } }

      Request body in pretty format

      {

         "data":{

            "title":"spacesection tile-sectionlist : 3",

            "content":[

               {

                  "text":"Sample Section",

                  "items":[

                     {

                        "text":"first item"

                     },

                     {

                        "text":"second item"

                     }

                  ]

               },

               {

                  "text":"Sample Section 2",

                  "items":[

                     {

                        "text":"jive main website",

                        "action":{

                           "url":"http://www.jivesoftware.com"

                        }

                     },

                     {

                        "text":"jive developer website",

                        "action":{

                           "url":"http://developer.jivesoftware.com"

                        }

                     }

                  ]

               }

            ],

            "style":"accordion"

         },

         "status":{

         }

      }

       

      Here are my configuration details:
      1. Create tile-sectionlist
      jive-sdk create tile-sectionlist --name="<tile name>"


      2.Provide host name that redirects to 127.0.0.1 localhost
      nano /private/etc/hosts

      127.0.0.1       localhost mylocalserver

       

      3.Change "clientUrl" on jiveclientconfiguration.json
      "clientUrl": "http://mylocalserver:8090"

      4.Update all node package dependencies.
      npm update

      5.Run service
      node app.js

      Please kindly give your advice to solve this issue.
      Thanks!

        • Re: Custom View & Data Tiles - Section List

          From the chat we had:

          nils.drews [2:04 PM]

          check for an error message in the jive server log

          [2:04]

          for the logger: com.jivesoftware.community.integration.tileinstance.impl.TileInstanceManagerImpl

          [2:04]

          log.error("Unable to validate external data JSON for tile " + tile, e);

          [2:04]

          that should give you more details

          [2:04]

          good luck

            • Re: Custom View & Data Tiles - Section List
              hendrik.tekayadi

              Hi Nils Drews

               

              I got these following error messages:

              2017-10-08 19:26:25,740 [http-bio-8080-exec-2] [-1:ANONYMOUS:REGULAR] ERROR com.jivesoftware.community.integration.tileinstance.impl.TileInstanceManagerImpl - Unable to validate external data JSON for tile com.jivesoftware.community.integration.tile.impl.TileProxy@77b523c9[name=sampletile-sectionlist,visualStyle=SECTIONLIST,data={"style":"accordion","title":"sampletile-sectionlist tile-sectionlist","content":[{"text":"Sample Section","items":[{"text":"first item"},{"text":"second item"}]},{"text":"Sample Section 2","items":[{"action":{"url":"http://www.jivesoftware.com"},"text":"jive main website"},{"action":{"url":"http://developer.jivesoftware.com"},"text":"jive developer website"}]}]},clientID=m28xl9oxho5nbph6e2uod7y1n6dkaddt.i,displayName=sampletile-sectionlist,description=sampletile-sectionlist,productName=<null>,configurationURL=http://apps.hendriktekayadi.com:8090/sampletile-sectionlist/configure?ts=1507461885548,actionURL=<null>,registerURL=http://apps.hendriktekayadi.com:8090/registration,unregisterURL=http://apps.hendriktekayadi.com:8090/unregister,dataProviderKey=external,pageTypes=PLACE]

              com.jivesoftware.community.integration.validation.JsonValidationException: Unexpected character (''' (code 39)): was expecting a colon to separate field name and value

              at [Source: java.io.InputStreamReader@2a19d8fa; line: 75, column: 52]

              at com.jivesoftware.community.integration.validation.JsonSchemaResourceValidator.validate(JsonSchemaResourceValidator.java:46)

              at com.jivesoftware.community.integration.validation.VisualStyleJsonValidator.validate(VisualStyleJsonValidator.java:28)

              at com.jivesoftware.community.integration.tileinstance.impl.TileInstanceManagerImpl.validateData(TileInstanceManagerImpl.java:248)

              at com.jivesoftware.community.integration.tileinstance.impl.TileInstanceManagerImpl.doUpdate(TileInstanceManagerImpl.java:211)

              at com.jivesoftware.community.integration.tileinstance.impl.TileInstanceManagerImpl.doUpdate(TileInstanceManagerImpl.java:1)

              at com.jivesoftware.community.objecttype.impl.AbstractJiveObjectManager.update_aroundBody4(AbstractJiveObjectManager.java:162)

              at com.jivesoftware.community.objecttype.impl.AbstractJiveObjectManager$AjcClosure5.run(AbstractJiveObjectManager.java:1)

              at org.springframework.transaction.aspectj.AbstractTransactionAspect.ajc$around$org_springframework_transaction_aspectj_AbstractTransactionAspect$1$2a73e96cproceed(AbstractTransactionAspect.aj:60)

              at org.springframework.transaction.aspectj.AbstractTransactionAspect$AbstractTransactionAspect$1.proceedWithInvocation(AbstractTransactionAspect.aj:66)