changeset 15:5bab6e95980e

parameters added
author dwinter
date Thu, 15 Nov 2012 17:23:31 +0100
parents a2bcca6539fd
children 70110fb915a9
files restService/redirector.py
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/restService/redirector.py	Mon Nov 12 09:29:28 2012 +0100
+++ b/restService/redirector.py	Thu Nov 15 17:23:31 2012 +0100
@@ -8,6 +8,7 @@
 import web
 import managePurls.manageIndexMetaPURLs as manageIndexMetaPURLs
 import logging
+import urllib
 
 class redirector:
     
@@ -41,6 +42,9 @@
                 
     def GET(self,path):
         
+        
+        params = web.input()
+        
         splitted=path.split("/")
         if len(splitted)!=2: #pfrad sollte zwei anteile habe "flavour/purl"
             raise web.notfound("not found")
@@ -60,18 +64,18 @@
         # checke ob es einen Image path gibt
         path,validity = self.purlHandler.getImagePathValidity(purl)
         if path is not None and path!="":
-            return self.handlePath(path,validity,viewerWithImagePathFormatString)
+            return self.handlePath(path,validity,viewerWithImagePathFormatString,params)
         
         
         path,validity = self.purlHandler.getPathValidity(purl)
         
         if path is not None and path !="":
-            return self.handlePath(path,validity,viewerWithIndexMetaFormatString)
+            return self.handlePath(path,validity,viewerWithIndexMetaFormatString,params)
         
     
     
     #handle path 
-    def handlePath(self,path,validity,viewerFormatString):
+    def handlePath(self,path,validity,viewerFormatString,params):
         
         if viewerFormatString is None or viewerFormatString=="": 
             raise web.internalerror("no viewer configure for indexMeta for this flavour")
@@ -85,9 +89,13 @@
         if validity is manageIndexMetaPURLs.TEMP_NON_VALID:
             return web.notfound("PURL currently not VALID try later!")
         
-    
-        viewerUrl = viewerFormatString%path
+        
+        
         
+        if len(params.keys())>0:
+            viewerUrl = viewerFormatString%path+'&'+urllib.urlencode(params)
+        else:
+            viewerUrl = viewerFormatString%path
         print viewerUrl
         raise web.redirect(viewerUrl,"302 found")