Topic
2 replies Latest Post - ‏2013-09-18T21:15:20Z by JunGuo
roymcd
roymcd
5 Posts
ACCEPTED ANSWER

Pinned topic How to check YAML errors

‏2013-09-13T15:12:19Z |

I am trying to set up a basic widget to show information that is stored in my Data Explorer. I have followed the tutorial on the info-cetner but I have yet to ever get it working. I have set up the entity models correctly and can use the entity explorer to search my data. 

I have then created 2 widgets for a Banking Demo.

1.banking_information (entity_information)

---
branch_information:
  based_on: entity_information
  title: |
    @subject.title

  follow: true
  info_groups:
    - info:
        - label: "Customer:"
          eval: |
            @subject['CUSTOMER_NAME'].first

        - label: "Country:"
          eval: |
            @subject['PRIMARY_COUNTRY'].first

    - info:
        - eval: |
            @subject['EFFECTIVE_FROM_DATE'].first

        - eval: |
            @subject['NUMBER_OF_SOCIAL_COMMUNICATIONS'].first

        - eval: |
            @subject['NUMBER_OF_POSITIVE_COMMUNICATIONS'].first

        - eval: |
            @subject['NUMBER_OF_NEGATIVE_COMMUNICATIONS'].first

  ajax: true
  supports:
    - branch
based_on: entity_information
supports:
  - Customers

 

2. banking_information (entity_table)

---
where_fields:
  - title
column_definitions:
  - class: title title
title: Customer Name
content: entity_link_to @entity.title, @entity, :link_class => "ellipsis", :title => @entity.title
aTargets:
  - 0
based_on: entity_table
supports:
  - Customers

 

lastly I then create 2 pages to add the widgets to as like the examples. A index and a show page and add the widgets to them. When I do this and check the home page in the AppBuilder I get an error message ...."An error occurred while loading. Please try again or contact the system administrator."

 

Where can I get some information on what the errors are that are stopping from showing me the tables.

I can see error from the message.logs in \IDE\AppBuilder\wlp\usr\servers\AppBuilder\logs

[16/09/13 13:55:16:390 BST] 00000c68 com.ibm.ws.webcontainer.extension                            W SRVE0190E: File not found: /Customers.html
[16/09/13 13:55:16:682 BST] 00000c70 com.ibm.ws.webcontainer.extension                            W SRVE0190E: File not found: /images/logo.html
[16/09/13 13:55:16:682 BST] 00000c72 com.ibm.ws.webcontainer.extension                            W SRVE0190E: File not found: /entities/render_event_response.html

This is what I get when I load the page with the widgets on . Are they more places to find details logs.


Roy

 

 

Updated on 2013-09-19T10:35:21Z at 2013-09-19T10:35:21Z by roymcd
  • JunGuo
    JunGuo
    8 Posts
    ACCEPTED ANSWER

    Re: How to check YAML errors

    ‏2013-09-18T17:37:58Z  in response to roymcd

    Hello roymcd,

    You can find more log under IBM\IDE\AppBuilder\wlp\usr\servers\AppBuilder\logs. But for the problem you have with the widget, i think it is syntax problem. Space is delimiter for YML. How much indent is for each row is crucial. The right syntax should be:


    based_on: entity_information
    title: @subject.title

    follow: true
    info_groups:

      - info:
          - label: "Customer:"
            eval: @subject['CUSTOMER_NAME'].first
          - label: "Country:"
            eval: @subject['PRIMARY_COUNTRY'].first

    • JunGuo
      JunGuo
      8 Posts
      ACCEPTED ANSWER

      Re: How to check YAML errors

      ‏2013-09-18T21:15:20Z  in response to JunGuo

      ␣ indicates white space,

      based_on: entity_information
      title: @subject.title

      follow: true
      info_groups:

      ␣␣- info:
      ␣␣- label: "Customer:"
      ␣␣␣␣eval: @subject['CUSTOMER_NAME'].first
      ␣␣- label: "Country:"
      ␣␣␣␣eval: @subject['PRIMARY_COUNTRY'].first