Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-2732

FIWARE.Request.Tech.WebUI.POIDataProvider.General_Support_#246_A_couple_of_bugs

    Details

    • HD-Chapter:
      WebUI
    • HD-Enabler:
      POI Provider

      Description

      Hi,

      A user found (and fixed) some bugs on the POI Data Provider GE.
      Here it is his report:

      "
      Hi.

      We are using a custom data field in our POI data. Based on the POI Data Provider documentation it should support adding custom fields to the data in addition to the "fw_core" field. However the POI Data Provider would not accept JSON data that had other than the predefined "fw_xxx" fields.

      The code in add_poi.php gets a list of supported components by calling get_supported_components() from db.php which has a hardcoded list of supported component names.

      We have fixed that by modifying the PHP code in our own instance ourselves. The change was made to db.php as follows:

      function get_supported_components()
      {
      // Markus Kauppinen: Added "mipsoft_landmarker"
      $components = array("fw_core", "fw_contact", "fw_xml3d", "fw_media",
      "fw_time", "fw_sensor", "fw_marker", "fw_relationships",
      "mipsoft_landmarker");

      return $components;
      }
      Also handling the timestamps when updating data could be better documented. It's quite confusing. It's not instantly clear should we include a new timestamp in the JSON data that we send via HTTP POST or will the receiving PHP code assign a new one.

      We now know that the PHP code inserts a new timestamp to the fw_core data. But it does not insert it to the custom data. However when updating it checks both timestamps (in update_poi.php) and if they do not match then that (custom) data is not updated. The PHP code even doesn't allow a zero timestamp value so it must a valid value.

      So it doesn't set the custom data timestamp but still expects a valid one when updating data. This is a clear error. It should either set the custom data timestamp or allow a zero timestamp when updating the data. We have now ourselves modified the PHP code to insert the custom data timestamp as well in add_poi.php as follows:

      $mongodb = connectMongoDB($db_opts['mongo_db_name']);
      foreach($request_array as $comp_name => $comp_data)
      {
      if ($comp_name == 'fw_core')
      continue;
      if (in_array($comp_name, $supported_components))

      { $comp_data["_id"] = $uuid; // Markus Kauppinen: $comp_data["last_update"]["timestamp"] = $timestamp; $collection = $mongodb->$comp_name; $collection->insert($comp_data); }

      }

      "

      Thanks in advance.

      (Reported by xavier.carol@i2cat.net)

        Issue Links

          Activity

          leandroguillen Leandro Guillén created issue -
          leandroguillen Leandro Guillén made changes -
          Field Original Value New Value
          Link This issue clones HELC-710 [ HELC-710 ]
          leandroguillen Leandro Guillén made changes -
          Project Help-Coaches-Desk [ 10926 ] Help-Desk [ 10841 ]
          Key HELC-711 HELP-2732
          Workflow FW extRequest Workflow-II [ 28911 ] FW eRequest Workflow [ 28911 ]
          Component/s FIWARE-TECH-HELP [ 10278 ]
          Component/s CreatiFI [ 10357 ]
          mev Manuel Escriche made changes -
          Assignee Leandro Guillén [ leandro.guillen ] Ari Okkonen [ ariokkon ]
          ariokkon Ari Okkonen made changes -
          Summary CLONE - [Fiware-creatifi-coaching] [CreatiFI Barcelona Hub] General Support #246: A couple of bugs in the POI Data Provider GE FIWARE.Request.Lab.WebUI.POIDataProvider.General_Support_#246_A_couple_of_bugs_in_the_POI_Data_Provider_GE
          Hide
          ariokkon Ari Okkonen added a comment -

          Old name "CLONE - [Fiware-creatifi-coaching] [CreatiFI Barcelona Hub] General Support #246: A couple of bugs in the POI Data Provider GE" changed according to "Request for urgent action on the help-desk - deadline TODAY- 13:00" in 2015-07-06.

          Show
          ariokkon Ari Okkonen added a comment - Old name "CLONE - [Fiware-creatifi-coaching] [CreatiFI Barcelona Hub] General Support #246: A couple of bugs in the POI Data Provider GE" changed according to "Request for urgent action on the help-desk - deadline TODAY- 13:00" in 2015-07-06.
          mev Manuel Escriche made changes -
          Summary FIWARE.Request.Lab.WebUI.POIDataProvider.General_Support_#246_A_couple_of_bugs_in_the_POI_Data_Provider_GE FIWARE.Request.Lab.WebUI.POIDataProvider.General_Support_#246_A_couple_of_bugs
          ariokkon Ari Okkonen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          ariokkon Ari Okkonen added a comment -

          One (not expressed, of course) design principle was that the server controls, which data components the server acknowledges, and what are their structures. A specialization guide is planned to instruct how to introduce new data components to the reference implementation. https://jira.fiware.org/browse/WEB-443 The input given in this request above is of great help.
          I'll analyze the timestamp problem more thoroughly. The logic was not well designed, originally. (The purpose of timestamps is to protect the data from update conflicts.)

          Show
          ariokkon Ari Okkonen added a comment - One (not expressed, of course) design principle was that the server controls, which data components the server acknowledges, and what are their structures. A specialization guide is planned to instruct how to introduce new data components to the reference implementation. https://jira.fiware.org/browse/WEB-443 The input given in this request above is of great help. I'll analyze the timestamp problem more thoroughly. The logic was not well designed, originally. (The purpose of timestamps is to protect the data from update conflicts.)
          ariokkon Ari Okkonen made changes -
          Link This issue relates to WEB-674 [ WEB-674 ]
          ariokkon Ari Okkonen made changes -
          Status In Progress [ 3 ] Answered [ 10104 ]
          Hide
          ariokkon Ari Okkonen added a comment -

          Redesign of timestamp behavior takes place under https://jira.fiware.org/browse/WEB-674 .

          Show
          ariokkon Ari Okkonen added a comment - Redesign of timestamp behavior takes place under https://jira.fiware.org/browse/WEB-674 .
          Hide
          ariokkon Ari Okkonen added a comment - - edited

          Transferred to development of the next release.

          Show
          ariokkon Ari Okkonen added a comment - - edited Transferred to development of the next release.
          ariokkon Ari Okkonen made changes -
          Resolution Done [ 10000 ]
          Status Answered [ 10104 ] Done [ 10000 ]
          Fix Version/s Sprint 4.4.3 [ 10936 ]
          mev Manuel Escriche made changes -
          Summary FIWARE.Request.Lab.WebUI.POIDataProvider.General_Support_#246_A_couple_of_bugs FIWARE.Request.Tech.WebUI.POIDataProvider.General_Support_#246_A_couple_of_bugs
          mev Manuel Escriche made changes -
          Workflow FW eRequest Workflow [ 28912 ] FW extRequest Workflow-II [ 40758 ]
          Status Done [ 10000 ] Closed [ 6 ]
          Issue Type eRequest [ 10101 ] extRequest [ 10104 ]
          mev Manuel Escriche made changes -
          HD-Enabler POI Provider [ 10898 ]
          HD-Chapter WebUI [ 10842 ]
          fla Fernando Lopez made changes -
          Fix Version/s 2021 [ 12600 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          99d 20h 13m 1 Ari Okkonen 19/Aug/15 2:04 PM
          In Progress In Progress Answered Answered
          19d 47m 1 Ari Okkonen 07/Sep/15 2:52 PM
          Answered Answered Done Done
          20h 42m 1 Ari Okkonen 08/Sep/15 11:34 AM
          Done Done Closed Closed
          125d 22h 34m 1 Manuel Escriche 12/Jan/16 9:08 AM

            People

            • Assignee:
              ariokkon Ari Okkonen
              Reporter:
              leandroguillen Leandro Guillén
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: