Index: lams_common/build.xml
===================================================================
diff -u -r7d0e65a9974f32df44e9cf250bc4d11b63837824 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/build.xml (.../build.xml) (revision 7d0e65a9974f32df44e9cf250bc4d11b63837824)
+++ lams_common/build.xml (.../build.xml) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -47,7 +47,7 @@
-
+
@@ -203,6 +203,7 @@
+
@@ -330,7 +331,7 @@
-
+
Index: lams_common/src/java/org/lamsfoundation/lams/applicationContext.xml
===================================================================
diff -u -r5bd9057d6aa08bfa1bb1e6c240d5b3707743c3d7 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/applicationContext.xml (.../applicationContext.xml) (revision 5bd9057d6aa08bfa1bb1e6c240d5b3707743c3d7)
+++ lams_common/src/java/org/lamsfoundation/lams/applicationContext.xml (.../applicationContext.xml) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -72,6 +72,10 @@
org/lamsfoundation/lams/workspace/WorkspaceFolderContent.hbm.xml
+
+ org/lamsfoundation/lams/themes/CSSProperty.hbm.xml
+ org/lamsfoundation/lams/themes/CSSStyle.hbm.xml
+ org/lamsfoundation/lams/themes/CSSThemeVisualElement.hbm.xml
@@ -198,4 +202,10 @@
+
+
+
+
+
+
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java
===================================================================
diff -u -r3107fdb17ab07d80b588cb1d0d4ccee6568b9c7e -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java (.../Activity.java) (revision 3107fdb17ab07d80b588cb1d0d4ccee6568b9c7e)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/Activity.java (.../Activity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -126,12 +126,6 @@
/** Date this activity was created */
private Date createDateTime;
- /** Offline Instruction for this activity*/
- private String offlineInstructions;
-
- /** Online Instructions for this activity*/
- private String onlineInstructions;
-
/** The image that represents the icon of this
* activity in the UI*/
private String libraryActivityUiImage;
@@ -196,7 +190,6 @@
Integer orderId,
Boolean defineLater,
Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -215,7 +208,6 @@
this.orderId = orderId;
this.defineLater = defineLater;
this.createDateTime = createDateTime;
- this.offlineInstructions = offlineInstructions;
this.learningLibrary = learningLibrary;
this.parentActivity = parentActivity;
this.parentUIID = parentUIID;
@@ -381,17 +373,6 @@
}
/**
- * @hibernate.property column="offline_instructions" length="65535"
- */
- public String getOfflineInstructions() {
- return this.offlineInstructions;
- }
-
- public void setOfflineInstructions(String offlineInstructions) {
- this.offlineInstructions = offlineInstructions;
- }
-
- /**
* @hibernate.many-to-one not-null="true"
* @hibernate.column name="learning_library_id"
*
@@ -591,19 +572,6 @@
this.runOffline = runOffline;
}
- /**
- * @return Returns the onlineInstructions.
- */
- public String getOnlineInstructions() {
- return onlineInstructions;
- }
- /**
- * @param onlineInstructions The onlineInstructions to set.
- */
- public void setOnlineInstructions(String onlineInstructions) {
- this.onlineInstructions = onlineInstructions;
- }
-
public Integer getActivityCategoryID()
{
return activityCategoryID;
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ComplexActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ComplexActivity.java (.../ComplexActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ComplexActivity.java (.../ComplexActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -53,7 +53,6 @@
Integer orderId,
Boolean defineLater,
Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -65,7 +64,7 @@
Transition transitionFrom,
Set activities) {
super(activityId, id, description, title, xcoord, ycoord, orderId,
- defineLater, createDateTime, offlineInstructions,
+ defineLater, createDateTime,
learningLibrary, parentActivity, libraryActivity,parentUIID,learningDesign, grouping,
activityTypeId, transitionTo,transitionFrom);
this.activities = activities;
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/GateActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/GateActivity.java (.../GateActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/GateActivity.java (.../GateActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -65,7 +65,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -87,7 +86,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupingActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupingActivity.java (.../GroupingActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/GroupingActivity.java (.../GroupingActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -52,7 +52,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -75,7 +74,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -147,9 +145,6 @@
groupingActivity.setApplyGrouping(originalActivity.getApplyGrouping());
groupingActivity.setActivityCategoryID(originalActivity.getActivityCategoryID());
- groupingActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- groupingActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
groupingActivity.setDefineLater(originalActivity.getDefineLater());
groupingActivity.setCreateDateTime(new Date());
groupingActivity.setRunOffline(originalActivity.getRunOffline());
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java (.../LearningDesign.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/LearningDesign.java (.../LearningDesign.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -150,6 +150,13 @@
/** persistent field*/
private Date lastModifiedDateTime;
+ /** Offline Instruction for this activity*/
+ private String offlineInstructions;
+
+ /** Online Instructions for this activity*/
+ private String onlineInstructions;
+
+
/** full constructor */
public LearningDesign(
Long learningDesignId,
@@ -171,7 +178,9 @@
Set activities,
Long duration,
String licenseText,
- License license) {
+ License license,
+ String offlineInstructions,
+ String onlineInstructions) {
this.learningDesignId = learningDesignId;
this.learningDesignUIID = ui_id;
this.description = description;
@@ -194,6 +203,8 @@
this.duration = duration;
this.licenseText = licenseText;
this.license = license;
+ this.offlineInstructions = offlineInstructions;
+ this.onlineInstructions = onlineInstructions;
}
/** default constructor */
@@ -492,6 +503,21 @@
public void setLastModifiedDateTime(Date lastModifiedDateTime) {
this.lastModifiedDateTime = lastModifiedDateTime;
}
+
+ public String getOfflineInstructions() {
+ return this.offlineInstructions;
+ }
+ public void setOfflineInstructions(String offlineInstructions) {
+ this.offlineInstructions = offlineInstructions;
+ }
+ public String getOnlineInstructions() {
+ return onlineInstructions;
+ }
+ public void setOnlineInstructions(String onlineInstructions) {
+ this.onlineInstructions = onlineInstructions;
+ }
+
+
public LearningDesignDTO getLearningDesignDTO(){
return new LearningDesignDTO(this);
}
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/OptionsActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/OptionsActivity.java (.../OptionsActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/OptionsActivity.java (.../OptionsActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -53,7 +53,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -76,7 +75,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -150,10 +148,6 @@
newOptionsActivity.setLearningLibrary(originalActivity.getLearningLibrary());
newOptionsActivity.setCreateDateTime(new Date());
newOptionsActivity.setRunOffline(originalActivity.getRunOffline());
-
- newOptionsActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- newOptionsActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
newOptionsActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage());
newOptionsActivity.setLibraryActivity(originalActivity.getLibraryActivity());
return newOptionsActivity;
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ParallelActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ParallelActivity.java (.../ParallelActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ParallelActivity.java (.../ParallelActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -44,7 +44,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -64,7 +63,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -138,9 +136,6 @@
newParallelActivity.setCreateDateTime(new Date());
newParallelActivity.setRunOffline(originalActivity.getRunOffline());
- newParallelActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- newParallelActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
newParallelActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage());
newParallelActivity.setLibraryActivity(originalActivity.getLibraryActivity());
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/PermissionGateActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/PermissionGateActivity.java (.../PermissionGateActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/PermissionGateActivity.java (.../PermissionGateActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -47,7 +47,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -69,7 +68,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -148,10 +146,6 @@
newPermissionGateActivity.setDefineLater(originalActivity.getDefineLater());
newPermissionGateActivity.setCreateDateTime(new Date());
newPermissionGateActivity.setRunOffline(originalActivity.getRunOffline());
-
- newPermissionGateActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- newPermissionGateActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
newPermissionGateActivity.setLibraryActivity(originalActivity.getLibraryActivity());
newPermissionGateActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage());
return newPermissionGateActivity;
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ScheduleGateActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ScheduleGateActivity.java (.../ScheduleGateActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ScheduleGateActivity.java (.../ScheduleGateActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -92,7 +92,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -115,7 +114,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -211,10 +209,6 @@
newScheduleGateActivity.setDefineLater(originalActivity.getDefineLater());
newScheduleGateActivity.setCreateDateTime(new Date());
newScheduleGateActivity.setRunOffline(originalActivity.getRunOffline());
-
- newScheduleGateActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- newScheduleGateActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
newScheduleGateActivity.setLibraryActivity(originalActivity.getLibraryActivity());
newScheduleGateActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage());
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/SequenceActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/SequenceActivity.java (.../SequenceActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/SequenceActivity.java (.../SequenceActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -45,7 +45,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -65,7 +64,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -139,9 +137,6 @@
newSequenceActivity.setCreateDateTime(new Date());
newSequenceActivity.setRunOffline(originalActivity.getRunOffline());
- newSequenceActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- newSequenceActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
newSequenceActivity.setLibraryActivity(originalActivity.getLibraryActivity());
newSequenceActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage());
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/SimpleActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/SimpleActivity.java (.../SimpleActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/SimpleActivity.java (.../SimpleActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -46,7 +46,6 @@
Integer orderId,
Boolean defineLater,
Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -64,7 +63,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/SynchGateActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/SynchGateActivity.java (.../SynchGateActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/SynchGateActivity.java (.../SynchGateActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -46,7 +46,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -67,7 +66,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -146,10 +144,6 @@
newSynchGateActivity.setDefineLater(originalActivity.getDefineLater());
newSynchGateActivity.setCreateDateTime(new Date());
newSynchGateActivity.setRunOffline(originalActivity.getRunOffline());
-
- newSynchGateActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- newSynchGateActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
newSynchGateActivity.setLibraryActivity(originalActivity.getLibraryActivity());
newSynchGateActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage());
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java
===================================================================
diff -u -r55901923afea1cbd769d8daa05051aa050bb99b6 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java (.../ToolActivity.java) (revision 55901923afea1cbd769d8daa05051aa050bb99b6)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/ToolActivity.java (.../ToolActivity.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -63,7 +63,6 @@
Integer orderId,
Boolean defineLater,
java.util.Date createDateTime,
- String offlineInstructions,
LearningLibrary learningLibrary,
Activity parentActivity,
Activity libraryActivity,
@@ -85,7 +84,6 @@
orderId,
defineLater,
createDateTime,
- offlineInstructions,
learningLibrary,
parentActivity,
libraryActivity,
@@ -163,10 +161,6 @@
newToolActivity.setLearningLibrary(originalActivity.getLearningLibrary());
newToolActivity.setCreateDateTime(new Date());
newToolActivity.setRunOffline(originalActivity.getRunOffline());
-
- newToolActivity.setOfflineInstructions(originalActivity.getOfflineInstructions());
- newToolActivity.setOnlineInstructions(originalActivity.getOnlineInstructions());
-
newToolActivity.setActivityCategoryID(originalActivity.getActivityCategoryID());
newToolActivity.setLibraryActivityUiImage(originalActivity.getLibraryActivityUiImage());
newToolActivity.setLibraryActivity(originalActivity.getLibraryActivity());
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java
===================================================================
diff -u -re7b22481b0c0e25c3fc0eec2f034dbd5897d3397 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java (.../AuthoringActivityDTO.java) (revision e7b22481b0c0e25c3fc0eec2f034dbd5897d3397)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/AuthoringActivityDTO.java (.../AuthoringActivityDTO.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -111,12 +111,6 @@
/** Indicates whether this activity is available offline*/
private Boolean runOffline;
- /** Offline Instruction for this activity*/
- private String offlineInstructions;
-
- /** Online Instruction for this activity*/
- private String onlineInstructions;
-
/** Maximum number of activities to be attempted */
private Integer maxOptions;
@@ -179,7 +173,6 @@
Integer activityTypeId, Long groupingID, Integer groupingUIID,
Integer orderID, Boolean defineLater, Long learningDesignID,
Long learningLibraryID, Date createDateTime, Boolean runOffline,
- String offlineInstructions, String onlineInstructions,
Integer maxOptions, Integer minOptions,
String optionsInstructions, Long toolID, Long toolContentID,
Integer activityCategoryID, Integer gateActivityLevelID,
@@ -208,8 +201,6 @@
this.learningLibraryID = learningLibraryID;
this.createDateTime = createDateTime;
this.runOffline = runOffline;
- this.offlineInstructions = offlineInstructions;
- this.onlineInstructions = onlineInstructions;
this.maxOptions = maxOptions;
this.minOptions = minOptions;
this.optionsInstructions = optionsInstructions;
@@ -262,8 +253,6 @@
WDDXTAGS.NUMERIC_NULL_VALUE_LONG;
this.createDateTime = activity.getCreateDateTime();
this.runOffline = activity.getRunOffline();
- this.offlineInstructions = activity.getOfflineInstructions();
- this.onlineInstructions = activity.getOnlineInstructions();
this.activityCategoryID = activity.getActivityCategoryID();
this.libraryActivityUiImage = activity.getLibraryActivityUiImage();
this.libraryActivityID = activity.getLibraryActivity()!=null?
@@ -310,10 +299,6 @@
this.createDateTime = (Date)activityDetails.get("createDateTime");
if(activityDetails.containsKey("runOffline"))
this.runOffline = (Boolean) activityDetails.get("runOffline");
- if(activityDetails.containsKey("offlineInstructions"))
- this.offlineInstructions= (String) activityDetails.get("offlineInstructions");
- if(activityDetails.containsKey("onlineInstructions"))
- this.onlineInstructions =(String) activityDetails.get("onlineInstructions");
if(activityDetails.containsKey("maxOptions"))
this.maxOptions = convertToInteger(activityDetails.get("maxOptions"));
if(activityDetails.containsKey("minOptions"))
@@ -572,12 +557,6 @@
return minOptions!=null?minOptions:WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER;
}
/**
- * @return Returns the offlineInstructions.
- */
- public String getOfflineInstructions() {
- return offlineInstructions!=null?offlineInstructions:WDDXTAGS.STRING_NULL_VALUE;
- }
- /**
* @return Returns the optionsInstructions.
*/
public String getOptionsInstructions() {
@@ -807,13 +786,6 @@
this.minOptions = minOptions;
}
/**
- * @param offlineInstructions The offlineInstructions to set.
- */
- public void setOfflineInstructions(String offlineInstructions) {
- if(!offlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE))
- this.offlineInstructions = offlineInstructions;
- }
- /**
* @param optionsInstructions The optionsInstructions to set.
*/
public void setOptionsInstructions(String optionsInstructions) {
@@ -883,19 +855,6 @@
this.ycoord = ycoord;
}
/**
- * @return Returns the onlineInstructions.
- */
- public String getOnlineInstructions() {
- return onlineInstructions!=null?onlineInstructions:WDDXTAGS.STRING_NULL_VALUE;
- }
- /**
- * @param onlineInstructions The onlineInstructions to set.
- */
- public void setOnlineInstructions(String onlineInstructions) {
- if(!onlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE))
- this.onlineInstructions = onlineInstructions;
- }
- /**
* @return Returns the applyGrouping.
*/
public Boolean getApplyGrouping() {
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/BaseDTO.java
===================================================================
diff -u -rc5e09e9db9b683b5503b9479c297bca130c363c4 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/BaseDTO.java (.../BaseDTO.java) (revision c5e09e9db9b683b5503b9479c297bca130c363c4)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/BaseDTO.java (.../BaseDTO.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -54,12 +54,13 @@
* @return Integer The required value
*/
public Integer convertToInteger(Object ob){
- Double doub = (Double)ob;
- Integer integer = new Integer(doub.intValue());
- if(!integer.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER))
- return integer;
- else
- return null;
+ if ( ob != null ) {
+ Double doub = (Double)ob;
+ Integer integer = new Integer(doub.intValue());
+ if(!integer.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER))
+ return integer;
+ }
+ return null;
}
/**
* This method converts the passed
@@ -69,11 +70,12 @@
* @return Long The required value
*/
public Long convertToLong(Object ob){
- Double doub = (Double)ob;
- Long longValue = new Long(doub.longValue());
- if(!longValue.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG))
- return longValue;
- else
- return null;
+ if ( ob != null ) {
+ Double doub = (Double)ob;
+ Long longValue = new Long(doub.longValue());
+ if(!longValue.equals(WDDXTAGS.NUMERIC_NULL_VALUE_LONG))
+ return longValue;
+ }
+ return null;
}
}
Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java
===================================================================
diff -u -r8e98619391a7b227ca6d7f16b884e219149e4a23 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java (.../LearningDesignDTO.java) (revision 8e98619391a7b227ca6d7f16b884e219149e4a23)
+++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/dto/LearningDesignDTO.java (.../LearningDesignDTO.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -66,6 +66,8 @@
private String lessonName;
private Date lessonStartDateTime;
private Date lastModifiedDateTime;
+ private String offlineInstructions;
+ private String onlineInstructions;
private ArrayList activities;
private ArrayList transitions;
@@ -97,7 +99,9 @@
Long lessonID,
String lessonName,
Date lessonStartDateTime,
- Date lastModifiedDateTime) {
+ Date lastModifiedDateTime,
+ String offlineInstructions,
+ String onlineInstructions) {
super();
this.learningDesignID = learningDesignId;
this.learningDesignUIID = learningDesignUIID;
@@ -109,6 +113,8 @@
this.validDesign = validDesign;
this.readOnly = readOnly;
this.dateReadOnly = dateReadOnly;
+ this.offlineInstructions = offlineInstructions;
+ this.onlineInstructions = onlineInstructions;
this.userID = userID;
this.helpText = helpText;
this.copyTypeID = copyTypeID;
@@ -144,6 +150,9 @@
this.readOnly = learningDesign.getReadOnly();
this.dateReadOnly = learningDesign.getDateReadOnly();
+ this.offlineInstructions = learningDesign.getOfflineInstructions();
+ this.onlineInstructions = learningDesign.getOnlineInstructions();
+
this.userID = learningDesign.getUser()!=null?
learningDesign.getUser().getUserId():
WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER;
@@ -188,6 +197,8 @@
this.validDesign = (Boolean)table.get("validDesign");
this.readOnly = (Boolean)table.get("readOnly");;
this.dateReadOnly = (Date)table.get("dateReadOnly");
+ this.offlineInstructions= (String) table.get("offlineInstructions");
+ this.onlineInstructions =(String) table.get("onlineInstructions");
this.userID = convertToInteger(table.get("userID"));
this.helpText = (String)table.get("helpText");
this.copyTypeID = convertToInteger(table.get("copyTypeID"));
@@ -601,6 +612,33 @@
if(!firstActivityUIID.equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER))
this.firstActivityUIID = firstActivityUIID;
}
+ /**
+ * @return Returns the onlineInstructions.
+ */
+ public String getOnlineInstructions() {
+ return onlineInstructions!=null?onlineInstructions:WDDXTAGS.STRING_NULL_VALUE;
+ }
+ /**
+ * @param onlineInstructions The onlineInstructions to set.
+ */
+ public void setOnlineInstructions(String onlineInstructions) {
+ if(!onlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE))
+ this.onlineInstructions = onlineInstructions;
+ }
+ /**
+ * @param offlineInstructions The offlineInstructions to set.
+ */
+ public void setOfflineInstructions(String offlineInstructions) {
+ if(!offlineInstructions.equals(WDDXTAGS.STRING_NULL_VALUE))
+ this.offlineInstructions = offlineInstructions;
+ }
+ /**
+ * @return Returns the offlineInstructions.
+ */
+ public String getOfflineInstructions() {
+ return offlineInstructions!=null?offlineInstructions:WDDXTAGS.STRING_NULL_VALUE;
+ }
+
public static LearningDesign extractLearningDesign(LearningDesignDTO learningDesignDTO){
LearningDesign learningDesign = new LearningDesign();
if(!learningDesignDTO.getLearningDesignUIID().equals(WDDXTAGS.NUMERIC_NULL_VALUE_INTEGER))
@@ -619,6 +657,10 @@
learningDesign.setCopyTypeID(learningDesignDTO.getCopyTypeID());
if(!learningDesignDTO.getHelpText().equals(WDDXTAGS.STRING_NULL_VALUE))
learningDesign.setHelpText(learningDesignDTO.getHelpText());
+ if(!learningDesignDTO.getOfflineInstructions().equals(WDDXTAGS.STRING_NULL_VALUE))
+ learningDesign.setHelpText(learningDesignDTO.getOfflineInstructions());
+ if(!learningDesignDTO.getOnlineInstructions().equals(WDDXTAGS.STRING_NULL_VALUE))
+ learningDesign.setHelpText(learningDesignDTO.getOnlineInstructions());
if(!learningDesignDTO.getVersion().equals(WDDXTAGS.STRING_NULL_VALUE))
learningDesign.setVersion(learningDesignDTO.getVersion());
if(!learningDesignDTO.getLicenseText().equals(WDDXTAGS.STRING_NULL_VALUE))
Index: lams_common/src/java/org/lamsfoundation/lams/themes/CSSProperty.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/CSSProperty.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/CSSProperty.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,223 @@
+package org.lamsfoundation.lams.themes;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * @hibernate.class
+ * table="lams_css_property"
+ *
+*/
+public class CSSProperty implements Serializable {
+
+ /** identifier field */
+ private Long propertyId;
+
+ /** persistent field */
+ private String name;
+
+ /** persistent field */
+ private String value;
+
+ /** persistent field */
+ private byte type;
+
+ /** persistent field */
+ private String styleSubset;
+
+ /** persistent field */
+ private CSSStyle style;
+
+ /** full constructor */
+ public CSSProperty(Long propertyId, String name, String value, byte type, String styleSubset, CSSStyle style) {
+ this.propertyId = propertyId;
+ this.name = name;
+ this.value = value;
+ this.type = type;
+ this.styleSubset = styleSubset;
+ this.style = style;
+ }
+
+ /** Create a property using just the name and the value (and any style subset e.g. _tf).
+ * Generates the appropriate type. */
+ public CSSProperty(String name, Object value, String styleSubset) {
+ this.name = name;
+ this.value = value != null ? value.toString() : null;
+ this.type = getValueType(value);
+ this.styleSubset = styleSubset;
+ }
+
+ /** default constructor */
+ public CSSProperty() {
+ }
+
+ /**
+ * @hibernate.id
+ * generator-class="assigned"
+ * type="java.lang.Long"
+ * column="property_id"
+ *
+ */
+ public Long getPropertyId() {
+ return this.propertyId;
+ }
+
+ public void setPropertyId(Long propertyId) {
+ this.propertyId = propertyId;
+ }
+
+ /**
+ * @hibernate.property
+ * column="name"
+ * length="255"
+ * not-null="true"
+ *
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @hibernate.property
+ * column="value"
+ * length="100"
+ * not-null="true"
+ *
+ */
+ public String getValue() {
+ return this.value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Should be a value in PropertyType.
+ *
+ * @hibernate.property
+ * column="type"
+ * length="4"
+ * not-null="true"
+ *
+ */
+ public byte getType() {
+ return this.type;
+ }
+
+ public void setType(byte type) {
+ this.type = type;
+ }
+
+ /**
+ * @hibernate.property
+ * column="style_subset"
+ * length="20"
+ * not-null="true"
+ *
+ */
+ public String getStyleSubset() {
+ return this.styleSubset;
+ }
+
+ public void setStyleSubset(String styleSubset) {
+ this.styleSubset = styleSubset;
+ }
+
+ /**
+ * @hibernate.many-to-one
+ * not-null="true"
+ * cascade="none"
+ * update="true"
+ * insert="true"
+ * @hibernate.column name="style_id"
+ *
+ */
+ public CSSStyle getStyle() {
+ return this.style;
+ }
+
+ public void setStyle(CSSStyle style) {
+ this.style = style;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("propertyId", getPropertyId())
+ .append("name", name)
+ .append("value", value)
+ .append("type", type)
+ .append("styleSubset",styleSubset)
+ .toString();
+ }
+
+ /** Get the value of the property as its correct type e.g. Integer */
+ public Object getValueAsObject() throws NumberFormatException, ParseException {
+ if ( value != null ) {
+ switch ( getType() ) {
+ case PropertyType.BOOLEAN:
+ return Boolean.valueOf(value);
+ case PropertyType.DATE:
+ return getDate();
+ case PropertyType.DOUBLE:
+ return Double.valueOf(value);
+ case PropertyType.LONG:
+ return Long.valueOf(value);
+ default:
+ return (String) value;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ /** Determines the object's appropriate type. Coded in order of most expected to least expected. */
+ protected byte getValueType(Object value) {
+ if ( value != null ) {
+ if ( String.class.isInstance(value)) {
+ return PropertyType.STRING;
+ }
+ if ( Boolean.class.isInstance(value) ) {
+ return PropertyType.BOOLEAN;
+ }
+ if ( Integer.class.isInstance(value) || Long.class.isInstance(value) ||
+ Short.class.isInstance(value) || BigInteger.class.isInstance(value)) {
+ return PropertyType.LONG;
+ }
+ if ( Double.class.isInstance(value) || Float.class.isInstance(value) ||
+ BigDecimal.class.isInstance(value) ) {
+ return PropertyType.DOUBLE;
+ }
+ if ( Calendar.class.isInstance(value) || Date.class.isInstance(value)) {
+ return PropertyType.DATE;
+ }
+ }
+ return PropertyType.STRING;
+ }
+ /**
+ * Returns a Calendar representation of the value.
+ *
+ * @throws ValueFormatException If able to convert the value to a Calendar.
+ */
+ private Calendar getDate() throws ParseException {
+ SimpleDateFormat df = new SimpleDateFormat();
+ Date date = df.parse(value);
+ Calendar calendar = new GregorianCalendar();
+ calendar.setTime(date);
+ return calendar;
+ }
+
+}
Index: lams_common/src/java/org/lamsfoundation/lams/themes/CSSStyle.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/CSSStyle.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/CSSStyle.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,113 @@
+package org.lamsfoundation.lams.themes;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * @hibernate.class
+ * table="lams_css_style"
+ *
+*/
+public class CSSStyle implements Serializable {
+
+ /** identifier field */
+ private Long styleId;
+
+ /** persistent field */
+ private CSSThemeVisualElement themeElement;
+
+ /** persistent field */
+ private Set properties;
+
+ /** full constructor */
+ public CSSStyle(Long styleId, CSSThemeVisualElement themeElement, Set properties) {
+ this.styleId = styleId;
+ this.themeElement = themeElement;
+ this.properties = properties;
+ }
+
+ /** default constructor */
+ public CSSStyle() {
+ }
+
+ /**
+ * @hibernate.id
+ * generator-class="native"
+ * type="java.lang.Long"
+ * column="style_id"
+ *
+ */
+ public Long getStyleId() {
+ return this.styleId;
+ }
+
+ public void setStyleId(Long styleId) {
+ this.styleId = styleId;
+ }
+
+ /**
+ * @hibernate.set
+ * lazy="true"
+ * inverse="true"
+ * cascade="all"
+ * @hibernate.collection-key
+ * column="style_id"
+ * @hibernate.collection-one-to-many
+ * class="org.lamsfoundation.lams.themes.CSSProperty"
+ *
+ */
+ public Set getProperties() {
+ return this.properties;
+ }
+
+ private void setProperties(Set properties) {
+ this.properties = properties;
+ }
+
+ /** Clear all the current properties of this style */
+ public void clearProperties() {
+ if ( getProperties() != null ) {
+ getProperties().clear();
+ }
+ }
+
+ /** Add a property to this style */
+ public void addProperty(CSSProperty property) {
+ if ( getProperties() == null ) {
+ Set set = new HashSet();
+ set.add(property);
+ setProperties(set);
+ } else {
+ getProperties().add(property);
+ }
+ property.setStyle(this);
+ }
+
+ /**
+ * @hibernate.many-to-one
+ * not-null="true"
+ * cascade="none"
+ * update="true"
+ * insert="true"
+ * @hibernate.column name="theme_ve_id"
+ *
+ */
+ public CSSThemeVisualElement getThemeElement() {
+ return this.themeElement;
+ }
+
+ public void setThemeElement(CSSThemeVisualElement themeElement) {
+ this.themeElement = themeElement;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("styleId", getStyleId())
+ .append("properties", getProperties())
+ .toString();
+ }
+
+}
Index: lams_common/src/java/org/lamsfoundation/lams/themes/CSSThemeVisualElement.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/CSSThemeVisualElement.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/CSSThemeVisualElement.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,297 @@
+package org.lamsfoundation.lams.themes;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.usermanagement.User;
+
+
+/**
+ * @hibernate.class
+ * table="lams_css_theme_ve"
+ *
+ * Models both a theme, and the visual elements that make up a theme. If we ever have
+ * themes within themes then this data structure will support that too!
+ *
+ * The isTheme() call will tell you if this is a theme or a visual element.
+ *
+*/
+public class CSSThemeVisualElement implements Serializable {
+
+ protected Logger log = Logger.getLogger(CSSThemeVisualElement.class);
+
+ /** identifier field */
+ private Long id;
+
+ /** persistent field */
+ private String name;
+
+ /** nullable persistent field */
+ private String description;
+
+ /** persistent field */
+ private boolean theme;
+
+ /** nullable persistent field */
+ private CSSThemeVisualElement parentTheme;
+
+ /** persistent field */
+ private Set users;
+
+ /** persistent field */
+ private Set styles;
+
+ /** persistent field */
+ private Set elements;
+
+ /** full constructor */
+ public CSSThemeVisualElement(Long id, String name, String description, boolean theme, CSSThemeVisualElement parentTheme, Set styles, Set users, Set elements) {
+ this.id = id;
+ this.name = name;
+ this.description = description;
+ this.theme = theme;
+ this.parentTheme = parentTheme;
+ this.styles = styles;
+ this.users = users;
+ this.elements = elements;
+ }
+
+ /** default constructor */
+ public CSSThemeVisualElement() {
+ }
+
+ /** minimal constructor */
+ public CSSThemeVisualElement(Long id, String name, boolean theme) {
+ this.id = id;
+ this.name = name;
+ this.theme = theme;
+ }
+
+ /**
+ * @hibernate.id
+ * generator-class="assigned"
+ * type="java.lang.Long"
+ * column="theme_ve_id"
+ *
+ */
+ public Long getId() {
+ return this.id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ /**
+ * @hibernate.property
+ * column="name"
+ * length="100"
+ * not-null="true"
+ *
+ */
+ public String getName() {
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @hibernate.property
+ * column="description"
+ * length="100"
+ *
+ */
+ public String getDescription() {
+ return this.description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * @hibernate.property
+ * column="theme_flag"
+ * length="1"
+ * not-null="true"
+ *
+ */
+ public boolean isTheme() {
+ return this.theme;
+ }
+
+ public void setTheme(boolean theme) {
+ this.theme = theme;
+ }
+
+ /**
+ * If a theme, then this is the base style. If a visual element, then
+ * it is the style for this element.
+ */
+ public CSSStyle getStyle() {
+ Set styleSet = getStyles();
+ if ( styleSet != null )
+ if ( styleSet.size() > 1 ) {
+ log.warn("Theme/Visual element has more than one style - only one can be used. "+this);
+ }
+ if ( styleSet.size() > 0 ) {
+ return (CSSStyle) styleSet.iterator().next();
+ }
+ return null;
+ }
+
+ /**
+ * If a theme, then this is the base style. If a visual element, then
+ * it is the style for this element.
+ */
+ public void setStyle(CSSStyle style) {
+ if ( getStyles() != null ) {
+ getStyles().clear();
+ getStyles().add(style);
+ } else {
+ Set styleSet = new HashSet();
+ styleSet.add(style);
+ setStyles(styleSet);
+ }
+ style.setThemeElement(this);
+ }
+
+ /**
+ *
+ * This is really a 1-1 as each theme/visual element has style should only be for one theme. Even if the
+ * values are the same, two styles should have different baseStyle records.
+ * But its easier with Hibernate to make it a uni-directional many to one.
+ *
+ * @hibernate.set
+ * lazy="true"
+ * inverse="true"
+ * cascade="all-delete-orphan"
+ *
+ * @hibernate.collection-key
+ * column="theme_ve_id"
+ *
+ * @hibernate.collection-one-to-many
+ * class="org.lamsfoundation.lams.themes.CSSStyle"
+ *
+ */
+ private Set getStyles() {
+ return this.styles;
+ }
+
+ private void setStyles(Set styles) {
+ this.styles = styles;
+ }
+
+ /**
+ *
+ * Users who have this theme as their style.
+ *
+ * @hibernate.set
+ * lazy="true"
+ * inverse="true"
+ * cascade="none"
+ * @hibernate.collection-key
+ * column="theme_id"
+ * @hibernate.collection-one-to-many
+ * class="org.lamsfoundation.lams.usermanagement.User"
+ *
+ */
+ private Set getUsers() {
+ return this.users;
+ }
+
+ private void setUsers(Set users) {
+ this.users = users;
+ }
+
+ public void clearUsers() {
+ if ( getUsers() != null ) {
+ getUsers().clear();
+ }
+ }
+
+ public void addUser(User user) {
+ if ( getUsers() == null ) {
+ Set set = new HashSet();
+ set.add(user);
+ setUsers(set);
+ } else {
+ getUsers().add(user);
+ }
+ user.setTheme(this);
+ }
+
+ /**
+ *
+ * The visual elements (or in the future sub-themes) that make up this theme
+ *
+ * @hibernate.set
+ * lazy="true"
+ * inverse="true"
+ * cascade="all-delete-orphan"
+ * @hibernate.collection-key
+ * column="parent_id"
+ * @hibernate.collection-one-to-many
+ * class="org.lamsfoundation.lams.themes.CSSThemeVisualElement"
+ *
+ */
+ public Set getElements() {
+ return this.elements;
+ }
+
+ private void setElements(Set elements) {
+ this.elements = elements;
+ }
+
+ public void clearElements() {
+ if ( getElements() != null ) {
+ getElements().clear();
+ }
+ }
+
+ public void addElement(CSSThemeVisualElement element) {
+ if ( getElements() == null ) {
+ Set set = new HashSet();
+ set.add(element);
+ setElements(set);
+ } else {
+ getElements().add(element);
+ }
+ element.setParentTheme(this);
+ }
+
+ /**
+ * @hibernate.many-to-one
+ * not-null="true"
+ * cascade="none"
+ * update="true"
+ * insert="true"
+ * @hibernate.column name="parent_id"
+ *
+ */
+ public CSSThemeVisualElement getParentTheme() {
+ return this.parentTheme;
+ }
+
+ public void setParentTheme(CSSThemeVisualElement parentTheme) {
+ this.parentTheme = parentTheme;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("id", getId())
+ .append("name", getName())
+ .append("description", getDescription())
+ .append("is theme?", isTheme())
+ .append("style", getStyle())
+ .append("visual elements", getElements())
+ .append("parent theme", getParentTheme())
+ .toString();
+ }
+
+}
Index: lams_common/src/java/org/lamsfoundation/lams/themes/PropertyType.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/PropertyType.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/PropertyType.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,96 @@
+/*
+ Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
+
+ http://www.gnu.org/licenses/gpl.txt
+*/
+
+package org.lamsfoundation.lams.themes;
+
+/**
+ * LAMS property types.
+ */
+public final class PropertyType {
+ /** String property type */
+ public static final int STRING = 1;
+ /** Long property type */
+ public static final int LONG = 2;
+ /** Double property type */
+ public static final int DOUBLE = 3;
+ /** Date property type */
+ public static final int DATE = 4;
+ /** Boolean property type */
+ public static final int BOOLEAN = 5;
+
+ /**
+ * The names of the supported property types,
+ * as used to convert to .
+ */
+ public static final String TYPENAME_STRING = "String";
+ public static final String TYPENAME_LONG = "Long";
+ public static final String TYPENAME_DOUBLE = "Double";
+ public static final String TYPENAME_DATE = "Date";
+ public static final String TYPENAME_BOOLEAN = "Boolean";
+
+ /**
+ * Returns the name of the specified type.
+ * @param type the property type
+ * @return the name of the specified type, defaults to String if no match.
+ */
+ public static String nameFromValue(int type) {
+ switch (type) {
+ case STRING:
+ return TYPENAME_STRING;
+ case BOOLEAN:
+ return TYPENAME_BOOLEAN;
+ case LONG:
+ return TYPENAME_LONG;
+ case DOUBLE:
+ return TYPENAME_DOUBLE;
+ case DATE:
+ return TYPENAME_DATE;
+ default:
+ return TYPENAME_STRING;
+ }
+ }
+
+ /**
+ * Returns the numeric constant value of the type with the specified name.
+ * @param name the name of the property type
+ * @return the numeric constant value, defaulting to String if name not recognised.
+ */
+ public static int valueFromName(String name) {
+ if (name.equals(TYPENAME_STRING)) {
+ return STRING;
+ } else if (name.equals(TYPENAME_BOOLEAN)) {
+ return BOOLEAN;
+ } else if (name.equals(TYPENAME_LONG)) {
+ return LONG;
+ } else if (name.equals(TYPENAME_DOUBLE)) {
+ return DOUBLE;
+ } else if (name.equals(TYPENAME_DATE)) {
+ return DATE;
+ } else {
+ return STRING;
+ }
+ }
+
+ /** private constructor to prevent instantiation */
+ private PropertyType() {
+ }
+}
+
Index: lams_common/src/java/org/lamsfoundation/lams/themes/dao/ICSSThemeDAO.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/dao/ICSSThemeDAO.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/dao/ICSSThemeDAO.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA
+
+ http://www.gnu.org/licenses/gpl.txt
+ */
+package org.lamsfoundation.lams.themes.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.themes.CSSThemeVisualElement;
+
+/**
+ * This class interacts with Spring's HibernateTemplate to save/delete and
+ * retrieve CSSTheme and other related objects.
+ *
+ * @author Fiona Malikoff
+ */
+public interface ICSSThemeDAO {
+ public abstract List getAllThemes();
+
+ public abstract CSSThemeVisualElement getThemeById(Long themeId);
+
+ public abstract List getThemeByName(String name);
+
+ public abstract void saveOrUpdateTheme(CSSThemeVisualElement theme);
+
+ public abstract void deleteTheme(CSSThemeVisualElement theme);
+
+ public abstract void deleteThemeById(Long themeId);
+}
\ No newline at end of file
Index: lams_common/src/java/org/lamsfoundation/lams/themes/dao/hibernate/CSSThemeDAO.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/dao/hibernate/CSSThemeDAO.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/dao/hibernate/CSSThemeDAO.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,70 @@
+/*
+ * Created on Nov 20, 2004
+ *
+ * Last modified on 20 Nov, 2004
+ */
+package org.lamsfoundation.lams.themes.dao.hibernate;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.themes.CSSThemeVisualElement;
+import org.lamsfoundation.lams.themes.dao.ICSSThemeDAO;
+import org.springframework.orm.hibernate.support.HibernateDaoSupport;
+
+/**
+ * This class interacts with Spring's HibernateTemplate to save/delete and
+ * retrieve CSSThemeVisualElement and other related objects.
+ *
+ * @author Fiona Malikoff
+*/
+public class CSSThemeDAO extends HibernateDaoSupport implements ICSSThemeDAO {
+
+ /**
+ * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#getAllThemes()
+ */
+ public List getAllThemes() {
+ return getHibernateTemplate().find("from CSSThemeVisualElement c where c.theme=true");
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#getThemeById(java.lang.Long)
+ */
+ public CSSThemeVisualElement getThemeById(Long themeId) {
+ String queryString = "from CSSThemeVisualElement c where c.id=?";
+ List list = getHibernateTemplate().find(queryString,themeId);
+ if ( list != null && list.size() > 0 )
+ return (CSSThemeVisualElement) list.get(0);
+ else
+ return null;
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#getThemeByName(java.lang.String)
+ */
+ public List getThemeByName(String name) {
+ String queryString = "from CSSThemeVisualElement c where c.name=? and c.theme=true";
+ return getHibernateTemplate().find(queryString,name);
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#saveOrUpdateTheme(org.lamsfoundation.lams.usermanagement.User)
+ */
+ public void saveOrUpdateTheme(CSSThemeVisualElement theme) {
+ getHibernateTemplate().saveOrUpdate(theme);
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#deleteTheme(org.lamsfoundation.lams.usermanagement.User)
+ */
+ public void deleteTheme(CSSThemeVisualElement theme) {
+ getHibernateTemplate().delete(theme);
+ }
+
+ /**
+ * @see org.lamsfoundation.lams.themes.dao.ICSSThemeDAO#deleteUserById(java.lang.Integer)
+ */
+ public void deleteThemeById(Long themeId) {
+ getHibernateTemplate().delete(getThemeById(themeId));
+ }
+
+}
Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSStyleDTO.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSStyleDTO.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSStyleDTO.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,156 @@
+/*
+Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+http://www.gnu.org/licenses/gpl.txt
+*/
+package org.lamsfoundation.lams.themes.dto;
+
+import java.text.ParseException;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.themes.CSSProperty;
+import org.lamsfoundation.lams.themes.CSSStyle;
+
+/**
+ * Models the Theme structure that is used to communicate with Flash.
+ * Includes all the information from Theme down to each individual property.
+ * Based on the native Flash structure for Style objects.
+ *
+ * This class extends Hashtable to make it look like the normal Flash object
+ * structure in a wddx packet. This class does not implement the Map interface.
+ *
+ * @author Fiona Malikoff
+ */
+public class CSSStyleDTO extends Hashtable {
+
+ protected Logger log = Logger.getLogger(CSSStyleDTO.class);
+
+ /**
+ * Create the DTO using the data from Flash
+ *
+ * @param styleHashtable
+ */
+ public CSSStyleDTO(Hashtable styleHashtable) {
+ super(styleHashtable);
+ }
+
+ /**
+ * Create the DTO from a database object.
+ *
+ * @param styleObject
+ * @throws ParseException
+ */
+ public CSSStyleDTO(CSSStyle styleObject) {
+ super.put(CSSThemeDTO.TEXT_FORMAT_TAG, new Hashtable());
+ Set properties = styleObject.getProperties();
+ if ( properties != null && properties.size() > 0 ) {
+ Iterator iter = properties.iterator();
+ while (iter.hasNext()) {
+ CSSProperty element = (CSSProperty) iter.next();
+ add(element);
+ }
+ }
+ }
+
+ /**
+ * Create the database object from this DTO. Can only create
+ * a whole new object as the id isn't stored in the DTO.
+ *
+ * Don't call it getCSSStyle, or CSSStyle will be be written out in the
+ * WDDX packet created from the DTO!
+ */
+ public CSSStyle createNewCSSStyle() {
+ CSSStyle style = new CSSStyle();
+ if ( this.size() > 0 ) {
+ Iterator iter= this.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry element = (Map.Entry) iter.next();
+ String key = (String) element.getKey();
+ Object value = element.getValue();
+ if ( CSSThemeDTO.TEXT_FORMAT_TAG.equals(key) && Map.class.isInstance(value) ) {
+ processTF((Map)value, style);
+ } else {
+ CSSProperty property = new CSSProperty(key, value, null);
+ style.addProperty(property);
+ }
+ }
+ }
+ return style;
+ }
+
+ /** Flatten the _tf entries, marking them using the styleSubset field */
+ private void processTF(Map tfMap, CSSStyle style) {
+ Iterator iter = tfMap.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry element = (Map.Entry) iter.next();
+ String key = (String) element.getKey();
+ Object value = element.getValue();
+ CSSProperty property = new CSSProperty(key, value, CSSThemeDTO.TEXT_FORMAT_TAG);
+ style.addProperty(property);
+ }
+ }
+
+ /** Can't do a putAll on this special class */
+ public void putAll(Map m) {
+ return;
+ }
+
+ /** Can't put any arbitrary object in this special class */
+ public Object put(Object key, Object value) {
+ return null;
+ }
+
+ /**
+ * Add a database property object to this style object, doing the necessary conversions.
+ *
+ * @param property
+ * @throws NumberFormatException
+ * @throws ParseException
+ */
+ public void add(CSSProperty property) {
+ try {
+ if ( CSSThemeDTO.TEXT_FORMAT_TAG.equals(property.getStyleSubset()) ) {
+ Hashtable tf = (Hashtable) this.get(CSSThemeDTO.TEXT_FORMAT_TAG);
+ tf.put(property.getName(), property.getValueAsObject() );
+ } else {
+ super.put(property.getName(), property.getValueAsObject() );
+ }
+ } catch ( NumberFormatException e ) {
+ log.error("NumberFormatException thrown processing property "+property+". Skipping this property",e);
+ } catch ( ParseException e ) {
+ log.error("ParseException thrown processing property "+property+". Skipping this property",e);
+ }
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(1000);
+ buf.append("[CSSStyleDTO: ");
+ Iterator iter = this.entrySet().iterator();
+ while (iter.hasNext()) {
+ Map.Entry element = (Map.Entry) iter.next();
+ buf.append(element.getKey()+"="+element.getValue());
+ }
+ buf.append("]");
+ return buf.toString();
+ }
+
+}
Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeBriefDTO.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeBriefDTO.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeBriefDTO.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,77 @@
+/*
+Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+http://www.gnu.org/licenses/gpl.txt
+*/
+package org.lamsfoundation.lams.themes.dto;
+
+import org.lamsfoundation.lams.learningdesign.dto.BaseDTO;
+import org.lamsfoundation.lams.themes.CSSThemeVisualElement;
+
+/**
+ * Contains only the basic details for a theme - name, id, etc. Does not
+ * contain any of the style details. Designed for returning the list
+ * of all themes to Flash.
+ *
+ * @author Fiona Malikoff
+ */
+public class CSSThemeBriefDTO extends BaseDTO {
+
+ public final static String ID_TAG = "id";
+ public final static String NAME_TAG = "name";
+ public final static String DESCRIPTION_TAG = "description";
+
+ /* The variables must have the same names as the tags above, or the WDDX packet will have the
+ * wrong tag names when sent to Flash. We can model the visual elements as CSSVisualElementDTO
+ * any arbitrary Java class to a hashtable. There is no point modelling the style objects
+ * as anything but a hashtable, as all they contain are properties.
+ */
+ private Long id;
+ private String name;
+ private String description;
+
+ /**
+ * Create the DTO from a database object.
+ */
+ public CSSThemeBriefDTO(CSSThemeVisualElement theme) {
+ if ( theme != null ) {
+ this.id = theme.getId();
+ this.name = theme.getName();
+ this.description = theme.getDescription();
+ }
+ }
+
+ /**
+ * @return Returns the description.
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * @return Returns the id.
+ */
+ public Long getId() {
+ return id;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+}
Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeDTO.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeDTO.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSThemeDTO.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,217 @@
+/*
+Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+http://www.gnu.org/licenses/gpl.txt
+*/
+package org.lamsfoundation.lams.themes.dto;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.learningdesign.dto.BaseDTO;
+import org.lamsfoundation.lams.themes.CSSThemeVisualElement;
+
+/**
+ * Models the Theme structure that is used to communicate with Flash.
+ * Includes all the information from Theme down to each individual property.
+ * Based on the native Flash structure for Style objects.
+ *
+ * @author Fiona Malikoff
+ */
+public class CSSThemeDTO extends BaseDTO {
+
+ protected Logger log = Logger.getLogger(CSSThemeDTO.class);
+
+ public final static String ID_TAG = "id";
+ public final static String NAME_TAG = "name";
+ public final static String DESCRIPTION_TAG = "description";
+ public final static String BASE_STYLE_OBJECT_TAG = "baseStyleObject";
+ public final static String VISUAL_ELEMENTS_TAG = "visualElements";
+ public final static String TEXT_FORMAT_TAG = "_tf";
+ public final static String STYLE_OBJECT_TAG = "styleObject";
+
+ /* The variables must have the same names as the tags above, or the WDDX packet will have the
+ * wrong tag names when sent to Flash. We can model the visual elements as CSSVisualElementDTO
+ * any arbitrary Java class to a hashtable. There is no point modelling the style objects
+ * as anything but a hashtable, as all they contain are properties.
+ */
+ private Long id;
+ private String name;
+ private String description;
+ private CSSStyleDTO baseStyleObject;
+ private List visualElements;
+
+ /**
+ * Create the DTO using the data from Flash
+ */
+ public CSSThemeDTO(Hashtable wddxData) {
+ if ( wddxData != null ) {
+ this.id = convertToLong(wddxData.get(ID_TAG));
+ this.name = (String) wddxData.get(NAME_TAG);
+ this.description = (String) wddxData.get(DESCRIPTION_TAG);
+ Hashtable so = (Hashtable) wddxData.get(BASE_STYLE_OBJECT_TAG);
+ if ( so != null ) {
+ baseStyleObject = new CSSStyleDTO(so);
+ }
+ List ve = (List) wddxData.get(VISUAL_ELEMENTS_TAG);
+ if ( ve != null ) {
+ int numElements = ve.size();
+ visualElements = new ArrayList(numElements);
+ Iterator iter = ve.iterator();
+ while ( iter.hasNext() ) {
+ visualElements.add(new CSSVisualElementDTO((Hashtable) iter.next()));
+ }
+ }
+ }
+ }
+
+ /**
+ * Create the DTO from a database object.
+ *
+ * @throws ParseException
+ *
+ */
+ public CSSThemeDTO (CSSThemeVisualElement theme){
+ if ( theme != null ) {
+ this.id = theme.getId();
+ this.name = theme.getName();
+ this.description = theme.getDescription();
+ if ( theme.getStyle()!= null ) {
+ this.baseStyleObject = new CSSStyleDTO(theme.getStyle());
+ }
+ if ( theme.getElements() != null ) {
+ int numElements = theme.getElements().size();
+ if ( numElements > 0 ) {
+ this.visualElements = new ArrayList(numElements);
+ Iterator iter = theme.getElements().iterator();
+ while ( iter.hasNext() ) {
+ CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next();
+ if ( element.isTheme() ) {
+ log.error("Theme found within another theme. Flash packet currently doesn't support this format. "
+ +" Theme being skipped. "+element);
+ } else {
+ this.visualElements.add(new CSSVisualElementDTO(element));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Creates the database format object from this DTO. Does not look up any
+ * existing entries in the database. Does not set the users field.
+ *
+ * Don't call it getCSSTheme, or CSSTheme will be be written out in the
+ * WDDX packet created from the DTO!
+ */
+ public CSSThemeVisualElement createCSSThemeVisualElement() {
+ CSSThemeVisualElement theme = new CSSThemeVisualElement();
+ if ( baseStyleObject != null ) {
+ theme.setStyle(baseStyleObject.createNewCSSStyle());
+ }
+ theme.setDescription(description);
+ theme.setName(name);
+ theme.setId(id);
+ theme.setTheme(true);
+ if ( visualElements != null && visualElements.size() > 0 ) {
+ Iterator iter = visualElements.iterator();
+ while (iter.hasNext()) {
+ CSSVisualElementDTO element = (CSSVisualElementDTO) iter.next();
+ theme.addElement(element.createCSSThemeVisualElement());
+ }
+ }
+ return theme;
+ }
+
+ /**
+ * Update an existing CSSTheme object ( probably from the database) with the
+ * current values. Arguably this functionality belongs in the CSSTheme object but
+ * that would confused matters as some of the field copying code would be in
+ * this object, and other bits would be in the CSSTheme object. Does not
+ * change the user's field.
+ *
+ * Changes the parameter object (currentTheme) and returns the modified object.
+ */
+ public CSSThemeVisualElement updateCSSTheme(CSSThemeVisualElement currentTheme) {
+ if ( baseStyleObject != null ) {
+ currentTheme.setStyle(baseStyleObject.createNewCSSStyle());
+ } else {
+ currentTheme.setStyle(null);
+ }
+ currentTheme.setDescription(description);
+ currentTheme.setName(name);
+ currentTheme.setId(id);
+ currentTheme.clearElements();
+ if ( visualElements != null && visualElements.size() > 0 ) {
+ Iterator iter = visualElements.iterator();
+ while (iter.hasNext()) {
+ CSSVisualElementDTO element = (CSSVisualElementDTO) iter.next();
+ currentTheme.addElement(element.createCSSThemeVisualElement());
+ }
+ }
+ return currentTheme;
+ }
+
+ /**
+ * @return Returns the baseStyleObject.
+ */
+ public CSSStyleDTO getBaseStyleObject() {
+ return baseStyleObject;
+ }
+ /**
+ * @return Returns the description.
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * @return Returns the id.
+ */
+ public Long getId() {
+ return id;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @return Returns the visualElements.
+ */
+ public List getVisualElements() {
+ return visualElements;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("id", id)
+ .append("name", name)
+ .append("description", description)
+ .append("baseStyleObject", baseStyleObject)
+ .append("visualElements", visualElements)
+ .toString();
+ }
+
+}
Index: lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSVisualElementDTO.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSVisualElementDTO.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/themes/dto/CSSVisualElementDTO.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,119 @@
+/*
+Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+http://www.gnu.org/licenses/gpl.txt
+*/
+package org.lamsfoundation.lams.themes.dto;
+
+import java.text.ParseException;
+import java.util.Hashtable;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.learningdesign.dto.BaseDTO;
+import org.lamsfoundation.lams.themes.CSSStyle;
+import org.lamsfoundation.lams.themes.CSSThemeVisualElement;
+
+/**
+ * Models the Theme structure that is used to communicate with Flash.
+ * Includes all the information from Theme down to each individual property.
+ * Based on the native Flash structure for Style objects.
+ *
+ * Can't resue the ThemeDTO as that has more fields, which would may be output
+ * in the Flash packet. Also the name of the style field is different.
+ *
+ * @author Fiona Malikoff
+ */
+public class CSSVisualElementDTO extends BaseDTO {
+
+ protected Logger log = Logger.getLogger(CSSVisualElementDTO.class);
+
+ /* The variables must have the same names as the tags in CSSThemeDTO, or the WDDX packet will have the
+ * wrong tag names when sent to Flash. We can model the style objects as CSSStyleDTO and
+ * CSSVisualElementDTO any arbitrary Java class to a hashtable. Note: the baseStyleObject
+ */
+ private String name;
+ private CSSStyleDTO styleObject; // contains _tf if needed
+
+ /**
+ * Create the DTO using the data from Flash
+ */
+ public CSSVisualElementDTO(Hashtable wddxData) {
+ if ( wddxData != null ) {
+ this.name = (String) wddxData.get(CSSThemeDTO.NAME_TAG);
+ Hashtable so = (Hashtable) wddxData.get(CSSThemeDTO.STYLE_OBJECT_TAG);
+ if ( so != null ) {
+ styleObject = new CSSStyleDTO(so);
+ }
+ }
+ }
+
+ /**
+ * Create the DTO from a database object.
+ *
+ * @throws ParseException
+ *
+ */
+ public CSSVisualElementDTO(CSSThemeVisualElement visualElement) {
+
+ if ( visualElement != null ) {
+ this.name = visualElement.getName();
+ CSSStyle style = visualElement.getStyle();
+ if ( style != null ) {
+ styleObject = new CSSStyleDTO(style);
+ }
+
+ }
+ }
+
+ /**
+ * Create the database object from this DTO. Can only create
+ * a whole new object as the id isn't stored in the DTO.
+ *
+ * Don't call it getCSSVisualElement, or CSSVisualElement will be be
+ * written out in the WDDX packet created from the DTO!
+ *
+ */
+ public CSSThemeVisualElement createCSSThemeVisualElement() {
+ CSSThemeVisualElement visualElement = new CSSThemeVisualElement();
+ visualElement.setName(name);
+ visualElement.setStyle(styleObject.createNewCSSStyle());
+ visualElement.setTheme(false);
+ return visualElement;
+ }
+
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("name", name)
+ .append("styleObject", styleObject)
+ .toString();
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @return Returns the styleObject.
+ */
+ public CSSStyleDTO getStyleObject() {
+ return styleObject;
+ }
+}
Index: lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java
===================================================================
diff -u -rb9d108908940cd377d1c092fd32b2dea39d4c4f1 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java (.../Tool.java) (revision b9d108908940cd377d1c092fd32b2dea39d4c4f1)
+++ lams_common/src/java/org/lamsfoundation/lams/tool/Tool.java (.../Tool.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -103,6 +103,12 @@
/** persistent field */
private Integer groupingSupportTypeId;
+ /** persistent field */
+ private String toolIdentifier;
+
+ /** persistent field */
+ private String toolVersion;
+
/** full constructor */
public Tool(Long toolId,
String learnerUrl,
@@ -124,7 +130,9 @@
Date createDateTime,
String monitorUrl,
String contributeUrl,
- String moderationUrl)
+ String moderationUrl,
+ String toolIdentifier,
+ String toolVersion)
{
this.toolId = toolId;
this.learnerUrl = learnerUrl;
@@ -147,6 +155,8 @@
this.monitorUrl = monitorUrl;
this.contributeUrl = contributeUrl;
this.moderationUrl = moderationUrl;
+ this.toolIdentifier = toolIdentifier;
+ this.toolVersion = toolVersion;
}
/** default constructor */
@@ -169,7 +179,9 @@
Set activities,
Integer groupingSupportTypeId,
Date createDateTime,
- String monitorUrl)
+ String monitorUrl,
+ String toolIdentifier,
+ String toolVersion)
{
this.toolId = toolId;
this.learnerUrl = learnerUrl;
@@ -187,6 +199,8 @@
this.groupingSupportTypeId = groupingSupportTypeId;
this.createDateTime = createDateTime;
this.monitorUrl = monitorUrl;
+ this.toolIdentifier = toolIdentifier;
+ this.toolVersion = toolVersion;
}
/**
@@ -479,6 +493,30 @@
{
this.monitorUrl = monitorUrl;
}
+
+
+ /**
+ * @hibernate.property column="tool_identifier" length="64"
+ */
+ public String getToolIdentifier() {
+ return this.toolIdentifier;
+ }
+
+ public void setToolIdentifier(String toolIdentifier) {
+ this.toolIdentifier = toolIdentifier;
+ }
+
+ /**
+ * @hibernate.property column="tool_version" length="10"
+ */
+ public String getToolVersion() {
+ return this.toolVersion;
+ }
+
+ public void setToolVersion(String toolVersion) {
+ this.toolVersion = toolVersion;
+ }
+
public String toString() {
return new ToStringBuilder(this)
.append("toolId", getToolId())
Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java
===================================================================
diff -u -re416d64a684ed42b23eb2593ef8801a245d393f1 -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java (.../User.java) (revision e416d64a684ed42b23eb2593ef8801a245d393f1)
+++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/User.java (.../User.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -9,6 +9,7 @@
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
+import org.lamsfoundation.lams.themes.CSSThemeVisualElement;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
/**
@@ -90,6 +91,9 @@
private Organisation baseOrganisation;
/** persistent field */
+ private CSSThemeVisualElement theme;
+
+ /** persistent field */
private Set learnerProgresses;
/** persistent field */
@@ -106,7 +110,7 @@
private String fullName;
/** full constructor */
- public User(String login, String password, String title, String firstName, String lastName, String addressLine1, String addressLine2, String addressLine3, String city, String state, String country, String dayPhone, String eveningPhone, String mobilePhone, String fax, String email, Boolean disabledFlag, Date createDate, Workspace workspace, AuthenticationMethod authenticationMethod, Set userOrganisations, Organisation baseOrganisation, Set learnerProgresses, Set userToolSessions, Set userGroups, Set learningDesigns, Set lessons) {
+ public User(String login, String password, String title, String firstName, String lastName, String addressLine1, String addressLine2, String addressLine3, String city, String state, String country, String dayPhone, String eveningPhone, String mobilePhone, String fax, String email, Boolean disabledFlag, Date createDate, Workspace workspace, AuthenticationMethod authenticationMethod, CSSThemeVisualElement theme, Set userOrganisations, Organisation baseOrganisation, Set learnerProgresses, Set userToolSessions, Set userGroups, Set learningDesigns, Set lessons) {
this.login = login;
this.password = password;
this.title = title;
@@ -127,6 +131,7 @@
this.createDate = createDate;
this.workspace = workspace;
this.authenticationMethod = authenticationMethod;
+ this.theme = theme;
this.userOrganisations = userOrganisations;
this.baseOrganisation = baseOrganisation;
this.learnerProgresses = learnerProgresses;
@@ -463,6 +468,20 @@
/**
* @hibernate.many-to-one
+ * not-null="false"
+ * @hibernate.column name="theme_id"
+ *
+ */
+ public CSSThemeVisualElement getTheme() {
+ return this.theme;
+ }
+
+ public void setTheme(CSSThemeVisualElement theme) {
+ this.theme = theme;
+ }
+
+ /**
+ * @hibernate.many-to-one
* not-null="true"
* @hibernate.column name="base_organisation_id"
*
Index: lams_common/src/java/org/lamsfoundation/lams/util/LanguageUtil.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/util/LanguageUtil.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/util/LanguageUtil.java (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -0,0 +1,73 @@
+/*
+Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+USA
+
+http://www.gnu.org/licenses/gpl.txt
+*/
+package org.lamsfoundation.lams.util;
+
+import java.util.Locale;
+
+/**
+ * Various internationalisation (internationalization) utilities.
+ *
+ * @author Fiona Malikoff
+ *
+ */
+public class LanguageUtil {
+
+ /**
+ *
+ */
+ public LanguageUtil() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ public static void main(String[] args) {
+
+ String[] arr = null;
+
+ Locale defaultLocale = Locale.getDefault();
+ if ( defaultLocale != null ) {
+ System.out.println("Default locale "+defaultLocale.getCountry()
+ +":"+defaultLocale.getISO3Country()
+ +":"+defaultLocale.getDisplayCountry()
+ +":"+defaultLocale.getLanguage()
+ +":"+defaultLocale.getISO3Language());
+ }
+ printArray(Locale.getISOCountries(), "2 code countries: ");
+ printArray(Locale.getISOLanguages(), "2 code lamguages: ");
+ }
+
+ /**
+ * @param arr
+ * @param comment
+ */
+ private static void printArray(String[] arr, String comment) {
+ System.out.println(comment);
+ int i=0;
+ while ( i 0 );
+ }
+
+ public void testGetThemeById() {
+ CSSThemeVisualElement theme = themeDAO.getThemeById(RUBY_THEME_ID);
+ assertTrue("Theme returned is Ruby theme",
+ theme!=null && RUBY_THEME_NAME.equals(theme.getName()));
+ }
+
+ public void testGetThemeByName() {
+ List list = themeDAO.getThemeByName(RUBY_THEME_NAME);
+ assertTrue("At least one theme returned", list != null && list.size() > 0 );
+ Iterator iter = list.iterator();
+ while (iter.hasNext()) {
+ CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next();
+ assertEquals("Theme has correct name (ruby)",RUBY_THEME_NAME,element.getName());
+ }
+ }
+
+ public void testSaveOrUpdateTheme() {
+ try {
+ // create a new theme
+ CSSThemeVisualElement theme = saveTheme("testSaveOrUpdateTheme", "testSaveOrUpdateTheme description");
+ Long themeId = theme.getId();
+ CSSStyle baseStyle = theme.getStyle();
+ Set elements = theme.getElements();
+ Iterator iter = elements.iterator();
+ CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next();
+
+ // update the theme and check the changes
+ theme.setName("testSaveOrUpdateTheme2");
+ theme.setDescription("testSaveOrUpdateTheme2 description");
+ element.setName("extendingButton");
+ themeDAO.saveOrUpdateTheme(theme);
+ CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId);
+ checkTheme("testSaveOrUpdateTheme2", themeId, "testSaveOrUpdateTheme2 description",
+ "extendingButton", dbTheme);
+
+ } catch (ParseException e) {
+ fail("ParseException thrown"+e.getMessage());
+ }
+ }
+
+
+ public void testDeleteTheme() {
+ CSSThemeVisualElement theme = null;
+ try {
+ theme = saveTheme("testDeleteTheme", "testDeleteTheme description");
+ } catch (ParseException e) {
+ fail("ParseException thrown"+e.getMessage());
+ }
+ Long themeId = theme.getId();
+
+ themeDAO.deleteTheme(theme);
+ themeDAO.getHibernateTemplate().flush();
+ CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId);
+ assertNull("Saved theme cannot be retrieved after deletion",dbTheme);
+ }
+
+ public void testDeleteThemeById() {
+ CSSThemeVisualElement theme = null;
+ try {
+ theme = saveTheme("testDeleteThemeById", "testDeleteThemeById description");
+ } catch (ParseException e) {
+ fail("ParseException thrown"+e.getMessage());
+ }
+ Long themeId = theme.getId();
+
+ themeDAO.deleteThemeById(themeId);
+ themeDAO.getHibernateTemplate().flush();
+ CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId);
+ assertNull("Saved theme cannot be retrieved after deletion",dbTheme);
+ }
+
+ /* ************* End of tests ***********************************/
+
+ private CSSThemeVisualElement saveTheme(String themeName, String description) throws ParseException {
+
+ CSSThemeVisualElement theme = createNewTheme(themeName, description, "button");
+ themeDAO.saveOrUpdateTheme(theme);
+ Long themeId = theme.getId();
+ themeDAO.getHibernateTemplate().flush();
+
+ CSSThemeVisualElement dbTheme = themeDAO.getThemeById(themeId);
+ assertNotNull("Saved theme can be retrieved",dbTheme);
+ checkTheme(themeName, themeId, description, "button", dbTheme);
+ assertEquals(themeName, dbTheme.getName());
+ return dbTheme;
+ }
+
+ /* if you change any of the values in the new theme, please change checkTheme to match */
+ private CSSThemeVisualElement createNewTheme(String themeName, String description, String elementName) {
+
+ CSSThemeVisualElement theme = new CSSThemeVisualElement();
+
+ theme.setDescription(description);
+ theme.setName(themeName);
+ theme.setTheme(true);
+
+ CSSStyle baseStyle = new CSSStyle();
+ CSSProperty property = new CSSProperty("borderStyle", "outset", null);
+ baseStyle.addProperty(property);
+ property = new CSSProperty("rollOverColor", new Long(16711680), null);
+ baseStyle.addProperty(property);
+ // try it as a double, as that is what WDDX creates
+ property = new CSSProperty("color", new Double(12452097), CSSThemeDTO.TEXT_FORMAT_TAG);
+ baseStyle.addProperty(property);
+
+ theme.setStyle(baseStyle);
+
+ CSSStyle elementStyle = new CSSStyle();
+ property = new CSSProperty("selectionColor", new Double(16711681), null);
+ elementStyle.addProperty(property);
+ property = new CSSProperty("display", "block", CSSThemeDTO.TEXT_FORMAT_TAG);
+ elementStyle.addProperty(property);
+
+ CSSThemeVisualElement element = new CSSThemeVisualElement();
+ element.setName(elementName);
+ element.setStyle(elementStyle);
+ element.setTheme(false);
+
+ theme.addElement(element);
+
+ return theme;
+ }
+
+ /* This attempts to check that the correct values have been written to the database. Doesn't really work
+ * as it isn't the db object that it is returned - it is the cached Hibernate object. e.g. if the cascades
+ * fail and no CSSThemeVisualElement are written to the database, the tested object contains them anyway!!!!
+ *
+ * @param themeName
+ * @param themeId
+ * @param description
+ * @param elementName
+ * @param theme
+ * @throws ParseException
+ */
+ private void checkTheme(String themeName, Long themeId, String description, String elementName, CSSThemeVisualElement theme) throws ParseException {
+
+ assertEquals(theme.getDescription(), description);
+ assertEquals(theme.getName(),themeName);
+ assertTrue("Theme flag for theme is true", theme.isTheme());
+
+ CSSStyle baseStyle = theme.getStyle();
+ assertNotNull(baseStyle);
+ Set bsproperties = baseStyle.getProperties();
+ assertNotNull(bsproperties);
+ Iterator iter = bsproperties.iterator();
+ while (iter.hasNext()) {
+ CSSProperty property = (CSSProperty) iter.next();
+ if ( "borderStyle".equals(property.getName()) ) {
+ assertEquals(property.getValueAsObject(), "outset");
+ assertNull(property.getStyleSubset());
+ } else if ( "rollOverColor".equals(property.getName()) ) {
+ assertEquals(property.getValueAsObject(), new Long(16711680));
+ assertNull(property.getStyleSubset());
+ } else if ( "color".equals(property.getName()) ) {
+ assertEquals(property.getValueAsObject(), new Double(12452097));
+ assertEquals(property.getStyleSubset(), CSSThemeDTO.TEXT_FORMAT_TAG);
+ } else {
+ fail("Unexpected property in baseStyle "+property);
+ }
+ }
+
+ Set elements = theme.getElements();
+ assertNotNull(elements);
+ iter = elements.iterator();
+ while (iter.hasNext()) {
+ CSSThemeVisualElement element = (CSSThemeVisualElement) iter.next();
+ assertEquals(element.getName(), elementName);
+ assertNull("Description is null",element.getDescription());
+ assertFalse("Theme flag for element is false", element.isTheme());
+ assertNotNull(element.getStyle());
+ assertNotNull(element.getStyle().getProperties());
+ Iterator iter2 = element.getStyle().getProperties().iterator();
+ while (iter2.hasNext()) {
+ CSSProperty property= (CSSProperty) iter2.next();
+ if ( "selectionColor".equals(property.getName()) ) {
+ assertEquals(property.getValueAsObject(), new Double(16711681));
+ assertNull(property.getStyleSubset());
+ } else if ( "display".equals(property.getName()) ) {
+ assertEquals(property.getValueAsObject(), "block");
+ assertEquals(property.getStyleSubset(), CSSThemeDTO.TEXT_FORMAT_TAG);
+ } else {
+ fail("Unexpected property in baseStyle "+property);
+ }
+ }
+ }
+
+ }
+
+
+}
Index: lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java
===================================================================
diff -u -rd1b5a741bb40c5bf60ff7d55fa11322ed769644f -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java (.../ToolDataAccessTestCase.java) (revision d1b5a741bb40c5bf60ff7d55fa11322ed769644f)
+++ lams_common/test/java/org/lamsfoundation/lams/tool/ToolDataAccessTestCase.java (.../ToolDataAccessTestCase.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -55,6 +55,8 @@
protected final Long TEST_TOOL_ID = new Long(6);
protected final String TEST_TOOL_SIG = "survey_signature";
protected final String TEST_TOOL_SERVICE_NAME = "surveyService";
+ protected final String TEST_TOOL_IDENTIFIER = "survey";
+ protected final String TEST_TOOL_VERSION = "1.1";
protected final String TEST_TOOL_DISPLAY_NAME = "Survey";
protected final long TEST_TOOL_DEFAULT_CONTENT_ID = 6;
Index: lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java
===================================================================
diff -u -rd1b5a741bb40c5bf60ff7d55fa11322ed769644f -rb0e60dcaf9e70b994ba004f4ce83feda7923ad39
--- lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java (.../TestToolDAO.java) (revision d1b5a741bb40c5bf60ff7d55fa11322ed769644f)
+++ lams_common/test/java/org/lamsfoundation/lams/tool/dao/TestToolDAO.java (.../TestToolDAO.java) (revision b0e60dcaf9e70b994ba004f4ce83feda7923ad39)
@@ -63,6 +63,8 @@
assertEquals("verify display name",TEST_TOOL_DISPLAY_NAME,testTool.getToolDisplayName());
assertEquals("verify default content id",TEST_TOOL_DEFAULT_CONTENT_ID,testTool.getDefaultToolContentId());
assertTrue("verify support define later",testTool.getSupportsDefineLater());
+ assertEquals("verify identifier",TEST_TOOL_IDENTIFIER,testTool.getToolIdentifier());
+ assertEquals("verify version",TEST_TOOL_VERSION,testTool.getToolVersion());
}
public void testGetAllTools(){