Mercurial > hg > purlService
changeset 35:d3ecbfd21e06
Merge with a25bfc49a068371c555ac034df1a24e349850163
author | dwinter |
---|---|
date | Wed, 23 Oct 2013 12:28:22 +0200 |
parents | aced422ae66c (diff) a25bfc49a068 (current diff) |
children | be8640c08d99 |
files | restService/templates/serviceDescription.html |
diffstat | 2 files changed, 30 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/restService/searcher.py Wed Oct 23 12:27:31 2013 +0200 +++ b/restService/searcher.py Wed Oct 23 12:28:22 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="""<div class="results"><div class="purls_found_count">%s</div>"""%len(purls) for purl in purls: @@ -41,6 +45,25 @@ return ret+"</div>" + 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
--- a/restService/templates/serviceDescription.html Wed Oct 23 12:27:31 2013 +0200 +++ b/restService/templates/serviceDescription.html Wed Oct 23 12:28:22 2013 +0200 @@ -6,13 +6,17 @@ <h2>/imagePath/PURL</h2> <p> Takes a <em>PURL</em> and returns the image Path as TXT, if stored, otherwise an empty string is returned. -h2>/imageURL/PURL</h2> +<h2>/imageURL/PURL</h2> <p> Takes a <em>PURL</em> and returns the image URL at the scaler all parameters are passed through, if stored, otherwise an empty string is returned. <h2>/search</h2> +<p>Searched the PURL or all PURLs, wich belong to the PATH the internal search format is "LIKE" </p> + +<h3>GET</h3> <p>needs a parameter ?q=PATH </p> -<p>Searched the PURL or all PURLs, wich belong to the PATH the internal search format is "LIKE" </p> +<h3>POST</h3> +<p>expects at \n separated list of paths and returns a list with the path and the purl. <h2>/docuview/PURL</h3>