diff --git a/share/entities.json b/share/entities.json new file mode 100644 index 0000000..8725d46 --- /dev/null +++ b/share/entities.json @@ -0,0 +1,108 @@ +/** + * Definition of entities + * + * @author Steffen Vogel + * @copyright Copyright (c) 2010, The volkszaehler.org project + * @package default + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ +/* + * This file is part of volkzaehler.org + * + * volkzaehler.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * volkzaehler.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with volkszaehler.org. If not, see . + */ + +{ + "entities" : [ + /*{ + "name" : "", // discriminator for database column + "required" : [], // list of required properties + "optional" : [], // list of optional properties + // allowed properties = optional + required + "interpreter" : "", // classname of intepreter (see backend/lib/Interpreter/) + "unit" : "", // not required for group + "icon" : "" // TODO url relative or absolute? + }*/ + { + "name" : "group", + "required" : ["name"], + "optional" : ["description", "details:", "owner:", "tolerance"], + "interpreter" : "GroupInterpreter", + "icon" : "" // TODO look for an group icon + }, + { + "name" : "power", + "required" : ["name", "resolution"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "MeterInterpreter", + "icon" : "" // TODO look for an power icon + }, + { + "name" : "gas", + "required" : ["name", "resolution"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "MeterInterpreter", + "icon" : "" // TODO look for an water icon + }, + { + "name" : "rainfall", + "required" : ["name", "resolution"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "MeterInterpreter", + "icon" : "" // TODO look for an water icon + }, + { + "name" : "temperature", + "required" : ["name"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "SensorInterpreter", + "icon" : "" // TODO look for an water icon + }, + { + "name" : "pressure", + "required" : ["name"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "SensorInterpreter", + "icon" : "" // TODO look for an water icon + }, + { + "name" : "humidity", + "required" : ["name"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "SensorInterpreter", + "icon" : "" // TODO look for an water icon + }, + { + "name" : "windspeed", + "required" : ["name"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "SensorInterpreter", + "icon" : "" // TODO look for an water icon + }, + { + "name" : "radition", + "required" : ["name"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "SensorInterpreter", + "icon" : "" // TODO look for an water icon + }, + { + "name" : "luminosity", + "required" : ["name"], + "optional" : ["description", "details:", "owner:", "address:", "tolerance"], + "interpreter" : "SensorInterpreter", + "icon" : "" // TODO look for an water icon + }, + ] +} \ No newline at end of file diff --git a/share/properties.json b/share/properties.json new file mode 100644 index 0000000..68c3726 --- /dev/null +++ b/share/properties.json @@ -0,0 +1,106 @@ +/** + * Definition of properties for entities + * + * @author Steffen Vogel + * @copyright Copyright (c) 2010, The volkszaehler.org project + * @package default + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ +/* + * This file is part of volkzaehler.org + * + * volkzaehler.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * volkzaehler.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with volkszaehler.org. If not, see . + */ + +{ + "properties" : [ + /*{ + "name" : "", // discriminator for database column + "type" : "", // one of: string, numeric, multiple + "pattern" : "", // regex pattern to match if type == string + "min" : 0, // minimal value if type == numeric + // required string length if type == string + "max" : 100, // maximal value if type == numeric + // allowed string length if type == string + "choices" : ["", "", ""] // list of possible choices if type == multiple + // (type as in javascript: 1.2 => numeric, "test" => string) + },*/ + { + "name" : "name", + "type" : "string", + "pattern" : "/[a-z0-9 ]/", + "max" : 255, + }, + { + "name" : "description", + "type" : "string", + "pattern" : "/[a-z0-9 ]/", // TODO add whitespaces as \t \n \r + "max" : 255, // TODO allowed column size in database? + }, + { + "name" : "cost", + "type" : "numeric", + "min" : 0, + }, + { + "name" : "resolution", + "type" : "numeric", + "min" : 1, + }, + { + "name" : "tolerance", + "type" : "numeric", + "min" : 0, + "max" : 1 + }, + { + "name" : "address:lat", + "type" : "numeric", + "min" : -90, + "max" : 90 + }, + { + "name" : "address:lon", + "type" : "numeric", + "min" : -90, + "max" : 90 + }, + { + "name" : "address:city", + "type" : "string", + "pattern" : "" // TODO add pattern + }, + { + "name" : "address:houseno", + "type" : "string" + }, + { + "name" : "address:postal", + "type" : "string" + }, + { + "name" : "address:state", + "type" : "string" + }, + { + "name" : "address:country", + "type" : "string" + }, + { + "name" : "photo:url", + "type" : "string", + "pattern" : "" // TODO add pattern + }, + ] +} \ No newline at end of file