diff --git a/docker-catalogue/docker-entrypoint.sh b/docker-catalogue/docker-entrypoint.sh old mode 100755 new mode 100644 diff --git a/docker-catalogue/manage.py b/docker-catalogue/manage.py old mode 100755 new mode 100644 diff --git a/docs.ja/slides/fiwaretheme/base.html b/docs.ja/slides/fiwaretheme/base.html index 1ea5ee05ef..b128679255 100644 --- a/docs.ja/slides/fiwaretheme/base.html +++ b/docs.ja/slides/fiwaretheme/base.html @@ -1,4 +1,5 @@ + - - - - - {{ head_title }} - + + + + +{{ head_title }} + {% if embed %} - - {% else %} - - + + {% endif %} {% for css in user_css %} {% if embed %} - {% else %} - + {% endif %} {% endfor %} - + {% if embed %} {% else %} - + {% endif %} {% for js in user_js %} {% if embed %} @@ -63,41 +64,40 @@ {{ js.contents }} {% else %} - + {% endif %} {% endfor %} - - -
-
-
-
-
-
+ + +
+
+
+
+
+
{% for slide in slides %}
-
+
{% if 'cover' in slide.classes %}

{{ head_title }}

Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

- - - - - +Image can not be loaded. + + + {% elif 'section-title' in slide.classes %}
-

{{ head_title }}

-

{{ slide.header }}

-
+

{{ head_title }}

+

{{ slide.header }}

+ {% elif 'back-cover' in slide.classes %}
Thanks!
- - - +Image can not be loaded. + + {% else %} {% if 'tutorialhard' in slide.classes %} @@ -125,91 +125,91 @@

{{ slide.header }}

{% endif %} {% if 'cover' not in slide.classes %} - - + + {% endif %} -
-

Presenter Notes

-
+
+

Presenter Notes

+
{% if slide.presenter_notes %} {{ slide.presenter_notes }} {% endif %}
-
-
-
+
+ +
{% endfor %}
-
+
{% if toc %} - + {% endif %} - - - + + + diff --git a/docs/slides/1.1_Introduction.html b/docs/slides/1.1_Introduction.html index 14aeec41f1..72508de9a1 100644 --- a/docs/slides/1.1_Introduction.html +++ b/docs/slides/1.1_Introduction.html @@ -1,4 +1,5 @@ + - - - - - Introduction to WireCloud - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-
- - -

Introduction to WireCloud

Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

- - - - - - - -
-

Presenter Notes

-
- -
-
-
-
- -
-
- - -
-

Introduction to WireCloud

-

Introduction

-
- - - -
-

Presenter Notes

-
- -
-
-
-
- -
-
- - - -
-

Introduction

-
- -
    + + + + +Introduction to WireCloud + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction to WireCloud

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction to WireCloud

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +
    • WireCloud is the Reference Implementation of the FIWARE’s Application Mashup Generic Enabler

      @@ -130,71 +99,45 @@

      Introduction

      under any license without any restriction

    - - - -
    -
    - -
    -
    - - -
    -

    Introduction to WireCloud

    -

    Basic Concepts

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Workspace / Dashboard

    -
    - -

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction to WireCloud

    +

    Basic Concepts

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Workspace / Dashboard

    +
    +

    Image can not be loaded.

    • A workspace represents the place where users can edit their dashboards.
    • A dashboard contains the set of widgets that will conform the frontend @@ -202,84 +145,54 @@

      Workspace / Dashboard

    • Users can place/resize/name... their widgets as they wish on the workspace.
    • A workspace is also composed of tabs.
    - - - -
    -
    - -
    -
    - - - -
    -

    Widget

    -
    - -

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Widget

    +
    +

    Image can not be loaded.

    • A widget is a UI component developed using web technologies (HTML, CSS, JavaScript, ...)
    • It provides the atomic functionality of the application mashup
    • It can send data to other widgets and/or receive events from them.
    - - - -
    -
    - -
    -
    - - - -
    -

    Wiring

    -
    - -

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Wiring

    +
    +

    Image can not be loaded.

    • WireCloud provides a data flow- or event-based mechanism that widgets can use to notify other widgets about changes in their state
    • @@ -291,224 +204,138 @@

      Wiring

    • It allows you to easily connect widgets with operators in a mashup to create a full-fledged dashboard with RIA functionality
    - - - -
    -
    - -
    -
    - - - -
    -

    Piping and Operators

    -
    - -

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Piping and Operators

    +
    +

    Image can not be loaded.

    Piping allows you to easily connect widgets to back-end services or data sources through an extendable set of operators, including filters, aggregators, adapters, etc...

    - - - -
    -
    - -
    -
    - - - -
    -

    Piping and Operators

    -
    - -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Piping and Operators

    +
    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Mashup

    -
    - -

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Mashup

    +
    +

    Image can not be loaded.

    • A mashup represents your application.
    • It is built from widgets, operators, and backend services, all of them connnected by wiring and piping.
    • The are built in the context of workspaces/dashboards
    - - - -
    -
    - -
    -
    - - -
    -

    Introduction to WireCloud

    -

    Architecture

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Architecture

    -
    - -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction to WireCloud

    +

    Architecture

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Architecture

    +
    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Architecture

    -
    - -
      + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    +

    Architecture

    +
    +
    • As shown in the previous diagram, WireCloud internally follows a client-server architecture.
    • From the user's perspective, WireCloud mainly runs on client side (in her @@ -525,71 +352,45 @@

      Architecture

- - - -
-
- -
-
- - -
-

Introduction to WireCloud

-

APIS

-
- - - -
-

Presenter Notes

-
- -
-
-
-
- -
-
- - - -
-

APIS

-
- -
    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
+
+
+
+
+

Introduction to WireCloud

+

APIS

+
+ +
+

Presenter Notes

+
+
+
+
+
+
+
+
+

APIS

+
+
- - - -
-
- -
-
- -
Thanks!
- - - - - -
-

Presenter Notes

-
- -
-
-
-
- -
-
- - - - - - + + + +
+

Presenter Notes

+
+
+
+ + +
+
+
Thanks!
+Image can not be loaded. + + + +
+

Presenter Notes

+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/docs/slides/1.2_Integration with other GEs.html b/docs/slides/1.2_Integration with other GEs.html index 849954f8a5..4bb2288d15 100644 --- a/docs/slides/1.2_Integration with other GEs.html +++ b/docs/slides/1.2_Integration with other GEs.html @@ -1,4 +1,5 @@ + - - - - - Integration with other GEs - - - - - - - - - - - - - - - -
-
-
-
-
-
- -
-
- - -

Integration with other GEs

Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

- - - - - - - -
-

Presenter Notes

-
- -
-
-
-
- -
-
- - -
-

Integration with other GEs

-

Introduction

-
- - - -
-

Presenter Notes

-
- -
-
-
-
- -
-
- - - -
-

Introduction

-
- -

WireCloud provides integration with several of the generic enablers provided by + + + + +Integration with other GEs + + + + + + + + + +

+
+
+
+
+
+
+
+

Integration with other GEs

Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

+Image can not be loaded. + + + + +
+

Presenter Notes

+
+
+
+
+
+
+
+
+

Integration with other GEs

+

Introduction

+
+ +
+

Presenter Notes

+
+
+
+
+
+
+
+
+

Introduction

+
+

WireCloud provides integration with several of the generic enablers provided by by FIWARE. Some of those GE has been integrated in the core of WireCloud by means of providing a plugin for FIWARE. This core integration provides support for the following GEs:

@@ -131,109 +100,68 @@

Introduction

  • CKAN
  • ...
  • - - - -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    This documnet will describe what can you expect from the integration of each of + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    This documnet will describe what can you expect from the integration of each of these generic enablers, from the perspective of an end-user and from the perpective of a developer.

    - - - -
    -
    - -
    -
    - - -
    -

    Integration with other GEs

    -

    IdM

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    IdM

    -
    - -
      + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    +

    Integration with other GEs

    +

    IdM

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    IdM

    +
    +
    • IdM is integrated directly in Wirecloud, there is no API for making request to the IdM server from widgets/operators
    • This integration provides the following features:
        @@ -243,71 +171,45 @@

        IdM

    - - - -
    -
    - -
    -
    - - -
    -

    Integration with other GEs

    -

    WStore

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    WStore

    -
    - -
      + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    +

    Integration with other GEs

    +

    WStore

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    WStore

    +
    +
    • WStore is integrated directly in WireCloud, there is no API for making request to the WStore from widgets/operators
    • Requires IdM integration for using user credentials when connecting with the WStore
    • This integration provides the following features:
        @@ -317,71 +219,45 @@

        WStore

    - - - -
    -
    - -
    -
    - - -
    -

    Integration with other GEs

    -

    Orion Context Broker

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Orion Context Broker

    -
    - -
      + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    +

    Integration with other GEs

    +

    Orion Context Broker

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Orion Context Broker

    +
    +
    • Orion Context Broker subscriptions/notifications requires what is called ngsi-proxy (You have to deploy it for custom deployments, but there is a global instance at FIWARE Lab)
    • @@ -399,71 +275,45 @@

      Orion Context Broker

    - - - -
    -
    - -
    -
    - - -
    -

    Integration with other GEs

    -

    Object Storage

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Object Storage

    -
    - -
      + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    +

    Integration with other GEs

    +

    Object Storage

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Object Storage

    +
    +
    • WireCloud provides a JavaScript API:
      • Has minimal support for querying KeyStone services
      • This API provides integration for authenticating through the KeyStone server using tokens obtained from the IdM server
      • @@ -471,71 +321,45 @@

        Object Storage

    - - - -
    -
    - -
    -
    - - -
    -

    Integration with other GEs

    -

    Other GEs

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Other GEs

    -
    - -

    Kurento

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Integration with other GEs

    +

    Other GEs

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Other GEs

    +
    +

    Kurento

    • Kurento is a WebRTC media server and a set of client APIs making simple the development of @@ -546,42 +370,27 @@

      Other GEs

    • You can develop widgets using Kurento without requiring special support from WireCloud.
    - - - -
    -
    - -
    -
    - - - -
    -

    Other GEs

    -
    - -

    CKAN

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Other GEs

    +
    +

    CKAN

    • CKAN is a powerful data management system that makes data accessible – by @@ -597,42 +406,27 @@

      Other GEs

      CKAN.

    - - - -
    -
    - -
    -
    - - - -
    -

    Other GEs

    -
    - -

    Cosmos

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Other GEs

    +
    +

    Cosmos

    • Comsos is planned to be integrated soon. This integration will provide support for:
        @@ -643,205 +437,161 @@

        Other GEs

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/2.3_End-user exercises.html b/docs/slides/2.3_End-user exercises.html index 0db077132b..e203631384 100644 --- a/docs/slides/2.3_End-user exercises.html +++ b/docs/slides/2.3_End-user exercises.html @@ -1,4 +1,5 @@ + - - - - - WireCloud End-User Exercises - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    WireCloud End-User Exercises

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Outline

    -
    - -
      + + + + +WireCloud End-User Exercises + + + + + + + + + +
      +
      +
      +
      +
      +
      +
      +
      +

      WireCloud End-User Exercises

      Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

      +Image can not be loaded. + + + + +
      +

      Presenter Notes

      +
      +
      +
      +
      +
      +
      +
      +
      +

      Outline

      +
      +
      • WC-EU-1. Complete the basic concepts tutorial
      • WC-EU-2. Multimedia viewer
      • WC-EU-3. Install the Orion Starter Kit
      • @@ -93,44 +73,28 @@

        Outline

      • WC-EU-5. Add basic video conference support into your dashboards
      • WC-EU-6. Testing the Crowd detector widget
      - - - -
      -
      - -
      -
      - - - -
      Easy
      - -
      -

      WC-EU-1. Complete the basic concepts tutorial

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Easy
      +
      +

      WC-EU-1. Complete the basic concepts tutorial

      +
      +
      • Prerequisites

          @@ -142,47 +106,32 @@

          WC-EU-1. Complete the basic concepts tutorial

          • Go to Mashup portal page
          • Click on the user menu -> Tutorials -> Basic concepts: - Basic concepts tutorial
          • + Image can not be loaded.
          • Follow the steps
      - - - -
      -
      - -
      -
      - - - -
      -

      WC-EU-2. Multimedia viewer

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      +

      WC-EU-2. Multimedia viewer

      +
      +
      • Prerequisites

          @@ -200,42 +149,27 @@

          WC-EU-2. Multimedia viewer

      - - - -
      -
      - -
      -
      - - - -
      -

      WC-EU-3. Install the Orion Starter Kit

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      +

      WC-EU-3. Install the Orion Starter Kit

      +
      +
      • Prerequisites

          @@ -258,42 +192,27 @@

          WC-EU-3. Install the Orion Starter Kit

      - - - -
      -
      - -
      -
      - - - -
      -

      WC-EU-4. Create a your own Dashboard using the context broker

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      +

      WC-EU-4. Create a your own Dashboard using the context broker

      +
      +
      • Prerequisites

          @@ -319,42 +238,27 @@

          WC-EU-4. Create a your own Dashboard using the context broker

      - - - -
      -
      - -
      -
      - - - -
      -

      WC-EU-5. Add basic video conference support into your dashboards

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      +

      WC-EU-5. Add basic video conference support into your dashboards

      +
      +
      • Prerequisites

          @@ -373,42 +277,27 @@

          WC-EU-5. Add basic video conference support into your dashboards

      - - - -
      -
      - -
      -
      - - - -
      -

      WC-EU-6. Testing the Crowd detector widget

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      +

      WC-EU-6. Testing the Crowd detector widget

      +
      +
      • Prerequisites

          @@ -423,165 +312,129 @@

          WC-EU-6. Testing the Crowd detector widget

      - - - -
      -
      - -
      -
      - -
      Thanks!
      - - - - - -
      -

      Presenter Notes

      -
      - -
      -
      -
      -
      - -
      -
      - - - - - - + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.1.0_quick_start.html b/docs/slides/3.1.0_quick_start.html index e16ec2ab6e..8afc9e0e14 100644 --- a/docs/slides/3.1.0_quick_start.html +++ b/docs/slides/3.1.0_quick_start.html @@ -1,4 +1,5 @@ + - - - - - Quick Start Tutorial - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Quick Start Tutorial

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Quick Start Tutorial

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    What do you need:

    + + + + +Quick Start Tutorial + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    Quick Start Tutorial

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Quick Start Tutorial

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    What do you need:

    • And editor of your choice
    • A zip tool
    • A gravatar account/profile
    - - - -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    Reference implementation

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    Reference implementation

    You can find the reference implementation of the widget and the operator build in this tutorial in the following github repo:

    https://github.com/wirecloud-fiware/quick-start-development-tutorial

    We recommend you to see it after completing the tutorial or in case you get stalled.

    - - - -
    -
    - -
    -
    - - -
    -

    Quick Start Tutorial

    -

    Basic chat widget

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Initial version

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Quick Start Tutorial

    +

    Basic chat widget

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Initial version

    The first step is to build a blank widget. It must have defined the metadata and a basic HTML. The metadata is written in the config.xml file, that could be similar to this:

    -
    <?xml version='1.0' encoding='UTF-8'?>
    -<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="basic-chat" version="0.1">
    +
    <?xml version='1.0' encoding='UTF-8'?>
    +<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="basic-chat" version="0.1">
         <details>
             <title>Basic chat</title>
             <homepage>https://github.com/wirecloud-fiware/quick-start-development-tutorial</homepage>
    @@ -241,143 +169,98 @@ 

    Basic chat widget

    <licenseurl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseurl> <doc>doc/developer-guide.md</doc> </details> - <contents src="index.html" useplatformstyle="true"/> - <rendering width="5" height="24"/> + <contents src="index.html" useplatformstyle="true"/> + <rendering width="5" height="24"/> </widget>
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Initial version

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Initial version

    That template indicates widget metadata such as author/vendor, together with longer descriptions that can be written using Markdown.

    Note the vendor, name and version indicated as attributes of the root element. Please consider that, depending on the WireCloud configuration, it might not admit uploading a widget twice (same version/name/vendor), so you should increase version, subversion or revision number to upload new versions of the widget. Moreover, you must change the vendor, since WireCloud will not upload the widget if another user has uploaded already the same widget (version, name and vendor).

    Two remarkable elements are the rendering element, with basic information about the size of the widget, and the reference to the main HTML file. Such file will be the entry point to the widget, and contains references to JavaScript or CSS files.

    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Initial version

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Initial version

    A basic HTML, named index.html as indicated in config.xml is indicated below. This document contains a basic header for user photo and nickname, a panel for messages, and a basic form for sending messages.

    <!DOCTYPE html>
     <html>
         <head>
    -        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"></meta>
    -        <script type="text/javascript" src="js/main.js"></script>
    -        <link rel="stylesheet" type="text/css" href="css/style.css" />
    +        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"></meta>
    +        <script type="text/javascript" src="js/main.js"></script>
    +        <link rel="stylesheet" type="text/css" href="css/style.css" />
         </head>
         <body>
    -        <div id="header">
    -            <img id="photo"id="photo"  alt="Profile photo" max-height="60" max-width="60" />
    -            <h2 id="username">Username</h2>
    +        <div id="header">
    +            <img id="photo"id="photo"  alt="Profile photo" max-height="60" max-width="60" />
    +            <h2 id="username">Username</h2>
             </div>
    -        <div id="conversations"></div>
    -        <div id="footer">
    -            <input id="input" type="text" /><button id="send" type="button">Send</button>
    +        <div id="conversations"></div>
    +        <div id="footer">
    +            <input id="input" type="text" /><button id="send" type="button">Send</button>
             </div>
         </body>
     </html>
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Initial version

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Initial version

    This HTML code refers to the js/main.js JavaScript file, that should contain the necessary code. JavaScript code will be throroughly described below. In addition, a CSS file is referenced, containing basic styling for our chat application.

    body {  padding: 0;
             margin: 0;
    @@ -415,51 +298,36 @@ 

    Basic chat widget

    body,html { height: 100%;}
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Initial version

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Initial version

    Finally, the referenced js/main.js is created. Here we include some basic elements such as a closure, an init() function and two functions to deal with the HTML interface.

    (function() {
    -    "use strict";
    +    "use strict";
     
         // object with the data received from gravatar
         var userData = null;
     
         function init() {
    -        document.getElementById("send").onclick = sendBtnHandler;
    +        document.getElementById("send").onclick = sendBtnHandler;
             getInfoFromGravatar();
         }
     
    @@ -467,17 +335,17 @@ 

    Basic chat widget

    } function createMsgDiv(text,imageSrc,received,id){ - var newMsgP = document.createElement('p'); - var newMsgImg = document.createElement('img'); - var newMsgDiv = document.createElement('div'); + var newMsgP = document.createElement('p'); + var newMsgImg = document.createElement('img'); + var newMsgDiv = document.createElement('div'); newMsgP.innerHTML = text; newMsgP.id = id; newMsgImg.src = imageSrc; - newMsgImg.alt = 'User profile img'; - newMsgDiv.className=(received)?'received':'sent'; + newMsgImg.alt = 'User profile img'; + newMsgDiv.className=(received)?'received':'sent'; newMsgDiv.appendChild(newMsgImg); newMsgDiv.appendChild(newMsgP); - var conversations = document.getElementById('conversations'); + var conversations = document.getElementById('conversations'); conversations.appendChild(newMsgDiv); conversations.scrollTop = newMsgDiv.offsetTop; } @@ -487,145 +355,99 @@

    Basic chat widget

    } function printUserData(user_data) { - document.getElementById('username').innerHTML = user_data.entry[0].displayName; - document.getElementById('photo').src = user_data.entry[0].thumbnailUrl; + document.getElementById('username').innerHTML = user_data.entry[0].displayName; + document.getElementById('photo').src = user_data.entry[0].thumbnailUrl; } - document.addEventListener('DOMContentLoaded', init.bind(this), true); + document.addEventListener('DOMContentLoaded', init.bind(this), true); })();
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Adding preferences

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Adding preferences

    The first feature that we are adding is preferences. Widget preferences must be declared in the config.xml, and after they're accessed through the WireCloud JavaScript API. The declaration of a preference for getting user gravatar profile would be like this:

    <preferences>
    -    <preference name="gravatar" type="text" label="Gravatar URL" description="URL to the gravatar profile of the user" />
    +    <preference name="gravatar" type="text" label="Gravatar URL" description="URL to the gravatar profile of the user" />
     </preferences>
     
    -

    This <preferences> section must be inside the root element <widget>. Now we can access its value using the name we've chosen. The following line will be inside the getInfoFromGravatar() function, so it can make the HTTP request to the specific URL.

    -
    var gravatarURL = MashupPlatform.prefs.get('gravatar');
    +
    var gravatarURL = MashupPlatform.prefs.get('gravatar');
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Adding preferences

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Adding preferences

    If we did this only, once the user has indicated his profile we would have to reload the widget so as to get the profile from Gravatar. To do things smartly, we're being notified from the platform on any preferences change, and react accordingly. In this case, we will invoke getInfoFromGravatar() again. Following code goes inside init() function:

        MashupPlatform.prefs.registerCallback(function(new_values) {
    -        if ('gravatar' in new_values) {
    +        if ('gravatar' in new_values) {
                 getInfoFromGravatar();
             }
         });
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Making an HTTP request

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Making an HTTP request

    Now it's time to make the HTTP request to gather other information from the user. Gravatar offers a JSON version of the profile on the same URL, appending a '.json' extension, so that will be the base URL for our request.

    The basic HTTP request might be like this:

        MashupPlatform.http.makeRequest(url, {
    -        method: 'GET',
    +        method: 'GET',
             onSuccess: function(response) {
                 var user_data;
                 user_data = JSON.parse(response.responseText);
    @@ -642,44 +464,29 @@ 

    Basic chat widget

    });
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Making an HTTP request

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Making an HTTP request

    This structure is invoked with the URL resulted from the concatenation of the obtained user preference gravatarURL and the string '.json'. And the actions to be performed are storing the data on the userData variable, and making it appear on the widget using the previously created printUserData() function:

    -
    var url = gravatarURL + '.json';
    +
    var url = gravatarURL + '.json';
     
     ...
     
    @@ -695,319 +502,217 @@ 

    Basic chat widget

    }
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Making an HTTP request

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Making an HTTP request

    The userData obtained from gravatar has a simple structure that is used for accessin its information, for example on the printUserData():

    {
    -    "entry": [{
    -        "id": "9508921",
    -        "hash": "61ac3cca6452efd339cb85c7864c147b",
    -        "requestHash": "mjimenezganan",
    -        "profileUrl": "http:\/\/gravatar.com\/mjimenezganan",
    -        "preferredUsername": "mjimenezganan",
    -        "thumbnailUrl": "http:\/\/2.gravatar.com\/avatar\/61ac3cca6452efd339cb85c7864c147b",
    -        "photos": [{
    -            "value": "http:\/\/2.gravatar.com\/avatar\/61ac3cca6452efd339cb85c7864c147b",
    -            "type": "thumbnail"
    +    "entry": [{
    +        "id": "9508921",
    +        "hash": "61ac3cca6452efd339cb85c7864c147b",
    +        "requestHash": "mjimenezganan",
    +        "profileUrl": "http:\/\/gravatar.com\/mjimenezganan",
    +        "preferredUsername": "mjimenezganan",
    +        "thumbnailUrl": "http:\/\/2.gravatar.com\/avatar\/61ac3cca6452efd339cb85c7864c147b",
    +        "photos": [{
    +            "value": "http:\/\/2.gravatar.com\/avatar\/61ac3cca6452efd339cb85c7864c147b",
    +            "type": "thumbnail"
             }],
    -        "name": {
    -            "givenName": "Miguel",
    -            "familyName": "Jim\u00e9nez"
    +        "name": {
    +            "givenName": "Miguel",
    +            "familyName": "Jim\u00e9nez"
             },
    -        "displayName": "mjimenezganan",
    -        "aboutMe": "More info on www.twitter.com\/miguel_jimg",
    -        "currentLocation": "Spain",
    -        "urls": []
    +        "displayName": "mjimenezganan",
    +        "aboutMe": "More info on www.twitter.com\/miguel_jimg",
    +        "currentLocation": "Spain",
    +        "urls": []
         }]
     }
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Sending and receiving through wiring

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Sending and receiving through wiring

    Chat functionality on the widget is done through the wiring mechanism of WireCloud. First of all, input and output endpoints have to be declared on the config.xml file:

    <wiring>
    -    <outputendpoint name="sendMsg" type="text" label="Send a message" description="The messages sent by the user are sent through this output endpoint" friendcode="message"/>
    -    <inputendpoint name="receiveMsg" type="text" label="Receive a message"  description="This is where messages sent by other widgets can be received" friendcode="message" />
    +    <outputendpoint name="sendMsg" type="text" label="Send a message" description="The messages sent by the user are sent through this output endpoint" friendcode="message"/>
    +    <inputendpoint name="receiveMsg" type="text" label="Receive a message"  description="This is where messages sent by other widgets can be received" friendcode="message" />
     </wiring>
     
    -

    Sending messages implies invoking the MashupPlatform.wiring.pushEvent() function referencing the output endpoint name as declared.

    -
    MashupPlatform.wiring.pushEvent('sendMsg', text);
    +
    MashupPlatform.wiring.pushEvent('sendMsg', text);
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Sending and receiving through wiring

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Sending and receiving through wiring

    It shall be added to the sendBtnHandler(). To be able to send messages with metadata (i.e. the Gravatar hash that allows getting sender's image), a JSON serialized object is sent:

    function sendBtnHandler(e) {
         var msgToSend = {};
    -    msgToSend.msg = document.getElementById("input").value;
    -    if (msgToSend.msg !== "" && userData != null) {
    +    msgToSend.msg = document.getElementById("input").value;
    +    if (msgToSend.msg !== "" && userData != null) {
             msgToSend.hash= userData.entry[0].hash;
    -        MashupPlatform.wiring.pushEvent('sendMsg', JSON.stringify(msgToSend));
    +        MashupPlatform.wiring.pushEvent('sendMsg', JSON.stringify(msgToSend));
         }
     }
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Sending and receiving through wiring

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Sending and receiving through wiring

    Now the message is sent through wiring, but the widget needs to receive other widgets' messages and print them on the conversations panel. This is performed registering a callback function on the platform registering for messages received on a specific input endpoint. identified by its name. On the init() function we would write somethint like this:

    -
    MashupPlatform.wiring.registerCallback('receiveMsg', processMsg);
    +
    MashupPlatform.wiring.registerCallback('receiveMsg', processMsg);
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic chat widget

    -
    - -

    Sending and receiving through wiring

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic chat widget

    +
    +

    Sending and receiving through wiring

    And a processMsg() function shall be created to indicate the desired behaviour. In our case, creating a message in the conversations panel. Since messages are sent as serialized JSON objects, they are de-serialized for accessing its elements. It is a bit tricky, since it detects my own messages and prints them as sent (different CSS style). This is how the echo is going to work.

    function processMsg(event_data) {
         var receivedMsg = JSON.parse(event_data);
         if (userData != null && receivedMsg.hash !== userData.entry[0].hash) {
    -        createMsgDiv(receivedMsg.msg, 'http://www.gravatar.com/avatar/' + receivedMsg.hash, true, receivedMsg.id);
    +        createMsgDiv(receivedMsg.msg, 'http://www.gravatar.com/avatar/' + receivedMsg.hash, true, receivedMsg.id);
         } else { // My message, echo, mark as sent
    -        createMsgDiv(receivedMsg.msg,'http://www.gravatar.com/avatar/' + receivedMsg.hash, false, receivedMsg.id);
    -        document.getElementById(receivedMsg.id).parentElement.className = 'sent'; 
    +        createMsgDiv(receivedMsg.msg,'http://www.gravatar.com/avatar/' + receivedMsg.hash, false, receivedMsg.id);
    +        document.getElementById(receivedMsg.id).parentElement.className = 'sent'; 
         }
     }
     
    - - - -
    -
    - -
    -
    - - -
    -

    Quick Start Tutorial

    -

    Basic NGSI chat operator

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    Initial operator

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Quick Start Tutorial

    +

    Basic NGSI chat operator

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    Initial operator

    The operator is defined on a config.xml declarative file, which references one or many JavaScript files containing its behaviour.

    Like widgets, the config.xml has vendor, name and version information that should be updated so as to avoid conflicts or WireCloud rejecting an operator.

    -
    <?xml version='1.0' encoding='UTF-8'?>
    -<operator xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1"
    -    vendor="CoNWeT" name="ngsi-chat-op" version="0.1.1">
    +
    <?xml version='1.0' encoding='UTF-8'?>
    +<operator xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1"
    +    vendor="CoNWeT" name="ngsi-chat-op" version="0.1.1">
         <details>
             <title>NGSI chat operator</title>
             <homepage>https://github.com/wirecloud-fiware/quick-start-development-tutorial</homepage>
    @@ -1021,165 +726,120 @@ 

    Basic NGSI chat operator

    <doc>doc/developer-guide.md</doc> </details> <scripts> - <script src="js/main.js"/> + <script src="js/main.js"/> </scripts> </operator>
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    Initial operator

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    Initial operator

    The widget has some preferences for easy indicating the URLs of the NGSI server and the proxy for accessing it from widgets/operators. Moreover, a chatroom preference has been added.

        <preferences>
    -        <preference name="ngsi_server"
    -            type="text" label="NGSI server URL"
    -            description="URL of the Orion Context Broker to use for retrieving entity information"
    -            default="http://orion.lab.fiware.org:10026/"/>
    -        <preference name="ngsi_proxy"
    -            type="text"
    -            label="NGSI proxy URL"
    -            description="URL of the PubSub Context Broker proxy to use for receiving notifications about changes"
    -            default="https://ngsiproxy.lab.fiware.org/"/>
    -        <preference name="chatroom"
    -            type="text"
    -            label="Chat room"
    -            description="Chat room to send and receive messages"
    -            default="Startup Weekends"/>
    +        <preference name="ngsi_server"
    +            type="text" label="NGSI server URL"
    +            description="URL of the Orion Context Broker to use for retrieving entity information"
    +            default="http://orion.lab.fiware.org:10026/"/>
    +        <preference name="ngsi_proxy"
    +            type="text"
    +            label="NGSI proxy URL"
    +            description="URL of the PubSub Context Broker proxy to use for receiving notifications about changes"
    +            default="https://ngsiproxy.lab.fiware.org/"/>
    +        <preference name="chatroom"
    +            type="text"
    +            label="Chat room"
    +            description="Chat room to send and receive messages"
    +            default="Startup Weekends"/>
         </preferences>
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    Initial operator

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    Initial operator

    Wiring is also used in the widget. It sends received messages back to the widget, and forwards user messages to the NGSI API:

        <wiring>
    -        <outputendpoint name="toBeReceived"
    -            type="text"
    -            label="Messages from NGSI"
    -            description="Forward a message to a chat widget"
    -            friendcode="message" />
    -        <inputendpoint name="toBeSent"
    -            type="text"
    -            label="Message to NGSI"
    -            description="Receive messages to be sent to the chat room"
    -            friendcode="message" />
    +        <outputendpoint name="toBeReceived"
    +            type="text"
    +            label="Messages from NGSI"
    +            description="Forward a message to a chat widget"
    +            friendcode="message" />
    +        <inputendpoint name="toBeSent"
    +            type="text"
    +            label="Message to NGSI"
    +            description="Receive messages to be sent to the chat room"
    +            friendcode="message" />
         </wiring>
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    Initial operator

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    Initial operator

    Basic JavaScript file is written below, containing initialization function, preferences and wiring subscriptions and some skeletons:

    (function() {
     
    -    "use strict";
    +    "use strict";
     
         var chatroom = null;
         var ngsi_connection = null;
     
         function init() {
    -        MashupPlatform.wiring.registerCallback('toBeSent', publishMsg);
    +        MashupPlatform.wiring.registerCallback('toBeSent', publishMsg);
             MashupPlatform.prefs.registerCallback(function(new_values) {
    -            if ('chatroom' in new_values) {
    +            if ('chatroom' in new_values) {
                     subscribeChatRoom();
                 }
             });
    @@ -1196,7 +856,7 @@ 

    Basic NGSI chat operator

    function receiveMessage(data){ for(var msg in data.elements){ - MashupPlatform.wiring.pushEvent('toBeReceived', JSON.stringify(data.elements[msg])); + MashupPlatform.wiring.pushEvent('toBeReceived', JSON.stringify(data.elements[msg])); } } @@ -1205,246 +865,169 @@

    Basic NGSI chat operator

    })();
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    NGSI connection

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    NGSI connection

    First, NGSI must be declared as a required feature in the config.xml file:

        <requirements>
    -        <feature name="NGSI"/>
    +        <feature name="NGSI"/>
         </requirements>
     
    -

    An NGSI connection must be stablished so as to make requests over it. It is authenticating using FIWARE tokens from the user logged on WireCloud. I've declared a global (closure) variable to hold it and access from other functions.

    -
    ngsi_connection = new NGSI.Connection(MashupPlatform.prefs.get('ngsi_server'), {
    +
    ngsi_connection = new NGSI.Connection(MashupPlatform.prefs.get('ngsi_server'), {
         use_user_fiware_token: true,
    -    ngsi_proxy_url: MashupPlatform.prefs.get('ngsi_proxy')
    +    ngsi_proxy_url: MashupPlatform.prefs.get('ngsi_proxy')
     });
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    NGSI publication

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    NGSI publication

    To create a new entity or modify an existing one, function addAttributes() of the connection is used. For the chat application, a new instance of class ChatMessageis created, using its hash and msg attributes (exactly as the event sent by wiring). Further information can be found on the NGSI API of WireCloud documentation or on the Orion Context Broker with WireCloud tutorial.

    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    NGSI publication

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    NGSI publication

    The entity to create is like this one, that

    [{
    -    entity: {id: MashupPlatform.prefs.get('chatroom') +  now.getTime() + msg.hash,
    -             type: 'ChatMessage'},
    +    entity: {id: MashupPlatform.prefs.get('chatroom') +  now.getTime() + msg.hash,
    +             type: 'ChatMessage'},
         attributes: [
             {
    -            type: 'string',
    -            name: 'hash',
    +            type: 'string',
    +            name: 'hash',
                 contextValue: msg.hash
             },
             {
    -            type: 'string',
    -            name: 'msg',
    +            type: 'string',
    +            name: 'msg',
                 contextValue: msg.msg
             }]
     }]
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    NGSI publication

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    NGSI publication

    Full publishMsg() definition ends like this:

    function publishMsg(event_data) {
         var now = new Date();
         var msg = JSON.parse(event_data);
         ngsi_connection.addAttributes([{
    -        entity: {id: MashupPlatform.prefs.get('chatroom') +  now.getTime() + msg.hash,
    -                 type: 'ChatMessage'},
    +        entity: {id: MashupPlatform.prefs.get('chatroom') +  now.getTime() + msg.hash,
    +                 type: 'ChatMessage'},
             attributes: [
                 {
    -                type: 'string',
    -                name: 'hash',
    +                type: 'string',
    +                name: 'hash',
                     contextValue: msg.hash
                 },
                 {
    -                type: 'string',
    -                name: 'msg',
    +                type: 'string',
    +                name: 'msg',
                     contextValue: msg.msg
                 }]
         }]);
     }
     
    -

    Note that the ID of the entity has been created with a fixed part (a preference indicating the chat room), plus a timestamp and the hash of the user writing.

    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    NGSI subscription

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    NGSI subscription

    This operator wants to receive the modification (creation is a kind of modification) of any instance of type ChatMessage whose ID starts with the chat room. If we had previously created the subscription (stored on chatroom @@ -1454,56 +1037,41 @@

    Basic NGSI chat operator

    parameters (like the id of the entities to monitorize, the list of attribute your interested on, the duration of the subscription, etc), in the next slide you will see an example of use for our scenario.

    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    NGSI subscription

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    NGSI subscription

    function subscribeChatRoom() {
         if (chatroom != null) {
             NGSI.cancelSubscription(chatroom);
         }
     
         var entityIdList = [
    -        {type: 'ChatMessage', id: MashupPlatform.prefs.get('chatroom') + '.*', isPattern: true}
    +        {type: 'ChatMessage', id: MashupPlatform.prefs.get('chatroom') + '.*', isPattern: true}
         ];
         var attributeList = null;
    -    var duration = 'PT30M';
    +    var duration = 'PT30M';
         var throttling = null;
         var notifyConditions = [{
    -        type: 'ONCHANGE',
    -        condValues: ['hash', 'msg']
    +        type: 'ONCHANGE',
    +        condValues: ['hash', 'msg']
         }];
         var options = {
             flat: true,
    @@ -1516,321 +1084,247 @@ 

    Basic NGSI chat operator

    }
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic NGSI chat operator

    -
    - -

    Renew NGSI subcriptions

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic NGSI chat operator

    +
    +

    Renew NGSI subcriptions

    The subscription duration is set to 30 minutes, and should be renewed (or the page reloaded) before that time. How to renew the subscription will be addressed in future versions of this tutorial (in the meantime, you can take a look to the Orion Context Broker with WierCloud tutorial for a generic tutorial of how to do it).

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.1.1_Creating widgets and operator descriptions.html b/docs/slides/3.1.1_Creating widgets and operator descriptions.html index 8fcd1fb23c..b7f2111449 100644 --- a/docs/slides/3.1.1_Creating widgets and operator descriptions.html +++ b/docs/slides/3.1.1_Creating widgets and operator descriptions.html @@ -1,4 +1,5 @@ + - - - - - Creating widget and operator descriptions - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Creating widget and operator descriptions

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Creating widget and operator descriptions

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    In WireCloud, every application mashup component have to provide a config.xml + + + + +Creating widget and operator descriptions + + + + + + + + + +

    +
    +
    +
    +
    +
    +
    +
    +

    Creating widget and operator descriptions

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating widget and operator descriptions

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    In WireCloud, every application mashup component have to provide a config.xml file providing metadata info. Moreover, every component must provide the following info:

      @@ -131,42 +100,27 @@

      Introduction

      appended to. So, revision 2.4 is newer than revision 2.4rc1, which in turn is newer than 2.4b1 or 2.4a1
    - - - -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    These tree attributes (vendor, name and version) uniquely identify the resource, + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    These tree attributes (vendor, name and version) uniquely identify the resource, therefore there can not be a repetition of such identifier in any collection of WireCloud resources (including widgets, mashups, operators, ...). In addition to these attributes, every resource can, optionally, provide the following @@ -190,42 +144,27 @@

    Introduction

    authors field

    - - - -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -
      + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    +

    Introduction

    +
    +
    • email: E-mail address for getting support
    • license: Name of the license associated to the mashable application component
    • @@ -241,115 +180,74 @@

      Introduction

    • doc: Absolute or template-relative URL of the mashable application component documentation.
    - - - -
    -
    - -
    -
    - - -
    -

    Creating widget and operator descriptions

    -

    XML

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    XML

    -
    - -

    Mashable application components described using XML should use the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating widget and operator descriptions

    +

    XML

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    XML

    +
    +

    Mashable application components described using XML should use the http://wirecloud.conwet.fi.upm.es/ns/macdescription/1 namespace for the root element that must be called widget or operator depending on the component that you want to develop. This root element must have the three attributes (vendor, name and version) that identify the resource. In addition, it should contain another element details that will carry on all the basic information about the resource, as explained before.

    - - - -
    -
    - -
    -
    - - - -
    -

    XML

    -
    - -

    The following code shows you the description of a widget using XML:

    -
    <?xml version='1.0' encoding='UTF-8'?>
    -<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="map-viewer" version="2.5.4">
    +
    +
    +
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    XML

    +
    +

    The following code shows you the description of a widget using XML:

    +
    <?xml version='1.0' encoding='UTF-8'?>
    +<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="map-viewer" version="2.5.4">
         <details>
             <title>Map Viewer</title>
             <authors>Example &lt;user@example.com&gt;</authors>
    @@ -366,44 +264,29 @@ 

    XML

    </widget>
    - - - -
    -
    - -
    -
    - - - -
    -

    XML

    -
    - -

    And here you have a description of an operator in XML:

    -
    <?xml version='1.0' encoding='UTF-8'?>
    -<operator xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="ngsi-source" version="3.0a2">
    +
    +
    +
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    XML

    +
    +

    And here you have a description of an operator in XML:

    +
    <?xml version='1.0' encoding='UTF-8'?>
    +<operator xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="ngsi-source" version="3.0a2">
         <details>
             <title>Map Viewer</title>
             <homepage>https://github.com/wirecloud-fiware/ngsi-source</homepage>
    @@ -421,71 +304,45 @@ 

    XML

    </operator>
    - - - -
    -
    - -
    -
    - - -
    -

    Creating widget and operator descriptions

    -

    RDF

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    RDF

    -
    - -

    In addition to the XML format, widget and operator descriptions (config.xml + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating widget and operator descriptions

    +

    RDF

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    RDF

    +
    +

    In addition to the XML format, widget and operator descriptions (config.xml files) can also be written using one of the following RDF notations: n3, turtle or rdf/xml. These RDF notations usually are more complex than the XML notation provided by WireCloud, making them more suitable when you want to add extra @@ -493,42 +350,27 @@

    RDF

    component metadata to other systems that uses RDF (but this is transparent to the user).

    We recommend you to stick using the XML notation when possible.

    - - - -
    -
    - -
    -
    - - - -
    -

    RDF

    -
    - -

    The first thing that you have to include in your config.xml file is the header + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    RDF

    +
    +

    The first thing that you have to include in your config.xml file is the header in order to have all the namespaces available in the rest of the document. At least you need to import the WireCloud namespace ("http://wirecloud.conwet.fi.upm.es/ns/widget"), but you can import other @@ -536,53 +378,38 @@

    RDF

    you can find an example. As can be seen, the WireCloud namespace has been tagged as "wire". In addition, some other namespaces has been imported (usdl-core, foaf, rdfs,...):

    -
    <?xml version="1.0" encoding="UTF-8"?>
    -<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    -xmlns:usdl-core="http://www.linked-usdl.org/ns/usdl-core#"
    -xmlns:foaf="http://xmlns.com/foaf/0.1/"
    -xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    -xmlns:dcterms="http://purl.org/dc/terms/"
    -xmlns:wire="http://wirecloud.conwet.fi.upm.es/ns/widget#"
    -xmlns:vCard = "http://www.w3.org/2006/vcard/ns#"
    -xmlns:gr="http://purl.org/goodrelations/v1#">
    +
    <?xml version="1.0" encoding="UTF-8"?>
    +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    +xmlns:usdl-core="http://www.linked-usdl.org/ns/usdl-core#"
    +xmlns:foaf="http://xmlns.com/foaf/0.1/"
    +xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    +xmlns:dcterms="http://purl.org/dc/terms/"
    +xmlns:wire="http://wirecloud.conwet.fi.upm.es/ns/widget#"
    +xmlns:vCard = "http://www.w3.org/2006/vcard/ns#"
    +xmlns:gr="http://purl.org/goodrelations/v1#">
     
    - - - -
    -
    - -
    -
    - - - -
    -

    RDF

    -
    - -

    And using turtle:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    RDF

    +
    +

    And using turtle:

    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
     @prefix usdl-core: <http://www.linked-usdl.org/ns/usdl-core#> .
     @prefix foaf: <http://xmlns.com/foaf/0.1/> .
    @@ -593,42 +420,27 @@ 

    RDF

    @prefix gr: <http://purl.org/goodrelations/v1#> .
    - - - -
    -
    - -
    -
    - - - -
    -

    RDF

    -
    - -

    Once added the RDF header, the next step is adding the required node: + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    RDF

    +
    +

    Once added the RDF header, the next step is adding the required node: wire:Operator or wire:Widget depending on the component that you want to create. This will be the root node, so all the metadata associated to the widget or operator should be a descendant of this node.

    @@ -645,316 +457,214 @@

    RDF

  • smartphoneimage: wire:hasiPhoneImageUri
  • doc: foaf:page
  • - - - -
    -
    - -
    -
    - - - -
    -

    RDF

    -
    - -

    The following code show an example of the description of an Operator:

    -
    <wire:Operator rdf:about="http://wirecloud.conwet.fi.upm.es/ns/widget#CoNWeT/entity-service/2.3.2">
    +
    +
    +
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    RDF

    +
    +

    The following code show an example of the description of an Operator:

    +
    <wire:Operator rdf:about="http://wirecloud.conwet.fi.upm.es/ns/widget#CoNWeT/entity-service/2.3.2">
         <usdl:hasProvider>
    -        <gr:BusinessEntity rdf:nodeID="Ne2a8644226d049239a5a9856bafcd7c6">
    +        <gr:BusinessEntity rdf:nodeID="Ne2a8644226d049239a5a9856bafcd7c6">
                 <foaf:name>CoNWeT</foaf:name>
             </gr:BusinessEntity>
         </usdl:hasProvider>
    -    <wire:hasImageUri rdf:resource="images/catalogue.png"/>
    -    <wire:hasiPhoneImageUr rdf:resource="images/catalogue_mob.png"/>
    +    <wire:hasImageUri rdf:resource="images/catalogue.png"/>
    +    <wire:hasiPhoneImageUr rdf:resource="images/catalogue_mob.png"/>
         <wire:displayName>Entity Service</wire:displayName>
         <dcterms:title>entity-service</dcterms:title>
         <usdl:versionInfo>2.3.2</usdl:versionInfo>
         <dcterms:description>This operator permits us gather information about several entities (Lamp posts, AMMSs and Regulators) from any NGSI service.</dcterms:description>
    -    <foaf:page rdf:resource="docs/index.html"/>
    +    <foaf:page rdf:resource="docs/index.html"/>
         <dcterms:creator>
    -        <foaf:Person rdf:nodeID="Ne3468f9471d349908dd8e81167153ac8">
    +        <foaf:Person rdf:nodeID="Ne3468f9471d349908dd8e81167153ac8">
                 <foaf:name>sblanco</foaf:name>
             </foaf:Person>
         </dcterms:creator>
         <vcard:addr>
    -        <vcard:Work rdf:nodeID="N6d57fc77a0e643138195f0db44b95fb2">
    +        <vcard:Work rdf:nodeID="N6d57fc77a0e643138195f0db44b95fb2">
                 <vcard:email>example@example.com</vcard:email>
             </vcard:Work>
         </vcard:addr>
     </wire:Operator>
     
    - - - -
    -
    - -
    -
    - - - -
    -

    RDF

    -
    - -

    Evidently, other RDF formats can also be used (e.g. n3):

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    RDF

    +
    +

    Evidently, other RDF formats can also be used (e.g. n3):

    <http://wirecloud.conwet.fi.upm.es/ns/widget#CoNWeT/entity-service/2.3.2> a wire:Operator ;
     dcterms:creator [ a foaf:Person ;
    -    foaf:name "example" ] ;
    -dcterms:description "This operator permits us gather information about several entities (Lamp posts, AMMSs and Regulators) from any NGSI service." ;
    -dcterms:title "entity-service" ;
    -wire:displayName "Entity Service" ;
    +    foaf:name "example" ] ;
    +dcterms:description "This operator permits us gather information about several entities (Lamp posts, AMMSs and Regulators) from any NGSI service." ;
    +dcterms:title "entity-service" ;
    +wire:displayName "Entity Service" ;
     wire:hasImageUri <images/catalogue.png> ;
     usdl:hasProvider [ a gr:BusinessEntity ;
    -    foaf:name "CoNWeT" ] ;
    -usdl:versionInfo "2.3.2" ;
    +    foaf:name "CoNWeT" ] ;
    +usdl:versionInfo "2.3.2" ;
     vcard:addr [ a vcard:Work ;
    -    vcard:email "example@example.com" ] ;
    +    vcard:email "example@example.com" ] ;
     foaf:page <docs/display/wirecloud> .
     
    - - - -
    -
    - -
    -
    - - -
    -

    Creating widget and operator descriptions

    -

    Entry Points

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Entry Points

    -
    - -

    Widgets and operators are very similar but not equals. There are some difference + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating widget and operator descriptions

    +

    Entry Points

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Entry Points

    +
    +

    Widgets and operators are very similar but not equals. There are some difference between them since the operators don't have a view. This means that operators descriptors don't use an initial HTML document as entry point. Instead, operators define the list of javascript files in their descriptor file.

    - - - -
    -
    - -
    -
    - - - -
    -

    Entry Points

    -
    - -

    Widgets

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Entry Points

    +
    +

    Widgets

    If you use XML to define your widget, you must define the contents element to set the HTML entry point. This element is contained by the root element (widget) (as we explained before):

    -
    <contents src="index.html"/>
    +
    <contents src="index.html"/>
     
    -

    Just in case you use RDF to describe your widget, you must set the element usdl:utilizedResource to set the HTML entry point. The following code is an example using N3:

    usdl:utilizedResource <index.html> ;
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Entry Points

    -
    - -

    Operators

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Entry Points

    +
    +

    Operators

    If you have developed your operator using XML, you must use the scripts element to define the JS files that will be executed. This element must be contained by the root one (operator) as can be sen in the following snippet:

    <scripts>
    -    <script src="js/main.js"/>
    -    <script src="..."/>
    +    <script src="js/main.js"/>
    +    <script src="..."/>
     </scripts>
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Entry Points

    -
    - -

    Operators

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Entry Points

    +
    +

    Operators

    To set the JS files of your operator in RDF, you must set the element usdl:utilizedResource and set the index of each file. To do so, you can stick to the following example:

    @@ -963,88 +673,60 @@

    Entry Points

    ... <js/main.js> a usdl:Resource ; - wire:index "0" . + wire:index "0" .
    -

    You can also use other RDF formats such as XML:

    <usdl:utilizedResource>
    -    <usdl:Resource rdf:about="js/main.js">
    +    <usdl:Resource rdf:about="js/main.js">
             <wire:index>0</wire:index>
         </usdl:Resource>
     </usdl:utilizedResource>
     
    - - - -
    -
    - -
    -
    - - -
    -

    Creating widget and operator descriptions

    -

    Switching between supported description formats

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Switching between supported description formats

    -
    - -

    WireCloud provides tools for automatically convert the format of your mashable + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating widget and operator descriptions

    +

    Switching between supported description formats

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Switching between supported description formats

    +
    +

    WireCloud provides tools for automatically convert the format of your mashable application component descriptions. If you want to do it, you can make use of the convert command (WireCloud must be installed in order to use this tool, see the Installation and Administration Guide for more info):

    $ wirecloud-admin convert [options] <source_widget_descriptor> [dest_file]
     
    -

    The most important options supported by this command are the -d flag, that allows you to specify the output format (currently you can use the following formats: xml, rdf and old_xml); and the --rdf-format option that allows you to @@ -1053,118 +735,76 @@

    Switching between supported description formats

    $ wirecloud-admin convert -d rdf --rdf-format n3 config.n3
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Switching between supported description formats

    -
    - -

    This will print the new description to the standard output. For saving the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Switching between supported description formats

    +
    +

    This will print the new description to the standard output. For saving the result into a file, you should use the [dest_file] argument. The next example will convert the config.ttl description file from RDF/turtle to xml creating a config.xml file:

    $ wirecloud-admin convert -d xml config.ttl config.xml
     
    -

    Remember that you can always obtain more info about the convert command using the help command:

    $ wirecloud-admin help convert
     
    - - - -
    -
    - -
    -
    - - -
    -

    Creating widget and operator descriptions

    -

    Examples

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Examples

    -
    - -

    The following tutorials will guide you to create a widget or an operator. These + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating widget and operator descriptions

    +

    Examples

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Examples

    +
    +

    The following tutorials will guide you to create a widget or an operator. These tutorials include some other configurations that can be added to your config.xml file. But the best way to understand the structure of these documents is to see some examples.

    @@ -1183,255 +823,201 @@

    Examples

    https://github.com/wirecloud-fiware

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    + + +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/docs/slides/3.1.2_Logging error messages.html b/docs/slides/3.1.2_Logging error messages.html index 7ab194de62..df9844ab8e 100644 --- a/docs/slides/3.1.2_Logging error messages.html +++ b/docs/slides/3.1.2_Logging error messages.html @@ -1,4 +1,5 @@ + - - - - - Logging error messages - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Logging error messages

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Logging error messages

    -

    Logging error messages

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Logging error messages

    -
    - -

    WireCloud provides support for logging error messages from widgets/operators. Those messages will be stored as info associated to the widget/operator and will be used to provide feedback to the user/developer (not only while the developer is testing a widget/operator, but also as part of bug reports).

    -
    MashupPlatform.widget.log("This is an error message"); // defaults to MashupPlatform.log.ERROR
    -MashupPlatform.widget.log("This is also an error message", MashupPlatform.log.ERROR);
    -MashupPlatform.widget.log("This is a warning message", MashupPlatform.log.WARN);
    -MashupPlatform.widget.log("This is an info message", MashupPlatform.log.INFO);
    +
    +
    +
    +
    +Logging error messages
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +

    Logging error messages

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +
    +

    WireCloud provides support for logging error messages from widgets/operators. Those messages will be stored as info associated to the widget/operator and will be used to provide feedback to the user/developer (not only while the developer is testing a widget/operator, but also as part of bug reports).

    +
    MashupPlatform.widget.log("This is an error message"); // defaults to MashupPlatform.log.ERROR
    +MashupPlatform.widget.log("This is also an error message", MashupPlatform.log.ERROR);
    +MashupPlatform.widget.log("This is a warning message", MashupPlatform.log.WARN);
    +MashupPlatform.widget.log("This is an info message", MashupPlatform.log.INFO);
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Logging error messages

    -
    - -

    WireCloud will provide a visual hint about widgets/operators having problems when a widget/operator calls to the log method using the ERROR level. This is an example of the visual hint for widgets:

    -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +
    +

    WireCloud will provide a visual hint about widgets/operators having problems when a widget/operator calls to the log method using the ERROR level. This is an example of the visual hint for widgets:

    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Logging error messages

    -
    - -

    Clicking on the alert icon will open the logs view. Anyway, you can always visit this view at any time using the widget's dropdown menu:

    -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +
    +

    Clicking on the alert icon will open the logs view. Anyway, you can always visit this view at any time using the widget's dropdown menu:

    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Logging error messages

    -
    - -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +
    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Logging error messages

    -
    - -

    The API for logging messages from operators is very similar:

    -
    MashupPlatform.operator.log("This is an error message"); // defaults to MashupPlatform.log.ERROR
    -MashupPlatform.operator.log("This is also an error message", MashupPlatform.log.ERROR);
    -MashupPlatform.operator.log("This is a warning message", MashupPlatform.log.WARN);
    -MashupPlatform.operator.log("This is an info message", MashupPlatform.log.INFO);
    +
    +
    +
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +
    +

    The API for logging messages from operators is very similar:

    +
    MashupPlatform.operator.log("This is an error message"); // defaults to MashupPlatform.log.ERROR
    +MashupPlatform.operator.log("This is also an error message", MashupPlatform.log.ERROR);
    +MashupPlatform.operator.log("This is a warning message", MashupPlatform.log.WARN);
    +MashupPlatform.operator.log("This is an info message", MashupPlatform.log.INFO);
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Logging error messages

    -
    - -

    Since Opertators are not shown in the Editor view, WireCloud provides you graphical elements to inform you when an Operator arises an error. If you are in the Editor view, you will be able to see that an error bag with the number of detected errors appears attached to the Wiring element in the menu, as you can note in the following image:

    -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +
    +

    Since Opertators are not shown in the Editor view, WireCloud provides you graphical elements to inform you when an Operator arises an error. If you are in the Editor view, you will be able to see that an error bag with the number of detected errors appears attached to the Wiring element in the menu, as you can note in the following image:

    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Logging error messages

    -
    - -

    When you are in the Wiring View, you will easily identify the Operator that caused the error because it will have an alert icon attached as you can be seen in the following picture:

    -

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Logging error messages

    +
    +

    When you are in the Wiring View, you will easily identify the Operator that caused the error because it will have an alert icon attached as you can be seen in the following picture:

    +

    Image can not be loaded.

    As happened with the widgets, clicking on the alert icon will show you the logs view. In the same way, you can use the widget's dropdown menu at any time to show that view.

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.1.3_Making requests and wiring.html b/docs/slides/3.1.3_Making requests and wiring.html index 342d1e4f0c..c7903e3dce 100644 --- a/docs/slides/3.1.3_Making requests and wiring.html +++ b/docs/slides/3.1.3_Making requests and wiring.html @@ -1,4 +1,5 @@ + - - - - - Making requests and wiring - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Making requests and wiring

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Making requests and wiring

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    In this example, we are going to implement a Weather Widget as an excuse to + + + + +Making requests and wiring + + + + + + + + + +

    +
    +
    +
    +
    +
    +
    +
    +

    Making requests and wiring

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making requests and wiring

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    In this example, we are going to implement a Weather Widget as an excuse to learn how to use the most commonly used features of WireCloud from a point of view of Widgets. Our intention is to create a Widget capable of making AJAX request to a external service and of communicating with other widgets in a @@ -125,123 +94,82 @@

    Introduction

    code contains a widget example skeleton including basic html/style code.

    Also, you will need to create a new API key for the Weather Underground API using this link.

    - - - -
    -
    - -
    -
    - - -
    -

    Making requests and wiring

    -

    Making request to Weather Underground

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Making request to Weather Underground

    -
    - -

    Weather Underground provide a rest API for this purpose (documented at + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making requests and wiring

    +

    Making request to Weather Underground

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making request to Weather Underground

    +
    +

    Weather Underground provide a rest API for this purpose (documented at http://www.wunderground.com/weather/api/d/docs), but we cannot access this API using normal AJAX request (using XMLHttpRequest) due browsers applying the same origin policy to javascript code. Fortunately, WireCloud provides the MashupPlatform.http.makeRequest method for dealing with this problem.

    - - - -
    -
    - -
    -
    - - - -
    -

    Making request to Weather Underground

    -
    - -

    A possible way to access to this API is by using the following code:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making request to Weather Underground

    +
    +

    A possible way to access to this API is by using the following code:

    var getForecastByCoord = function getForecastByCoord(coord, onSuccess, onError) {
         var url;
    -    if ((typeof onSuccess !== 'function') || (typeof onError !== 'function')) {
    +    if ((typeof onSuccess !== 'function') || (typeof onError !== 'function')) {
             throw new TypeError();
         }
    -    url = 'http://api.wunderground.com/api/' + API_KEY + '/conditions/forecast/q/';
    -    url += coord.lat + ',' + coord.lon;
    -    url += '.json';
    +    url = 'http://api.wunderground.com/api/' + API_KEY + '/conditions/forecast/q/';
    +    url += coord.lat + ',' + coord.lon;
    +    url += '.json';
         MashupPlatform.http.makeRequest(url, {
    -        method: 'GET',
    +        method: 'GET',
             onSuccess: function (response) {
                 var forecast_data;
                 forecast_data = JSON.parse(response.responseText);
    @@ -257,74 +185,47 @@ 

    Making request to Weather Underground

    }); };
    -

    The getForecastByCoord function makes the appropriated request to Weather Underground and passes the result to the onSuccess callback.

    - - - -
    -
    - -
    -
    - - -
    -

    Making requests and wiring

    -

    Adding an input endpoint

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Adding an input endpoint

    -
    - -

    Input endpoints must be declared into the widget template before it can be used + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making requests and wiring

    +

    Adding an input endpoint

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an input endpoint

    +
    +

    Input endpoints must be declared into the widget template before it can be used by the javascript code of the widget. To do so, open config.xml and add an inputendpoint element into the wiring section. The final result should look like:

    @@ -332,53 +233,38 @@

    Adding an input endpoint

    <wiring> <inputendpoint - name="coord" - type="text" - label="Show forecast by coord" - description="Shows the weather forecast for a given location (a latitude longitude coordinate)." - friendcode="location" + name="coord" + type="text" + label="Show forecast by coord" + description="Shows the weather forecast for a given location (a latitude longitude coordinate)." + friendcode="location" /> </wiring> ...
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding an input endpoint

    -
    - -

    Input endpoint metadata

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an input endpoint

    +
    +

    Input endpoint metadata

    • The name attribute will be use to reference to the input endpoint when using the javascript API
    • @@ -396,133 +282,88 @@

      Adding an input endpoint

      by output endpoints with a friendcode of "location". The format of this data is a string with the longitude and the latitude separated by a comma
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding an input endpoint

    -
    - -

    This is how to declare the input endpoint when using RDF (turtle):

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an input endpoint

    +
    +

    This is how to declare the input endpoint when using RDF (turtle):

    ...
     wire:hasPlatformWiring [ a <http://WireCloud.conwet.fi.upm.es/ns/widget#PlatformWiring>;
         wire:hasInputEndpoint [ a <http://wirecloud.conwet.fi.upm.es/ns/widget#InputEndpoint>;
    -        rdfs:label "Show forecast by coord";
    -        dcterms:description "Shows the weather forecast for a given location (a latitude longitude coordinate).";
    -        dcterms:title "coord";
    -        wire:friendcode "location";
    -        wire:type "text" ] ];
    +        rdfs:label "Show forecast by coord";
    +        dcterms:description "Shows the weather forecast for a given location (a latitude longitude coordinate).";
    +        dcterms:title "coord";
    +        wire:friendcode "location";
    +        wire:type "text" ] ];
     ...
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding an input endpoint

    -
    - -

    Once declared the input endpoint in the widget template, you can register a + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an input endpoint

    +
    +

    Once declared the input endpoint in the widget template, you can register a callback for this endpoint making use of the MashupPlatform.wiring.registerCallback method. In addition to registering the input endpoint, we need to process event data before using it and to notify the user that the forecast data for the given location is being requested.

    - - - -
    -
    - -
    -
    - - - -
    -

    Adding an input endpoint

    -
    - -

    This can be accomplished by using the following code:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an input endpoint

    +
    +

    This can be accomplished by using the following code:

    var searchByCoordListener = function searchByCoordListener(event_data) {
         var tmp, coord;
    -    tmp = event_data.split(',');
    +    tmp = event_data.split(',');
         coord = {
             lat: tmp[1],
             lon: tmp[0]
    @@ -537,128 +378,87 @@ 

    Adding an input endpoint

    }); }; -MashupPlatform.wiring.registerCallback("coord", searchByCoordListener); +MashupPlatform.wiring.registerCallback("coord", searchByCoordListener);
    - - - -
    -
    - -
    -
    - - -
    -

    Making requests and wiring

    -

    Adding an output endpoint

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Adding an output endpoint

    -
    - -

    As we did with the input endpoint, we need to declare the new output endpoint in + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making requests and wiring

    +

    Adding an output endpoint

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an output endpoint

    +
    +

    As we did with the input endpoint, we need to declare the new output endpoint in the weather widget's description. This is the final result of the Wiring section after adding it:

    ...
     
     <wiring>
    -    <inputendpoint name="coord" type="text" label="Show forecast by coord" description="Shows the weather forecast for a given location (a latitude longitude coordinate)." friendcode="location"/>
    +    <inputendpoint name="coord" type="text" label="Show forecast by coord" description="Shows the weather forecast for a given location (a latitude longitude coordinate)." friendcode="location"/>
         <outputendpoint
    -        name="location_coord"
    -        type="text"
    -        label="Forecast location"
    -        description="This event is launched when the user clicks on the location name of current forecast."
    -        friendcode="location"
    +        name="location_coord"
    +        type="text"
    +        label="Forecast location"
    +        description="This event is launched when the user clicks on the location name of current forecast."
    +        friendcode="location"
         />
     </wiring>
     
     ...
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding an output endpoint

    -
    - -

    Output endpoint metadata

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an output endpoint

    +
    +

    Output endpoint metadata

    • The name attribute will be use to reference to the output endpoint when using the javascript API
    • @@ -677,565 +477,398 @@

      Adding an output endpoint

      recommendations. In this case, we are declaring that we send data aligned with the friendcode "location"
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding an output endpoint

    -
    - -

    This is how to declare the output endpoint when using RDF (turtle):

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an output endpoint

    +
    +

    This is how to declare the output endpoint when using RDF (turtle):

    ...
     
     wire:hasPlatformWiring [ a <http://wirecloud.conwet.fi.upm.es/ns/widget#PlatformWiring>;
             wire:hasInputEndpoint [ a <http://wirecloud.conwet.fi.upm.es/ns/widget#InputEndpoint>;
    -                rdfs:label "Show forecast by coord";
    -                dcterms:description "Shows the weather forecast for a given location (a latitude longitude coordinate).";
    -                dcterms:title "coord";
    -                wire:friendcode "location";
    -                wire:type "text" ] ];
    +                rdfs:label "Show forecast by coord";
    +                dcterms:description "Shows the weather forecast for a given location (a latitude longitude coordinate).";
    +                dcterms:title "coord";
    +                wire:friendcode "location";
    +                wire:type "text" ] ];
             wire:hasOutputEndpoint [ a <http://wirecloud.conwet.fi.upm.es/ns/widget#OutputEndpoint>;
    -                rdfs:label "Forecast location";
    -                dcterms:description "This event is launched when the user clicks on the location name of current forecast.";
    -                dcterms:title "location_coord";
    -                wire:friendcode "location";
    -                wire:type "text" ];
    +                rdfs:label "Forecast location";
    +                dcterms:description "This event is launched when the user clicks on the location name of current forecast.";
    +                dcterms:title "location_coord";
    +                wire:friendcode "location";
    +                wire:type "text" ];
     
     ...
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding an output endpoint

    -
    - -

    After adding the output endpoint to the widget description, we can send data + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding an output endpoint

    +
    +

    After adding the output endpoint to the widget description, we can send data through it using the MashupPlatform.wiring.pushEvent method. The following code adds an event listener to the location title that sends the location of the current forecast:

    -
    document.getElementById('title').onclick = function (event) {
    +
    document.getElementById('title').onclick = function (event) {
         var long, lat;
     
         long = forecast_data.current_observation.display_location.longitude;
         lat = forecast_data.current_observation.display_location.latitude;
    -    MashupPlatform.wiring.pushEvent('location_coord', long + ',' + lat);
    +    MashupPlatform.wiring.pushEvent('location_coord', long + ',' + lat);
     };
     
    - - - -
    -
    - -
    -
    - - -
    -

    Making requests and wiring

    -

    Testing it

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Testing it

    -
    - -

    Now that we have implemented the weather widget we can make use of it to test it + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making requests and wiring

    +

    Testing it

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Testing it

    +
    +

    Now that we have implemented the weather widget we can make use of it to test it is working as expected. One of the Widget that should be compatible with our newly created weather widget is the "Web Map Service" Widget so a way to test our widgets is to create a new Workspace with both widgets.

    You can download Web Map Service widget from this link.

    - - - -
    -
    - -
    -
    - - - -
    -

    Testing it

    -
    - -

    Here is a screenshot of a workspace with both widgets:

    -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Testing it

    +
    +

    Here is a screenshot of a workspace with both widgets:

    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Testing it

    -
    - -

    And how to wire them:

    -

    - - - - +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Testing it

    +
    +

    And how to wire them:

    +

    Image can not be loaded.

    + -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Testing it

    -
    - -

    Go back to your dashboard and click in any place of the map. Your weather widget + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Testing it

    +
    +

    Go back to your dashboard and click in any place of the map. Your weather widget should be update and you should see something similiar to this:

    -

    - - - -
    + -
    -

    Presenter Notes

    -
    - -
    -
    - -
    - -
    -
    - - - -
    -

    Testing it

    -
    - -

    Also you should test that sending events from the widget is working correctly, + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Testing it

    +
    +

    Also you should test that sending events from the widget is working correctly, so move the map viewport to another part of the world and click on the location title on the weather widget ("Horndon on the Hill, United kingdom" in the screenshot) so visit other places using the Web Map Service Widget and click on the location title to see if the Web Map Service goes back to the forecast location.

    You can download both our implementation of the widget as the mashup example.

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    - - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    + + +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/docs/slides/3.1.4_Adding preferences.html b/docs/slides/3.1.4_Adding preferences.html index c6a8a49493..93a1c7b4c3 100644 --- a/docs/slides/3.1.4_Adding preferences.html +++ b/docs/slides/3.1.4_Adding preferences.html @@ -1,4 +1,5 @@ + - - - - - Adding preferences - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Adding preferences

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Adding preferences

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    This widget represents the reference implementation of the "Adding preferences" + + + + +Adding preferences + + + + + + + + + +

    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    This widget represents the reference implementation of the "Adding preferences" tutorial. This tutorial is based on previous tutorials were we have used a hardcoded value of the API key for the weather underground service. This may be good enough for a basic version of the widget, but in the real world this @@ -122,123 +91,82 @@

    Introduction

    For this tutorial, we're are going to use the proposed solution from the "[Making requests and wiring][prev_tutorial]" tutorial as base. You can download the code of the widget using this link.

    [prev_tutorial]: 3.1.3_Making\ requests\ and\ wiring

    - - - -
    -
    - -
    -
    - - -
    -

    Adding preferences

    -

    Adding preferences to the config.xml

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Adding preferences to the config.xml

    -
    - -

    The first step for adding a preference is declaring it in the config.xml file. + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences

    +

    Adding preferences to the config.xml

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences to the config.xml

    +
    +

    The first step for adding a preference is declaring it in the config.xml file. This can be accomplished by adding a preference element into the preferences element. The final result should look like:

    ...
     
         <preferences>
             <preference
    -            name="api_key"
    -            type="text"
    -            description="Weather Underground API key"
    -            label="API key"
    +            name="api_key"
    +            type="text"
    +            description="Weather Underground API key"
    +            label="API key"
             />
         </preferences>
     
     ...
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding preferences to the config.xml

    -
    - -

    Description of the attributes:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences to the config.xml

    +
    +

    Description of the attributes:

    • The name attribute will be use to reference this preference when using the javascript API
    • @@ -250,88 +178,58 @@

      Adding preferences to the config.xml

    • The description attribute is used to provided a more description about the preference
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding preferences to the config.xml

    -
    - -

    This is the same declaration but using RDF (turtle):

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences to the config.xml

    +
    +

    This is the same declaration but using RDF (turtle):

    ...
         wire:hasPlatformPreference [ a wire:PlatformPreference ;
    -            rdfs:label "API key" ;
    -            dcterms:description "Weather Underground API key" ;
    -            dcterms:title "api_key" ;
    -            wire:index "0" ;
    -            wire:type "text" ] ;
    +            rdfs:label "API key" ;
    +            dcterms:description "Weather Underground API key" ;
    +            dcterms:title "api_key" ;
    +            wire:index "0" ;
    +            wire:type "text" ] ;
     ...
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding preferences to the config.xml

    -
    - -

    Preferences of type list need to provide the list of options to be provided in + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences to the config.xml

    +
    +

    Preferences of type list need to provide the list of options to be provided in the user interface. This is accomplished by means of using the option element. This element requires two attributes:

      @@ -340,118 +238,77 @@

      Adding preferences to the config.xml

    • The label attribute will be used in the user interface when referencing this option/value. This attribute can be translated.
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding preferences to the config.xml

    -
    - -

    This is an example of how to declare a list preference:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences to the config.xml

    +
    +

    This is an example of how to declare a list preference:

    ...
         <preferences>
    -        <preference name="list" type="list" label="list" description="list preference" default="default">
    -            <option value="default" label="Default value"/>
    -            <option value="1" label="value1"/>
    -            <option value="2" label="value2"/>
    +        <preference name="list" type="list" label="list" description="list preference" default="default">
    +            <option value="default" label="Default value"/>
    +            <option value="1" label="value1"/>
    +            <option value="2" label="value2"/>
             </preference>
         </preferences>
     ...
     
    - - - -
    -
    - -
    -
    - - -
    -

    Adding preferences

    -

    Basic usage

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Basic usage

    -
    - -

    Once declared the users preference in the widget or operator descriptor, you + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences

    +

    Basic usage

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic usage

    +
    +

    Once declared the users preference in the widget or operator descriptor, you will be able to read the current value of the preference using the MashupPlatform.prefs.get method. This method will return a value using the type associated with the type of the preference:

    @@ -460,49 +317,34 @@

    Basic usage

  • number for preferences of type number
  • and boolean for boolean preferences
  • - - - -
    -
    - -
    -
    - - - -
    -

    Basic usage

    -
    - -

    For example, taking into account the code used in previous tutorials:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic usage

    +
    +

    For example, taking into account the code used in previous tutorials:

    var getForecastByCoord = function getForecastByCoord(coord, onSuccess, onError) {
     
         ...
     
    -    url = 'http://api.wunderground.com/api/' + API_KEY + '/conditions/forecast/q/';
    -    url += coord.lat + ',' + coord.lon;
    -    url += '.json';
    +    url = 'http://api.wunderground.com/api/' + API_KEY + '/conditions/forecast/q/';
    +    url += coord.lat + ',' + coord.lon;
    +    url += '.json';
     
         MashupPlatform.http.makeRequest(url, {
     
    @@ -510,462 +352,333 @@ 

    Basic usage

    };
    - - - -
    -
    - -
    -
    - - - -
    -

    Basic usage

    -
    - -

    Should be transformed to:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Basic usage

    +
    +

    Should be transformed to:

    var getForecastByCoord = function getForecastByCoord(coord, onSuccess, onError) {
     
         ...
     
    -    url = 'http://api.wunderground.com/api/' + MashupPlatform.prefs.get('api_key') + '/conditions/forecast/q/';
    -    url += coord.lat + ',' + coord.lon;
    -    url += '.json';
    +    url = 'http://api.wunderground.com/api/' + MashupPlatform.prefs.get('api_key') + '/conditions/forecast/q/';
    +    url += coord.lat + ',' + coord.lon;
    +    url += '.json';
     
         MashupPlatform.http.makeRequest(url, {
     
         ...
     };
     
    -

    After this change, the API_KEY constant is not used anymore, so you can safely remove it from the source code.

    - - - -
    -
    - -
    -
    - - -
    -

    Adding preferences

    -

    Reacting to preference changes

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Reacting to preference changes

    -
    - -

    Some times widgets need to react to changes in the preferences. This can be + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences

    +

    Reacting to preference changes

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Reacting to preference changes

    +
    +

    Some times widgets need to react to changes in the preferences. This can be accomplished using the MashupPlatform.prefs.registerCallback method. For example, we can make use of this support for displaying an alert message to the user just in case the new value for the api-key preference is not valid:

    var updateMissingAPIKeyAlert = function updateMissingAPIKeyAlert() {
    -    if (MashupPlatform.prefs.get('api_key').trim().length !== 16) {
    -        document.getElementById('api-key-alert').classList.remove('hide');
    +    if (MashupPlatform.prefs.get('api_key').trim().length !== 16) {
    +        document.getElementById('api-key-alert').classList.remove('hide');
         } else {
    -        document.getElementById('api-key-alert').classList.add('hide');
    +        document.getElementById('api-key-alert').classList.add('hide');
         }
     };
     
     MashupPlatform.prefs.registerCallback(function (new_values) {
    -    if ('api_key' in new_values) {
    +    if ('api_key' in new_values) {
            updateMissingAPIKeyAlert();
         }
     });
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Reacting to preference changes

    -
    - -

    Evidently, this only check the value of the preference when this is changed, so + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Reacting to preference changes

    +
    +

    Evidently, this only check the value of the preference when this is changed, so you need to call manually the updateMissingAPIKeyAlert function when the widget is loaded. This can be accomplished using the following code:

    -
    window.addEventListener('load', function () {
    +
    window.addEventListener('load', function () {
         updateMissingAPIKeyAlert();
     }, true);
     
    - - - -
    -
    - -
    -
    - - -
    -

    Adding preferences

    -

    Testing it

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Testing it

    -
    - -

    Once implemented our new widget we should test if it works as expected. This + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding preferences

    +

    Testing it

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Testing it

    +
    +

    Once implemented our new widget we should test if it works as expected. This widget has the same functionallity provided by the widget created by following the steps of the "[Making requests and wiring][prev_tutorial]"

    You can download both our implementation of the widget as the mashup example.

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.1.5_Accessing context information.html b/docs/slides/3.1.5_Accessing context information.html index 93165c0922..4f9495eb01 100644 --- a/docs/slides/3.1.5_Accessing context information.html +++ b/docs/slides/3.1.5_Accessing context information.html @@ -1,4 +1,5 @@ + - - - - - Accessing context information - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Accessing context information

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Accessing context information

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    WireCloud provides context at three levels: platform, mashup and widget/operator levels. Those context are accesible through the following objects:

    + + + + +Accessing context information + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    Accessing context information

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Accessing context information

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    WireCloud provides context at three levels: platform, mashup and widget/operator levels. Those context are accesible through the following objects:

    MashupPlatform.widget.context   // Widget context   (Only available to widgets)
     MashupPlatform.operator.context // Operator context (Only available to operators)
     MashupPlatform.mashup.context   // Mashup context
     MashupPlatform.context          // Platform context
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    Each of these context managers supports three methods:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    Each of these context managers supports three methods:

    • getAvailableContext: That provides information about what concepts are available for the given level
    • get: Retrieves the current value for a concept
    • registerCallback: Allows to register a callback that will be called when any of the concepts are modified

    Basically you'll make use of the get method. For example:

    -
    MashupPlatform.widget.context.get('heightInPixels');
    -MashupPlatform.mashup.context.get('name');
    -MashupPlatform.context.get('username');
    +
    MashupPlatform.widget.context.get('heightInPixels');
    +MashupPlatform.mashup.context.get('name');
    +MashupPlatform.context.get('username');
     
    - - - -
    -
    - -
    -
    - - -
    -

    Accessing context information

    -

    Discovering the available context information of a WireCloud instance

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Discovering the available context information of a WireCloud instance

    -
    - -

    The available context information depends on the version and the list of addons + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Accessing context information

    +

    Discovering the available context information of a WireCloud instance

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Discovering the available context information of a WireCloud instance

    +
    +

    The available context information depends on the version and the list of addons installed in the concrete instance of WireCloud. Here you have to options:

    • Discovering available context information using the getAvailableContext method
    • Or discovering it using the Context Inspector widget
    - - - -
    -
    - -
    -
    - - -
    -

    Accessing context information

    -

    Using widget context for resizing widget's content

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Using widget context for resizing widget's content

    -
    - -

    One of the main uses that developers can give to the context support is using it + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Accessing context information

    +

    Using widget context for resizing widget's content

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using widget context for resizing widget's content

    +
    +

    One of the main uses that developers can give to the context support is using it for receiving notification about changes in the size of a widget. This is due to the fact that CSS is better prepared for managing horizontal dimensions than vertical ones. In addition to this, the resize event is not fired inside widgets @@ -312,7 +214,7 @@

    Using widget context for resizing widget's content

    MashupPlatform.widget.context.registerCallback(function (new_values) {
         ...
     
    -    if ('heightInPixels' in new_values) {
    +    if ('heightInPixels' in new_values) {
             repaint();
         }
     
    @@ -320,165 +222,129 @@ 

    Using widget context for resizing widget's content

    });
    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.1.6_Translating widgets.html b/docs/slides/3.1.6_Translating widgets.html index ed23d7465c..18e7686405 100644 --- a/docs/slides/3.1.6_Translating widgets.html +++ b/docs/slides/3.1.6_Translating widgets.html @@ -1,4 +1,5 @@ + - - - - - Translating widgets - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Translating widgets

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Translating widgets

    -

    Translating widget metadata

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using XML templates

    + + + + +Translating widgets + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widgets

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widgets

    +

    Translating widget metadata

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using XML templates

    XML templates allows translations of some fields that will be displayed to users in WireCloud platform, this translations can be included in the template adding the translations node with the attribute default specifying the default language @@ -126,44 +95,29 @@

    Translating widget metadata

    (matching the translation names with the name attribute) to the translation nodes. These msg elements, will provide the string that will be used to remplace the translations patterns.

    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using XML templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using XML templates

    The structure of a config.xml file before and after adding the translations can be seen below:

    -
    <widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="weather-example" version="1.0">
    +
    <widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="weather-example" version="1.0">
       <details>
         <title>Weather Widget Example</title>
         <authors>aarranz</authors>
    @@ -174,52 +128,37 @@ 

    Translating widget metadata

    <doc>doc/index.html</doc> </details> <wiring> - <outputendpoint name="location_coord" type="text" label="Forecast location" description="This event is launched when the user clicks on the location name of current forecast." friendcode="location"/> - <inputendpoint name="coord" type="text" label="Show forecast by coord" description="Shows the weather forecast for a given location (a latitude longitude coordinate)." friendcode="location"/> + <outputendpoint name="location_coord" type="text" label="Forecast location" description="This event is launched when the user clicks on the location name of current forecast." friendcode="location"/> + <inputendpoint name="coord" type="text" label="Show forecast by coord" description="Shows the weather forecast for a given location (a latitude longitude coordinate)." friendcode="location"/> </wiring> - <contents src="weather.html" contenttype="text/html" charset="utf-8"/> - <rendering height="24" width="6"/> + <contents src="weather.html" contenttype="text/html" charset="utf-8"/> + <rendering height="24" width="6"/> </widget>
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using XML templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using XML templates

    Final result (main part):

    -
    <widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="weather-example" version="1.0">
    +
    <widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="weather-example" version="1.0">
       <details>
         <title>__MSG_displayName__</title>
         <authors>aarranz</authors>
    @@ -230,153 +169,108 @@ 

    Translating widget metadata

    <doc>doc/index.html</doc> </details> <wiring> - <outputendpoint name="location_coord" type="text" label="__MSG_eventLabel__" description="__MSG_eventDescription__" friendcode="location"/> - <inputendpoint name="coord" type="text" label="__MSG_slotLabel__" description="__MSG_slotDescription__" friendcode="location"/> + <outputendpoint name="location_coord" type="text" label="__MSG_eventLabel__" description="__MSG_eventDescription__" friendcode="location"/> + <inputendpoint name="coord" type="text" label="__MSG_slotLabel__" description="__MSG_slotDescription__" friendcode="location"/> </wiring> - <contents src="weather.html" contenttype="text/html" charset="utf-8"/> - <rendering height="24" width="6"/> + <contents src="weather.html" contenttype="text/html" charset="utf-8"/> + <rendering height="24" width="6"/> ...
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using XML templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using XML templates

    Final result (translations):

    ...
    -  <translations default="en">
    -    <translation lang="en">
    -      <msg name="displayName">Weather Widget Example</msg>
    -      <msg name="description">Example of widget for the Wirecloud Plaftorm.</msg>
    -      <msg name="eventDescription">This event is launched when the user clicks on the location name of current forecast.</msg>
    -      <msg name="slotDescription">Shows the weather forecast for a given location (a latitude longitude coordinate).</msg>
    -      <msg name="slotLabel">Show forecast by coord</msg>
    -      <msg name="eventLabel">Forecast location</msg>
    +  <translations default="en">
    +    <translation lang="en">
    +      <msg name="displayName">Weather Widget Example</msg>
    +      <msg name="description">Example of widget for the Wirecloud Plaftorm.</msg>
    +      <msg name="eventDescription">This event is launched when the user clicks on the location name of current forecast.</msg>
    +      <msg name="slotDescription">Shows the weather forecast for a given location (a latitude longitude coordinate).</msg>
    +      <msg name="slotLabel">Show forecast by coord</msg>
    +      <msg name="eventLabel">Forecast location</msg>
         </translation>
    -    <translation lang="es">
    -      <msg name="displayName">Ejemplo de widget del tiempo</msg>
    -      <msg name="description">Ejemplo de un widget para la plataforma Wirecloud.</msg>
    -      <msg name="eventDescription">Este evento se lanza cuando el usuario hace click en el nombre de la ubicación de la previsión actual.</msg>
    -      <msg name="slotDescription">Muestra las previsiones meteorológicas para una ubicación dada (coordenadas en latitud y longitud).</msg>
    -      <msg name="slotLabel">Muestra las prevesiones por coordenadas</msg>
    -      <msg name="eventLabel">Ubicación de la previsión</msg>
    +    <translation lang="es">
    +      <msg name="displayName">Ejemplo de widget del tiempo</msg>
    +      <msg name="description">Ejemplo de un widget para la plataforma Wirecloud.</msg>
    +      <msg name="eventDescription">Este evento se lanza cuando el usuario hace click en el nombre de la ubicación de la previsión actual.</msg>
    +      <msg name="slotDescription">Muestra las previsiones meteorológicas para una ubicación dada (coordenadas en latitud y longitud).</msg>
    +      <msg name="slotLabel">Muestra las prevesiones por coordenadas</msg>
    +      <msg name="eventLabel">Ubicación de la previsión</msg>
         </translation>
       </translations>
     </widget>
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using RDF templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using RDF templates

    Translations in RDF descriptions are based in the use of RDF literal attribute lang. To translate a field it is included in the template for every language to be translated, specifying the language with the attribute lang.

    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using RDF templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using RDF templates

    The structure of a RDF (xml) description without translations:

    ...
     
    -<wire:Widget rdf:about="http://wirecloud.conwet.fi.upm.es/ns/weather-example">
    +<wire:Widget rdf:about="http://wirecloud.conwet.fi.upm.es/ns/weather-example">
             <dcterms:title>weather-example</dcterms:title>
             <dcterms:description>Example of widget for the Wirecloud Plaftorm.</dcterms:description>
             <wire:displayName>Weather Widget Example</wire:displayName>
    @@ -386,425 +280,313 @@ 

    Translating widget metadata

    </foaf:Person> </dcterms:creator> <usdl-core:versionInfo>1.0</usdl-core:versionInfo> - <wire:hasImageUri rdf:resource="images/catalogue.png"/> - <wire:hasiPhoneImageUri rdf:resource="images/catalogue_iphone.png"/> + <wire:hasImageUri rdf:resource="images/catalogue.png"/> + <wire:hasiPhoneImageUri rdf:resource="images/catalogue_iphone.png"/> ...
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using RDF templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using RDF templates

    The structure of a RDF (xml) description with translations:

    ...
     
    -<wire:Widget rdf:about="http://wirecloud.conwet.fi.upm.es/ns/weather-example">
    +<wire:Widget rdf:about="http://wirecloud.conwet.fi.upm.es/ns/weather-example">
             <dcterms:title>weather-example</dcterms:title>
    -        <dcterms:description xml:lang="en">Example of widget for the Wirecloud Plaftorm.</dcterms:description>
    -        <dcterms:description xml:lang="es">Ejemplo de un widget para la plataforma Wirecloud.</dcterms:description>
    -        <wire:displayName xml:lang="en">Weather Widget Example</wire:displayName>
    -        <wire:displayName xml:lang="es">Ejemplo de widget del tiempo</wire:displayName>
    +        <dcterms:description xml:lang="en">Example of widget for the Wirecloud Plaftorm.</dcterms:description>
    +        <dcterms:description xml:lang="es">Ejemplo de un widget para la plataforma Wirecloud.</dcterms:description>
    +        <wire:displayName xml:lang="en">Weather Widget Example</wire:displayName>
    +        <wire:displayName xml:lang="es">Ejemplo de widget del tiempo</wire:displayName>
             <dcterms:creator>
                 <foaf:Person>
                     <foaf:name>aarranz</foaf:name>
                 </foaf:Person>
             </dcterms:creator>
             <usdl-core:versionInfo>1.0</usdl-core:versionInfo>
    -        <wire:hasImageUri rdf:resource="images/catalogue.png"/>
    -        <wire:hasiPhoneImageUri rdf:resource="images/catalogue_iphone.png"/>
    +        <wire:hasImageUri rdf:resource="images/catalogue.png"/>
    +        <wire:hasiPhoneImageUri rdf:resource="images/catalogue_iphone.png"/>
     ...
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using RDF templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using RDF templates

    The structure of a RDF (turtle) description without translations:

    ...
     
     <http://wirecloud.conwet.fi.upm.es/ns/weather-example>
         a wire:Widget ;
    -    dcterms:title "weather-example" ;
    -    wire:displayName "Weather Widget Example" ;
    -    dcterms:description "Example of widget for the Wirecloud Plaftorm." ;
    +    dcterms:title "weather-example" ;
    +    wire:displayName "Weather Widget Example" ;
    +    dcterms:description "Example of widget for the Wirecloud Plaftorm." ;
         dcterms:creator _:b1 ;
    -    usdl-core:versionInfo "1.0" ;
    +    usdl-core:versionInfo "1.0" ;
         wire:hasImageUri <images/catalogue.png> ;
         wire:hasiPhoneImageUri <images/catalogue_iphone.png> ;
     ...
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating widget metadata

    -
    - -

    Using RDF templates

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget metadata

    +
    +

    Using RDF templates

    The structure of a RDF (turtle) description with translations:

    ...
     
     <http://wirecloud.conwet.fi.upm.es/ns/weather-example>
         a wire:Widget ;
    -    dcterms:title "weather-example" ;
    -    wire:displayName "Weather Widget Example"@en ;
    -    wire:displayName "Ejemplo de widget del tiempo"@es ;
    -    dcterms:description "Example of widget for the Wirecloud Plaftorm."@en ;
    -    dcterms:description "Ejemplo de un widget para la plataforma Wirecloud."@es ;
    +    dcterms:title "weather-example" ;
    +    wire:displayName "Weather Widget Example"@en ;
    +    wire:displayName "Ejemplo de widget del tiempo"@es ;
    +    dcterms:description "Example of widget for the Wirecloud Plaftorm."@en ;
    +    dcterms:description "Ejemplo de un widget para la plataforma Wirecloud."@es ;
         dcterms:creator _:b1 ;
    -    usdl-core:versionInfo "1.0" ;
    +    usdl-core:versionInfo "1.0" ;
         wire:hasImageUri <images/catalogue.png> ;
         wire:hasiPhoneImageUri <images/catalogue_iphone.png> ;
     ...
     
    - - - -
    -
    - -
    -
    - - -
    -

    Translating widgets

    -

    Translating widget contents

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Translating widget contents

    -
    - -

    The content of the widget should be translated using javascript and the support + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widgets

    +

    Translating widget contents

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating widget contents

    +
    +

    The content of the widget should be translated using javascript and the support for accessing to the context of the platform. Platform context support is needed for knowing what language is currently in use:

    -
    MashupPlatform.context.get('language');
    +
    MashupPlatform.context.get('language');
     
    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.1.7_Dynamic_dashboards.html b/docs/slides/3.1.7_Dynamic_dashboards.html index 23dd5968f7..86f2b17845 100644 --- a/docs/slides/3.1.7_Dynamic_dashboards.html +++ b/docs/slides/3.1.7_Dynamic_dashboards.html @@ -1,4 +1,5 @@ + - - - - - Dynamic dashboards - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Dynamic dashboards

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Dynamic dashboards

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    This tutorial will show you how to use the Dashboard Management API from + + + + +Dynamic dashboards + + + + + + + + + +

    +
    +
    +
    +
    +
    +
    +
    +

    Dynamic dashboards

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Dynamic dashboards

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    This tutorial will show you how to use the Dashboard Management API from widgets and operators by providing some examples of what can be done by using it.

    Widgets and operators using the Dashboard Management API will be able to add new @@ -125,144 +94,92 @@

    Introduction

    You can find the reference documentation of the Dashboard Management API on the WidgetAPI documentation (Search DashboardManagement to discover the relevant documentation sections).

    - - - -
    -
    - -
    -
    - - -
    -

    Dynamic dashboards

    -

    Enabling the Dashboard Management API

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Enabling the Dashboard Management API

    -
    - -

    The first step for being able to use the Dashboard Management API is to add the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Dynamic dashboards

    +

    Enabling the Dashboard Management API

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Enabling the Dashboard Management API

    +
    +

    The first step for being able to use the Dashboard Management API is to add the DashboardManagement feature as a requirement of the widget/operator.

    For example, if you use the xml version of the MACDL this is done by adding the following code inside the <widget> or <operator> element (depending if you are adding this feature into a widget or an operator):

    <requirements>
    -    <feature name="DashboardManagement"/>
    +    <feature name="DashboardManagement"/>
     </requirements>
     
    - - - -
    -
    - -
    -
    - - -
    -

    Dynamic dashboards

    -

    Videoconference example

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Videoconference example

    -
    - -

    Introduction

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Dynamic dashboards

    +

    Videoconference example

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Videoconference example

    +
    +

    Introduction

    This example will show you how to use the Kurento one2one widget for providing videoconferece support into a thrid party widget.

    The steps for adding that functionallity are:

    @@ -275,94 +192,64 @@

    Videoconference example

  • Wait until the Kurento One2one connects with the kurento service
  • Start the videoconference by sending a call event to the Kurento One2one widget
  • - - - -
    -
    - -
    -
    - - - -
    -

    Videoconference example

    -
    - -

    Adding the one2one widget

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Videoconference example

    +
    +

    Adding the one2one widget

    You can add the Kurento One2one widget to the current dashboard using the addWidget method. For example, using the following code:

    -
    var widget = MashupPlatform.mashup.addWidget('CoNWeT/kuernto-one2one/1.0', {
    -    "permissions": {
    -        "close": false,
    -        "configure": false
    +
    var widget = MashupPlatform.mashup.addWidget('CoNWeT/kuernto-one2one/1.0', {
    +    "permissions": {
    +        "close": false,
    +        "configure": false
         },
    -    "preferences": {
    -        "stand-alone": {
    -            "value": false
    +    "preferences": {
    +        "stand-alone": {
    +            "value": false
             }
         },
    -    "top": "0px",
    -    "left": "66%"
    +    "top": "0px",
    +    "left": "66%"
     });
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Videoconference example

    -
    - -

    Adding the one2one widget

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Videoconference example

    +
    +

    Adding the one2one widget

    The previous code will add the Kurento One2one widget placed it at an static position: 0px, 66%. Also, we are using the permissions option to block users to configure and close the Kurento One2one widget. By using the preferences @@ -372,636 +259,451 @@

    Videoconference example

    alternative to to use the top and left options, in this case, is to use the refposition option. This way, the Kurento One2one widget will be placed near the button the user has clicked.

    - - - -
    -
    - -
    -
    - - - -
    -

    Videoconference example

    -
    - -

    Adding the one2one widget

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Videoconference example

    +
    +

    Adding the one2one widget

    To use the refposition option, you have to obtain a ClientRect instance representing your button, you can obtain such an object by using the getBoundingClientRect method:

    -
    var one2one_widget = MashupPlatform.mashup.addWidget('CoNWeT/kuernto-one2one/1.0', {
    -    "permissions": {
    -        "close": false,
    -        "configure": false
    +
    var one2one_widget = MashupPlatform.mashup.addWidget('CoNWeT/kuernto-one2one/1.0', {
    +    "permissions": {
    +        "close": false,
    +        "configure": false
         },
    -    "preferences": {
    -        "stand-alone": {
    -            "value": false
    +    "preferences": {
    +        "stand-alone": {
    +            "value": false
             }
         },
    -    "refposition": button.getBoundingClientRect()
    +    "refposition": button.getBoundingClientRect()
     });
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Videoconference example

    -
    - -

    Wiring configuration

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Videoconference example

    +
    +

    Wiring configuration

    We can make use the enpoints defined in the widget/operator description (config.xml file) for connecting with the Kurento One2one widget, so it's not mandatory to create new endpoints in a dynamic way. However, by creating them using the Dashboard Management API we are declaring that they are going to be used exclusively from the widget/operator code: Users won't be able to create connections using those endpoint in the Wiring Editor view.

    - - - -
    -
    - -
    -
    - - - -
    -

    Videoconference example

    -
    - -

    Wiring configuration

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Videoconference example

    +
    +

    Wiring configuration

    The needed endpoints can be created using this code:

    var call_endpoint = MashupPlatform.widget.createOutputEndpoint();
     var state_endpoint = MashupPlatform.widget.createInputEndpoint(function (state) {
    -    if (state === 'REGISTERED') {
    +    if (state === 'REGISTERED') {
             // Update the call button that tiggered the videoconference to become a
             // hang button. This button should call one2one_widget.remove() to end
             // the videoconference
     
             // By sending this event, the one2one widget will start the videoconferece
             call_endpoint.pushEvent(information.username);
    -    } else if (state === 'ENABLED_CALL') {
    +    } else if (state === 'ENABLED_CALL') {
             one2one_widget.remove();
         }
     });
     
    - -

    Note: If you are developing an operator you should use MashupPlatform.operator.createOutputEndpoint and MashupPlatform.operator.createInputEndpoint instead.

    - - - -
    -
    - -
    -
    - - - -
    -

    Videoconference example

    -
    - -

    Wiring configuration

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Videoconference example

    +
    +

    Wiring configuration

    The connection between those dynamic endpoint and the endpoints of the Kurento One2one widget can be established using the following code:

    -
    call_endpoint.connect(one2one_widget.inputs['call-user']);
    -one2one_widget.outputs['call-state'].connect(state_endpoint);
    +
    call_endpoint.connect(one2one_widget.inputs['call-user']);
    +one2one_widget.outputs['call-state'].connect(state_endpoint);
     
    - - - -
    -
    - -
    -
    - - -
    -

    Dynamic dashboards

    -

    Map example

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Map example

    -
    - -

    Introduction

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Dynamic dashboards

    +

    Map example

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Map example

    +
    +

    Introduction

    This example will show you how to use the Map viewer widget for displaying some Point of Interest in a map in a dynamic way (without displaying a map viewer widget all the time).

    The main difference with the previous example is that in this case, we are going to use a NGSI Entity 2 PoI operator for transforming the event data to be compatible with the one expected by the Map Viewer widget.

    - - - -
    -
    - -
    -
    - - - -
    -

    Map example

    -
    - -

    Adding the Map viewer widget

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Map example

    +
    +

    Adding the Map viewer widget

    This step can be accomplished in the same way as we did with the Kurento One2one widget:

    -
    var map_widget = MashupPlatform.mashup.addWidget('CoNWeT/map-viewer/2.5.7', {
    -    "permissions": {
    -        "close": false,
    -        "configure": false
    +
    var map_widget = MashupPlatform.mashup.addWidget('CoNWeT/map-viewer/2.5.7', {
    +    "permissions": {
    +        "close": false,
    +        "configure": false
         },
    -    "preferences": {
    -        "stand-alone": {
    -            "value": false
    +    "preferences": {
    +        "stand-alone": {
    +            "value": false
             }
         },
    -    "top": "0px",
    -    "left": "66%"
    +    "top": "0px",
    +    "left": "66%"
     });
     
    - -

    Remember to use refposition in replacement of the top and left options if applicable.

    - - - -
    -
    - -
    -
    - - - -
    -

    Map example

    -
    - -

    Adding the NGSI entity to PoI operator

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Map example

    +
    +

    Adding the NGSI entity to PoI operator

    The addOperator method works in a very similar way to the addWidget operator. E.g. for adding the NGSI Entity 2 PoI operator, we can make use of the following code:

    -
    var operator = MashupPlatform.mashup.addOperator('CoNWeT/ngsientity2poi/3.0.3', {
    -    "preferences": {
    -        "coordinates_attr": {
    -            "value": "position"
    +
    var operator = MashupPlatform.mashup.addOperator('CoNWeT/ngsientity2poi/3.0.3', {
    +    "preferences": {
    +        "coordinates_attr": {
    +            "value": "position"
             }
         }
     });
     
    - -

    Note: Rembember to change the coordinates_attr value according to your requirements.

    - - - -
    -
    - -
    -
    - - - -
    -

    Map example

    -
    - -

    Wiring configuration

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Map example

    +
    +

    Wiring configuration

    var poi_endpoint = MashupPlatform.widget.wiring.createOutputEndpoint();
     
    -poi_endpoint.connect(operator.inputs['entityInput']);
    -operator.outputs['poiOutput'].connect(map_widget.inputs['poiInput']);
    +poi_endpoint.connect(operator.inputs['entityInput']);
    +operator.outputs['poiOutput'].connect(map_widget.inputs['poiInput']);
     
    - -

    Now you can send events using poi_endpoint. E.g.:

    poi_endpoint.pushEvent(JSON.stringify({
    -    "id": "Big Ben",
    -    "position": "51.5008715, -0.1259872"
    +    "id": "Big Ben",
    +    "position": "51.5008715, -0.1259872"
     });
     
    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.1.8_Accessing_third-party_servicies_using_IdM_tokens.html b/docs/slides/3.1.8_Accessing_third-party_servicies_using_IdM_tokens.html index aa536fe037..611642c078 100644 --- a/docs/slides/3.1.8_Accessing_third-party_servicies_using_IdM_tokens.html +++ b/docs/slides/3.1.8_Accessing_third-party_servicies_using_IdM_tokens.html @@ -1,4 +1,5 @@ + - - - - - Accessing third-party servicies using IdM tokens - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Accessing third-party servicies using IdM tokens

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Accessing third-party servicies using IdM tokens

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    Sometimes you need to access to a third-party service whose authentication is + + + + +Accessing third-party servicies using IdM tokens + + + + + + + + + +

    +
    +
    +
    +
    +
    +
    +
    +

    Accessing third-party servicies using IdM tokens

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Accessing third-party servicies using IdM tokens

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    Sometimes you need to access to a third-party service whose authentication is managed using the same IdM service used by the WireCloud instance. In those cases, you can make use of the support provided by WireCloud for injecting the OAuth2 token obtained from the IdM server into the requests made from your @@ -127,48 +96,32 @@

    Introduction

    support for reading OAuth2 tokens from widgets/operators.

    -

    Note: This document uses the headers names available on WireCloud 0.9.1+ for simplicity, but previous versions of WireCloud use other names. See the latest slide for more info.

    - - - -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    How to use the token injection support

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    How to use the token injection support

    All the configuration about how to inject the OAuth2 token into your requests is provided using HTTP headers that will be consumed by the WireCloud's proxy. The main header is: FIWARE-OAuth-Token. This header should be added to any @@ -178,73 +131,47 @@

    Introduction

    support several auth backends. In that case, some user won't be associated with an IdM account. You can check if the currently logged user has an associated IdM token by running the following code:

    -
    MashupPlatform.context.get('fiware_token_available');
    +
    MashupPlatform.context.get('fiware_token_available');
     
    - - - -
    -
    - -
    -
    - - -
    -

    Accessing third-party servicies using IdM tokens

    -

    Injecting IdM tokens...

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Injecting IdM tokens...

    -
    - -

    into HTTP headers

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Accessing third-party servicies using IdM tokens

    +

    Injecting IdM tokens...

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Injecting IdM tokens...

    +
    +

    into HTTP headers

    Usually you will want to inject the OAuth2 token into an HTTP header, this can be accomplished by using the FIWARE-OAuth-Header-Name header. Tipically, you will want to add the token into the X-Auth-Token header (as used by Open @@ -254,183 +181,123 @@

    Injecting IdM tokens...

    Example:

    MashupPlatform.http.makeRequest(url, {
         requestHeaders: {
    -        "FIWARE-OAuth-Token": "true",
    -        "FIWARE-OAuth-Header-Name": "X-Auth-Token"
    +        "FIWARE-OAuth-Token": "true",
    +        "FIWARE-OAuth-Header-Name": "X-Auth-Token"
         },
         ...
     });
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Injecting IdM tokens...

    -
    - -

    as GET parameters

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Injecting IdM tokens...

    +
    +

    as GET parameters

    Another common place for injecting the OAuth2 token is into a GET parameter on the URL. This kind of injection is configured using the FIWARE-OAuth-GET-Parameter header.

    Example:

    MashupPlatform.http.makeRequest(url, {
         requestHeaders: {
    -        "FIWARE-OAuth-Token": "true",
    -        "FIWARE-OAuth-GET-Parameter": "access_token"
    +        "FIWARE-OAuth-Token": "true",
    +        "FIWARE-OAuth-GET-Parameter": "access_token"
         },
         ...
     });
     
    - -

    This will add an access_token GET parameter into the URL containing the OAuth2 token of the currently logged user.

    - - - -
    -
    - -
    -
    - - - -
    -

    Injecting IdM tokens...

    -
    - -

    into the body of the request

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Injecting IdM tokens...

    +
    +

    into the body of the request

    Finally, the proxy can inject OAuth2 tokens into the body of the request. To do so, you have to provide the pattern to be searched and replaced with the OAuth2 token using the FIWARE-OAuth-Body-Pattern header.

    Example:

    MashupPlatform.http.makeRequest(url, {
    -    method: 'POST',
    -    postBody: JSON.stringify({token: "%fiware_token%"}),
    +    method: 'POST',
    +    postBody: JSON.stringify({token: "%fiware_token%"}),
         requestHeaders: {
    -        "FIWARE-OAuth-Token": "true",
    -        "FIWARE-OAuth-Body-Pattern": "%fiware_token%"
    +        "FIWARE-OAuth-Token": "true",
    +        "FIWARE-OAuth-Body-Pattern": "%fiware_token%"
         },
         ...
     });
     
    - -

    This will search for any %fiware_token% ocurrence in the body of the request and replace it with the OAuth2 token of the user.

    - - - -
    -
    - -
    -
    - - -
    -

    Accessing third-party servicies using IdM tokens

    -

    Using the dashboard owner IdM token

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Using the dashboard owner IdM token

    -
    - -

    WireCloud 0.7.2+ provides experimental support for using the OAuth2 token of the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Accessing third-party servicies using IdM tokens

    +

    Using the dashboard owner IdM token

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using the dashboard owner IdM token

    +
    +

    WireCloud 0.7.2+ provides experimental support for using the OAuth2 token of the owner of the dashboard instead of using the OAuth2 token of the current logged user. To do so, add the FIWARE-OAuth-Source header into your request and use the workspaceowner value. This header can be used in combination with any of @@ -439,49 +306,34 @@

    Using the dashboard owner IdM token

    Example:

    MashupPlatform.http.makeRequest(url, {
         requestHeaders: {
    -        "FIWARE-OAuth-Token": "true",
    -        "FIWARE-OAuth-Header-Name": "X-Auth-Token",
    -        "FIWARE-OAuth-Source": "workspaceowner"
    +        "FIWARE-OAuth-Token": "true",
    +        "FIWARE-OAuth-Header-Name": "X-Auth-Token",
    +        "FIWARE-OAuth-Source": "workspaceowner"
         },
         ...
     });
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Deprecated header names

    -
    - -

    Version 0.9.0 and below of WireCloud uses another set of the header names. + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Deprecated header names

    +
    +

    Version 0.9.0 and below of WireCloud uses another set of the header names. They were prefixed with X- and had a dash inside the FIWARE word. For example, FIWARE-OAuth-Token was named X-FI-WARE-OAuth-Token. In addition, the header for indicating the body pattern was further restructured.

    @@ -512,180 +364,141 @@

    Deprecated header names

    Old names can still be used but will be removed in WireCloud 1.1

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/3.2.1_Using Orion Context Broker.html b/docs/slides/3.2.1_Using Orion Context Broker.html index aaa609f051..b188576e6a 100644 --- a/docs/slides/3.2.1_Using Orion Context Broker.html +++ b/docs/slides/3.2.1_Using Orion Context Broker.html @@ -1,4 +1,5 @@ + - - - - - Using Orion Context Broker - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Using Orion Context Broker

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    As part of the FIWARE work, WireCloud has integrated support for accessing + + + + +Using Orion Context Broker + + + + + + + + + +

    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    Introduction

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    +
    +

    As part of the FIWARE work, WireCloud has integrated support for accessing Orion Context Broker (reference implementation of the FIWARE's Pub/Sub Context Broker GE) instances from widgets/operators. In this tutorial we're going to learn how to use this support.

    - - - -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    Adding NGSI support to widgets and operators

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Adding NGSI support to widgets and operators

    -
    - -

    First of all, widgets and operators wishing to use the JavaScript bindings + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    Adding NGSI support to widgets and operators

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding NGSI support to widgets and operators

    +
    +

    First of all, widgets and operators wishing to use the JavaScript bindings provided by WireCloud for accessing the FIWARE NGSI Open RESTful API in order to seamlessly interoperate with the Orion Context Broker must add the NGSI feature as a requirement into their description files (config.xml files).

    - - - -
    -
    - -
    -
    - - - -
    -

    Adding NGSI support to widgets and operators

    -
    - -

    Using the XML description format

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding NGSI support to widgets and operators

    +
    +

    Using the XML description format

    The following is an example of a widget description using the XML flavour of the Mashable Application Component Description Language:

    -
    <?xml version='1.0' encoding='UTF-8'?>
    -<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="observation-reporter" version="1.0">
    +
    <?xml version='1.0' encoding='UTF-8'?>
    +<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="CoNWeT" name="observation-reporter" version="1.0">
       <details>
         <title>Observation Reporter</title>
         <authors>aarranz</authors>
    @@ -236,100 +164,85 @@ 

    Adding NGSI support to widgets and operators

    <doc>http://www.envirofi.eu/</doc> </details> <requirements> - <feature name="NGSI"/> + <feature name="NGSI"/> </requirements> <wiring/> - <contents src="index.html" contenttype="text/html" charset="utf-8" useplatformstyle="true"/> - <rendering height="20" width="5"/> + <contents src="index.html" contenttype="text/html" charset="utf-8" useplatformstyle="true"/> + <rendering height="20" width="5"/> </widget>
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding NGSI support to widgets and operators

    -
    - -

    Using the RDF description format

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding NGSI support to widgets and operators

    +
    +

    Using the RDF description format

    The RDF/xml flavour of the same widget description is:

    -
    <?xml version="1.0" encoding="utf-8"?>
    +
    <?xml version="1.0" encoding="utf-8"?>
     <rdf:RDF
    -  xmlns:foaf="http://xmlns.com/foaf/0.1/"
    -  xmlns:wire="http://wirecloud.conwet.fi.upm.es/ns/widget#"
    -  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    -  xmlns:usdl="http://www.linked-usdl.org/ns/usdl-core#"
    -  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    -  xmlns:ns1="http://purl.org/goodrelations/v1#"
    -  xmlns:dcterms="http://purl.org/dc/terms/"
    -  xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
    +  xmlns:foaf="http://xmlns.com/foaf/0.1/"
    +  xmlns:wire="http://wirecloud.conwet.fi.upm.es/ns/widget#"
    +  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    +  xmlns:usdl="http://www.linked-usdl.org/ns/usdl-core#"
    +  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    +  xmlns:ns1="http://purl.org/goodrelations/v1#"
    +  xmlns:dcterms="http://purl.org/dc/terms/"
    +  xmlns:vcard="http://www.w3.org/2006/vcard/ns#"
     >
    -  <wire:Widget rdf:about="http://wirecloud.conwet.fi.upm.es/ns/widget#CoNWeT/observation-reporter/1.0">
    +  <wire:Widget rdf:about="http://wirecloud.conwet.fi.upm.es/ns/widget#CoNWeT/observation-reporter/1.0">
         <vcard:addr>
    -      <vcard:Work rdf:nodeID="Nb17ce611aa2645e488515f86eb855e53">
    +      <vcard:Work rdf:nodeID="Nb17ce611aa2645e488515f86eb855e53">
             <vcard:email>aarranz@conwet.com</vcard:email>
           </vcard:Work>
         </vcard:addr>
         <usdl:utilizedResource>
    -      <usdl:Resource rdf:about="index.html">
    +      <usdl:Resource rdf:about="index.html">
             <wire:codeCacheable>True</wire:codeCacheable>
           </usdl:Resource>
         </usdl:utilizedResource>
         <wire:hasPlatformWiring>
    -      <wire:PlatformWiring rdf:nodeID="Neecb97db81ed40859b8c04e935a9a9cc"/>
    +      <wire:PlatformWiring rdf:nodeID="Neecb97db81ed40859b8c04e935a9a9cc"/>
         </wire:hasPlatformWiring>
         <wire:displayName>Observation Reporter</wire:displayName>
    -    <wire:hasiPhoneImageUri rdf:resource="images/smartphone.png"/>
    +    <wire:hasiPhoneImageUri rdf:resource="images/smartphone.png"/>
         <usdl:versionInfo>1.0</usdl:versionInfo>
         <usdl:hasProvider>
    -      <ns1:BusinessEntity rdf:nodeID="N9a6bf56577c741ac806997a80281afff">
    +      <ns1:BusinessEntity rdf:nodeID="N9a6bf56577c741ac806997a80281afff">
             <foaf:name>CoNWeT</foaf:name>
           </ns1:BusinessEntity>
         </usdl:hasProvider>
    -    <wire:hasImageUri rdf:resource="images/catalogue.png"/>
    +    <wire:hasImageUri rdf:resource="images/catalogue.png"/>
         <wire:hasPlatformRendering>
    -      <wire:PlatformRendering rdf:nodeID="N713e5ea11dce4750a592c754c748def7">
    +      <wire:PlatformRendering rdf:nodeID="N713e5ea11dce4750a592c754c748def7">
             <wire:renderingHeight>20</wire:renderingHeight>
             <wire:renderingWidth>5</wire:renderingWidth>
           </wire:PlatformRendering>
         </wire:hasPlatformRendering>
         <wire:hasRequirement>
    -      <wire:Feature rdf:nodeID="N3cb336bd9b6243ecbf345c80442498f9">
    +      <wire:Feature rdf:nodeID="N3cb336bd9b6243ecbf345c80442498f9">
             <rdfs:label>NGSI</rdfs:label>
           </wire:Feature>
         </wire:hasRequirement>
         <dcterms:title>observation-reporter</dcterms:title>
         <dcterms:description>Creates a new observation</dcterms:description>
         <dcterms:creator>
    -      <foaf:Person rdf:nodeID="Ndb72cb5a7f3844b29b72f304baaa14a7">
    +      <foaf:Person rdf:nodeID="Ndb72cb5a7f3844b29b72f304baaa14a7">
             <foaf:name>aarranz</foaf:name>
           </foaf:Person>
         </dcterms:creator>
    @@ -337,112 +250,71 @@ 

    Adding NGSI support to widgets and operators

    </rdf:RDF>
    - - - -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    Creating connections to NGSI Context Brokers

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Creating connections to NGSI Context Brokers

    -
    - -

    Before being able to make use of the NGSI API, you should create a Connection + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    Creating connections to NGSI Context Brokers

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating connections to NGSI Context Brokers

    +
    +

    Before being able to make use of the NGSI API, you should create a Connection with the NGSI Context Broker you're going to use. This can be accomplished with the following code:

    var ngsi_connection = new NGSI.Connection(ngsi_server[, options]);
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Creating connections to NGSI Context Brokers

    -
    - -

    See the NGSI javascript API documentation for the full list of supported options + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating connections to NGSI Context Brokers

    +
    +

    See the NGSI javascript API documentation for the full list of supported options but, as summary, the ngsi_proxy_url option is required for being able to create subscriptions handled by widgets/operators. Also, if you are connecting to a Orion Context Broker using the IdM authentication, you will need to pass the @@ -458,121 +330,79 @@

    Creating connections to NGSI Context Brokers

    this category). If you're worried about security, take into account that the OAuth2 token is injected in the request by the WireCloud's proxy
    - - - -
    -
    - -
    -
    - - - -
    -

    Creating connections to NGSI Context Brokers

    -
    - -

    This is an example of NGSI connection creation using the resources available at FIWARE Lab:

    -
    var ngsi_connection = new NGSI.Connection('http://orion.lab.fiware.org:1026', {
    +
    +
    +
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating connections to NGSI Context Brokers

    +
    +

    This is an example of NGSI connection creation using the resources available at FIWARE Lab:

    +
    var ngsi_connection = new NGSI.Connection('http://orion.lab.fiware.org:1026', {
         use_user_fiware_token: true,
    -    ngsi_proxy_url: 'https://ngsiproxy.lab.fiware.org'
    +    ngsi_proxy_url: 'https://ngsiproxy.lab.fiware.org'
     });
     
    -

    Once created the connection, you will be able to use the NGSI API bindings (in the example, through the ngsi_connection variable).

    - - - -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    Making queries

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    Queries are the most basic operations that can be executed in a Orion Context + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    Making queries

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    Queries are the most basic operations that can be executed in a Orion Context Broker. This operation can be accessed thought the query method of the connection object:

    var entityIdList = [
    -    {type: 'Van', id: '.*', isPattern: true}
    +    {type: 'Van', id: '.*', isPattern: true}
     ];
    -var attributeList = ['current_position'];
    +var attributeList = ['current_position'];
     var options = {
         flat: true,
         onSuccess: function (data) {
    @@ -583,84 +413,54 @@ 

    Making queries

    ngsi_connection.query(entityIdList, attributeList, options);
    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    The first parameter is the list of entities you're interested on. In our case, + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    The first parameter is the list of entities you're interested on. In our case, we're interested in all Van entities. This is accomplished using the isPattern option that allows us to use a regular expression that matches with any id.

    The second one is the list of attributes you're interested on. In our case, we're interested only in the current_position attribute. However, you can pass null or an empty list to indicate that you are interested in all the attributes of the selected entities.

    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    Finally, all the methods supports a last parameter called options that should be + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    Finally, all the methods supports a last parameter called options that should be used to pass the callbacks and the extra options. Any method of NGSI.Connection support at least the following callbacks:

      @@ -668,42 +468,27 @@

      Making queries

    • onFailure is called when the request finish with errors
    • onComplete is called when the request finish regardless of whether the request is successful or not
    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    The query method also supports other extra options. The flat options is used for simplifying the data structure used for representing the returned data. This simplification relies in making the following assumptions about the returned entry set:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    The query method also supports other extra options. The flat options is used for simplifying the data structure used for representing the returned data. This simplification relies in making the following assumptions about the returned entry set:

    • given an entity id there is only one value for the entity's type parameter
    • entities doesn't have attributes called id or type
    • @@ -711,198 +496,153 @@

      Making queries

    • attribute types don't matter or are already known
    • attribute metadata don't matter or is already known
    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    For example, this is the value of the data parameter passed to the onSuccess callback when using the flat option:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    For example, this is the value of the data parameter passed to the onSuccess callback when using the flat option:

     {
    -    "van1": {
    -        "id": "van1",
    -        "type": "Van",
    -        "current_position": "43.47557, -3.8048315"
    +    "van1": {
    +        "id": "van1",
    +        "type": "Van",
    +        "current_position": "43.47557, -3.8048315"
         },
    -    "van2": {
    -        "id": "van2",
    -        "type": "Van",
    -        "current_position": "43.47258, -3.8026643"
    +    "van2": {
    +        "id": "van2",
    +        "type": "Van",
    +        "current_position": "43.47258, -3.8026643"
         },
    -    "van3": {
    -        "id": "van3",
    -        "type": "Van",
    -        "current_position": "43.47866, -3.7991238"
    +    "van3": {
    +        "id": "van3",
    +        "type": "Van",
    +        "current_position": "43.47866, -3.7991238"
         },
    -    "van4": {
    -        "id": "van4",
    -        "type": "Van",
    -        "current_position": "43.471214, -3.7994885"
    +    "van4": {
    +        "id": "van4",
    +        "type": "Van",
    +        "current_position": "43.471214, -3.7994885"
         }
     }
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    Whereas this is the value of the data parameter when flat is false (default value):

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    Whereas this is the value of the data parameter when flat is false (default value):

     [
         {
    -        "entity": {
    -            "id": "van1",
    -            "type": "Van"
    +        "entity": {
    +            "id": "van1",
    +            "type": "Van"
             },
    -        "attributes": [
    +        "attributes": [
                 {
    -                "name": "current_position",
    -                "type": "coordinates",
    -                "contextValue": "43.47557, -3.8048315",
    -                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
    +                "name": "current_position",
    +                "type": "coordinates",
    +                "contextValue": "43.47557, -3.8048315",
    +                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
                 }
             ]
         },
         {
    -        "entity": {
    -            "id": "van2",
    -            "type": "Van"
    +        "entity": {
    +            "id": "van2",
    +            "type": "Van"
             },
    -        "attributes": [
    +        "attributes": [
                 {
    -                "name": "current_position",
    -                "type": "coordinates",
    -                "contextValue": "43.47258, -3.8026643",
    -                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
    +                "name": "current_position",
    +                "type": "coordinates",
    +                "contextValue": "43.47258, -3.8026643",
    +                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
                 }
             ]
         },
         {
    -        "entity": {
    -            "id": "van3",
    -            "type": "Van"
    +        "entity": {
    +            "id": "van3",
    +            "type": "Van"
             },
    -        "attributes": [
    +        "attributes": [
                 {
    -                "name": "current_position",
    -                "type": "coordinates",
    -                "contextValue": "43.47866, -3.7991238",
    -                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
    +                "name": "current_position",
    +                "type": "coordinates",
    +                "contextValue": "43.47866, -3.7991238",
    +                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
                 }
             ]
         },
         {
    -        "entity": {
    -            "id": "van4",
    -            "type": "Van"
    +        "entity": {
    +            "id": "van4",
    +            "type": "Van"
             },
    -        "attributes": [
    +        "attributes": [
                 {
    -                "name": "current_position",
    -                "type": "coordinates",
    -                "contextValue": "43.471214, -3.7994885",
    -                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
    +                "name": "current_position",
    +                "type": "coordinates",
    +                "contextValue": "43.471214, -3.7994885",
    +                "metadata": [{name: 'location', type: 'string', value: 'WGS84'}]
                 }
             ]
         }
     ]
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    Pagination

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    Pagination

    In addition to the flat option. The query method also support other options related to the pagination support found on Orion 0.14.0 and newer. These options are the limit, offset and details options. For example, the following code can @@ -917,42 +657,27 @@

    Making queries

    ngsi_connection.query(entityIdList, attributeList, options);
    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    Pagination

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    Pagination

    While this code will request the second page:

    var options = {
         flat: true,
    @@ -965,42 +690,27 @@ 

    Making queries

    ngsi_connection.query(entityIdList, attributeList, options);
    - - - -
    -
    - -
    -
    - - - -
    -

    Making queries

    -
    - -

    Pagination

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Making queries

    +
    +

    Pagination

    You can get the total number of matches using the details option:

    var options = {
         flat: true,
    @@ -1015,71 +725,45 @@ 

    Making queries

    ngsi_connection.query(entityIdList, attributeList, options);
    - - - -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    Creating subscriptions

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Creating subscriptions

    -
    - -

    One of the most important operations provided by the context broker is the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    Creating subscriptions

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating subscriptions

    +
    +

    One of the most important operations provided by the context broker is the support for creating subscriptions, in this way our system can obtain "real time" notifications about the status of the entities of our system. Subscriptions are very similar to queries, the main difference between queries @@ -1089,51 +773,36 @@

    Creating subscriptions

    that there is no gap between the current values and their notified changes.

    Both widgets and operators can create subscriptions through the createSubscription method.

    - - - -
    -
    - -
    -
    - - - -
    -

    Creating subscriptions

    -
    - -

    The following example explains how to be notified about the changes of the position of the vans:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating subscriptions

    +
    +

    The following example explains how to be notified about the changes of the position of the vans:

    var entityIdList = [
    -    {type: 'Van', id: '.*', isPattern: true}
    +    {type: 'Van', id: '.*', isPattern: true}
     ];
     var attributeList = null;
    -var duration = 'PT3H';
    +var duration = 'PT3H';
     var throttling = null;
     var notifyConditions = [{
    -    type: 'ONCHANGE',
    -    condValues: ['current_position']
    +    type: 'ONCHANGE',
    +    condValues: ['current_position']
     }];
     var options = {
         flat: true,
    @@ -1147,42 +816,27 @@ 

    Creating subscriptions

    ngsi_connection.createSubscription(entityIdList, attributeList, duration, throttling, notifyConditions, options);
    - - - -
    -
    - -
    -
    - - - -
    -

    Creating subscriptions

    -
    - -

    In the previous example, this call to createSubscription will make the context broker + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating subscriptions

    +
    +

    In the previous example, this call to createSubscription will make the context broker call the onNotify function each time the current_position attribute of the entities of type Van is changed. You must take into account that the Orion Context Broker evaluates patterns at runtime, so using patterns you will be able @@ -1195,284 +849,198 @@

    Creating subscriptions

    making the context broker release any info about the subscription. In any case, WireCloud will cancel any subscription automatically when widgets/operators are unloaded.

    - - - -
    -
    - -
    -
    - - - -
    -

    Creating subscriptions

    -
    - -

    As with the query operations, you can make use of the flat option when creating + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating subscriptions

    +
    +

    As with the query operations, you can make use of the flat option when creating subscriptions. The assumptions made by the createSubscription method will be the same that the ones used by the query method, the only thing that changes is that this affects to the parameter passed to the notification callback instead to the success callback.

    - - - -
    -
    - -
    -
    - - - -
    -

    Creating subscriptions

    -
    - -

    As example, this is the value of the data parameter passed to + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating subscriptions

    +
    +

    As example, this is the value of the data parameter passed to the onNotify callback when using the flat option:

    {
    -    "elements": {
    -        "van2": {
    -            "id": "van2",
    -            "type": "Van",
    -            "current_position": "43.47258, -3.8026643"
    +    "elements": {
    +        "van2": {
    +            "id": "van2",
    +            "type": "Van",
    +            "current_position": "43.47258, -3.8026643"
             },
    -        "van4": {
    -            "id": "van4",
    -            "type": "Van",
    -            "current_position": "43.471214, -3.7994885"
    +        "van4": {
    +            "id": "van4",
    +            "type": "Van",
    +            "current_position": "43.471214, -3.7994885"
             }
         },
    -    "subscriptionId": "53708768286043030c116e2c",
    -    "originator": "localhost"
    +    "subscriptionId": "53708768286043030c116e2c",
    +    "originator": "localhost"
     }
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Creating subscriptions

    -
    - -

    Whereas this is the value of the data parameter when flat is false (default value):

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating subscriptions

    +
    +

    Whereas this is the value of the data parameter when flat is false (default value):

    {
    -    "elements": [
    +    "elements": [
             {
    -            "entity": {
    -                "id": "van2",
    -                "type": "Van"
    +            "entity": {
    +                "id": "van2",
    +                "type": "Van"
                 },
    -            "attributes": [
    +            "attributes": [
                     {
    -                    "name": "current_position",
    -                    "type": "coordinates",
    -                    "contextValue": "43.47258, -3.8026643"
    +                    "name": "current_position",
    +                    "type": "coordinates",
    +                    "contextValue": "43.47258, -3.8026643"
                     }
                 ]
             },
             {
    -            "entity": {
    -                "id": "van4",
    -                "type": "Van"
    +            "entity": {
    +                "id": "van4",
    +                "type": "Van"
                 },
    -            "attributes": [
    +            "attributes": [
                     {
    -                    "name": "current_position",
    -                    "type": "coordinates",
    -                    "contextValue": "43.471214, -3.7994885"
    +                    "name": "current_position",
    +                    "type": "coordinates",
    +                    "contextValue": "43.471214, -3.7994885"
                     }
                 ]
             }
         },
    -    "subscriptionId": "53708768286043030c116e2c",
    -    "originator": "localhost"
    +    "subscriptionId": "53708768286043030c116e2c",
    +    "originator": "localhost"
     }
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    Creating entities and updating their attributes

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Creating entities and updating their attributes

    -
    - -

    Widgets and operator can update entities using the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    Creating entities and updating their attributes

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating entities and updating their attributes

    +
    +

    Widgets and operator can update entities using the updateAttributes and addAttributes methods. The updateAttributes and addAttributes methods use the same format for their parameters, the main difference is that addAttribute method will create new attributes/entities if needed whereas updateAttributes will fail if the referred entities/attributes didn't exist.

    - - - -
    -
    - -
    -
    - - - -
    -

    Creating entities and updating their attributes

    -
    - -

    For example, the following code updates the attribute position of the van1 entity if it + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating entities and updating their attributes

    +
    +

    For example, the following code updates the attribute position of the van1 entity if it exists, or creates the attribute or the entity if one of them don't exist:

    ngsi_connection.addAttributes([{
    -        entity: {id: 'van1', type: 'Van'},
    +        entity: {id: 'van1', type: 'Van'},
             attributes: [
                 {
    -                type: 'string',
    -                name: 'current_position',
    +                type: 'string',
    +                name: 'current_position',
                     contextValue: coordinates
                 }
             ]
    @@ -1496,42 +1064,27 @@ 

    Creating entities and updating their attributes

    );
    - - - -
    -
    - -
    -
    - - - -
    -

    Creating entities and updating their attributes

    -
    - -

    The response_data parameter of the onSuccess callback is a summary of the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating entities and updating their attributes

    +
    +

    The response_data parameter of the onSuccess callback is a summary of the accepted changes as returned by the Orion Context Broker. This info can normally be ignored, as it will be very similar to the one provided to the updateAttributes/addAttribute methods when the request ends successfully. If @@ -1540,53 +1093,38 @@

    Creating entities and updating their attributes

    all the info about what changes were rejected. It's very important to take this into account as the onFailure callback won't be called for reporting unaccepted changes as they are treated individually by the Orion Context Broker.

    - - - -
    -
    - -
    -
    - - - -
    -

    Creating entities and updating their attributes

    -
    - -

    For example, if we execute the following code:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating entities and updating their attributes

    +
    +

    For example, if we execute the following code:

    ngsi_connection.updateAttributes([
             {
    -            'entity': {type: 'City', id: 'Madrid'},
    -            'attributes': [
    -                {name: 'position', type: 'coords', contextValue: '40.418889, -3.691944'}
    +            'entity': {type: 'City', id: 'Madrid'},
    +            'attributes': [
    +                {name: 'position', type: 'coords', contextValue: '40.418889, -3.691944'}
                 ]
             },
             {
    -            'entity': {type: 'Point', id: 'A'},
    -            'attributes': [
    -                {name: 'mobile_phone', type: 'string', contextValue: '0034223456789'}
    +            'entity': {type: 'Point', id: 'A'},
    +            'attributes': [
    +                {name: 'mobile_phone', type: 'string', contextValue: '0034223456789'}
                 ]
             }
         ],
    @@ -1594,181 +1132,125 @@ 

    Creating entities and updating their attributes

    );
    - - - -
    -
    - -
    -
    - - - -
    -

    Creating entities and updating their attributes

    -
    - -

    Giving the fact both Madrid and A entities exit but only the position attribute + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating entities and updating their attributes

    +
    +

    Giving the fact both Madrid and A entities exit but only the position attribute exists, the value of the accepted_changes will be:

    [
         {
    -        entity: {id: 'Madrid', type: 'City'},
    +        entity: {id: 'Madrid', type: 'City'},
             attributes: [
    -            {name: 'position', type: 'coords'}
    +            {name: 'position', type: 'coords'}
             ]
         }
     ]
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Creating entities and updating their attributes

    -
    - -

    Whereas the value of the unaccepted_changes parameters will be something similar to this:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Creating entities and updating their attributes

    +
    +

    Whereas the value of the unaccepted_changes parameters will be something similar to this:

    [
         {
    -        entity: {id: 'A', type: 'Point'},
    +        entity: {id: 'A', type: 'Point'},
             attributes: [
    -            {name: 'mobile_phone', type: 'string'}
    +            {name: 'mobile_phone', type: 'string'}
             ],
             statusCode: {
                 code: 472,
    -            reasonPhrase: 'request parameter is invalid/not allowed',
    -            details : 'action: UPDATE - entity: (A, Point) - offending attribute: mobile_phone'
    +            reasonPhrase: 'request parameter is invalid/not allowed',
    +            details : 'action: UPDATE - entity: (A, Point) - offending attribute: mobile_phone'
             }
         }
     ]
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    Using Orion's geolocation capabilities

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Using Orion's geolocation capabilities

    -
    - -

    The following code snippet shows an example of how to create a position + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    Using Orion's geolocation capabilities

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion's geolocation capabilities

    +
    +

    The following code snippet shows an example of how to create a position attribute indicating that it will be used for defining the location of the entity:

    ngsi_connection.addAttributes([
             {
    -            entity: {type: 'City', id: 'Madrid'},
    +            entity: {type: 'City', id: 'Madrid'},
                 attributes: [
                     {
    -                    name: 'position',
    -                    type: 'coords',
    -                    contextValue: '40.418889, -3.691944',
    +                    name: 'position',
    +                    type: 'coords',
    +                    contextValue: '40.418889, -3.691944',
                         metadata: [
    -                        {name: 'location', type: 'string', value: 'WGS84'}
    +                        {name: 'location', type: 'string', value: 'WGS84'}
                         ]
                     }
                 ]
    @@ -1778,56 +1260,41 @@ 

    Using Orion's geolocation capabilities

    );
    - - - -
    -
    - -
    -
    - - - -
    -

    Using Orion's geolocation capabilities

    -
    - -

    After which you can issue geo-located queries. For example:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion's geolocation capabilities

    +
    +

    After which you can issue geo-located queries. For example:

    connection.query([
    -        {type: 'City', id: '.*', isPattern: true}
    +        {type: 'City', id: '.*', isPattern: true}
         ],
         null,
         {
             restriction: {
                 scopes: [
                     {
    -                    type: "FIWARE_Location",
    +                    type: "FIWARE_Location",
                         value: {
                             circle: {
    -                            centerLatitude: "40.418889",
    -                            centerLongitude: "-3.691944",
    -                            radius: "14000"
    +                            centerLatitude: "40.418889",
    +                            centerLongitude: "-3.691944",
    +                            radius: "14000"
                             }
                         }
                     }
    @@ -1837,57 +1304,42 @@ 

    Using Orion's geolocation capabilities

    });
    - - - -
    -
    - -
    -
    - - - -
    -

    Using Orion's geolocation capabilities

    -
    - -

    Or:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion's geolocation capabilities

    +
    +

    Or:

    connection.query([
    -        {type: 'Point', id: '.*', isPattern: true}
    +        {type: 'Point', id: '.*', isPattern: true}
         ],
         null,
         {
             restriction: {
                 scopes: [
                     {
    -                    type : "FIWARE_Location",
    +                    type : "FIWARE_Location",
                         value : {
                             polygon: {
                                 vertices: [
    -                                { latitude: "0", longitude: "0" },
    -                                { latitude: "0", longitude: "6" },
    -                                { latitude: "6", longitude: "0" }
    +                                { latitude: "0", longitude: "0" },
    +                                { latitude: "0", longitude: "6" },
    +                                { latitude: "6", longitude: "0" }
                                 ],
                                 inverted: true
                             }
    @@ -1899,71 +1351,45 @@ 

    Using Orion's geolocation capabilities

    });
    - - - -
    -
    - -
    -
    - - -
    -

    Using Orion Context Broker

    -

    A Real Example

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    A Real Example

    -
    - -

    To check how NGSI works, an example using this feature is provided. If you want + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Orion Context Broker

    +

    A Real Example

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    A Real Example

    +
    +

    To check how NGSI works, an example using this feature is provided. If you want to see it running you have to upload the following mashup into WireCloud:

    • NGSI Example Mashup
    • @@ -1980,373 +1406,288 @@

      A Real Example

      Another source of examples is the OrionStarterKit offering available at the FIWARE Lab's Store containing all the generic widgets and operators related to the Orion Context Broker and several example mashups.

    - - - -
    -
    - -
    -
    - - - -
    -

    A Real Example

    -
    - -

    If everything is ok, you will see a map as the following one, with the location + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    A Real Example

    +
    +

    If everything is ok, you will see a map as the following one, with the location of some lampposts in the city of Santander.

    -

    - - - -
    + -
    -

    Presenter Notes

    -
    - -
    -
    - -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    - - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    + + +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/docs/slides/3.2.2_Using Object Storage.html b/docs/slides/3.2.2_Using Object Storage.html index 356d071ec1..82b93403c0 100644 --- a/docs/slides/3.2.2_Using Object Storage.html +++ b/docs/slides/3.2.2_Using Object Storage.html @@ -1,4 +1,5 @@ + - - - - - Using Object Storage - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Using Object Storage

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Introduction

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Introduction

    -
    - -

    Object Storage offers persistent storage for binary objects. Objects are stored in named locations known as containers. Containers can be nested thus objects can be stored hierarchically. The main aim of this section is to show an example that allows you to understand how to use this API.

    - - - -
    - - - - -
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Adding ObjectStorage support to widgets/operators

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding ObjectStorage support to widgets/operators

    +
    +

    If you want to use this feature, first of all you have to modify your config.xml file and add a new Feature named ObjectStorage within Requirements. For example, if you use XML to set up the configuration of your widget, your code should look similar to the following one. Note that we have also added a preference that will be useful to store the KeyStone server URL.

    +
    <?xml version='1.0' encoding='UTF-8'?>
    +<widget xmlns="http://wirecloud.conwet.fi.upm.es/ns/macdescription/1" vendor="Wirecloud" name="objectstorage-test-widget" version="1.0">
       <details>
         <title>Wirecloud Object Storage API test widget</title>
         <authors>aarranz</authors>
    @@ -192,53 +135,38 @@ 

    Adding ObjectStorage support to widgets/operators

    <doc>doc/index.html</doc> </details> <requirements> - <feature name="ObjectStorage"/> + <feature name="ObjectStorage"/> </requirements> <preferences> - <preference name="keystone_url" type="text" label="Keystone Server" description="Keystone Server where the Object Storage server to use for testing the integration between Wirecloud and the Object Storage GE is registered" default="https://cloud.lab.fiware.org/keystone"/> + <preference name="keystone_url" type="text" label="Keystone Server" description="Keystone Server where the Object Storage server to use for testing the integration between Wirecloud and the Object Storage GE is registered" default="https://cloud.lab.fiware.org/keystone"/> </preferences> <wiring/> - <contents src="test.html" contenttype="text/html" charset="utf-8" useplatformstyle="true"/> - <rendering height="24" width="6"/> + <contents src="test.html" contenttype="text/html" charset="utf-8" useplatformstyle="true"/> + <rendering height="24" width="6"/> </widget>
    - - - -
    -
    - -
    -
    - - - -
    -

    Adding ObjectStorage support to widgets/operators

    -
    - -

    In case you prefer to use RDF, your code should be similar to the following one:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Adding ObjectStorage support to widgets/operators

    +
    +

    In case you prefer to use RDF, your code should be similar to the following one:

    !
     <?xml version="1.0" encoding="utf-8"?>
     <rdf:RDF
    @@ -308,307 +236,196 @@ 

    Adding ObjectStorage support to widgets/operators

    </wire:Widget> </rdf:RDF>
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Connecting with the KeyStone Server

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Connecting with the KeyStone Server

    -
    - -

    To start using the ObjectStorage, first you have to set up the connection with the KeyStone server. To do so, you should create a new KeystoneAPI:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Connecting with the KeyStone Server

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Connecting with the KeyStone Server

    +
    +

    To start using the ObjectStorage, first you have to set up the connection with the KeyStone server. To do so, you should create a new KeystoneAPI:

    var keystone = new KeystoneAPI(url, options)
     
    -

    See the ObjectStorage Javascript API documentation for the full list of supported options but, as summary, the url is the ObjectStorage Server location. Also, if you are connecting to a ObjectStorage instance using the IdM authentication, you will need to pass the required authentication credentials. This can be accomplished in two ways:

    • Making use of the token option and passing directly the required Authentication header
    • Making use of the use_user_fiware_token option to make the ObjectStorage use the token obtained by WireCloud from the IdM
    - - - -
    -
    - -
    -
    - - - -
    -

    Connecting with the KeyStone Server

    -
    - -

    This example shows you how to connect with the KeyStone server using the resources available in the FIWARE Testbed. Note that the Keystone URL used is the one obtained from the preferences:

    -
    var keystone = new KeystoneAPI(MashupPlatform.prefs.get('keystone_url'), {
    +
    +
    +
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Connecting with the KeyStone Server

    +
    +

    This example shows you how to connect with the KeyStone server using the resources available in the FIWARE Testbed. Note that the Keystone URL used is the one obtained from the preferences:

    +
    var keystone = new KeystoneAPI(MashupPlatform.prefs.get('keystone_url'), {
         use_user_fiware_token: true
     });
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Getting all the available tenants for the users

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Getting all the available tenants for the users

    -
    - -

    Once that you are connected with the KeyStone server, you have to take into account is that a user can use several tenants to store the information. To get the list of available tenants for a user, you can use the getTenants function:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Getting all the available tenants for the users

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Getting all the available tenants for the users

    +
    +

    Once that you are connected with the KeyStone server, you have to take into account is that a user can use several tenants to store the information. To get the list of available tenants for a user, you can use the getTenants function:

    keystone.getTenants([options])
     
    -

    The options argument allows you to set two callbacks:

    • onSuccess is called when the request finishes successfully. This function will receive a dictionary with the field tenants that contains all the available tenants for the user that make the request
    • onFailure is called when the request finish with errors
    - - - -
    -
    - -
    -
    - - - -
    -

    Getting all the available tenants for the users

    -
    - -

    In the following example, we call the function with both callbacks. If the request finish successfully, we will show the id of the first available tenant. Otherwise, we will show a message error:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Getting all the available tenants for the users

    +
    +

    In the following example, we call the function with both callbacks. If the request finish successfully, we will show the id of the first available tenant. Otherwise, we will show a message error:

    keystone.getTenants({
         onSuccess: function(data) {
    -        document.getElementById('tenantId').textContent = data.tenants[0].id;
    +        document.getElementById('tenantId').textContent = data.tenants[0].id;
         },
         onFailure: function () {
    -        document.getElementById('tenantId').textContent = 'Fail';
    +        document.getElementById('tenantId').textContent = 'Fail';
         }
     });
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Getting the authentication token

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Getting the authentication token

    -
    - -

    When you have selected the tenant that you want to use, you must get an authentication token using the getAuthToken function:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Getting the authentication token

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Getting the authentication token

    +
    +

    When you have selected the tenant that you want to use, you must get an authentication token using the getAuthToken function:

    keystone.getAuthToken([options])
     
    -

    options argument include the following fields:

    • tenantName: name of the tenant to be associated to the generated token. Both @@ -626,197 +443,128 @@

      Getting the authentication token

    • onFailure: called when the request finish with errors
    - - - -
    -
    - -
    -
    - - - -
    -

    Getting the authentication token

    -
    - -

    The next snippet shows you how to use this function. In this case we will use the tenant id obtained in the previous code. Note that we will also process the data parameter in order to get the ObjectStorage URL:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Getting the authentication token

    +
    +

    The next snippet shows you how to use this function. In this case we will use the tenant id obtained in the previous code. Note that we will also process the data parameter in order to get the ObjectStorage URL:

    keystone.getAuthToken({
         tenantId: data.tenants[0].id,
         onSuccess: function (new_token, data) {
             for (i = 0; i < data.access.serviceCatalog.length; i++) {
    -            if (data.access.serviceCatalog[i].type === 'object-store') {
    +            if (data.access.serviceCatalog[i].type === 'object-store') {
                     object_storage = data.access.serviceCatalog[i].endpoints[0].publicURL;
                 }
             }
         },
         onFailure: function () {
    -        document.getElementById('api_token').textContent = 'Fail';
    +        document.getElementById('api_token').textContent = 'Fail';
         }
     });
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Connecting with the ObjectStorage Server

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Connecting with the ObjectStorage Server

    -
    - -

    Once that you have the URL of the ObjectStorage server, we can connect to it. To do so, we must use the following function:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Connecting with the ObjectStorage Server

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Connecting with the ObjectStorage Server

    +
    +

    Once that you have the URL of the ObjectStorage server, we can connect to it. To do so, we must use the following function:

    objectStorage = ObjectStorageAPI(url)
     
    -

    In our case we have saved the ObjectStorage Server URL in the object_storage variable, so our code should be the following one:

    objectStorage = ObjectStorageAPI(object_storage)
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Listing the content available in a container

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Listing the content available in a container

    -
    - -

    When we are connected to a ObjectStorage Server, we are able to list all the content available in a container. To do so, we should use the listContainer function:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Listing the content available in a container

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Listing the content available in a container

    +
    +

    When we are connected to a ObjectStorage Server, we are able to list all the content available in a container. To do so, we should use the listContainer function:

    objectStorage.listContainer(container[, options])
     
    -

    The container argument is the name of the container while the options argument should contain the following fields:

      @@ -825,125 +573,83 @@

      Listing the content available in a container

      receives as argument the list of available files in the container
    • onFailure: called when the request finish with errors
    - - - -
    -
    - -
    -
    - - - -
    -

    Listing the content available in a container

    -
    - -

    In the next example, we will show we will get the available files in the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Listing the content available in a container

    +
    +

    In the next example, we will show we will get the available files in the integrationTests container, and we will show the name of the first one.

    -
    objectStorage.listContainer('integrationTests', {
    +
    objectStorage.listContainer('integrationTests', {
         token: token,
     
         onSuccess: function(file_list) {
    -        document.getElementById('file_name').textContent = file_list[0].name;
    +        document.getElementById('file_name').textContent = file_list[0].name;
         },
     
         onFailure: function () {
    -        document.getElementById('file_count').textContent = 'Fail';
    +        document.getElementById('file_count').textContent = 'Fail';
         }
     });
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Uploading a file

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Uploading a file

    -
    - -

    If you are connected to the ObjectStorage, you can also upload a file easily. To + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Uploading a file

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Uploading a file

    +
    +

    If you are connected to the ObjectStorage, you can also upload a file easily. To do so, you must use the uploadFile function:

    objectStorage.uploadFile(container, file[, options])
     
    -

    container is the name where the file is going to be uploaded, while file is the content to be uploaded. The options argument should contain the following fields:

    @@ -954,124 +660,82 @@

    Uploading a file

    not receive any arguments
  • onFailure: called when the request finish with errors
  • - - - -
    -
    - -
    -
    - - - -
    -

    Uploading a file

    -
    - -

    Here you can see how to upload a text file containing "Hello world!".

    -
    var blob = new Blob(["Hello world!"], { type: "text/plain" });
    -objectStorage.uploadFile('integrationTests', blob, {
    +
    +
    +
    +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Uploading a file

    +
    +

    Here you can see how to upload a text file containing "Hello world!".

    +
    var blob = new Blob(["Hello world!"], { type: "text/plain" });
    +objectStorage.uploadFile('integrationTests', blob, {
         token: token,
    -    file_name: 'test1.txt',
    +    file_name: 'test1.txt',
         onSuccess: function() {
    -        document.getElementById('file_upload').textContent = 'OK';
    +        document.getElementById('file_upload').textContent = 'OK';
         },
         onFailure: function () {
    -        document.getElementById('file_upload').textContent = 'Fail';
    +        document.getElementById('file_upload').textContent = 'Fail';
         }
     });
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Deleting a file

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Deleting a file

    -
    - -

    It's useful to upload a file, but in some occasions you will want to delete it. + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Deleting a file

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Deleting a file

    +
    +

    It's useful to upload a file, but in some occasions you will want to delete it. To do so, you have to use the deleteFile function:

    objectStorage.deleteFile(container, file_name[, options])
     
    -

    container is the name of the container where the file is going to be deleted while file_name is the name of the file to delete. The options argument should contain the following fields:

    @@ -1081,384 +745,287 @@

    Deleting a file

    not receive any arguments
  • onFailure: called when the request finish with errors
  • - - - -
    -
    - -
    -
    - - - -
    -

    Deleting a file

    -
    - -

    The following example shows how to delete the file that we have created in the + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Deleting a file

    +
    +

    The following example shows how to delete the file that we have created in the previous step:

    -
    objectStorage.deleteFile('integrationTests', file_name, {
    +
    objectStorage.deleteFile('integrationTests', file_name, {
         token: token,
         onSuccess: function() {
    -        document.getElementById('file_deletion').textContent = 'OK';
    +        document.getElementById('file_deletion').textContent = 'OK';
         },
         onFailure: function () {
    -        document.getElementById('file_deletion').textContent = 'Fail';
    +        document.getElementById('file_deletion').textContent = 'Fail';
         }
     });
     
    - - - -
    -
    - -
    -
    - - -
    -

    Using Object Storage

    -

    Test it yourself!

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Test it yourself!

    -
    - -

    We think that the best way to learn to use this feature is using it. For this + + + +

    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Using Object Storage

    +

    Test it yourself!

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Test it yourself!

    +
    +

    We think that the best way to learn to use this feature is using it. For this reason we offer you a very simple example based on this guide. Check the code and modify as you like and test if it works. This widget will only work if you create a instanceTests container before running it, otherwise it will fail.

    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    + + +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    + + + + + + \ No newline at end of file diff --git a/docs/slides/3.4_Developer exercises.html b/docs/slides/3.4_Developer exercises.html index 4b58ccd40b..f645b3befa 100644 --- a/docs/slides/3.4_Developer exercises.html +++ b/docs/slides/3.4_Developer exercises.html @@ -1,4 +1,5 @@ + - - - - - WireCloud Developer Exercises - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    WireCloud Developer Exercises

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Outline

    -
    - -
      + + + + +WireCloud Developer Exercises + + + + + + + + + +
      +
      +
      +
      +
      +
      +
      +
      +

      WireCloud Developer Exercises

      Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

      +Image can not be loaded. + + + + +
      +

      Presenter Notes

      +
      +
      +
      +
      +
      +
      +
      +
      +

      Outline

      +
      +
      • WC-D-1. Complete the quick start tutorial
      • WC-D-2. Read all the basic developers tutorials available on the FIWARE’s Academy
      • WC-D-3. Customised PoI metadata
      • WC-D-4. Creating an offering on the Store
      - - - -
      -
      - -
      -
      - - - -
      Easy
      - -
      -

      WC-D-1. Complete the quick start tutorial

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Easy
      +
      +

      WC-D-1. Complete the quick start tutorial

      +
      +
      • Prerequisites

          @@ -145,44 +109,28 @@

          WC-D-1. Complete the quick start tutorial

      - - - -
      -
      - -
      -
      - - - -
      Easy
      - -
      -

      WC-D-2. Read all the basic developers tutorials available on the FIWARE’s Academy

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Easy
      +
      +

      WC-D-2. Read all the basic developers tutorials available on the FIWARE’s Academy

      +
      +
      • Steps

          @@ -191,44 +139,28 @@

          WC-D-2. Read all the basic developers tutorials available on the FIWARE’s

      - - - -
      -
      - -
      -
      - - - -
      Medium
      - -
      -

      WC-D-3. Customised PoI metadata

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Medium
      +
      +

      WC-D-3. Customised PoI metadata

      +
      +
      • Prerequisites

          @@ -249,44 +181,28 @@

          WC-D-3. Customised PoI metadata

      - - - -
      -
      - -
      -
      - - - -
      Medium
      - -
      -

      WC-D-4. Creating an offering on the Store (1/2)

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Medium
      +
      +

      WC-D-4. Creating an offering on the Store (1/2)

      +
      +
      • Prerequisites

          @@ -310,44 +226,28 @@

          WC-D-4. Creating an offering on the Store (1/2)

      - - - -
      -
      - -
      -
      - - - -
      Medium
      - -
      -

      WC-D-4. Creating an offering on the store (2/2)

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Medium
      +
      +

      WC-D-4. Creating an offering on the store (2/2)

      +
      +
      • Hints

          @@ -360,160 +260,125 @@

          WC-D-4. Creating an offering on the store (2/2)

      - - - -
      -
      - -
      -
      - -
      Thanks!
      - - - - - -
      -

      Presenter Notes

      -
      - -
      -
      -
      -
      - -
      -
      - - - - - - + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/4.2_Internationalisation.html b/docs/slides/4.2_Internationalisation.html index 54976486cc..46aede6f3d 100644 --- a/docs/slides/4.2_Internationalisation.html +++ b/docs/slides/4.2_Internationalisation.html @@ -1,4 +1,5 @@ + - - - - - Translating WireCloud - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    Translating WireCloud

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - -
    -

    Translating WireCloud

    -

    Translating WireCloud

    -
    - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Translating WireCloud

    -
    - -

    You need to download WireCloud's source code from the github repository:

    + + + + +Translating WireCloud + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating WireCloud

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    +Image can not be loaded. + + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating WireCloud

    +

    Translating WireCloud

    +
    + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating WireCloud

    +
    +

    You need to download WireCloud's source code from the github repository:

    $ git clone https://github.com/Wirecloud/wirecloud.git
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating WireCloud

    -
    - -

    Next step is creating or updating the catalogue of messages to translate, this can be accomplished with the following commands:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating WireCloud

    +
    +

    Next step is creating or updating the catalogue of messages to translate, this can be accomplished with the following commands:

    $ cd <wirecloud_repo_path>/src
     $ cd <module>
     $ django-admin.py makemessages -l <locale>
     $ django-admin.py makemessages -l <locale> -d djangojs
     
    -

    Where:

    • wirecloud_repo_path is the path where the working copy of the WireCloud's git repository has been downloaded
    • @@ -171,236 +124,172 @@

      Translating WireCloud

    • locale is the locale of the messages files that are going to be created/updated. e.g. "es_MX" for Mexican Spanish, "de" for German, ...
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating WireCloud

    -
    - -

    You will be able to edit the django.po and djangojs.po files located at wirecloud_repo_path>/<module>/locale/<locale>/LC_MESSAGES/, after running the command of the previous slide. Those files can be edited manually or any generic PO file editor.

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating WireCloud

    +
    +

    You will be able to edit the django.po and djangojs.po files located at wirecloud_repo_path>/<module>/locale/<locale>/LC_MESSAGES/, after running the command of the previous slide. Those files can be edited manually or any generic PO file editor.

    Once you feel comfortable with your translated message catalogue, you can compile it for testing purporses by running the following code (for each module):

    $ cd <wirecloud_repo_path>/src
     $ cd <module>
     $ django-admin.py compilemessages
     
    - - - -
    -
    - -
    -
    - - - -
    -

    Translating WireCloud

    -
    - -

    After compiling messages, you can test it by running WireCloud. As we're developing, the recommended way is by executing the runserver command:

    + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    +

    Translating WireCloud

    +
    +

    After compiling messages, you can test it by running WireCloud. As we're developing, the recommended way is by executing the runserver command:

    $ python manage.py runserver --insecure
     
    - - - -
    -
    - -
    -
    - -
    Thanks!
    - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - - - - + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/4.4_Administrator exercises.html b/docs/slides/4.4_Administrator exercises.html index 9b79e87d6e..3e217c2e6e 100644 --- a/docs/slides/4.4_Administrator exercises.html +++ b/docs/slides/4.4_Administrator exercises.html @@ -1,4 +1,5 @@ + - - - - - WireCloud Administrator Exercises - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    - -
    -
    - - -

    WireCloud Administrator Exercises

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - - - -
    -

    Presenter Notes

    -
    - -
    -
    -
    -
    - -
    -
    - - - -
    -

    Outline

    -
    - -
      + + + + +WireCloud Administrator Exercises + + + + + + + + + +
      +
      +
      +
      +
      +
      +
      +
      +

      WireCloud Administrator Exercises

      Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

      +Image can not be loaded. + + + + +
      +

      Presenter Notes

      +
      +
      +
      +
      +
      +
      +
      +
      +

      Outline

      +
      +
      • WC-A-1. Install your own WireCloud instance
      • WC-A-2. Connect your instance to the FIWARE Lab’s account portal
      - - - -
      -
      - -
      -
      - - - -
      Easy
      - -
      -

      WC-A-1. Install your own WireCloud instance

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Easy
      +
      +

      WC-A-1. Install your own WireCloud instance

      +
      +
      • Prerequisites

          @@ -149,44 +113,28 @@

          WC-A-1. Install your own WireCloud instance

      - - - -
      -
      - -
      -
      - - - -
      Medium
      - -
      -

      WC-A-2. Connect your instance to the FIWARE Lab’s account portal

      -
      - -
        + + + +
        +

        Presenter Notes

        +
        +
        +
        +
      +
      +
      +
      +
      Medium
      +
      +

      WC-A-2. Connect your instance to the FIWARE Lab’s account portal

      +
      +
      • Prerequisites

          @@ -207,145 +155,113 @@

          WC-A-2. Connect your instance to the FIWARE Lab’s account portal

      - - - -
      -
      - -
      -
      - -
      Thanks!
      - - - - - -
      -

      Presenter Notes

      -
      - -
      -
      -
      -
      - -
      -
      - - - - - - + + + +
      +

      Presenter Notes

      +
      +
      +
      +
    +
    +
    +
    +
    Thanks!
    +Image can not be loaded. + + + +
    +

    Presenter Notes

    +
    +
    +
    +
    +
    +
    +
    + + + + \ No newline at end of file diff --git a/docs/slides/build.sh b/docs/slides/build.sh old mode 100755 new mode 100644 diff --git a/docs/slides/fiwaretheme/base.html b/docs/slides/fiwaretheme/base.html index a34917c826..4d29904fd0 100644 --- a/docs/slides/fiwaretheme/base.html +++ b/docs/slides/fiwaretheme/base.html @@ -1,4 +1,5 @@ + - - - - - {{ head_title }} - + + + + +{{ head_title }} + {% if embed %} - - {% else %} - - + + {% endif %} {% for css in user_css %} {% if embed %} - {% else %} - + {% endif %} {% endfor %} - + {% if embed %} {% else %} - + {% endif %} {% for js in user_js %} {% if embed %} @@ -63,41 +64,40 @@ {{ js.contents }} {% else %} - + {% endif %} {% endfor %} - - -
    -
    -
    -
    -
    -
    + + +
    +
    +
    +
    +
    +
    {% for slide in slides %}
    -
    +
    {% if 'cover' in slide.classes %}

    {{ head_title }}

    Application Mashup (WireCloud) course @ https://fiware-academy.readthedocs.io/

    - - - - - +Image can not be loaded. + + + {% elif 'section-title' in slide.classes %}
    -

    {{ head_title }}

    -

    {{ slide.header }}

    -
    +

    {{ head_title }}

    +

    {{ slide.header }}

    + {% elif 'back-cover' in slide.classes %}
    Thanks!
    - - - +Image can not be loaded. + + {% else %} {% if 'tutorialhard' in slide.classes %} @@ -125,91 +125,91 @@

    {{ slide.header }}

    {% endif %} {% if 'cover' not in slide.classes %} - - + + {% endif %} -
    -

    Presenter Notes

    -
    +
    +

    Presenter Notes

    +
    {% if slide.presenter_notes %} {{ slide.presenter_notes }} {% endif %}
    -
    -
    -
    +
    + +
    {% endfor %}
    -
    +
    {% if toc %} - + {% endif %} - - - + + + diff --git a/src/ci_scripts/conf_scripts/chrome-prepare.sh b/src/ci_scripts/conf_scripts/chrome-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/chromium-local-prepare.sh b/src/ci_scripts/conf_scripts/chromium-local-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/django2.0-prepip.sh b/src/ci_scripts/conf_scripts/django2.0-prepip.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/django2.1-prepip.sh b/src/ci_scripts/conf_scripts/django2.1-prepip.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/django2.2-prepip.sh b/src/ci_scripts/conf_scripts/django2.2-prepip.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/elasticsearch-prepare.sh b/src/ci_scripts/conf_scripts/elasticsearch-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/firefox-local-prepare.sh b/src/ci_scripts/conf_scripts/firefox-local-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/firefox-prepare.sh b/src/ci_scripts/conf_scripts/firefox-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/fiware-prepare.sh b/src/ci_scripts/conf_scripts/fiware-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/nobeautiful-prepip.sh b/src/ci_scripts/conf_scripts/nobeautiful-prepip.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/postgres-prepare.sh b/src/ci_scripts/conf_scripts/postgres-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/search-api-prepare.sh b/src/ci_scripts/conf_scripts/search-api-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/selenium-prepare.sh b/src/ci_scripts/conf_scripts/selenium-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/solr-prepare.sh b/src/ci_scripts/conf_scripts/solr-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/sqlite3-prepare.sh b/src/ci_scripts/conf_scripts/sqlite3-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/conf_scripts/unittest-prepare.sh b/src/ci_scripts/conf_scripts/unittest-prepare.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/travis.sh b/src/ci_scripts/travis.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/travis_after_success.sh b/src/ci_scripts/travis_after_success.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/travis_before_script.sh b/src/ci_scripts/travis_before_script.sh old mode 100755 new mode 100644 diff --git a/src/ci_scripts/travis_install.sh b/src/ci_scripts/travis_install.sh old mode 100755 new mode 100644 diff --git a/src/manage.py b/src/manage.py old mode 100755 new mode 100644 diff --git a/src/setup.py b/src/setup.py old mode 100755 new mode 100644 diff --git a/src/wirecloud/commons/conf/catalogue_project_template/manage.py b/src/wirecloud/commons/conf/catalogue_project_template/manage.py old mode 100755 new mode 100644 diff --git a/src/wirecloud/commons/conf/platform_project_template/manage.py b/src/wirecloud/commons/conf/platform_project_template/manage.py old mode 100755 new mode 100644 diff --git a/src/wirecloud/commons/static/tests/embedded_iframe.html b/src/wirecloud/commons/static/tests/embedded_iframe.html index 5220060649..c362be4a59 100644 --- a/src/wirecloud/commons/static/tests/embedded_iframe.html +++ b/src/wirecloud/commons/static/tests/embedded_iframe.html @@ -1,10 +1,11 @@ - + - - IFrame test - - -

    IFrame test

    - - + +IFrame test + + +

    IFrame test

    + + +
    \ No newline at end of file diff --git a/src/wirecloud/commons/templates/wirecloud/bootstrap.html b/src/wirecloud/commons/templates/wirecloud/bootstrap.html index 55eae9c46c..d20ba43666 100644 --- a/src/wirecloud/commons/templates/wirecloud/bootstrap.html +++ b/src/wirecloud/commons/templates/wirecloud/bootstrap.html @@ -12,8 +12,8 @@ ui: {} }; - - + + +{% load static from staticfiles %}{% for file in files %} {% endfor %} diff --git a/src/wirecloud/commons/test-data/src/context-inspector/context-inspector.html b/src/wirecloud/commons/test-data/src/context-inspector/context-inspector.html index 18a1e601af..5669c782d9 100644 --- a/src/wirecloud/commons/test-data/src/context-inspector/context-inspector.html +++ b/src/wirecloud/commons/test-data/src/context-inspector/context-inspector.html @@ -1,12 +1,13 @@ + - - - - Context Test - - - - - + + + +Context Test + + + + + diff --git a/src/wirecloud/commons/test-data/src/wirecloud-components-showcase/index.html b/src/wirecloud/commons/test-data/src/wirecloud-components-showcase/index.html index 81275effbf..f1235894fc 100644 --- a/src/wirecloud/commons/test-data/src/wirecloud-components-showcase/index.html +++ b/src/wirecloud/commons/test-data/src/wirecloud-components-showcase/index.html @@ -1,17 +1,16 @@ + - - - Styles - - - - - + + +Styles + + + - -
    + +
    diff --git a/src/wirecloud/defaulttheme/templates/400.html b/src/wirecloud/defaulttheme/templates/400.html index 9957478026..975f7b04c2 100644 --- a/src/wirecloud/defaulttheme/templates/400.html +++ b/src/wirecloud/defaulttheme/templates/400.html @@ -3,6 +3,6 @@ {% block path %}{% trans "error400" %}{% endblock %} {% block content %}

    {% block title %}{% trans "Error 400 - Bad request" %}{% endblock %}

    -

    {{ error_msg }}

    -

    {{ details }}

    +

    {{ error_msg }}

    +

    {{ details }}

    {% endblock %} diff --git a/src/wirecloud/defaulttheme/templates/401.html b/src/wirecloud/defaulttheme/templates/401.html index 63c719ba32..cc48f0934d 100644 --- a/src/wirecloud/defaulttheme/templates/401.html +++ b/src/wirecloud/defaulttheme/templates/401.html @@ -3,6 +3,6 @@ {% block path %}{% trans "error401" %}{% endblock %} {% block content %}

    {% block title %}{% trans "Error 401 - Unauthorized" %}{% endblock %}

    -

    {% blocktrans %}This server could not verify that you are authorized to access the document you requested ({{request_path}}). Either you supplied the wrong credentials (e.g., bad password), or your browser/application does not understand how to supply the credentials required.{% endblocktrans %}

    -

    {% trans "Authentication required" %}

    +

    {% blocktrans %}This server could not verify that you are authorized to access the document you requested ({{request_path}}). Either you supplied the wrong credentials (e.g., bad password), or your browser/application does not understand how to supply the credentials required.{% endblocktrans %}

    +

    {% trans "Authentication required" %}

    {% endblock %} diff --git a/src/wirecloud/defaulttheme/templates/500.html b/src/wirecloud/defaulttheme/templates/500.html index f1ba3eece5..d11343a887 100644 --- a/src/wirecloud/defaulttheme/templates/500.html +++ b/src/wirecloud/defaulttheme/templates/500.html @@ -3,5 +3,5 @@ {% block path %}{% block title %}{% trans "Error 500 - Internal Server Error" %}{% endblock %}{% endblock %} {% block content %}

    Sorry, but the requested page is unavailable due to a server hiccup.

    -

    Our engineers have been notified, so check back later.

    +

    Our engineers have been notified, so check back later.

    {% endblock %} diff --git a/src/wirecloud/defaulttheme/templates/registration/login.html b/src/wirecloud/defaulttheme/templates/registration/login.html index ed1b8b110a..10d9d82812 100644 --- a/src/wirecloud/defaulttheme/templates/registration/login.html +++ b/src/wirecloud/defaulttheme/templates/registration/login.html @@ -1,61 +1,52 @@ {% load compress i18n wirecloudtags %}{% load static from staticfiles %} - + - {% trans "WireCloud Platform - Sign in" %} - - +{% trans "WireCloud Platform - Sign in" %} + + {% compress css %} {% platform_css "index" %} {% endcompress %} - + - -
    +
    {% with wc_logo_id="123456"|make_list|random %}{% with wc_logo="images/logos/wc"|add:wc_logo_id|add:".png" %} - + Image can not be loaded. {% endwith %}{% endwith %}
    - - - -
    -
    - -
    + + +
    +
    {% if form.errors %}
    {% blocktrans %}

    Your username and password didn't match.

    Please try again.

    {% endblocktrans %}
    {% endif %} {% csrf_token %} - - -
    -
    -
    -
    -
    -
    - - -
    - -
    - - - - + + + {% endcompress %} - + {% compress js %} {% block core_scripts %} diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/views/base_plain.html b/src/wirecloud/defaulttheme/templates/wirecloud/views/base_plain.html index df674023c5..31d3e44f5d 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/views/base_plain.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/views/base_plain.html @@ -1,17 +1,16 @@ {% load compress i18n wirecloudtags %}{% load static from staticfiles %} - + + - {% block title %}{% trans "WireCloud Platform" %}{% endblock %} +{% block title %}{% trans "WireCloud Platform" %}{% endblock %} {% block meta %} - - - - - + + + + + {% endblock %} {% block basecss %} @@ -24,10 +23,10 @@ {% endblock %} {% block basejs %} - + {% compress js %} - - + + {% wirecloud_bootstrap "classic" %} {% extra_javascripts "classic" %} {% endcompress %} @@ -43,13 +42,12 @@ {% endblock %} - -
    - -
    WireCloud
    {% block path %}{% endblock %}
    -
    -
    +
    + +
    Image can not be loaded.
    {% block path %}{% endblock %}
    +
    +
    {% block content %} {% endblock %}
    diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/views/header.html b/src/wirecloud/defaulttheme/templates/wirecloud/views/header.html index 1eadae4061..25dce7ab03 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/views/header.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/views/header.html @@ -1,5 +1,5 @@ {% load wirecloudtags %}
    - -
    WireCloud
    + +
    Image can not be loaded.
    diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/widget_error.html b/src/wirecloud/defaulttheme/templates/wirecloud/widget_error.html index 8db77a46e9..251b384369 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/widget_error.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/widget_error.html @@ -1,10 +1,11 @@ {% load i18n %} + -

    {% block title %}{% trans "Error 400 - Bad request" %}{% endblock %}

    -

    {{ error_msg }}

    -

    {{ details }}

    +

    {% block title %}{% trans "Error 400 - Bad request" %}{% endblock %}

    +

    {{ error_msg }}

    +

    {{ details }}

    diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/wiring/behaviour_sidebar.html b/src/wirecloud/defaulttheme/templates/wirecloud/wiring/behaviour_sidebar.html index 189015228e..25fc6347e2 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/wiring/behaviour_sidebar.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/wiring/behaviour_sidebar.html @@ -1,13 +1,13 @@ {% load i18n %} - +
    -
    -
    - {% trans "Behaviours" %} -
    -
    -
    -
    - +
    +
    +{% trans "Behaviours" %} +
    +
    +
    +
    +
    diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/wiring/component_group.html b/src/wirecloud/defaulttheme/templates/wirecloud/wiring/component_group.html index 0e34e06c0a..13646251bc 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/wiring/component_group.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/wiring/component_group.html @@ -1,15 +1,15 @@ - -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/wiring/footer.html b/src/wirecloud/defaulttheme/templates/wirecloud/wiring/footer.html index 118725b916..219eb8fffb 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/wiring/footer.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/wiring/footer.html @@ -1,18 +1,18 @@ {% load i18n %} - + - {"class": "wiring-footer"} - - - - {% trans "Connections" %} +{"class": "wiring-footer"} + + + + {% trans "Connections" %} - - {% trans "Operators" %} + + {% trans "Operators" %} - - {% trans "Widgets" %} + + {% trans "Widgets" %} - + \ No newline at end of file diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/empty_tab_message.html b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/empty_tab_message.html index 3fb800a0fa..aeb3c0151d 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/empty_tab_message.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/empty_tab_message.html @@ -1,8 +1,8 @@ {% load i18n %} - +
    -

    {% trans "Hey! This tab is empty" %}

    -

    {% trans "Add some widgets using the add widget button () available on the top right part of the workspace view." %}

    -
    +

    {% trans "Hey! This tab is empty" %}

    +

    {% trans "Add some widgets using the add widget button () available on the top right part of the workspace view." %}

    +
    \ No newline at end of file diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/missing_widget.html b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/missing_widget.html index 387967297f..e934c820d2 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/missing_widget.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/missing_widget.html @@ -1,22 +1,21 @@ {% load i18n %} + - - - {% for file in style %} + + + {% for file in style %} {% endfor %} - - -
    -

    {% trans "Missing widget" %}

    + +
    +

    {% trans "Missing widget" %}

    {% trans "This widget is currently not available. Probably you or an administrator uninstalled it." %} {% blocktrans %}
    Suggestions:
    -
      -
    • Remove this widget from the dashboard
    • -
    • Reinstall the appropiated version of the widget
    • -
    • Install another version of the widget and use the Upgrade/Downgrade option
    • -
    {% endblocktrans %} +
      +
    • Remove this widget from the dashboard
    • +
    • Reinstall the appropiated version of the widget
    • +
    • Install another version of the widget and use the Upgrade/Downgrade option
    • +
    {% endblocktrans %}
    - - + diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/sharing_user.html b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/sharing_user.html index 9023f293ad..ec5ef5e820 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/sharing_user.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/sharing_user.html @@ -1,16 +1,16 @@ - -
    -
    - - - - -
    -
    -
    -
    -
    -
    -
    -
    + +
    +
    + + + + +
    +
    +
    +
    +
    +
    +
    +
    diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/visibility_option.html b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/visibility_option.html index 1fc2651f9b..99e3f75c2c 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/visibility_option.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/visibility_option.html @@ -1,10 +1,10 @@ - - + + diff --git a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/widget.html b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/widget.html index 3a47ce281e..6ff5717bec 100644 --- a/src/wirecloud/defaulttheme/templates/wirecloud/workspace/widget.html +++ b/src/wirecloud/defaulttheme/templates/wirecloud/workspace/widget.html @@ -1,7 +1,7 @@ - +
    -

    -
    - +

    +
    +
    diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/legal/legal_template.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/legal/legal_template.html index a90f8117cc..bf2abc8d3c 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/legal/legal_template.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/legal/legal_template.html @@ -2,6 +2,6 @@

    {% trans 'Legal Conditions' %}

    %(title)s

    %(description)s
    -
    +

    {% trans 'Clauses:' %}

      diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/main_resource_details.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/main_resource_details.html index 837c335948..ed54a1e2b1 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/main_resource_details.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/main_resource_details.html @@ -1,6 +1,4 @@ -{% load i18n %} - -

      {% trans 'Description' %}

      -
      - +{% load i18n %} +

      {% trans 'Description' %}

      +
      diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/price_component_template.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/price_component_template.html index c0a93d2176..3f5a41ca18 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/price_component_template.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/price_component_template.html @@ -1,7 +1,7 @@ {% load i18n %}
    • %(title)s -
        -
      • {% trans 'Description:' %} %(description)s
      • -
      • {% trans 'Value:' %} %(value)s %(currency)s %(unit)s
      • -
      +
        +
      • {% trans 'Description:' %} %(description)s
      • +
      • {% trans 'Value:' %} %(value)s %(currency)s %(unit)s
      • +
    • diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/pricing_template.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/pricing_template.html index 8b92a9f617..44e4cff268 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/pricing_template.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/pricing/pricing_template.html @@ -1,8 +1,8 @@ {% load i18n %}

      {% trans 'Price plan:' %}

        -
      • {% trans 'Title:' %} %(title)s
      • -
      • {% trans 'Description:' %} %(description)s
      • -
      • {% trans 'Components:' %}
        • -
        • {% trans 'Taxes:' %}
          • +
          • {% trans 'Title:' %} %(title)s
          • +
          • {% trans 'Description:' %} %(description)s
          • +
          • {% trans 'Components:' %}
            • +
            • {% trans 'Taxes:' %}
              diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource.html index 5adfc5eea5..fd5eff6f98 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource.html @@ -1,13 +1,12 @@ -{% load i18n %}
              -
              - - - - - -
              -
              - -
              -
              -
              +{% load i18n %}
              +
              + + + + + +
              +
              +
              +
              +
              diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource_details.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource_details.html index de1d5331f3..3e48f72151 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource_details.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/resource_details.html @@ -1,33 +1,26 @@ -{% load i18n %} +{% load i18n %} - - {"class": "resource_details"} - - -
              -
              - - - -
              -
              {% trans 'Store' %}
              -
              -
              {% trans 'Owner' %}
              -
              -
              {% trans 'Version' %}
              -
              -
              {% trans 'Publication date' %}
              -
              -
              -
              -
              - - - - {"class": "description_column"} - - - - +{"class": "resource_details"} + +
              +
              + + +
              +
              {% trans 'Store' %}
              +
              +
              {% trans 'Owner' %}
              +
              +
              {% trans 'Version' %}
              +
              +
              {% trans 'Publication date' %}
              +
              +
              +
              +
              + +{"class": "description_column"} + +
              diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/search_interface.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/search_interface.html index b3abf4bc59..cc44622fd0 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/search_interface.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/search_interface.html @@ -1,27 +1,21 @@ {% load i18n %} - + - - - {"class": "search_bar"} - -

              {% trans "Filtering" %}

              - -
              - - -
              - -
              - - -
              - -
              - - - - - + +{"class": "search_bar"} +

              {% trans "Filtering" %}

              + +
              + + +
              +
              + + +
              +
              + + +
              diff --git a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/sla/sla_expresion_template.html b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/sla/sla_expresion_template.html index 9a7baa9933..a23f873a25 100644 --- a/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/sla/sla_expresion_template.html +++ b/src/wirecloud/fiware/templates/wirecloud/fiware/marketplace/sla/sla_expresion_template.html @@ -1,5 +1,5 @@ {% load i18n %}
            • %(title)s: %(description)s

              {% trans "Expresion variables" %}

              -
                +
                • diff --git a/src/wirecloud/fiware/tests/test-data/src/ngsi-test-widget/test.html b/src/wirecloud/fiware/tests/test-data/src/ngsi-test-widget/test.html index d0c9179f9f..e3f8d421a4 100644 --- a/src/wirecloud/fiware/tests/test-data/src/ngsi-test-widget/test.html +++ b/src/wirecloud/fiware/tests/test-data/src/ngsi-test-widget/test.html @@ -1,15 +1,16 @@ + - - - Test - - - -
                  API Available:
                  -
                  create registration:
                  -
                  add attributes:
                  -
                  update attributes:
                  -
                  cancel registration:
                  - + + +Test + + + +
                  API Available:
                  +
                  create registration:
                  +
                  add attributes:
                  +
                  update attributes:
                  +
                  cancel registration:
                  + diff --git a/src/wirecloud/fiware/tests/test-data/src/objectstorage-test-widget/test.html b/src/wirecloud/fiware/tests/test-data/src/objectstorage-test-widget/test.html index 226a853523..b1498275fc 100644 --- a/src/wirecloud/fiware/tests/test-data/src/objectstorage-test-widget/test.html +++ b/src/wirecloud/fiware/tests/test-data/src/objectstorage-test-widget/test.html @@ -1,17 +1,18 @@ + - - - Test - - - -
                  API Available:
                  -
                  Tenant Id:
                  -
                  API Token:
                  -
                  integrationTests container file count:
                  -
                  file name (used to upload the test file):
                  -
                  test file upload:
                  -
                  test file deletion:
                  - + + +Test + + + +
                  API Available:
                  +
                  Tenant Id:
                  +
                  API Token:
                  +
                  integrationTests container file count:
                  +
                  file name (used to upload the test file):
                  +
                  test file upload:
                  +
                  test file deletion:
                  + diff --git a/src/wirecloud/fiwarelabtheme/templates/wirecloud/user_menu.html b/src/wirecloud/fiwarelabtheme/templates/wirecloud/user_menu.html index a93feb894b..5fb488de8d 100644 --- a/src/wirecloud/fiwarelabtheme/templates/wirecloud/user_menu.html +++ b/src/wirecloud/fiwarelabtheme/templates/wirecloud/user_menu.html @@ -1,3 +1,3 @@ - - + + diff --git a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/base_plain.html b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/base_plain.html index 36910c4df8..3876f2c051 100644 --- a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/base_plain.html +++ b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/base_plain.html @@ -1,17 +1,16 @@ {% load compress i18n wirecloudtags %}{% load static from staticfiles %} - + + - {% block title %}{% trans "WireCloud Platform" %}{% endblock %} +{% block title %}{% trans "WireCloud Platform" %}{% endblock %} {% block meta %} - - - - - + + + + + {% endblock %} {% block basecss %} @@ -24,10 +23,10 @@ {% endblock %} {% block basejs %} - + {% compress js %} - - + + {% wirecloud_bootstrap "classic" %} {% extra_javascripts "classic" %} {% endcompress %} @@ -43,13 +42,12 @@ {% endblock %} - -
                  +
                  {% include "wirecloud/views/header_common.html" %} -
                  {% block path %}{% endblock %}
                  -
                  -
                  +
                  {% block path %}{% endblock %}
                  +
                  +
                  {% block content %} {% endblock %}
                  diff --git a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/footer.html b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/footer.html index 57b5a8c662..1761bfe4dc 100644 --- a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/footer.html +++ b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/footer.html @@ -1,9 +1,9 @@ {% if FIWARE_OFFICIAL_PORTAL %} {% endif %} diff --git a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header.html b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header.html index 5b9606db92..c0292d8c46 100644 --- a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header.html +++ b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header.html @@ -3,6 +3,5 @@ {% include "wirecloud/views/header_common.html" %} -
                  - +
                  diff --git a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header_common.html b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header_common.html index b4bae201c8..9938b4c13b 100644 --- a/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header_common.html +++ b/src/wirecloud/fiwarelabtheme/templates/wirecloud/views/header_common.html @@ -1,28 +1,28 @@ {% load wirecloudtags %} diff --git a/src/wirecloud/fiwaretheme/templates/wirecloud/signin.html b/src/wirecloud/fiwaretheme/templates/wirecloud/signin.html index 69056c3ec8..b437b78e52 100644 --- a/src/wirecloud/fiwaretheme/templates/wirecloud/signin.html +++ b/src/wirecloud/fiwaretheme/templates/wirecloud/signin.html @@ -1,4 +1,4 @@ {% load i18n %} - - + + diff --git a/src/wirecloud/fiwaretheme/templates/wirecloud/views/base_plain.html b/src/wirecloud/fiwaretheme/templates/wirecloud/views/base_plain.html index bc7f697889..ae76334185 100644 --- a/src/wirecloud/fiwaretheme/templates/wirecloud/views/base_plain.html +++ b/src/wirecloud/fiwaretheme/templates/wirecloud/views/base_plain.html @@ -1,14 +1,13 @@ {% load compress i18n wirecloudtags %}{% load static from staticfiles %} - + + - {% block title %}{% trans "WireCloud Platform" %}{% endblock %} +{% block title %}{% trans "WireCloud Platform" %}{% endblock %} {% block meta %} - - + + {% endblock %} {% block basecss %} @@ -21,10 +20,10 @@ {% endblock %} {% block basejs %} - + {% compress js %} - - + + {% wirecloud_bootstrap "classic" %} {% extra_javascripts "classic" %} {% endcompress %} @@ -40,26 +39,21 @@ {% endblock %} - -
                  - - -
                  - WireCloud -
                  -
                  -

                  FIWARE

                  -

                  WireCloud Mashup Platform

                  -
                  -
                  -
                  - -
                  {% block path %}{% endblock %}
                  - -
                  - -
                  +
                  + +
                  +Image can not be loaded. +
                  +
                  +

                  FIWARE

                  +

                  WireCloud Mashup Platform

                  +
                  +
                  +
                  +
                  {% block path %}{% endblock %}
                  +
                  +
                  {% block content %} {% endblock %}
                  diff --git a/src/wirecloud/fiwaretheme/templates/wirecloud/views/header.html b/src/wirecloud/fiwaretheme/templates/wirecloud/views/header.html index 9e97fa1601..fcd5cf9a36 100644 --- a/src/wirecloud/fiwaretheme/templates/wirecloud/views/header.html +++ b/src/wirecloud/fiwaretheme/templates/wirecloud/views/header.html @@ -1,15 +1,12 @@ {% load wirecloudtags %}
                  - - -
                  - WireCloud -
                  -

                  FIWARE

                  -

                  WireCloud Mashup Platform

                  -
                  -
                  - -
                  - + +
                  +Image can not be loaded. +
                  +

                  FIWARE

                  +

                  WireCloud Mashup Platform

                  +
                  +
                  +
                  diff --git a/src/wirecloud/guidebuilder/test-data/responses/repository/CoNWeT/.service8.rdf.swp b/src/wirecloud/guidebuilder/test-data/responses/repository/CoNWeT/.service8.rdf.swp deleted file mode 100644 index face2db666..0000000000 Binary files a/src/wirecloud/guidebuilder/test-data/responses/repository/CoNWeT/.service8.rdf.swp and /dev/null differ diff --git a/src/wirecloud/oauth2provider/templates/wirecloud/oauth2provider/auth.html b/src/wirecloud/oauth2provider/templates/wirecloud/oauth2provider/auth.html index 3a61d773a5..e0a35ea3f8 100644 --- a/src/wirecloud/oauth2provider/templates/wirecloud/oauth2provider/auth.html +++ b/src/wirecloud/oauth2provider/templates/wirecloud/oauth2provider/auth.html @@ -2,21 +2,21 @@ {% load i18n %} {% block content %}
                  -
                  -
                  -

                  {% blocktrans with app_name=app.name %}Authorize {{ app_name }}?{% endblocktrans %}

                  -
                  -
                  +
                  +
                  +

                  {% blocktrans with app_name=app.name %}Authorize {{ app_name }}?{% endblocktrans %}

                  +
                  +
                  {% blocktrans with app_name=app.name username=request.user.username %}The app {{ app_name }} would like to be able to do the following actions in your name ({{ username }}):{% endblocktrans %}
                    -
                  • {% trans "Read your public and private information" %}
                  • -
                  • {% trans "Access and modify your workspaces" %}
                  • -
                  • {% trans "Manage your mashable application components" %}
                  • -
                  - - -
                  -
                  +
                • {% trans "Read your public and private information" %}
                • +
                • {% trans "Access and modify your workspaces" %}
                • +
                • {% trans "Manage your mashable application components" %}
                • + + + +
                  +
                  {% csrf_token %}
                  {% endblock %} diff --git a/src/wirecloud/platform/templates/wirecloud/operator_xhtml.html b/src/wirecloud/platform/templates/wirecloud/operator_xhtml.html index 7a42c29ae8..c2ca7ea844 100644 --- a/src/wirecloud/platform/templates/wirecloud/operator_xhtml.html +++ b/src/wirecloud/platform/templates/wirecloud/operator_xhtml.html @@ -1,9 +1,10 @@ + - - - {% for url in js_files %}{% endfor %} + + + {% for url in js_files %}{% endfor %} - - + + diff --git a/src/wirecloud/platform/widget/test-data/html-empty-expected.html b/src/wirecloud/platform/widget/test-data/html-empty-expected.html index 77ec466905..735b81f395 100644 --- a/src/wirecloud/platform/widget/test-data/html-empty-expected.html +++ b/src/wirecloud/platform/widget/test-data/html-empty-expected.html @@ -1 +1,2 @@ - + + diff --git a/src/wirecloud/platform/widget/test-data/html-unclosed-tags-expected.html b/src/wirecloud/platform/widget/test-data/html-unclosed-tags-expected.html index ba9f3bbfb1..e3cab9fe4e 100644 --- a/src/wirecloud/platform/widget/test-data/html-unclosed-tags-expected.html +++ b/src/wirecloud/platform/widget/test-data/html-unclosed-tags-expected.html @@ -1 +1,2 @@ -Test
                  + +Test
                  diff --git a/src/wirecloud/platform/widget/test-data/html-unclosed-tags-initial.html b/src/wirecloud/platform/widget/test-data/html-unclosed-tags-initial.html index 569a18dbf5..942da201f8 100644 --- a/src/wirecloud/platform/widget/test-data/html-unclosed-tags-initial.html +++ b/src/wirecloud/platform/widget/test-data/html-unclosed-tags-initial.html @@ -1,11 +1,9 @@ - - Test - - - - -
                  -
                  - + +Test + + + +
                  +
                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml-empty-expected.html b/src/wirecloud/platform/widget/test-data/xhtml-empty-expected.html index 4d6523b9cb..af7f8ceefc 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml-empty-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml-empty-expected.html @@ -1 +1 @@ - diff --git a/src/wirecloud/platform/widget/test-data/xhtml-unclosed-tags-initial.html b/src/wirecloud/platform/widget/test-data/xhtml-unclosed-tags-initial.html index 569a18dbf5..942da201f8 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml-unclosed-tags-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml-unclosed-tags-initial.html @@ -1,11 +1,9 @@ - - Test - - - - -
                  -
                  - + +Test + + + +
                  +
                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml1-expected.html b/src/wirecloud/platform/widget/test-data/xhtml1-expected.html index ba9f3bbfb1..e3cab9fe4e 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml1-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml1-expected.html @@ -1 +1,2 @@ -Test
                  + +Test
                  diff --git a/src/wirecloud/platform/widget/test-data/xhtml1-initial.html b/src/wirecloud/platform/widget/test-data/xhtml1-initial.html index bd84943aae..c279e60957 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml1-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml1-initial.html @@ -1,11 +1,10 @@ - - Test - - - - -
                  -
                  - + +Test + + + +
                  +
                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-expected.html b/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-expected.html index f3e80dc95d..8837488041 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-expected.html @@ -1 +1,2 @@ -Test

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  + +Test

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  diff --git a/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-initial.html b/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-initial.html index 84059d47a9..e576dca31a 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml1-iso8859-15-initial.html @@ -1,12 +1,11 @@ - - - Test - - - - -

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  -

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  - + + +Test + + + +

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  +

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml2-compressed-expected.html b/src/wirecloud/platform/widget/test-data/xhtml2-compressed-expected.html index 829143a9a2..f144b3e506 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml2-compressed-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml2-compressed-expected.html @@ -1 +1,2 @@ -
                  + +Test
                  diff --git a/src/wirecloud/platform/widget/test-data/xhtml2-expected.html b/src/wirecloud/platform/widget/test-data/xhtml2-expected.html index ad2f7a2115..20af9acf74 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml2-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml2-expected.html @@ -1 +1,2 @@ -
                  + +Test
                  diff --git a/src/wirecloud/platform/widget/test-data/xhtml2-initial.html b/src/wirecloud/platform/widget/test-data/xhtml2-initial.html index 0c892469e7..98640a545d 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml2-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml2-initial.html @@ -1,12 +1,12 @@ - - - Test - - - -
                  -
                  - + + +Test + + + +
                  +
                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-expected.html b/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-expected.html index 7227021ba2..dca4bf1968 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-expected.html @@ -1 +1,2 @@ -

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  + +Test

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  diff --git a/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-initial.html b/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-initial.html index 056c710265..55ae1f8e70 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml2-iso8859-15-initial.html @@ -1,13 +1,13 @@ - - - - Test - - - -

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  -

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  - + + + +Test + + + +

                  Spanish text using the ISO-8859-15 charset (please don't remove)

                  +

                  Este trozo de texto ha sido aadido para aadir caracteres especficos de la codificacin ISO-8859-15.

                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml3-expected.html b/src/wirecloud/platform/widget/test-data/xhtml3-expected.html index 6cb8f2d6f4..b35abf4464 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml3-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml3-expected.html @@ -1 +1 @@ -
                  diff --git a/src/wirecloud/platform/widget/test-data/xhtml3-initial.html b/src/wirecloud/platform/widget/test-data/xhtml3-initial.html index 4cbef94243..93e8f9218a 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml3-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml3-initial.html @@ -1,6 +1,6 @@ - -
                  -
                  - + +
                  +
                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml4-expected.html b/src/wirecloud/platform/widget/test-data/xhtml4-expected.html index bf056be211..bcf30ee6d3 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml4-expected.html +++ b/src/wirecloud/platform/widget/test-data/xhtml4-expected.html @@ -1 +1,2 @@ -Test
                  + +Test
                  diff --git a/src/wirecloud/platform/widget/test-data/xhtml4-extra-base-elements-initial.html b/src/wirecloud/platform/widget/test-data/xhtml4-extra-base-elements-initial.html index b951f2d6a0..ff7358a484 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml4-extra-base-elements-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml4-extra-base-elements-initial.html @@ -1,14 +1,13 @@ - - - Test - - - - - - -
                  -
                  - + + +Test + + + + + +
                  +
                  + diff --git a/src/wirecloud/platform/widget/test-data/xhtml4-initial.html b/src/wirecloud/platform/widget/test-data/xhtml4-initial.html index 782ec2188c..59344c866f 100644 --- a/src/wirecloud/platform/widget/test-data/xhtml4-initial.html +++ b/src/wirecloud/platform/widget/test-data/xhtml4-initial.html @@ -1,12 +1,11 @@ - - - Test - - - - -
                  -
                  - + + +Test + + + +
                  +
                  +