changeset 30:2f19cdf8e60b

nicer filenames for automatic XML export.
author casties
date Tue, 23 Aug 2016 17:43:09 +0200
parents 5786aa6caeb3
children 7d8ebe8ac8a2
files src/main/java/org/mpi/openmind/scheduling/utils/Scheduling.java
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/mpi/openmind/scheduling/utils/Scheduling.java	Mon Aug 22 19:43:34 2016 +0200
+++ b/src/main/java/org/mpi/openmind/scheduling/utils/Scheduling.java	Tue Aug 23 17:43:09 2016 +0200
@@ -20,21 +20,21 @@
 
 	public synchronized void dailyKickOff(){
 		if(configurationService.isSchedulingEnable() && StringUtils.isNotEmpty(configurationService.getSchedulingPath())){
-			
-			String schedulingPath = configurationService.getSchedulingPath();
-			if(schedulingPath.charAt(schedulingPath.length() - 1) != '/'){
-				schedulingPath += "/";
-			}
-			
-			
-			Date now = new Date();
-			DateFormat formatter = new SimpleDateFormat("yyyy.MM.dd[HH.mm]");
-			
-			logger.info("Backup Definitions as: " + schedulingPath + formatter.format(now) + "-DEF.xml");
-			OM4StreamWriter.backupDefinitions(schedulingPath + formatter.format(now) + "-DEF.xml" , persistenceService);
-			logger.info("Backup Entities as: " + schedulingPath + formatter.format(now) + "-ENT.xml");
-			OM4StreamWriter.backupEntities(schedulingPath + formatter.format(now) + "-ENT.xml", persistenceService);
-			
+	        // get path from configuration service
+	        String schedulingPath = configurationService.getSchedulingPath();
+	        if(schedulingPath.charAt(schedulingPath.length() - 1) != '/'){
+	            schedulingPath += "/";
+	        }
+	        // add date
+	        Date now = new Date();
+	        DateFormat formatter = new SimpleDateFormat("yyMMdd-HHmm");
+	        String defFn = "openmind-defs-" + formatter.format(now) + ".xml";
+	        String entFn = "openmind-data-" + formatter.format(now) + ".xml";
+	        // export XML
+	        logger.info("Backup Definitions as: " + defFn);
+	        OM4StreamWriter.backupDefinitions(schedulingPath + defFn, persistenceService);
+	        logger.info("Backup Entities as: " + entFn);
+	        OM4StreamWriter.backupEntities(schedulingPath + entFn, persistenceService);
 		}
 	}