source: ndgCommon/trunk/ndg/common/src/clients/interfacesearchclient.py @ 5008

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/ndgCommon/trunk/ndg/common/src/clients/interfacesearchclient.py@5008
Revision 5008, 2.7 KB checked in by cbyrom, 11 years ago (diff)

Remove unused imports from interfaces.

Line 
1'''
2 Basic interface for clients to implement for the searching
3 of metadata documents
4 
5 @author: C Byrom - Tessella, Jan 09
6'''
7
8class InterfaceSearchClient(object):
9
10    # target to use when specifying atom searches
11    ATOM_TARGET = 'Atom'
12   
13    # value used when specifying '*' in searches
14    DEFAULT_ALL_VAL = 'All' 
15   
16    def search(self, term, start=1, howmany=20, target='All',
17               scope=None, bbox=None, dateRange=None, geoSearchType='overlaps'):
18        '''
19        Get a list of documents, with basic summary info for each doc, for a
20        specific term using a free text search
21        @param term: term to search on
22        @keyword start:  first record to return
23        @keyword howmany: number of records to return
24        @keyword target: target of search
25        @keyword scope: scope of search
26        @keyword bbox: bounding box for search data - NB, this should be an array with
27        content, [N, W, E, S]
28        @keyword dateRange: range of dates to use in search - an array with content,
29        [startDate, endDate]
30        @keyword geoSearchType: type of geospatial search to use - NB, currently only
31        'overlaps' accepted
32        @return: array of search results; if no results are found this array should be empty
33        '''
34        raise NotImplementedError("This is an interface class and this method has not " + \
35                                  "been implemented yet")
36
37
38    def getDocs(self, documents, format='original'):
39        '''
40        Return one or more complete document
41        @param documents: array of documents to retrieve
42        @keyword format: format the retrieved document should be in.  Default, 'original'
43        returns documents in their original format 
44        @raise ValueError if the requested document(s) cannot be found
45        @return: dictionary with format, {docName: docContents}
46        '''
47        raise NotImplementedError("This is an interface class and this method has not " + \
48                                  "been implemented yet")
49
50
51    def getNDGDoc(self, providerID, docType, localID, targetCollection = "/"):
52        '''
53        Retrieve the document represented by an ndgURI
54        @param providerID: ID of the provider of the metadata
55        @param docType: document type - see ndgObject for valid types
56        @param localID: local ID of the ndg document to retrieve
57        @keyword targetCollection: collection in XML db to look for doc in.  Default = '/'
58        - i.e. the base collection
59        @return document matching the ndgURI
60        '''
61        raise NotImplementedError("This is an interface class and this method has not " + \
62                                  "been implemented yet")
Note: See TracBrowser for help on using the repository browser.