Mercurial > hg > drupalISMI
changeset 6:447623f107dc
new relation_processor
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 17 Jun 2015 18:57:22 +0200 |
parents | 1c73c660c2f2 (current diff) 0ae6145e7c80 (diff) |
children | f651752ee9ad |
files | |
diffstat | 3 files changed, 22 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/importFromOpenMind/importer/filterISMI.py Wed Jun 17 18:55:14 2015 +0200 +++ b/importFromOpenMind/importer/filterISMI.py Wed Jun 17 18:57:22 2015 +0200 @@ -4,6 +4,7 @@ @author: dwinter ''' +import os import json import urllib.request @@ -68,7 +69,7 @@ ids,rels = self.getEntIdsMentioned(kind=kind,filterOC=filterOC) - baseUrl="http://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/jsonInterface?include_content=true&include_romanization=true&method=get_ents" + baseUrl="https://ismi.mpiwg-berlin.mpg.de/om4-ismi/jsonInterface?include_content=true&include_romanization=true&method=get_ents" lenId = len(ids) @@ -116,7 +117,7 @@ # """ # - url = """http://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/jsonInterface?method=get_public_codices""" + url = """https://ismi.mpiwg-berlin.mpg.de/om4-ismi/jsonInterface?method=get_public_codices""" imp.loadJSON(url) @@ -126,31 +127,35 @@ #loadall = imp.loadallEnts() #print(loadall.encode('utf-8')) - + + exportDir = '/tmp/ismi_data' + if not os.access(exportDir, os.R_OK): + # dir doesn't exist -> create + os.makedirs(exportDir) - imp.saveallEnts("/tmp/witnesses") + imp.saveallEnts(exportDir+"/witnesses",kind="tar") - imp.saveallEnts("/tmp/codex_src",kind="src",filterOC=['CODEX','WITNESS']) + imp.saveallEnts(exportDir+"/codex_src",kind="src",filterOC=['CODEX','WITNESS']) #hole jetzt alle relationen an den witnessen - imp.loadJSONFromFile("/tmp/witnesses") + imp.loadJSONFromFile(exportDir+"/witnesses") #ids= imp.getEntIdsMentioned(kind="src") - imp.saveallEnts("/tmp/texts",kind="src",filterOC=['CODEX','WITNESS','PERSON']) + imp.saveallEnts(exportDir+"/texts",kind="src",filterOC=['CODEX','WITNESS','PERSON']) - imp.loadJSONFromFile("/tmp/texts") + imp.loadJSONFromFile(exportDir+"/texts") - imp.saveallEnts("/tmp/authors_subjects_src",kind="src",filterOC=['CODEX','WITNESS','TEXT']) + imp.saveallEnts(exportDir+"/authors_subjects_src",kind="src",filterOC=['CODEX','WITNESS','TEXT']) - imp.saveallEnts("/tmp/authors_subjects_tar",kind="tar",filterOC=['CODEX','WITNESS','TEXT']) + imp.saveallEnts(exportDir+"/authors_subjects_tar",kind="tar",filterOC=['CODEX','WITNESS','TEXT']) - imp.loadJSONFromFile("/tmp/authors_subjects_src") + imp.loadJSONFromFile(exportDir+"/authors_subjects_src") - imp.saveallEnts("/tmp/subjects_places",kind="src",filterOC=['CODEX','WITNESS','TEXT','PERSON']) - imp.saveallEnts("/tmp/references_places",kind="tar",filterOC=['CODEX','WITNESS','TEXT','PERSON']) + imp.saveallEnts(exportDir+"/subjects_places",kind="src",filterOC=['CODEX','WITNESS','TEXT','PERSON']) + imp.saveallEnts(exportDir+"/references_places",kind="tar",filterOC=['CODEX','WITNESS','TEXT','PERSON'])
--- a/openmindattribute/templates/openmindattribute-item-thumbnail.tpl.php Wed Jun 17 18:55:14 2015 +0200 +++ b/openmindattribute/templates/openmindattribute-item-thumbnail.tpl.php Wed Jun 17 18:57:22 2015 +0200 @@ -9,10 +9,10 @@ <?php if ($type=="WITNESS"):?> -<a href="https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/public/publicWitness.jsp?eid=<?php print $entid ?>"><img src="<?php print $objdata['thumburl']; ?>"/></a> +<a href="/om4-ismi/public/publicWitness.jsp?eid=<?php print $entid ?>"><img src="<?php print $objdata['thumburl']; ?>"/></a> <?php endif;?> <?php if ($type=="CODEX"):?> -<a href="https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/public/publicCodex.jsp?eid=<?php print $entid ?>"><img src="<?php print $objdata['thumburl']; ?>"/></a> +<a href="/om4-ismi/public/publicCodex.jsp?eid=<?php print $entid ?>"><img src="<?php print $objdata['thumburl']; ?>"/></a> <?php endif;?> </td>
--- a/openmindattribute/templates/openmindattribute_diva_link.tpl.php Wed Jun 17 18:55:14 2015 +0200 +++ b/openmindattribute/templates/openmindattribute_diva_link.tpl.php Wed Jun 17 18:57:22 2015 +0200 @@ -1,7 +1,7 @@ <?php if ($type=="WITNESS"):?> -<a href="https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/public/publicWitness.jsp?eid=<?php print $entid ?>">View</a> +<a href="/om4-ismi/public/publicWitness.jsp?eid=<?php print $entid ?>">View</a> <?php endif;?> <?php if ($type=="CODEX"):?> -<a href="https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/public/publicCodex.jsp?eid=<?php print $entid ?>">View</a> +<a href="/om4-ismi/public/publicCodex.jsp?eid=<?php print $entid ?>">View</a> <?php endif;?>