# HG changeset patch # User dwinter # Date 1377687456 -7200 # Node ID aced422ae66cb9eb5ff3df97685f725ce772a17d # Parent ea7017439ab9803da44005f09bc4856defd1e43a added post resquest for search diff -r ea7017439ab9 -r aced422ae66c restService/searcher.py --- a/restService/searcher.py Thu Aug 15 09:02:04 2013 +0200 +++ b/restService/searcher.py Wed Aug 28 12:57:36 2013 +0200 @@ -29,8 +29,12 @@ currentUrl = web.ctx.homepath if purls is None: - purls=[] + #versuche noch mal mit "/index.meta" + purls=self.md.search(query+"/index.meta") + if purls is None: + purls=[] + ret="""
%s
"""%len(purls) for purl in purls: @@ -41,6 +45,25 @@ return ret+"
" + def POST(self): + data = web.data() + ret=[] + print data + for line in data.split("\n"): + purls=self.md.search(line) + + if purls is None: + #versuche noch mal mit "/index.meta" + purls=self.md.search(line+"/index.meta") + if purls is None: + purls=[] + + + for purl in purls: + ret.append("%s\t%s"%(line,purl['purl'])) + + + return "\n".join(ret) if __name__ == '__main__': pass \ No newline at end of file diff -r ea7017439ab9 -r aced422ae66c restService/templates/serviceDescription.html --- a/restService/templates/serviceDescription.html Thu Aug 15 09:02:04 2013 +0200 +++ b/restService/templates/serviceDescription.html Wed Aug 28 12:57:36 2013 +0200 @@ -6,13 +6,17 @@

/imagePath/PURL

Takes a PURL and returns the image Path as TXT, if stored, otherwise an empty string is returned. -h2>/imageURL/PURL +

/imageURL/PURL

Takes a PURL and returns the image URL at the scaler all parameters are passed through, if stored, otherwise an empty string is returned.

/search

+

Searched the PURL or all PURLs, wich belong to the PATH the internal search format is "LIKE"

+ +

GET

needs a parameter ?q=PATH

-

Searched the PURL or all PURLs, wich belong to the PATH the internal search format is "LIKE"

+

POST

+

expects at \n separated list of paths and returns a list with the path and the purl.

/docuview/PURL