# HG changeset patch # User dwinter # Date 1363095176 -3600 # Node ID 7fdd2d68fd6bacc8f999a2e465ec8be9585cbc14 # Parent f748e2b684c96c6a3038263d884337c26010b77c imagepath added diff -r f748e2b684c9 -r 7fdd2d68fd6b restService/restService.py --- a/restService/restService.py Wed Jan 30 08:37:48 2013 +0100 +++ b/restService/restService.py Tue Mar 12 14:32:56 2013 +0100 @@ -26,7 +26,8 @@ '/searchLines','searchLines', '/searchLines/annotator/search','searchLines', '/getPurls','getPurls', - '/searchSolr','searchSolr' + '/searchSolr','searchSolr', + '/imagePath/(.+)','imagePath' ) @@ -91,6 +92,28 @@ return path +class imagePath: + + def __init__(self): + self.md=manageIndexMetaPURLs.IndexMetaPURLManager() + + def GET(self,purl): + + path,validity=self.md.getImagePathValidity(purl) + + if path is None: + raise web.notfound("Cannnot find a URL to this path") + + if validity is manageIndexMetaPURLs.PERM_NON_VALID: + raise web.notfound("PURL NON VALID ANYMORE!") + + if validity is manageIndexMetaPURLs.TEMP_NON_VALID: + return web.notfound("PURL currently not VALID try later!") + + + return path + + if __name__ == "__main__":