IstSOS Web API

Lightweight Javascript framework for interacting with the sensor observation data managed by IstSOS server implementation

This work is part of Google Summer of Code 2016 and 2017 program

IstSOS Core JavaScript Library

Exposes communication with the IstSOS WA REST interface

IstSOS core JavaScript library was developed using pure ES6 syntax, Babel transpiler and Webpack. IstSOS core JavaScript library covers most of the IstSOS WA REST HTTP requests, which means that developers can easily get the observation data from IstSOS and publish it to their own Web site/page. Using this library, developers can go even further into development and implement IstSOS admin functionalities, like service registering, sensor registering, creating new offerings, adding new units of measures etc...


GitHub repository

https://github.com/istSOS/javascript-core

Usage instructions

https://github.com/istSOS/javascript-core#2-installation

Commit list

https://github.com/istSOS/javascript-core/commits/master?author=Luka-G

API Reference

https://luka-g.github.io/javascript-core

***Note: If, for some reason, there is no code at the links above or it's not complete, check the "Links" section for a forked repository. It's most likely in the process of moving the code to the main repository

Click on the button below to check out the javascript core test page...

JS core test

How it works

Class structure

Class Structure

Flow chart

Flow chart

Example response

Example response

    Changes made to the library during Google Summer of Code 2017:
  • Removed Closure library
  • Rewrite using ES6, Babel transpiler and Webpack
  • Developed simple promisified HTTP API
  • Solved event handling with istsos.EventEmitter class
  • Added authentication support
  • Library published to npm

Example screenshots

Home page

Home

Map tool

Map tool

Example response

Box tool

    Changes made to the IstSOS Web Widget Creator during Google Summer of Code 2017:
  • Rewrite using React JS library, ES6, Babel transpiler and Webpack
  • Simplified installation
  • Simplified configuration
  • Chart widget tool temporary removed due to difficulties in VistSOS integration

IstSOS Web Widget Creator

Introduces tools for generating feature-rich widgets based on sensor observation data from IstSOS

IstSOS Web widget creator is an application, that was build using the IstSOS core JavaScript library and IstSOS widget library (particularly designed for widget creation). Tools that are offered to end-users/developers:

  • Map tool
  • Box tool
  • Chart tool (Implementation of VistSOS - IstSOS data visualization framework project. See here...)

GitHub repository

https://github.com/istSOS/web-widget-creator

Usage instructions

https://github.com/istSOS/web-widget-creator#usage-instructions

Commit list

https://github.com/istSOS/web-widget-creator/commits/master?author=Luka-G

***Note: If, for some reason, there is no code at the links above or it's not complete, check the "Links" section for a forked repository. It's most likely in the process of moving the code to the main repository

Click on the button below to check out the Web widget creator test page...

Widget creator test

Status

IstSOS Web API framework is considered operational from now on, but users/developers should know that, there are some disadvantages that will be worked on in the near future. On the table below, there is a list of features that will be fixed, updated, implemented or reimplemented.

Features to be implemented/fixed:

CHART WIDGET TOOL

Chart widget tool depends on VistSOS project. For some reason, it's not working as expected, so fixing that will be the goal in the next build.

CONFIGURATION TOOL

Idea is to imlement configuration tool that will help with creation of the json specification object. It would be a simple form with json config output.

AUTO-UPDATE

User will be able to set automatic widget data update, based on selected interval of time.

Weekly Reports 2016

Weekly reports displayed below, describe the development process from the very beginning. Last report represents summary of the whole project. Click on report to display it's content...

  • Week 1

    What did you get done this week?

    This week, I’ve been indentifying all the admin HTTP requests to the server, that are targeting the istSOS RESTful API. By identifying, I mean writting down:

    • URL
    • type of request (GET, POST, PUT, DELETE)
    • response data
    • request payload

    Also, I’ve started designing the class structure, for the purpose of developing JavaScript core library. All of the mentioned work, I’m doing in partnership with a GsoC student Florin-Daniel Cioloboc, who’s working on an Java core library for istSOS and our work overlaps in this section.

    What do you plan on doing next week?

    Next week, I will be finishing the class structure and begin with the actual development/coding of JavaScript core library. I will be also creating some test pages along the way, to check for possible errors.

    Are you blocked on anything?

    Currently, everything is going according to plan.

  • Week 2

    What did you get done this week?

    This week, I've been continuosly working on class structure design for JavaScript core library and also started commiting some code. The was to implement IstSOS, Server and Database classes, but let's say that 90% of it is done.

    What do you plan on doing next week?

    Next week, I will be completing the class structure and will try to implement more classes like Service, Offering, Procedure.

    Are you blocked on anything?

    Actually, the reason why 90% of mentioned classes were done, is that I was unable to store JSON response object into an outside variable. For the information, I've been using Google Closure library for executing AJAX requests.

  • Week 3

    What did you get done this week?

    This week, I’ve implemented Configuration, Service, Offering, ObservedProperty, DataQuality, UnitOfMeasure and Date classes. Service class is partially implemented, because it depends on other classes that should be implemented soon. Also, I’ve created an html and JavaScript file for testing and I’ve already tested some of the previously implemented classes, but the new ones are about to be tested.
    Appart from mentioned, I’ve updated OSgeo wiki page with timeline and weekly reports, also you can take a look at README file in my GitHub forked repository, because I’ve started with creating API documentation for the core library I’ve been working on.

    What do you plan on doing next week?

    Next week, I plan to implement last two classes (Procedure, VirtualProcedure) and to do all the testing, bug fixes and refining the code and documentation. Hopefully, by June 20-th, I will be releasing istSOS JavaScript core library.

    Are you blocked on anything?

    Currently, everything is fine. I solved the issue with AJAX requests in consultance with my mentors.

  • Week 4

    What did you get done this week?

    I have implemented all the classes and did the testing of all the GET requests, which can be checked if you take a look at istsos-test.html and istsos-test.js.
    I have also updated the GitHub wiki page with the API documentation and the class structure of the library.

    What do you plan on doing next week?

    I plan to test all requests (POST/PUT/DELETE). Hopefully, this part will go easier and quicker, because I already fixed most of the minor problems during GET request tests.
    Also, I will be updating documentation along the way.
    We have regular meetengs with our mentors every Tuesday, so If everything goes as planned, I will prepare the first version of a library until then.

    Are you blocked on anything?

    Currently, everything is going according to plan.

  • Week 5

    What did you get done this week?

    It's a midterm evaluation period and I did a lot of testing of the library, there is a test html and test js on my GitHub forked repository. Also, I've been updating the API documentation and Class structure on the GitHub wiki page.
    Next part of my job is to develop JavaScript Framework based on previously developed library, so I started thinking about how it should be implemented, how should interface look like etc.

    What do you plan on doing next week?

    I plan to finish the documentation in the next few days, do some more testing of a library and generate a compiled version of a library, so other people can use it easily. Also, I will work on conceptual design of JavaScript Framework, I will be working together with GSoC student Felipe Poveda, because I need to integrate his implementation into my project and he needs to use my library for his own project.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 6

    What did you get done this week?

    I've been working on a design of the JavaScript Framework. No coding this week, more thinking and drawing on a piece of paper. Also, I started writing into a sreadsheet, every functionallity that should be implemented with description, so I can better organize my self, when the coding starts

    What do you plan on doing next week?

    I plan to finish conceptual design and start implementing/coding the features. Of course, updates&fixes of the previously developed library along the way, is inevitable.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 7

    What did you get done this week?

    I've been designing home page, with some of the tools (without functionality, just visual aspect) . Usage of Bootstrap helped with the page repsonsivness. Code can be checked and tested here.

    What do you plan on doing next week?

    Next week, I plan to finish with design and implement a lot of tools, like Map creator tools, Admin tools for creating, updating and deleting data etc. I will be thinking and adding some new tools allong the way. Of course, fixing of design errors may be necessary, depending on the feature requirements.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 8

    What did you get done this week?

    This week, in consultance with my mentors, I've reduced number of tools that I've had planned to implement, because they seem irrelevant. Also, I changed approach a little bit, so I needed to start over with implementation. New plan is to develop small library for creating widgets. So far, I have implemented istsos.widget.Widget base class and partially istsos.widget.Map class. Code can be checked here.

    What do you plan on doing next week?

    Next week, I plan to improve Widget base class and finish the Map class implementation. Also, I will start with developing Box class and working on a way to integrate this project as a Chart class.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 9

    What did you get done this week?

    This week, I finished with the implementation of Map creator tool. Of course, further improvements will be made along the way, but the main functionality is covered and tested. I also started with the implementation of a Box creator tool. Also I've been updating and fixing the istsos core library with some changes regarding the getObservations method and compatibility issues with Internet Explorer 11. All variations of getObservations method can now pass multiple procedures as parameter. Code can be checked at following links:

    What do you plan on doing next week?

    Next week, I plan to improve Map creator tool with some styling settings and to finish the Box creator tool. Also, I will be taking a closer look at VistSOS data visualization framework project and hopefully start integrating it as a Chart creator tool. Also, I'm kinda slow with the documentation updates, so I will be focusing on that also starting tomorrow.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 10

    What did you get done this week?

    This week, I almost finished the implementation of Box widget creator tool. Generated box widget rellies on Bootstrap and this is not good, because it forces the user to import Bootsrap to his Web page, so, design part needs to be rearranged. Functionality is fully implemented, except the "decision making", when it comes to choosing the right icon to represent selected observed properties. This will be solved in consultance with the mentors.
    I also spent a lot of time, familiarizing with the VistSOS data visualization framework and I'm still working on a plan how to integrate it into my project. So far, I thought of general concept of how the user input form is going to look like, how am I going to connect it to the istsos.widget.Chart class and what parts of VistSOS project I'm going to use.

    What do you plan on doing next week?

    Next week, I plan to finish the Map creator tool (minor changes related to displaying of a time format, will be introduced), Box creator tool with pure CSS styling and I plan to have first version of Chart creator tool. In order to implement Chart creator tool, I still need to explore the capabilities of VistSOS in consultance with the student, who's working on that project. Hopefully in the period from August 7th to August 14th, I will be having first version of istSOS Web API and will be dealing with fixing the minor issues, completing the documentation etc.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 11

    What did you get done this week?

    This week, I implemented the form for generating chart widgets, there is still "build" method left to implement, but that will be quick, because whole logic is about dynamically creating the <istsos-chart> element. This implementation rellies on Vistsos - Data visualization framework and I prepared it for possible updates. If any change comes up, the only thing that needs to be updated is chart-types specification file and application does all the rest.

    What do you plan on doing next week?

    Next week, I plan to refine the code,put some comments and update the documentation. Also there are some issues with the event handling, which I'm going to solve in consultance with the mentors

    Are you blocked on anything?

    Other than mentioned above, everything is fine.

  • Week 12

    The state of the project as it was before your GSoC?

    Before my GSoC, IstSOS data couldn't be published on the Web, without hard coding from scratch. Developers would have had to learn about WA REST interface, to implement those requests in order to get the data, to define how they want to publish that data, etc...

    The addition that your project brought to the software?

    With istSOS Web API, developers can use powerfull istSOS core JavaScript library that covers most of the WA REST HTTP requests. Also, developers now have istSOS Web widget creator , at their disposal. This is an application that uses istSOS core Javascript library and offers the set of widget creator tools:

    • Map - developers can easily build map widgets, that show sensor locations, last observation and date&time of the last observation for each sensor
    • Box - developers can easily build boxes, that contain sensor name, date&time of the last observation, and last observation values for each observed property related to selected sensor
    • Chart - integrated framework from the project - VistSOS - Data visualization framework. Developers can easily configure and build several types of interactive charts, that represent observation data in selected time span.

    Links:

Weekly Reports 2017

Weekly reports displayed below, describe the development process from the very beginning. Last report represents summary of the whole project. Click on report to display it's content...

  • Week 1

    What did you get done this week?

    This week, I've been preparing the project structure for transitioning from old version of the istsos core library to the new one. I've installed dev tools(like npm and webpack), that are going to be used in development process and did some initial configuration of those tools. I've also prepared source files from the old version, that are going to be refactored in the next weeks.

    What do you plan on doing next week?

    Next week, I will refactor as much classes as I can. Following set of changes are going to be introduced:

    • ES6 syntax will be used
    • Class constructors will be simplified a lot
    • Code will be refined.
    I will also, along the way, work on the major issue of the library - Event Handling.

    Are you blocked on anything?

    Currently, everything is going according to plan.

  • Week 2

    What did you get done this week?

    This week, I've refactored and rewritten ServerContainer, Date, Configuration, EventType, Events and Database classes. I've been also exploring possible solutions to the Event Handling problem, there was some encouraging progress.

    What do you plan on doing next week?

    Next week, I will continue with refactoring and rewritting remaining classes. Hopefully I will fix the EventHandling issue and start working on Basic HTTP authentication integration.

    Are you blocked on anything?

    Currently, everything is going according to plan.

  • Week 3

    What did you get done this week?

    This week I rewritten and refactored all of the remaining classes to ES6. I've also added a new class - EventEmitter, which introduces a simple event handling system.

    What do you plan on doing next week?

    The plan for the next week, until evaluation:

    • Update documentation (Wiki, gh-pages for javascript-core)
    • Integrate EventEmitter into all of the classes and implement authentication
    • Update webpack config in order to adopt the new changes
    • Testing

    Are you blocked on anything?

    Currently, everything is going according to plan.

  • Week 4

    What did you get done this week?

    This week, I dealt with next set of tasks:

    • Removed closure library, to improve efficiency and make webpack easier to handle the bundling
    • Integrated EventEmitter into all classes as a super class.
    • Added authentication logic to the istsos core
    • Updated Wiki page
    • Created API documentation for the library

    What do you plan on doing next week?

    Next week, I will continue to test and refine the library, if needed and to prepare it for publishing, although this is planned for the end of the project.

    Are you blocked on anything?

    Currently, everything is going according to plan.

  • Week 5

    What did you get done this week?

    I prepared library configuration for publishing and did some testing, to make sure that everything works fine.

    What do you plan on doing next week?

    I decided to take time and write unit tests for the library, starting from tomorrow until the end of the project. So every time, library build runs, a lot of tests will come first and if everything goes well, build will be finished. Also, I will start with conceptual design of new and improved IstSOS Web Widget Creators and that will be done in consultance with the mentors.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 6

    What did you get done this week?

    I did some changes to webpack config and fixed some bugs in the library. Also I've been refining the code and fixing some minor bugs, that were found through testing. I have some ideas how to rewrite IstSOS Web Widget Creator, so that is enough to get things started next week.

    What do you plan on doing next week?

    I will create project structure, prepare the new branch in the repository and prepare all the necessary dev tools for rewriting the IstSOS Web Widget Creator. Also I will continue to test and fix issues in the istsos javascript core library.

    Are you blocked on anything?

    Currently, everything is going according to plan. Didn't do much this week, but I will be more "agressive" next week.

  • Week 7

    What did you get done this week?

    I prepared environment for IstSOS Web Widget Creator, organized the project structure and component architecture and started with app redesign. I also performed another series of tests of the istsos javascript core library to make sure that everything works fine.

    What do you plan on doing next week?

    I plan to complete the IstSOS Web Widget component structuring and prepare the app for istsos javascript core integration. I will also add some CSS style to the application. Testing of the istsos javascript core library will continue as usual.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 8

    What did you get done this week?

    I've been working on app design and it's almost finished. There is some styling to be applied and to fix some of the components, but in general it's almost ready for istsos core integration.

    What do you plan on doing next week?

    I will continue to test the library and will start the integration process with web widget creator. I will also update documentation before submitting second phase evaluation.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 9

    What did you get done this week?

    Did some refinements on the istsos core library, because it needs to work well in order to successfully integrate it into istsos web widget creator. I started to develop small library for widget creation. It will contain 4 classes:

    • istsos.Widget - base class
    • istsos.Map - map widget
    • istsos.Box - box widget
    • istsos.Chart - chart widget

    What do you plan on doing next week?

    I will finish the istsos-widget class and combine it with React logic in order to test the new istsos web widget creator. Before that, I need to prepare React UI for dynamic data display.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 10

    What did you get done this week?

    This week, I refined the code for istsos core javascript library and published it to npm as 'istsos-javascript-core', althought there is more testing to be done. Also, I've prepared web-widget-creator to handle dynamic data.

    What do you plan on doing next week?

    I will work on integrating istsos widget library into Web Widget Creator and hopefully start with testing by the end of the week.

    Are you blocked on anything?

    Currently, everything is fine.

  • Week 11

    What did you get done this week?

    I didn't do much, because I've had a fever for the whole week. I succeded to add some functionlities to the map widget creator.

    What do you plan on doing next week?

    I will compensate the work from last week, and finish with integrations. Also I will finish istsos widget library and integrate it into web widget creator.

    Are you blocked on anything?

    Everything will be fine, I will just need to work more hours in the next week to compensate last weeks lack of work.

  • Week 12

    TITLE: Improving IstSOS Web API and finalizing IstSOS Javascript Core Library

    SOFTWARE COMMUNITY: IstSOS, under OSGeo.

    ABSTRACT

    Idea was to modernize and improve IstSOS Javascript core library following the best practices, so that users/developers could use it like any other modern JavaScript library. Also, one of the tasks was to rewrite IstSOS Web Widget Creator using React JS.

    STATE BEFORE

    Library build logic was poorly written and with every fix, update or change, build had to be done manually. There were also some crucial issues with event handling system and authentication support. As for Web Widget Creator, anyone who have had tried to install it, had troubles understanding usage instructions. A too much procedures and manual configuration were needed in order for app to work as expected.

    STATE AFTER

    - Library is modernized and rewritten using ES6. Build processes were automated using Webpack, Closure Compiler plugin for Webpack and Babel transpiler. Event handling problem is resolved with new class called istsos.EventEmitter and also the basic authentication support is enabled with login configuration object. Library was published to npm as "istsos-javascript-core".
    - IstSOS Web Widget Creator is rewritten using React JS. Component based architecture has proven itself very useful in improving the logic of the Web Widget Creator. Although, there are still some things left to do concerning Chart widget.

    LEFT TO DO

    • Finish Box widget - not much has left, just some bug fixes
    • Chart widget is an issue - this widget depends on another project called VistSOS, which is not functioning as expected, so this will be left to deal with in later contributions to the project.
    • Update documentation
    • Do some testing