-
Notifications
You must be signed in to change notification settings - Fork 0
/
st-repository-observedproperty.html
59 lines (56 loc) · 2.09 KB
/
st-repository-observedproperty.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="st-rest.html">
<link rel="import" href="st-utils.html">
<link rel="import" href="st-odata.html">
<dom-module id="st-repository-observedproperty">
<template>
<st-rest id="rest" ></st-rest>
<st-utils id="utils" baseurl='{{baseurl}}'></st-utils>
<st-odata id="odata"></st-odata>
</template>
<script>
Polymer({
is:'st-repository-observedproperty',
properties: {
baseurl: {
type: String,
notify: true
},
sensorproperties: {
type: Array,
value: ['id', 'name', 'definition', 'description'],
readOnly: true,
},
expandproperties: {
type: Array,
value: ['Datastreams'],
readOnly: true,
}
},
_checkODATA(odata){
var correct = this.$.odata.check('observedproperty', odata);
},
get(odata){
this.$.rest.get(this.$.utils.getPath('observedproperty'), odata);
},
getByID(id, odata){
this.$.rest.get(this.$.utils.getPath('observedproperty', id), odata);
},
getByDatastream(datastreamID, odata){
this.$.rest.get(this.$.utils.getPath('observedproperty', datastreamID, 'datastream', true), odata);
},
post(data){
this.$.rest.post(this.$.utils.getPath('observedproperty'), data);
},
put(id, data){
this.$.rest.put(this.$.utils.getPath('observedproperty', id), data);
},
patch(id, data){
this.$.rest.patch(this.$.utils.getPath('observedproperty', id), data);
},
delete(id){
this.$.rest.delete(this.$.utils.getPath('observedproperty', id));
}
});
</script>
</dom-module>