# HG changeset patch # User dwinter # Date 1359531468 -3600 # Node ID f748e2b684c96c6a3038263d884337c26010b77c # Parent 90643ccc6545537f64b754c1af98c6e1bfc0fd90 bug in xml output fixed diff -r 90643ccc6545 -r f748e2b684c9 addDriToIndexMeta.py --- a/addDriToIndexMeta.py Tue Jan 29 17:20:25 2013 +0100 +++ b/addDriToIndexMeta.py Wed Jan 30 08:37:48 2013 +0100 @@ -12,6 +12,7 @@ errorFile = file("/tmp/addDRIErrors.txt","w") parseErrorFile = file("/tmp/addDRIParseErrors.txt","w") +alreadyExistsFile = file("/tmp/addDRIalreadyExists.txt","w") def addPURL(fl,purl,test=False): try: @@ -32,7 +33,9 @@ metas[0].append(newDri) else: dris[0].text=purl - + alreadyExistsFile.write("%s \n"%fl) + return True + print etree.tostring(tree, pretty_print=True) if not test: @@ -70,4 +73,4 @@ dirs.remove(dir) if __name__ == '__main__': - addDriToIndexMeta("/mpiwg/online/",delpath="/mpiwg/online",test=False) + addDriToIndexMeta("/mpiwg/online/",delpath="/mpiwg/online",test=True) diff -r 90643ccc6545 -r f748e2b684c9 managePurls/manageIndexMetaPURLs.py --- a/managePurls/manageIndexMetaPURLs.py Tue Jan 29 17:20:25 2013 +0100 +++ b/managePurls/manageIndexMetaPURLs.py Wed Jan 30 08:37:48 2013 +0100 @@ -38,8 +38,8 @@ def __init__(self): - #self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="p*lWa55eR", host="tuxserve03") - self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="3333") + self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="p*lWa55eR", host="tuxserve03") + #self.purlDB = web.database(dbn="postgres", db="purlDB",user="purlUSER",password="3333") diff -r 90643ccc6545 -r f748e2b684c9 restService/config.py --- a/restService/config.py Tue Jan 29 17:20:25 2013 +0100 +++ b/restService/config.py Wed Jan 30 08:37:48 2013 +0100 @@ -1,3 +1,3 @@ -#TEMPLATE_PATH="/usr/local/metadataServices/purlService/restService/templates/" -TEMPLATE_PATH="/Users/dwinter/Documents/Projekte/MetaDataManagement/purlService/restService/templates/" -TEXTER_URL="http://digilib.mpiwg-berlin.mpg.de/digitallibrary/servlet/Texter?fn=%s" \ No newline at end of file +TEMPLATE_PATH="/usr/local/metadataServices/purlService/restService/templates/" +#TEMPLATE_PATH="/Users/dwinter/Documents/Projekte/MetaDataManagement/purlService/restService/templates/" +TEXTER_URL="http://digilib.mpiwg-berlin.mpg.de/digitallibrary/servlet/Texter?fn=%s" diff -r 90643ccc6545 -r f748e2b684c9 restService/getPurls.py --- a/restService/getPurls.py Tue Jan 29 17:20:25 2013 +0100 +++ b/restService/getPurls.py Wed Jan 30 08:37:48 2013 +0100 @@ -18,14 +18,15 @@ self.purlManager = IndexMetaPURLManager() def GET(self): - + auth = web.ctx.env.get('HTTP_AUTHORIZATION') authreq = False - if auth is None: - authreq = True + if auth is None:#no authentification needed, SHOULD BE DONE VIA APACHE!! + #authreq = True + username = "internal user (Please replace with your username)" else: - print auth + auth = re.sub('^Basic ','',auth) username,password = base64.decodestring(auth).split(':') diff -r 90643ccc6545 -r f748e2b684c9 restService/templates/serviceDescription.html --- a/restService/templates/serviceDescription.html Tue Jan 29 17:20:25 2013 +0100 +++ b/restService/templates/serviceDescription.html Wed Jan 30 08:37:48 2013 +0100 @@ -49,7 +49,7 @@ 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 +eg. purls/searchSolr?text-url-path=/diverse/de/Einst_Beric_de_1907.xml an additional parameter format=short suppresses the additional metadata in the output. diff -r 90643ccc6545 -r f748e2b684c9 searchService/searchSolr.py --- a/searchService/searchSolr.py Tue Jan 29 17:20:25 2013 +0100 +++ b/searchService/searchSolr.py Wed Jan 30 08:37:48 2013 +0100 @@ -59,7 +59,7 @@ if short: key="text-url-path" r=hit.get(key) - ret+="""<%s>%s<%s>"""%(key,r,key) + ret+="""<%s>%s"""%(key,r,key) else: @@ -71,8 +71,8 @@ for r in res: - - ret+="""<%s>%s<%s>"""%(key,r,key) + if not key.startswith("_"): + ret+="""<%s>%s"""%(key,r,key) #ret.append(hit.get('archive-path'))