renamed "backend" to "middleware"
This commit is contained in:
parent
aca8c2fc21
commit
4dc269c8e8
15 changed files with 38 additions and 33 deletions
6
README
6
README
|
@ -3,12 +3,12 @@ Feel free to setup your own installation and protect your privacy!
|
|||
|
||||
volkszaehler.org/
|
||||
|_ htdocs/ static files accessible through the web
|
||||
| |_ backend.php backend bootstrapping
|
||||
| |_ middleware.php middleware bootstrapping
|
||||
| \_ frontend web frontend
|
||||
|
|
||||
|_ etc/ configuration files
|
||||
|_ var/ SQLite database (optional)
|
||||
|_ lib/ backend libraries
|
||||
|_ lib/ middleware libraries
|
||||
|_ misc/
|
||||
|_ controller/
|
||||
| |_ php/ simple reference implemenation of controllers
|
||||
|
@ -21,7 +21,7 @@ volkszaehler.org/
|
|||
| \_ demo/ demo data
|
||||
|
|
||||
|_ tools/ scripts for imports, installation etc.
|
||||
|_ tests/ simple tests for backend classes
|
||||
|_ tests/ simple tests for middleware classes
|
||||
\_ website/ our main webpage on http://volkszaehler.org
|
||||
|
||||
Wiki: http://wiki.volkszaehler.org
|
||||
|
|
|
@ -52,7 +52,7 @@ $config['db']['user'] = 'vz';
|
|||
$config['db']['password'] = 'demo';
|
||||
|
||||
/**
|
||||
* @var string backend database
|
||||
* @var string database name
|
||||
* @link http://www.doctrine-project.org/projects/dbal/2.0/docs/reference/configuration/en
|
||||
*/
|
||||
$config['db']['dbname'] = 'volkszaehler';
|
||||
|
|
|
@ -109,8 +109,8 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="backend-url"><img src="images/server.png" alt="" /> Backend-Adresse</label></td>
|
||||
<td><input type="text" id="backend-url" /></td>
|
||||
<td><label for="middleware-url"><img src="images/server.png" alt="" /> Backend-Adresse</label></td>
|
||||
<td><input type="text" id="middleware-url" /></td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td><label for="tuples"><img src="images/shading.png" alt="" /> Tuples (Auflösung)</label></td>
|
||||
|
@ -144,7 +144,7 @@
|
|||
<div id="entity-subscribe">
|
||||
<p>Hier können Sie einen existierenden Kanal über seine UUID hinzufügen</p>
|
||||
<p><label for="uuid">UUID:</label> <input id="uuid" type="text" size="36" maxlength="36" /></p>
|
||||
<!-- <p><label for="backend">Backend: </label> <input id="backend" type="text" /></p> -->
|
||||
<!-- <p><label for="middleware">Backend: </label> <input id="middleware" type="text" /></p> -->
|
||||
<p><label for="cookie">Cookie:</label> <input class="cookie" type="checkbox" /></p>
|
||||
<input type="button" value="abonnieren" />
|
||||
</div>
|
||||
|
|
|
@ -80,7 +80,7 @@ Entity.prototype.getDOM = function(edit) {
|
|||
|
||||
case 'uuid':
|
||||
var title = 'UUID';
|
||||
var value = '<a href="' + vz.options.backendUrl + '/entity/' + this[property] + '.json">' + this[property] + '</a>';
|
||||
var value = '<a href="' + vz.options.middlewareUrl + '/entity/' + this[property] + '.json">' + this[property] + '</a>';
|
||||
break;
|
||||
|
||||
case 'color':
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Universal helper for backend ajax requests with error handling
|
||||
* Universal helper for middleware ajax requests with error handling
|
||||
*/
|
||||
vz.load = function(args) {
|
||||
$.extend(args, {
|
||||
url: this.options.backendUrl,
|
||||
url: this.options.middlewareUrl,
|
||||
dataType: 'json',
|
||||
error: function(xhr) {
|
||||
try {
|
||||
|
@ -41,7 +41,7 @@ vz.load = function(args) {
|
|||
}
|
||||
}
|
||||
|
||||
throw new Exception(xhr.statusText, 'Unknown backend response', xhr.status)
|
||||
throw new Exception(xhr.statusText, 'Unknown middleware response', xhr.status)
|
||||
}
|
||||
catch (e) {
|
||||
vz.wui.dialogs.exception(e);
|
||||
|
@ -92,7 +92,7 @@ vz.parseUrlParams = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* Load capabilities from backend
|
||||
* Load capabilities from middleware
|
||||
*/
|
||||
vz.capabilities.load = function() {
|
||||
return vz.load({
|
||||
|
|
|
@ -46,7 +46,7 @@ var vz = {
|
|||
// flot instance
|
||||
plot: { },
|
||||
|
||||
// debugging and runtime information from backend
|
||||
// debugging and runtime information from middleware
|
||||
capabilities: {
|
||||
definitions: { } // definitions of entities & properties
|
||||
},
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
// default time interval to show
|
||||
vz.options = {
|
||||
language: 'de',
|
||||
backendUrl: '../backend.php', // TODO default backend, store backend urls in cookies
|
||||
middlewareUrl: '../middleware.php', // TODO default middleware, store middleware urls in cookies
|
||||
tuples: 300,
|
||||
precision: 2, // TODO update from backend capabilities?
|
||||
precision: 2, // TODO update from middleware capabilities?
|
||||
render: 'lines',
|
||||
refresh: false,
|
||||
defaultInterval: 24*60*60*1000, // 1 day
|
||||
|
|
|
@ -71,11 +71,11 @@ vz.wui.init = function() {
|
|||
vz.entities.loadData().done(vz.wui.drawPlot);
|
||||
});
|
||||
|
||||
// backend address
|
||||
$('#backend-url')
|
||||
.val(vz.options.backendUrl)
|
||||
// middleware address
|
||||
$('#middleware-url')
|
||||
.val(vz.options.middlewareUrl)
|
||||
.change(function() {
|
||||
vz.options.backendUrl = $(this).val();
|
||||
vz.options.middlewareUrl = $(this).val();
|
||||
});
|
||||
|
||||
// auto refresh
|
||||
|
@ -361,7 +361,7 @@ vz.entities.each = function(cb) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get all entity information from backend
|
||||
* Get all entity information from middleware
|
||||
*/
|
||||
vz.entities.loadDetails = function() {
|
||||
this.clear();
|
||||
|
@ -445,7 +445,7 @@ vz.entities.showTable = function() {
|
|||
vz.wui.dialogs.exception(e);
|
||||
} finally {
|
||||
$.when(queue).done(function() {
|
||||
// wait for backend
|
||||
// wait for middleware
|
||||
vz.entities.loadDetails().done(vz.entities.showTable);
|
||||
});
|
||||
$(this).dialog('close');
|
||||
|
@ -486,7 +486,7 @@ vz.entities.showTable = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* Load json data from the backend
|
||||
* Load json data from the middleware
|
||||
*
|
||||
* @todo move to Entity class
|
||||
*/
|
||||
|
|
|
@ -52,14 +52,14 @@ class EntityDefinition extends Definition {
|
|||
protected $optional = array();
|
||||
|
||||
/**
|
||||
* Classname of intepreter (see backend/lib/Interpreter/)
|
||||
* Classname of intepreter (see lib/Interpreter/)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $interpreter;
|
||||
|
||||
/**
|
||||
* Classname of model (see backend/lib/Model/)
|
||||
* Classname of model (see lib/Model/)
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
|
|
@ -136,7 +136,7 @@ class Router {
|
|||
/**
|
||||
* Processes the request
|
||||
*
|
||||
* Example: http://sub.domain.local/backend.php/channel/550e8400-e29b-11d4-a716-446655440000/data.json?operation=edit&title=New Title
|
||||
* Example: http://sub.domain.local/middleware.php/channel/550e8400-e29b-11d4-a716-446655440000/data.json?operation=edit&title=New Title
|
||||
*/
|
||||
public function run() {
|
||||
$operation = self::getOperation($this->view->request);
|
||||
|
|
|
@ -33,17 +33,20 @@
|
|||
|
||||
# configuration
|
||||
#
|
||||
# backend url
|
||||
URL="http://192.168.10.1/backend"
|
||||
# middleware url
|
||||
URL="http://volkszaehler.org/demo/middleware.php"
|
||||
|
||||
# sensor settings
|
||||
# Sensor 0x48 (72) ist bei ds1631 sensorid = 0 warum auch immer?
|
||||
# folglich ist sensor 0x4d (75) sensorid = 3 usw.
|
||||
SENSORID=<put your onewire sensors hw id here>
|
||||
|
||||
# ip address of the controller board running ethersex
|
||||
ESEXIP=<put the ip address of your controller board here>
|
||||
|
||||
# uuid of the sensor in the volkszaehler database
|
||||
UUID=<put the uuid of your temperature sensor here>
|
||||
|
||||
##
|
||||
# paths to binaries - you should not need to change these
|
||||
CURL=/usr/bin/curl
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
# configuration
|
||||
#
|
||||
# backend url
|
||||
URL="http://localhost/workspace/volkszaehler.org/backend/index.php/"
|
||||
# middleware url
|
||||
URL="http://volkszaehler.org/demo/middleware.php"
|
||||
|
||||
# 1wire sensor id => volkszaehler.org uuid
|
||||
declare -A MAPPING
|
||||
|
|
|
@ -33,14 +33,16 @@
|
|||
|
||||
# configuration
|
||||
#
|
||||
# backend url
|
||||
URL="http://volkszaehler.org/neu/backend/index.php"
|
||||
# middleware url
|
||||
URL="http://volkszaehler.org/demo/middleware.php"
|
||||
|
||||
# sensor settings
|
||||
# id of the sensor
|
||||
SENSORID=<put your onewire sensors hw id here>
|
||||
|
||||
# ip address of the controller board running ethersex
|
||||
ESEXIP=<put the ip address of your controller board here>
|
||||
|
||||
# uuid of the sensor in the volkszaehler database
|
||||
UUID=<put the uuid of your temperature sensor here>
|
||||
|
||||
|
|
|
@ -751,7 +751,7 @@ C
|
|||
ontroller Entwurfsmuster aufgebaut.
|
||||
Jeder Request an das Backend muss über die Datei
|
||||
\family typewriter
|
||||
/htdocs/backend.php
|
||||
/htdocs/middleware.php
|
||||
\family default
|
||||
erfolgen.
|
||||
Sie ist quasi der
|
||||
|
@ -834,7 +834,7 @@ Alle Anfragen an das Backend müssen einem bestimmten Schema entsprechen.
|
|||
\begin_layout Standard
|
||||
|
||||
\family typewriter
|
||||
http://<server>:<port>/<path_to_volkszaehler>/backend[.php]/<context>[/<uuid>].<fo
|
||||
http://<server>:<port>/<path_to_volkszaehler>/middleware[.php]/<context>[/<uuid>].<fo
|
||||
rmat>?<paramters>=<values>
|
||||
\end_layout
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue