- Timestamp:
- 26/06/12 14:02:15 (9 years ago)
- Location:
- mauRepo/HPFos/trunk
- Files:
-
- 1 added
- 3 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/HPFos/trunk/resources/requirements.txt
r8383 r8406 8 8 # to your pip install 9 9 ceda-markup==0.0.1 10 ceda-moles-model==0.1.0 10 11 11 12 #This package should be available in the machine where CedaManager will be deployed -
mauRepo/HPFos/trunk/src/HPFos/moles3epb.py
r8354 r8406 42 42 from sqlalchemy.orm import mapper 43 43 from ea_model.moles3_4.utilities.mo_responsiblepartyinfo import MO_ResponsiblePartyInfo 44 from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue45 44 from sqlalchemy.orm.collections import InstrumentedList 46 45 from ceda_guid import CedaGUID … … 242 241 return self._session.query(CEDA_ObservationCollection, CEDA_Observation).filter(CEDA_ObservationCollection.id==obs_coll_id).all() 243 242 244 def observationAuthor(self, obs_id):245 """246 Lists the CEDA_Observation author.247 @param obs_id: the CEDA_Observation id248 @return: True if the collection contains the given observation, False otherwise249 """250 ret = self._session.query(MO_ResponsiblePartyInfo).join(MO_Observation). \251 filter(MO_ResponsiblePartyInfo.role == MO_RoleValue.cl_author). \252 filter(MO_Observation.id == obs_id)253 return ret254 243 255 244 def extractObservationByTitleKeywords(self, keywords): -
mauRepo/HPFos/trunk/src/HPFos/osImpl/myimpl.py
r8383 r8406 46 46 from ceda_markup.georss.georss import Where 47 47 from ceda_markup.template.html import OSHTMLResponse 48 from ceda_markup.opensearch.osquery import OSQuery 48 from ceda_markup.opensearch.osquery import OSQuery, URL_INDEX_OFFSET_DEFAULT,\ 49 URL_PAGE_OFFSET_DEFAULT 49 50 from ceda_markup.opensearch.osParam import OSParam 50 51 … … 239 240 super(MyOSQuery, self).__init__(params) 240 241 241 def _packResult(self, results, **kwargs): 242 subresults = [] 243 242 243 def _filterResults(self, results, **kwargs): 244 244 step = calculateStep(**kwargs) 245 245 … … 264 264 lastResult = len(results) 265 265 266 for result in results[firstResult - 1:lastResult]: 266 return results[firstResult - 1:lastResult] 267 268 def _packResult(self, results, **kwargs): 269 270 filtered = self._filterResults(results, **kwargs) 271 272 subresults = [] 273 for result in filtered: 267 274 result_guid = kwargs['moles3EPB'].retrieveGUIDFromInstance(result) 268 275 item = Subresult(result_guid.id, "title", datetime.now().isoformat()) … … 270 277 271 278 return Result(len(results), subresult = subresults) 272 279 273 280 274 281 def doSearch(self, **kwargs): … … 290 297 results = kwargs['moles3EPB'].getObservationCollections(bbox = ibbox) 291 298 292 293 299 294 300 295 301 return self._packResult(results, **kwargs) -
mauRepo/HPFos/trunk/src/HPFos/settings.py
r8349 r8406 169 169 #MOLES3_DB_CONNECTION = 'PG_MOLES3_DB_CONNECTION' 170 170 #MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3' 171 MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3_ test1'172 from sqlTables import doTables as doMoles171 MOLES3_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3_dev1' 172 from ea_model.sqlTables import doTables as doMoles 173 173 MOLES3_DB_SCRIPT = doMoles -
mauRepo/HPFos/trunk/src/HPFos/view/view.py
r8360 r8406 78 78 params[RESULT] = result_guid 79 79 80 response = os_engine.doSearch(hostURL, iformat, params_values = params, moles3EPB = request.moles3EPB) 80 response = os_engine.doSearch(hostURL, iformat, params_values = params, moles3EPB = request.moles3EPB, \ 81 startIndex = 1, startPage = 2, count = 0) 81 82 context = {} 82 83 context['response'] = mark_safe(response) -
mauRepo/HPFos/trunk/src/tests/moles3epbtests.py
r8354 r8406 37 37 from tests.testconfig import getMoles3EPB, closeEPB 38 38 from ea_model.ceda_metadatamodel.ceda_observationcollection.ceda_observationcollection import CEDA_ObservationCollection 39 from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation40 39 41 40 class Moles3EPBTest(TestCase): -
mauRepo/HPFos/trunk/src/tests/testconfig.py
r8354 r8406 37 37 POSTGIS_DB_CONNECTION = 'postgresql://badc:rotyn217m@neptune.badc.rl.ac.uk:5432/Moles3' 38 38 39 from sqlTables import doTables as doMoles, attachEvents39 from ea_model.sqlTables import doTables as doMoles, attachEvents 40 40 MOLES3_DB_SCRIPT = doMoles 41 41 EVENTS_DB = attachEvents
Note: See TracChangeset
for help on using the changeset viewer.