dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #01725
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 532: Replaced form manager with SystemSettingManager.
------------------------------------------------------------
revno: 532
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-09-01 07:11:45 +0200
message:
Replaced form manager with SystemSettingManager.
modified:
dhis-2/dhis-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java
local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/GetFormConfigurationAction.java
local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetImageDirectoryOnServerAction.java
local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetNumberOfRecordsAction.java
local/vn/dhis-web-chr-form/src/main/resources/META-INF/dhis/beans.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'dhis-2/dhis-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java'
--- dhis-2/dhis-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java 2009-09-01 04:38:01 +0000
+++ dhis-2/dhis-options/src/main/java/org/hisp/dhis/options/SystemSettingManager.java 2009-09-01 05:11:45 +0000
@@ -47,8 +47,8 @@
final String KEY_OMIT_INDICATORS_ZERO_NUMERATOR_DATAMART = "omitIndicatorsZeroNumeratorDataMart";
final String KEY_REPORT_TEMPLATE_DIRECTORY = "reportTemplateDirectory";
- final String CHR_IMAGE_DIRECTORY = "chrImageDirectory";
- final String CHR_NUMBER_OF_RECORDS = "chrNumberOfRecords";
+ final String KEY_CHR_IMAGE_DIRECTORY = "chrImageDirectory";
+ final String KEY_CHR_NUMBER_OF_RECORDS = "chrNumberOfRecords";
void saveSystemSetting( String name, Serializable value );
=== modified file 'local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/GetFormConfigurationAction.java'
--- local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/GetFormConfigurationAction.java 2009-09-01 03:49:33 +0000
+++ local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/GetFormConfigurationAction.java 2009-09-01 05:11:45 +0000
@@ -5,62 +5,67 @@
*
*/
-import org.hisp.dhis.options.formconfiguration.FormConfigurationManager;
+import org.hisp.dhis.options.SystemSettingManager;
import com.opensymphony.xwork.Action;
-public class GetFormConfigurationAction implements Action {
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
- private FormConfigurationManager formConfigurationManager;
-
- // -------------------------------------------------------------------------
- // Input && Output
- // -------------------------------------------------------------------------
-
- private String imageDirectoryOnServer;
-
- private String numberOfRecords;
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- public void setFormConfigurationManager(
- FormConfigurationManager formConfigurationManager) {
- this.formConfigurationManager = formConfigurationManager;
- }
-
- public String getImageDirectoryOnServer() {
- return imageDirectoryOnServer;
- }
-
- public void setImageDirectoryOnServer(String imageDirectoryOnServer) {
- this.imageDirectoryOnServer = imageDirectoryOnServer;
- }
-
- public String getNumberOfRecords() {
- return numberOfRecords;
- }
-
- public void setNumberOfRecords(String numberOfRecords) {
- this.numberOfRecords = numberOfRecords;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute() throws Exception {
-
- imageDirectoryOnServer = formConfigurationManager
- .getImageDirectoryOnServer();
-
- numberOfRecords = formConfigurationManager.getNumberOfRecords();
-
- return SUCCESS;
- }
-
+public class GetFormConfigurationAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private SystemSettingManager systemSettingManager;
+
+ public void setSystemSettingManager( SystemSettingManager systemSettingManager )
+ {
+ this.systemSettingManager = systemSettingManager;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input && Output
+ // -------------------------------------------------------------------------
+
+ private String imageDirectoryOnServer;
+
+ private String numberOfRecords;
+
+ // -------------------------------------------------------------------------
+ // Getters && Setters
+ // -------------------------------------------------------------------------
+
+ public String getImageDirectoryOnServer()
+ {
+ return imageDirectoryOnServer;
+ }
+
+ public void setImageDirectoryOnServer( String imageDirectoryOnServer )
+ {
+ this.imageDirectoryOnServer = imageDirectoryOnServer;
+ }
+
+ public String getNumberOfRecords()
+ {
+ return numberOfRecords;
+ }
+
+ public void setNumberOfRecords( String numberOfRecords )
+ {
+ this.numberOfRecords = numberOfRecords;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ imageDirectoryOnServer = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_CHR_IMAGE_DIRECTORY );
+
+ numberOfRecords = (String) systemSettingManager.getSystemSetting( SystemSettingManager.KEY_CHR_NUMBER_OF_RECORDS );
+
+ return SUCCESS;
+ }
}
=== modified file 'local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetImageDirectoryOnServerAction.java'
--- local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetImageDirectoryOnServerAction.java 2009-09-01 03:49:33 +0000
+++ local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetImageDirectoryOnServerAction.java 2009-09-01 05:11:45 +0000
@@ -5,50 +5,54 @@
*
*/
-import org.hisp.dhis.options.formconfiguration.FormConfigurationManager;
+import org.hisp.dhis.options.SystemSettingManager;
import org.hisp.dhis.vn.chr.form.action.ActionSupport;
-public class SetImageDirectoryOnServerAction extends ActionSupport {
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private FormConfigurationManager formConfigurationManager;
-
- // -------------------------------------------------------------------------
- // Input && Output
- // -------------------------------------------------------------------------
- private String imageDirectoryOnServer;
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- public void setImageDirectoryOnServer(String imageDirectoryOnServer) {
- this.imageDirectoryOnServer = imageDirectoryOnServer;
- }
-
- public String getImageDirectoryOnServer() {
- return imageDirectoryOnServer;
- }
-
- public void setFormConfigurationManager(
- FormConfigurationManager formConfigurationManager) {
- this.formConfigurationManager = formConfigurationManager;
- }
-
- // --------------------------------------------------------------------
- // Implements
- // --------------------------------------------------------------------
-
- public String execute() throws Exception {
- formConfigurationManager
- .setImageDirectoryOnServer(imageDirectoryOnServer);
-
- message = i18n.getString("success");
-
- return SUCCESS;
- }
-
+public class SetImageDirectoryOnServerAction
+ extends ActionSupport{
+
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private SystemSettingManager systemSettingManager;
+
+ public void setSystemSettingManager( SystemSettingManager systemSettingManager )
+ {
+ this.systemSettingManager = systemSettingManager;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input && Output
+ // -------------------------------------------------------------------------
+
+ private String imageDirectoryOnServer;
+
+ // -------------------------------------------------------------------------
+ // Getters && Setters
+ // -------------------------------------------------------------------------
+
+ public void setImageDirectoryOnServer( String imageDirectoryOnServer )
+ {
+ this.imageDirectoryOnServer = imageDirectoryOnServer;
+ }
+
+ public String getImageDirectoryOnServer()
+ {
+ return imageDirectoryOnServer;
+ }
+
+ // --------------------------------------------------------------------
+ // Implements
+ // --------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ systemSettingManager.saveSystemSetting( SystemSettingManager.KEY_CHR_IMAGE_DIRECTORY, imageDirectoryOnServer );
+
+ message = i18n.getString( "success" );
+
+ return SUCCESS;
+ }
}
=== modified file 'local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetNumberOfRecordsAction.java'
--- local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetNumberOfRecordsAction.java 2009-09-01 03:49:33 +0000
+++ local/vn/dhis-web-chr-form/src/main/java/org/hisp/dhis/vn/chr/configuration/action/SetNumberOfRecordsAction.java 2009-09-01 05:11:45 +0000
@@ -5,48 +5,54 @@
*
*/
-import org.hisp.dhis.options.formconfiguration.FormConfigurationManager;
+import org.hisp.dhis.options.SystemSettingManager;
import org.hisp.dhis.vn.chr.form.action.ActionSupport;
-public class SetNumberOfRecordsAction extends ActionSupport {
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
- private FormConfigurationManager formConfigurationManager;
-
- // -------------------------------------------------------------------------
- // Input && Output
- // -------------------------------------------------------------------------
- private String numberOfRecords;
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- public String getNumberOfRecords() {
- return numberOfRecords;
- }
-
- public void setNumberOfRecords(String numberOfRecords) {
- this.numberOfRecords = numberOfRecords;
- }
-
- public void setFormConfigurationManager(
- FormConfigurationManager formConfigurationManager) {
- this.formConfigurationManager = formConfigurationManager;
- }
-
- // --------------------------------------------------------------------
- // Implements
- // --------------------------------------------------------------------
-
- public String execute() throws Exception {
- formConfigurationManager.setNumberOfRecords(numberOfRecords);
-
- message = i18n.getString("success");
-
- return SUCCESS;
- }
-
+public class SetNumberOfRecordsAction
+ extends ActionSupport
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private SystemSettingManager systemSettingManager;
+
+ public void setSystemSettingManager( SystemSettingManager systemSettingManager )
+ {
+ this.systemSettingManager = systemSettingManager;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input && Output
+ // -------------------------------------------------------------------------
+
+ private String numberOfRecords;
+
+ // -------------------------------------------------------------------------
+ // Getters && Setters
+ // -------------------------------------------------------------------------
+
+ public String getNumberOfRecords()
+ {
+ return numberOfRecords;
+ }
+
+ public void setNumberOfRecords( String numberOfRecords )
+ {
+ this.numberOfRecords = numberOfRecords;
+ }
+
+ // --------------------------------------------------------------------
+ // Implements
+ // --------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ systemSettingManager.saveSystemSetting( SystemSettingManager.KEY_CHR_NUMBER_OF_RECORDS, numberOfRecords );
+
+ message = i18n.getString( "success" );
+
+ return SUCCESS;
+ }
}
=== modified file 'local/vn/dhis-web-chr-form/src/main/resources/META-INF/dhis/beans.xml'
--- local/vn/dhis-web-chr-form/src/main/resources/META-INF/dhis/beans.xml 2009-09-01 03:49:33 +0000
+++ local/vn/dhis-web-chr-form/src/main/resources/META-INF/dhis/beans.xml 2009-09-01 05:11:45 +0000
@@ -176,24 +176,24 @@
id="org.hisp.dhis.vn.chr.configuration.action.GetFormConfigurationAction"
class="org.hisp.dhis.vn.chr.configuration.action.GetFormConfigurationAction"
scope="prototype">
- <property name="formConfigurationManager"
- ref="org.hisp.dhis.options.formconfiguration.FormConfigurationManager" />
+ <property name="systemSettingManager"
+ ref="org.hisp.dhis.options.SystemSettingManager" />
</bean>
<bean
id="org.hisp.dhis.vn.chr.configuration.action.SetImageDirectoryOnServerAction"
class="org.hisp.dhis.vn.chr.configuration.action.SetImageDirectoryOnServerAction"
scope="prototype">
- <property name="formConfigurationManager"
- ref="org.hisp.dhis.options.formconfiguration.FormConfigurationManager" />
+ <property name="systemSettingManager"
+ ref="org.hisp.dhis.options.SystemSettingManager" />
</bean>
<bean
id="org.hisp.dhis.vn.chr.configuration.action.SetNumberOfRecordsAction"
class="org.hisp.dhis.vn.chr.configuration.action.SetNumberOfRecordsAction"
scope="prototype">
- <property name="formConfigurationManager"
- ref="org.hisp.dhis.options.formconfiguration.FormConfigurationManager" />
+ <property name="systemSettingManager"
+ ref="org.hisp.dhis.options.SystemSettingManager" />
</bean>
<!-- --><!-- --><!-- -->