Commit 11e0e84b5ead4de67e2cd04b9ae11e708b80450c
- Diff rendering mode:
- inline
- side by side
fetch.py
(5 / 4)
  | |||
11 | 11 | import urllib2 | |
12 | 12 | import StringIO | |
13 | 13 | import json | |
14 | import urllib | ||
14 | 15 | ||
15 | 16 | app = Flask(__name__) | |
16 | 17 | ||
… | … | ||
34 | 34 | resource = "default" | |
35 | 35 | if request.args.has_key('uri'): | |
36 | 36 | resource = request.args['uri'] | |
37 | for i in collection.find({'uri':resource}): | ||
37 | for i in collection.find({'resource':resource}): | ||
38 | 38 | del(i['_id']) | |
39 | 39 | ret[x] = i | |
40 | 40 | x = x + 1 | |
… | … | ||
51 | 51 | y = 0 | |
52 | 52 | ret = {} | |
53 | 53 | keywords_dict = json.loads(request.args['data']) | |
54 | keywords = json.loads(keywords_dict)['data'] | ||
54 | #keywords = json.loads(keywords_dict)['data'] | ||
55 | 55 | for i in collection.find(): | |
56 | for keyword in keywords: | ||
57 | print keyword | ||
56 | for keyword in keywords_dict: | ||
58 | 57 | try: | |
59 | 58 | if keyword in i['nodes']: | |
60 | 59 | del(i['_id']) | |
60 | i['text'] = urllib.unquote_plus(i['text']) | ||
61 | 61 | ret[y] = i | |
62 | 62 | y = y + 1 | |
63 | 63 | except: |
static/myVector.js
(3 / 2)
  | |||
72 | 72 | str['material'] = ans.ans[i]['material']; | |
73 | 73 | // str['jewellery'] = ans.ans[i]['jewellery'] | |
74 | 74 | } | |
75 | |||
75 | 76 | z = new OpenLayers.Popup.FramedCloud( | |
76 | 77 | "test", | |
77 | 78 | feature.geometry.getBounds().getCenterLonLat(), | |
78 | 79 | new OpenLayers.Size(640,480), | |
79 | JSON.stringify(str,null,' '),null,true); | ||
80 | '<iframe src='+config.indexer+"/search?data="+JSON.stringify(ans.ans[i]["nodes"])+" ></iframe>",null,true); | ||
80 | 81 | feature.popup = z; | |
81 | 82 | z.panMapIfOutOfView = true; | |
82 | 83 | map.addPopup(z); | |
… | … | ||
181 | 181 | numZoomLevels: 8 | |
182 | 182 | }; | |
183 | 183 | map = new OpenLayers.Map('map', options); | |
184 | $.get(config.indexer+"/fetch",{url:window.location.href} , function(data){ | ||
184 | $.get(config.indexer+"/fetch",{uri:"default"} , function(data){ | ||
185 | 185 | if (data != undefined) | |
186 | 186 | { | |
187 | 187 | ans.ans = data; |
templates/blank.html
(1 / 1)
  | |||
1 | 1 | {% for obj in content %} | |
2 | 2 | <div> | |
3 | 3 | {% for key in content[obj].keys() %} | |
4 | {{ key }}: {{ content[obj][key] }} | ||
4 | <p>{{ key }}: {{ content[obj][key] }}</p> | ||
5 | 5 | {% endfor %} | |
6 | 6 | </div> | |
7 | 7 | {% endfor %} |