-
Notifications
You must be signed in to change notification settings - Fork 0
/
st-repository-datastream.html
71 lines (68 loc) · 2.81 KB
/
st-repository-datastream.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
60
61
62
63
64
65
66
67
68
69
70
71
<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-datastream">
<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-datastream',
properties: {
baseurl: {
type: String,
notify: true
},
datastreamproperties: {
type: Array,
value: ['id', 'name', 'description', 'observationType', 'unitOfMeasurement', 'observedArea', 'phenomenonTime', 'resultTime'],
readOnly: true,
},
expandproperties: {
type: Array,
value: ['Sensor', 'ObservedProperty', 'Thing', 'Observations'],
readOnly: true,
}
},
_checkODATA(odata){
var correct = this.$.odata.check('datastream', odata);
},
get(odata){
this.$.rest.get(this.$.utils.getPath('datastream'), odata);
},
getByID(id, odata){
this.$.rest.get(this.$.utils.getPath('datastream', id), odata);
},
getBySensor(sensorID, odata){
this.$.rest.get(this.$.utils.getPath('datastream', sensorID, 'sensor', false), odata);
},
getByObservedProperty(observedPropertyID, odata){
this.$.rest.get(this.$.utils.getPath('datastream', observedPropertyID, 'observedproperty', false), odata);
},
getByThing(thingID, odata){
this.$.rest.get(this.$.utils.getPath('datastream', thingID, 'thing', false), odata);
},
getByObservation(observationID, odata){
this.$.rest.get(this.$.utils.getPath('datastream', observationID, 'observation', true), odata);
},
post(data){
this.$.rest.post(this.$.utils.getPath('datastream'), data);
},
postByThing(thingID, data){
this.$.rest.post(this.$.utils.getPath('datastream', thingID, 'thing', false), data);
},
put(id, data){
this.$.rest.put(this.$.utils.getPath('datastream', id), data);
},
patch(id, data){
this.$.rest.patch(this.$.utils.getPath('datastream', id), data);
},
delete(id){
this.$.rest.delete(this.$.utils.getPath('datastream', id));
}
});
</script>
</dom-module>