changeset 14:a2bcca6539fd

static pages
author dwinter
date Mon, 12 Nov 2012 09:29:28 +0100
parents a1577a498c85
children 5bab6e95980e
files managePurls/manageIndexMetaPURLs.py purlservice.wsgi restService/redirector.py restService/restService.py restService/templates/serviceDescription.html
diffstat 4 files changed, 55 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/managePurls/manageIndexMetaPURLs.py	Tue Nov 06 08:50:24 2012 +0100
+++ b/managePurls/manageIndexMetaPURLs.py	Mon Nov 12 09:29:28 2012 +0100
@@ -38,7 +38,7 @@
     
   
     def __init__(self):
-        self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="p*lWa55eR", host="localhost")
+        self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="p*lWa55eR", host="tuxserve03")
       
  
     
--- a/restService/redirector.py	Tue Nov 06 08:50:24 2012 +0100
+++ b/restService/redirector.py	Mon Nov 12 09:29:28 2012 +0100
@@ -15,8 +15,8 @@
     purlHandler=None
     def __init__(self):
         #read config file for the viewers
-        confFile= file("/usr/local/metadataServices/purlService/restService/viewer.config")
-        
+        #confFile= file("/usr/local/metadataServices/purlService/restService/viewer.config")
+        confFile= file("/Users/dwinter/Documents/Projekte/MetaDataManagement/purlService/restService/viewer.config")
         self.purlHandler = manageIndexMetaPURLs.IndexMetaPURLManager()
         
         for line in confFile.readlines():
@@ -53,10 +53,8 @@
         
         formats = self.viewers[flavour]
         
-  
         viewerWithIndexMetaFormatString = formats[0].rstrip().lstrip().replace("\n",'')
         viewerWithImagePathFormatString = formats[1].lstrip().lstrip().replace("\n",'')
-      
         
       
         # checke ob es einen Image path gibt
--- a/restService/restService.py	Tue Nov 06 08:50:24 2012 +0100
+++ b/restService/restService.py	Mon Nov 12 09:29:28 2012 +0100
@@ -5,7 +5,7 @@
 '''
 import web
 import managePurls.manageIndexMetaPURLs as manageIndexMetaPURLs
-from redirector import redirector
+from redirector import redirector 
 import logging
 from searcher import searcher
 
@@ -14,6 +14,7 @@
     '/docuview/(.+)','redirector',
     '/search','searcher',
     '/indexMeta/(.+)','indexMeta',
+    '/','serviceDescription'
 )
 
 app = web.application(urls, globals())
@@ -21,6 +22,16 @@
 
 TEXTER_URL="http://digilib.mpiwg-berlin.mpg.de/digitallibrary/servlet/Texter?fn=%s"
 
+
+
+class serviceDescription:
+    
+    def __init__(self):
+        self.render = web.template.render('templates/')
+    def GET(self):
+        
+        return self.render.serviceDescription()
+
 class indexMeta:
     
     def __init__(self):
@@ -42,10 +53,7 @@
        
         
         raise web.redirect(TEXTER_URL%path)
-        
-    
-    def __init__(self):
-        self.md=manageIndexMetaPURLs.IndexMetaPURLManager()
+
 
 
 class purl:
@@ -70,9 +78,7 @@
         return path
         
     
-    def __init__(self):
-        self.md=manageIndexMetaPURLs.IndexMetaPURLManager()
-        
+
 
 if __name__ == "__main__":
     app.run()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/restService/templates/serviceDescription.html	Mon Nov 12 09:29:28 2012 +0100
@@ -0,0 +1,38 @@
+<h1>PURL service</h1>
+
+<h2>/purl/PURL</h2>
+<p> Takes a <em>PURL</em> als Parameter and returns the real path as TXT.
+
+<h2>/search</h2>
+<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>
+
+<h2>/docuview/PURL</h3>
+
+<p>Is explained 
+at <a href="https://it-dev.mpiwg-berlin.mpg.de/tracs/metadataprovider/wiki/purls">https://it-dev.mpiwg-berlin.mpg.de/tracs/metadataprovider/wiki/purls</a>.
+</p>
+
+<h4>Config</h4>
+The viewer configuration in stored in <em>viewer.config</em>.
+
+<p> e.g.</p>
+<pre>
+echo,http://echo.mpiwg-berlin.mpg.de/ECHOdocuViewfull?url=%s,http://echo.mpiwg-berlin.mpg.de/ECHOdocuViewfull?mode=imagepath&url=%s&viewMode=images
+libcoll,http://libcoll.mpiwg-berlin.mpg.de/libviewa?url=%s,http://libcoll.mpiwg-berlin.mpg.de/libviewa?url=%s&viewMode=images
+digilib,,http://digilib.mpiwg-berlin.mpg.de/digitallibrary/jquery/digilib.html?fn=%s
+</pre>
+
+<p>The format is:
+
+<pre>
+FLAVOUR,FULTEXTVIEWER,IMAGEVIEWER
+</pre>
+
+</p>
+
+<h3>/indexMeta/PURL</h3>
+<p>
+Redirects to the index.meta file of the source, if existing.
+</p>
\ No newline at end of file