changeset 21:90643ccc6545

cross scripting and xml mime-type
author dwinter
date Tue, 29 Jan 2013 17:20:25 +0100
parents cf4503528b5e
children f748e2b684c9
files restService/templates/serviceDescription.html searchService/searchSolr.py
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/restService/templates/serviceDescription.html	Tue Jan 29 16:51:28 2013 +0100
+++ b/restService/templates/serviceDescription.html	Tue Jan 29 17:20:25 2013 +0100
@@ -45,3 +45,13 @@
 
 POST: expects the parameter "username" and "amount"", return list of purls
 
+<h3>/purls/searchSolr?text-url-path=PATH</h3>
+
+gives the path to the index.meta at the storage system as XML
+
+eg. purls/searchSolr?text-url-path=/diverse/de/Einst_Bemer_de_1907.xml
+
+an additional parameter <b>format=short</b> suppresses the additional metadata in the output.
+
+
+
--- a/searchService/searchSolr.py	Tue Jan 29 16:51:28 2013 +0100
+++ b/searchService/searchSolr.py	Tue Jan 29 17:20:25 2013 +0100
@@ -12,8 +12,8 @@
 import urllib2
 import logging
 
-#SOLR_SERVER="https://md.mpiwg-berlin.mpg.de/solr"
-SOLR_SERVER="http://127.0.0.1:8983/solr"
+SOLR_SERVER="https://md.mpiwg-berlin.mpg.de/solr"
+#SOLR_SERVER="http://127.0.0.1:8983/solr"
 DRI_SERVER="http://md.mpiwg-berlin.mpg.de/"
 
 class searchSolr:
@@ -79,7 +79,10 @@
             ret+="</result>"
         
         
-        
+        web.header('Content-Type', 'text/xml')
+        web.header('Access-Control-Allow-Origin', '*')
+        web.header('Access-Control-Allow-Credentials', 'true')
+       
         return ret+"</results>"