VM9 / orion-explorer-php-frame-work

A PHP 5 library Orion Context Broker services
MIT License
7 stars 2 forks source link

how to connect to another database in my orion Context broker? #8

Open sabrine2020 opened 8 years ago

sabrine2020 commented 8 years ago

Hello,

In orion-explorer it connects by default to the "orion" database. My entities are stored in another database: "orion-mydatabase", that was created based on the header "Fiware-Service: mydatabase"

show dbs local 0.03125GB orion 0.0625GB //the one orionExplorer connects to orion-mydatabase 0.0625GB

how can I using orionExlorer connect to another databases beside the default one? Tanks in advance for your help!

LeonanCarvalho commented 8 years ago

Hi!

The orionexplorer.com implements this framework, thats uses the Orion Context Broker to API to communicate and provide informations.

At this moment isn't possible connect at another database, but we are working on it #4, any help will be welcome.

How we connect to another database using the Orion Context Broker API?

sabrine2020 commented 8 years ago

It is based on the multiservice functionality: https://fiware-orion.readthedocs.org/en/develop/user/multitenancy/index.html

and it is done by adding in the REST request the following header : "Fiware-Service: service_name"

The entity information will be then stored on the mongo data base : "orion_service_name"

Best regards.

sabrine2020 commented 8 years ago

Another implemented feature is the Entity service paths: https://fiware-orion.readthedocs.org/en/develop/user/service_path/index.html

It is also can be added by adding a request header: "Fiware-ServicePath: /Madrid/Gardens/ParqueNorte/Parterre1"

Best regards.

LeonanCarvalho commented 8 years ago

On orionexplorer.com interface we don't have this configuration at moment, but if you're using our lib to build your application you can use the method setToken to append custom headers on request:

<?php 
$OrionAPI = new Orion\ContextBroker("localhost", 1024, "v1");
$OrionAPI->setToken("Fiware-Service","service_name");
$OrionAPI->setToken("Fiware-ServicePath",'/Madrid/Gardens/ParqueNorte/Parterre1');

(https://github.com/VM9/orion-explorer-php-frame-work/tree/master/examples)

At this moment it's the only way to use service based since is needed changes on user interface.

Best regards.

sabrine2020 commented 8 years ago

Thanks for your response but I am not using the lib code, I am only using the orionexplorer.com interface. Is there a fixed date for the release that contains the new features?

Best regards.