Commit 5ecc7202 authored by mp487's avatar mp487
Browse files

bugfixes and adaption for windows

parent c32ee949
......@@ -64,12 +64,12 @@ public class App
changes.putAll( bioModelsDb.listChanges() );
if( log.isInfoEnabled() )
log.info("running PMR2 Crawler");
pmr2Db.run();
// add all changes from PMR2 to the change Map
changes.putAll( pmr2Db.listChanges() );
// if( log.isInfoEnabled() )
// log.info("running PMR2 Crawler");
//
// pmr2Db.run();
// // add all changes from PMR2 to the change Map
// changes.putAll( pmr2Db.listChanges() );
if( log.isInfoEnabled() )
log.info("crawling model changes finished. Now start pushing");
......
......@@ -179,8 +179,8 @@ public class BioModelsDb implements ModelDatabase {
if( release.isDownloaded() && release.isExtracted() )
config.setProperty( "knownReleases", config.getProperty("knownReleases", "") + "," + release.getReleaseName() );
if( limiter++ >= 5 )
break;
// if( limiter++ >= 5 )
// break;
}
log.info("finished cloning BioModelsDatabase!");
......@@ -676,8 +676,7 @@ public class BioModelsDb implements ModelDatabase {
// ... creates one ...
changeSet = new BioModelsChangeSet(fileId);
// ... and put it into the map (the pointer)
changeSetMap.put(fileId, changeSet);
// only put this in the map, if there is a latest version anywhere
// if GraphDb is available for this instance
if( morreClient != null ) {
......@@ -722,13 +721,6 @@ public class BioModelsDb implements ModelDatabase {
isChangeNew = true;
// set parent
change.addParent( latest.getFileId(), latest.getVersionId() );
/*
* This was the previous line. I don't know, why I was setting the parent of the current crawled version to the parent of latest version.
* Actually this would make no sense, because the version tree would so skipped one version, every time...
* But I keep this as reminder, if something goes wrong with the new version from above...
* // change.setParentVersionId( latest.getParentVersionId() );
*
*/
if( log.isInfoEnabled() )
log.info("hashs are not equal -> new version");
......@@ -741,6 +733,11 @@ public class BioModelsDb implements ModelDatabase {
if( isChangeNew ) {
// pushs it into changeSet
changeSet.addChange(change);
if( !changeSetMap.containsKey(fileId) ) {
// make this changeset public!
changeSetMap.put(fileId, changeSet);
}
if( log.isDebugEnabled() )
log.debug("put new version into change set");
} else if( log.isDebugEnabled() ) {
......
......@@ -43,6 +43,7 @@ import org.apache.http.impl.client.HttpClientBuilder;
import com.aragost.javahg.Changeset;
import com.aragost.javahg.Repository;
import com.aragost.javahg.commands.ExecutionException;
import com.aragost.javahg.commands.LogCommand;
import com.aragost.javahg.commands.PullCommand;
import com.aragost.javahg.commands.UpdateCommand;
......@@ -216,9 +217,13 @@ public class PmrDb implements ModelDatabase {
// Scan for cellml and other model files and transfer them
scanAndTransferRepository(repoName, location, repo);
}
if( limiter++ >= 5 )
break;
// closes the repo
if( repo != null )
repo.close();
// if( limiter++ >= 5 )
// break;
}
......@@ -752,7 +757,11 @@ public class PmrDb implements ModelDatabase {
try {
updateCmd.execute();
} catch (IOException e) {
log.fatal( MessageFormat.format("IOException while updating {0} to {1}", location, currentNodeId), e);
log.error( MessageFormat.format("IOException while updating {0} to {1}. skip this repo after now.", location, currentNodeId), e);
return;
} catch (ExecutionException e) {
log.error( MessageFormat.format("IOException while updating {0} to {1}. skip this repo after now.", location, currentNodeId), e);
return;
}
// get all added or modified files in this Changeset
......
......@@ -10,4 +10,5 @@ de.unirostock.sems.ModelCrawler.BioModelsDb.subTempDir = temp/
# the config file in the working dir. stores all indexed release and some other stuff...
de.unirostock.sems.ModelCrawler.BioModelsDb.workingDirConfig = config.properties
# The Url to release Directory on the FTP Server
de.unirostock.sems.ModelCrawler.BioModelsDb.ftpUrl = ftp://ftp.ebi.ac.uk/pub/databases/biomodels/releases/
#de.unirostock.sems.ModelCrawler.BioModelsDb.ftpUrl = ftp://ftp.ebi.ac.uk/pub/databases/biomodels/releases/
de.unirostock.sems.ModelCrawler.BioModelsDb.ftpUrl = ftp://localhost/releases/
......@@ -4,10 +4,12 @@
#
# Main Working Directory, only a semi-temp dir
de.unirostock.sems.ModelCrawler.workingDir = /tmp/crawler-working-dir/
#de.unirostock.sems.ModelCrawler.workingDir = /tmp/crawler-working-dir/
de.unirostock.sems.ModelCrawler.workingDir = D:\\2mt\\crawler-working-dir\\
# XML File Repository Location - Directory for all indexed xml files from the databases
de.unirostock.sems.ModelCrawler.xmlFileServer = http://taylor.informatik.uni-rostock.de:8000/XmlFileServer/
#de.unirostock.sems.ModelCrawler.xmlFileServer = http://taylor.informatik.uni-rostock.de:8000/XmlFileServer/
de.unirostock.sems.ModelCrawler.xmlFileServer = http://localhost:8080/XmlFileServer/
# Encoding for the URLs
de.unirostock.sems.ModelCrawler.encoding = UTF-8
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment