Skip to content
Snippets Groups Projects
Commit 725343a8 authored by srosse's avatar srosse
Browse files

OO-619: for compatibility, set the delivery options for old single page,...

OO-619: for compatibility, set the delivery options for old single page, structure node and CP to use the glossary
parent e74cf742
No related branches found
No related tags found
No related merge requests found
...@@ -209,7 +209,7 @@ public class SPCourseNode extends AbstractAccessableCourseNode { ...@@ -209,7 +209,7 @@ public class SPCourseNode extends AbstractAccessableCourseNode {
config.set(SPEditController.CONFIG_KEY_DELIVERYOPTIONS, defaultOptions); config.set(SPEditController.CONFIG_KEY_DELIVERYOPTIONS, defaultOptions);
// new since config version 3 // new since config version 3
config.setConfigurationVersion(3); config.setConfigurationVersion(4);
} else { } else {
config.remove(NodeEditController.CONFIG_INTEGRATION); config.remove(NodeEditController.CONFIG_INTEGRATION);
int version = config.getConfigurationVersion(); int version = config.getConfigurationVersion();
...@@ -219,6 +219,14 @@ public class SPCourseNode extends AbstractAccessableCourseNode { ...@@ -219,6 +219,14 @@ public class SPCourseNode extends AbstractAccessableCourseNode {
config.setBooleanEntry(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, Boolean.FALSE.booleanValue()); config.setBooleanEntry(SPEditController.CONFIG_KEY_ALLOW_RELATIVE_LINKS, Boolean.FALSE.booleanValue());
config.setConfigurationVersion(2); config.setConfigurationVersion(2);
} }
if(version < 4) {
if(config.get(SPEditController.CONFIG_KEY_DELIVERYOPTIONS) == null) {
DeliveryOptions defaultOptions = DeliveryOptions.defaultWithGlossary();
config.set(SPEditController.CONFIG_KEY_DELIVERYOPTIONS, defaultOptions);
}
config.setConfigurationVersion(4);
}
//there was a version 3 but all keys new in this version have been removed //there was a version 3 but all keys new in this version have been removed
} }
} }
......
...@@ -565,6 +565,10 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Assess ...@@ -565,6 +565,10 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Assess
// set the default display to peekview in two columns // set the default display to peekview in two columns
config.setStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE, STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW); config.setStringValue(STCourseNodeEditController.CONFIG_KEY_DISPLAY_TYPE, STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW);
config.setIntValue(STCourseNodeEditController.CONFIG_KEY_COLUMNS, 2); config.setIntValue(STCourseNodeEditController.CONFIG_KEY_COLUMNS, 2);
DeliveryOptions defaultOptions = DeliveryOptions.defaultWithGlossary();
config.set(SPEditController.CONFIG_KEY_DELIVERYOPTIONS, defaultOptions);
config.setConfigurationVersion(3); config.setConfigurationVersion(3);
} else { } else {
// update to version 2 // update to version 2
...@@ -591,6 +595,14 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Assess ...@@ -591,6 +595,14 @@ public class STCourseNode extends AbstractAccessableCourseNode implements Assess
} }
config.setConfigurationVersion(3); config.setConfigurationVersion(3);
} }
if (config.getConfigurationVersion() < 4) {
if(config.get(SPEditController.CONFIG_KEY_DELIVERYOPTIONS) == null) {
DeliveryOptions defaultOptions = DeliveryOptions.defaultWithGlossary();
config.set(SPEditController.CONFIG_KEY_DELIVERYOPTIONS, defaultOptions);
}
config.setConfigurationVersion(4);
}
} }
} }
......
...@@ -95,11 +95,17 @@ public class CPManagerImpl extends CPManager { ...@@ -95,11 +95,17 @@ public class CPManagerImpl extends CPManager {
FileResourceManager frm = FileResourceManager.getInstance(); FileResourceManager frm = FileResourceManager.getInstance();
File reFolder = frm.getFileResourceRoot(ores); File reFolder = frm.getFileResourceRoot(ores);
File configXml = new File(reFolder, PACKAGE_CONFIG_FILE_NAME); File configXml = new File(reFolder, PACKAGE_CONFIG_FILE_NAME);
CPPackageConfig config;
if(configXml.exists()) { if(configXml.exists()) {
CPPackageConfig config = (CPPackageConfig)configXstream.fromXML(configXml); config = (CPPackageConfig)configXstream.fromXML(configXml);
return config; } else {
//set default config
config = new CPPackageConfig();
config.setDeliveryOptions(DeliveryOptions.defaultWithGlossary());
setCPPackageConfig(ores, config);
} }
return null; return config;
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment