summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Terry2013-07-11 15:37:28 (EDT)
committer David Terry2013-07-11 15:37:28 (EDT)
commit7080de9b1abfc1ad002060121ea3248966b877a7 (patch)
treece3020e522c4648fe85862d6d5b85d7f9e964822
parentd6dbe27678fad54faa8958967381a38cc87d43f0 (diff)
downloadorg.eclipse.lyo.rio-7080de9b1abfc1ad002060121ea3248966b877a7.zip
org.eclipse.lyo.rio-7080de9b1abfc1ad002060121ea3248966b877a7.tar.gz
org.eclipse.lyo.rio-7080de9b1abfc1ad002060121ea3248966b877a7.tar.bz2
[412797] All users to control the TRS reference application's resourcerefs/changes/85/14485/1
files This change allows users to control where change request information is written by altering a parameter in the config.properties file. Change-Id: I7e8a5df9af9c880abe7c3c64ad5aefa373122d4c Signed-off-by: David Terry <dgterry@us.ibm.com>
-rw-r--r--org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Constants.java2
-rw-r--r--org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Persistence.java11
-rw-r--r--org.eclipse.lyo.rio.trs/src/main/resources/config.properties4
3 files changed, 9 insertions, 8 deletions
diff --git a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Constants.java b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Constants.java
index f792a71..d802983 100644
--- a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Constants.java
+++ b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Constants.java
@@ -47,6 +47,4 @@ public interface Constants
public static String PATH_CHANGE_REQUEST = "changeRequest";
public static String USAGE_LIST = CHANGE_MANAGEMENT_NAMESPACE + "list";
-
- public static String PATH_FLAT_FILE = "C:/temp/changeRequests.xml";
}
diff --git a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Persistence.java b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Persistence.java
index 9e4e3cd..7c3043c 100644
--- a/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Persistence.java
+++ b/org.eclipse.lyo.rio.trs/src/main/java/org/eclipse/lyo/rio/trs/cm/Persistence.java
@@ -37,6 +37,7 @@ import org.eclipse.lyo.core.utils.marshallers.OSLC4JContext;
import org.eclipse.lyo.core.utils.marshallers.OSLC4JMarshaller;
import org.eclipse.lyo.oslc4j.core.exception.OslcCoreApplicationException;
import org.eclipse.lyo.oslc4j.provider.jena.JenaModelHelper;
+import org.eclipse.lyo.rio.trs.util.ConfigUtil;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
@@ -157,9 +158,9 @@ public class Persistence {
public static void initialize() {
try {
- CHANGE_REQUESTS_LOADED = true;
+ fileload(ConfigUtil.getPropertiesInstance().getProperty("ChangeRequestsFile"));
- fileload(Constants.PATH_FLAT_FILE);
+ CHANGE_REQUESTS_LOADED = true;
} catch (FileNotFoundException e) {
e.printStackTrace();
@@ -261,7 +262,7 @@ public class Persistence {
Long.valueOf(changeRequest.getIdentifier()), changeRequest);
// save out to file here
- save(Constants.PATH_FLAT_FILE);
+ save(ConfigUtil.getPropertiesInstance().getProperty("ChangeRequestsFile"));
// Notify any listeners of creation event
notifyListeners(changeRequest, "create");
@@ -280,7 +281,7 @@ public class Persistence {
CHANGE_REQUESTS_MAP.put(longIdentifier, changeRequest);
// save out to file here
- save(Constants.PATH_FLAT_FILE);
+ save(ConfigUtil.getPropertiesInstance().getProperty("ChangeRequestsFile"));
// Notify any listeners of the update event
notifyListeners(changeRequest, "update");
@@ -299,7 +300,7 @@ public class Persistence {
// this means we successfully removed something with the given identifier
if (result != null) {
// save out to file here
- save(Constants.PATH_FLAT_FILE);
+ save(ConfigUtil.getPropertiesInstance().getProperty("ChangeRequestsFile"));
// Notify any listeners of the deletion event
notifyListeners(result, "delete");
diff --git a/org.eclipse.lyo.rio.trs/src/main/resources/config.properties b/org.eclipse.lyo.rio.trs/src/main/resources/config.properties
index 471c283..0fdfb3f 100644
--- a/org.eclipse.lyo.rio.trs/src/main/resources/config.properties
+++ b/org.eclipse.lyo.rio.trs/src/main/resources/config.properties
@@ -1,4 +1,6 @@
# Change events in the ChangeLogFile older than this number of days will be removed at startup
PruneTimeInDays = 7
# The file on disk where change events will be stored
-ChangeEventsFile=C:/temp/changeEvents.xml \ No newline at end of file
+ChangeEventsFile=changeEvents.xml
+# The file on disk where change requests (the resource) will be stored
+ChangeRequestsFile=changeRequests.xml \ No newline at end of file