=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableAutoSaveDataEntryFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableAutoSaveDataEntryFormAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableAutoSaveDataEntryFormAction.java 1970-01-01 00:00:00 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package org.hisp.dhis.settings.action.user; - -import org.hisp.dhis.user.UserSettingService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * @version GetAvailableAutoSaveDataEntryFormAction.java Jun 23, 2010 3:49:11 PM - */ -public class GetAvailableAutoSaveDataEntryFormAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependency - // ------------------------------------------------------------------------- - - private UserSettingService userSettingService; - - public void setUserSettingService( UserSettingService userSettingService ) - { - this.userSettingService = userSettingService; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Boolean autoSave; - - public Boolean getAutoSave() - { - return autoSave; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - autoSave = (Boolean) userSettingService.getUserSetting( UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM, false ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableChartsInDashboardAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableChartsInDashboardAction.java 2011-04-06 11:39:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableChartsInDashboardAction.java 1970-01-01 00:00:00 +0000 @@ -1,69 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.List; - -import org.hisp.dhis.options.UserSettingManager; - -import com.opensymphony.xwork2.Action; - -public class GetAvailableChartsInDashboardAction - implements Action -{ - private UserSettingManager userSettingManager; - - public void setUserSettingManager( UserSettingManager userSettingManager ) - { - this.userSettingManager = userSettingManager; - } - - private Integer chartsInDashboard; - - public Integer getChartsInDashboard() - { - return chartsInDashboard; - } - - private List chartsInDashboardOptions; - - public List getChartsInDashboardOptions() - { - return chartsInDashboardOptions; - } - - @Override - public String execute() - throws Exception - { - chartsInDashboard = userSettingManager.getChartsInDashboard(); - chartsInDashboardOptions = userSettingManager.getChartsInDashboardOptions(); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableDisplayPropertiesAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableDisplayPropertiesAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableDisplayPropertiesAction.java 1970-01-01 00:00:00 +0000 @@ -1,86 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.List; - -import org.hisp.dhis.options.displayproperty.DisplayPropertyManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id: GetAvailableDisplayPropertiesAction.java 3264 2007-04-25 14:54:05Z stianast $ - */ -public class GetAvailableDisplayPropertiesAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DisplayPropertyManager displayPropertyManager; - - public void setDisplayPropertyManager( DisplayPropertyManager displayPropertyManager ) - { - this.displayPropertyManager = displayPropertyManager; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List displayProperties; - - public List getDisplayProperties() - { - return displayProperties; - } - - private String currentDisplayProperty; - - public String getCurrentDisplayProperty() - { - return currentDisplayProperty; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - displayProperties = displayPropertyManager.getDisplayProperties(); - - currentDisplayProperty = displayPropertyManager.getCurrentDisplayProperty(); - - return SUCCESS; - } - -} - === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableLocalesAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableLocalesAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableLocalesAction.java 1970-01-01 00:00:00 +0000 @@ -1,103 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Locale; - -import org.hisp.dhis.i18n.locale.LocaleManager; -import org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Torgeir Lorange Ostby - * @version $Id: GetAvailableLocalesAction.java 3264 2007-04-25 14:54:05Z stianast $ - */ -public class GetAvailableLocalesAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ResourceBundleManager resourceBundleManager; - - public void setResourceBundleManager( ResourceBundleManager resourceBundleManager ) - { - this.resourceBundleManager = resourceBundleManager; - } - - private LocaleManager localeManager; - - public void setLocaleManager( LocaleManager localeManager ) - { - this.localeManager = localeManager; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List availableLocales; - - public List getAvailableLocales() - { - return availableLocales; - } - - private Locale currentLocale; - - public Locale getCurrentLocale() - { - return currentLocale; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - availableLocales = new ArrayList( resourceBundleManager.getAvailableLocales() ); - - Collections.sort( availableLocales, new Comparator() { - public int compare( Locale locale0, Locale locale1 ) - { - return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); - } - } ); - - currentLocale = localeManager.getCurrentLocale(); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableLocalesDbAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableLocalesDbAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableLocalesDbAction.java 1970-01-01 00:00:00 +0000 @@ -1,88 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Locale; - -import org.hisp.dhis.i18n.I18nService; -import org.hisp.dhis.i18n.locale.LocaleManager; - -import com.opensymphony.xwork2.Action; - -/** - * Created by IntelliJ IDEA. - * User: yvindbrucker - * Date: Mar 12, 2007 - * Time: 8:33:39 PM - * To change this template use File | Settings | File Templates. - */ -public class GetAvailableLocalesDbAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private I18nService i18nService; - - public void setI18nService( I18nService i18nService ) - { - this.i18nService = i18nService; - } - - private LocaleManager localeManager; - - public void setLocaleManager( LocaleManager localeManager ) - { - this.localeManager = localeManager; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List availableLocales; - - public List getAvailableLocalesDb() - { - return availableLocales; - } - - private Locale currentLocaleDb; - - public Locale getCurrentLocaleDb() - { - return currentLocaleDb; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - availableLocales = new ArrayList( i18nService.getAvailableLocales() ); - - if ( !availableLocales.contains( localeManager.getFallbackLocale() ) ) - { - availableLocales.add( localeManager.getFallbackLocale() ); - } - - { - Collections.sort( availableLocales, new Comparator() - { - public int compare( Locale locale0, Locale locale1 ) - { - return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); - } - } ); - } - - currentLocaleDb = localeManager.getCurrentLocale(); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableSortOrdersAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableSortOrdersAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableSortOrdersAction.java 1970-01-01 00:00:00 +0000 @@ -1,84 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.List; - -import org.hisp.dhis.options.sortorder.SortOrderManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - * @version $Id: GetAvailableSortOrdersAction.java 3264 2007-04-25 14:54:05Z stianast $ - */ -public class GetAvailableSortOrdersAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private SortOrderManager sortOrderManager; - - public void setSortOrderManager( SortOrderManager sortOrderManager ) - { - this.sortOrderManager = sortOrderManager; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List sortOrders; - - public List getSortOrders() - { - return sortOrders; - } - - private String currentSortOrder; - - public String getCurrentSortOrder() - { - return currentSortOrder; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() throws Exception - { - sortOrders = sortOrderManager.getSortOrders(); - - currentSortOrder = sortOrderManager.getCurrentSortOrder(); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableStylesAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableStylesAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableStylesAction.java 1970-01-01 00:00:00 +0000 @@ -1,92 +0,0 @@ -package org.hisp.dhis.settings.action.user; - -/* - * Copyright (c) 2004-2010, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.SortedMap; - -import org.hisp.dhis.options.style.StyleManager; -import org.hisp.dhis.options.style.UserStyleManager; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * @version $Id: GetAvailableStylesAction.java 2010-10-26 17:28:05Z $ - */ -public class GetAvailableStylesAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private StyleManager styleManager; - - public void setStyleManager( StyleManager styleManager ) - { - this.styleManager = styleManager; - } - - private UserStyleManager userStyleManager; - - public void setUserStyleManager( UserStyleManager userStyleManager ) - { - this.userStyleManager = userStyleManager; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private String currentStyle; - - public String getCurrentStyle() - { - return currentStyle; - } - - private SortedMap styles; - - public SortedMap getStyles() - { - return styles; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - { - styles = styleManager.getStyles(); - - currentStyle = userStyleManager.getCurrentStyle(); - - return SUCCESS; - } -} === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/java/org/hisp/dhis/settings/action/user/GetAvailableUserSettingsAction.java 2011-05-31 03:26:58 +0000 @@ -0,0 +1,305 @@ +/* + * Copyright (c) 2004-2009, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.hisp.dhis.settings.action.user; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Locale; +import java.util.SortedMap; + +import org.hisp.dhis.i18n.I18nService; +import org.hisp.dhis.i18n.locale.LocaleManager; +import org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager; +import org.hisp.dhis.options.UserSettingManager; +import org.hisp.dhis.options.displayproperty.DisplayPropertyManager; +import org.hisp.dhis.options.sortorder.SortOrderManager; +import org.hisp.dhis.options.style.StyleManager; +import org.hisp.dhis.options.style.UserStyleManager; +import org.hisp.dhis.user.UserSettingService; + +import com.opensymphony.xwork2.Action; + +/** + * @author Chau Thu Tran + * @version $ GetAvailableUserSettingsAction.java May 31, 2011 9:31:54 AM $ + * + */ +public class GetAvailableUserSettingsAction + implements Action +{ + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private ResourceBundleManager resourceBundleManager; + + public void setResourceBundleManager( ResourceBundleManager resourceBundleManager ) + { + this.resourceBundleManager = resourceBundleManager; + } + + private I18nService i18nService; + + public void setI18nService( I18nService i18nService ) + { + this.i18nService = i18nService; + } + + private LocaleManager localeManager; + + public void setLocaleManager( LocaleManager localeManager ) + { + this.localeManager = localeManager; + } + + private SortOrderManager sortOrderManager; + + public void setSortOrderManager( SortOrderManager sortOrderManager ) + { + this.sortOrderManager = sortOrderManager; + } + + private UserSettingManager userSettingManager; + + public void setUserSettingManager( UserSettingManager userSettingManager ) + { + this.userSettingManager = userSettingManager; + } + + private UserSettingService userSettingService; + + public void setUserSettingService( UserSettingService userSettingService ) + { + this.userSettingService = userSettingService; + } + + private StyleManager styleManager; + + public void setStyleManager( StyleManager styleManager ) + { + this.styleManager = styleManager; + } + + private UserStyleManager userStyleManager; + + public void setUserStyleManager( UserStyleManager userStyleManager ) + { + this.userStyleManager = userStyleManager; + } + + private DisplayPropertyManager displayPropertyManager; + + public void setDisplayPropertyManager( DisplayPropertyManager displayPropertyManager ) + { + this.displayPropertyManager = displayPropertyManager; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List availableLocales; + + public List getAvailableLocales() + { + return availableLocales; + } + + private Locale currentLocale; + + public Locale getCurrentLocale() + { + return currentLocale; + } + + private List availableLocalesDb; + + public List getAvailableLocalesDb() + { + return availableLocalesDb; + } + + private Locale currentLocaleDb; + + public Locale getCurrentLocaleDb() + { + return currentLocaleDb; + } + + private List sortOrders; + + public List getSortOrders() + { + return sortOrders; + } + + private String currentSortOrder; + + public String getCurrentSortOrder() + { + return currentSortOrder; + } + + private Integer chartsInDashboard; + + public Integer getChartsInDashboard() + { + return chartsInDashboard; + } + + private List chartsInDashboardOptions; + + public List getChartsInDashboardOptions() + { + return chartsInDashboardOptions; + } + + private List displayProperties; + + public List getDisplayProperties() + { + return displayProperties; + } + + private String currentDisplayProperty; + + public String getCurrentDisplayProperty() + { + return currentDisplayProperty; + } + + private Boolean autoSave; + + public Boolean getAutoSave() + { + return autoSave; + } + + private String currentStyle; + + public String getCurrentStyle() + { + return currentStyle; + } + + private SortedMap styles; + + public SortedMap getStyles() + { + return styles; + } + + // ------------------------------------------------------------------------- + // Action implementation + // ------------------------------------------------------------------------- + + public String execute() + throws Exception + { + // --------------------------------------------------------------------- + // Get available locales + // --------------------------------------------------------------------- + + availableLocales = new ArrayList( resourceBundleManager.getAvailableLocales() ); + + Collections.sort( availableLocales, new Comparator() + { + public int compare( Locale locale0, Locale locale1 ) + { + return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); + } + } ); + + currentLocale = localeManager.getCurrentLocale(); + + // --------------------------------------------------------------------- + // Get available locales in db + // --------------------------------------------------------------------- + + availableLocalesDb = new ArrayList( i18nService.getAvailableLocales() ); + + if ( !availableLocales.contains( localeManager.getFallbackLocale() ) ) + { + availableLocales.add( localeManager.getFallbackLocale() ); + } + + { + Collections.sort( availableLocales, new Comparator() + { + public int compare( Locale locale0, Locale locale1 ) + { + return locale0.getDisplayName().compareTo( locale1.getDisplayName() ); + } + } ); + } + + currentLocaleDb = localeManager.getCurrentLocale(); + + // --------------------------------------------------------------------- + // Get Sort orders + // --------------------------------------------------------------------- + + sortOrders = sortOrderManager.getSortOrders(); + + currentSortOrder = sortOrderManager.getCurrentSortOrder(); + + // --------------------------------------------------------------------- + // Get Charts in Dashboard + // --------------------------------------------------------------------- + + chartsInDashboard = userSettingManager.getChartsInDashboard(); + + chartsInDashboardOptions = userSettingManager.getChartsInDashboardOptions(); + + // --------------------------------------------------------------------- + // Get Display Properties + // --------------------------------------------------------------------- + + displayProperties = displayPropertyManager.getDisplayProperties(); + + currentDisplayProperty = displayPropertyManager.getCurrentDisplayProperty(); + + // --------------------------------------------------------------------- + // Get Auto-save data entry form + // --------------------------------------------------------------------- + + autoSave = (Boolean) userSettingService.getUserSetting( UserSettingService.AUTO_SAVE_DATA_ENTRY_FORM, false ); + + // --------------------------------------------------------------------- + // Get styles + // --------------------------------------------------------------------- + + styles = styleManager.getStyles(); + + currentStyle = userStyleManager.getCurrentStyle(); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml 2011-04-06 11:39:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/META-INF/dhis/beans.xml 2011-05-31 03:26:58 +0000 @@ -1,157 +1,128 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml 2011-04-06 11:39:06 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-settings/src/main/resources/struts.xml 2011-05-31 03:26:58 +0000 @@ -30,31 +30,7 @@ - - getAvailableLocalesDb - - - - getAvailableSortOrders - - - - getAvailableChartsInDashboard - - - - getAvailableDisplayProperties - - - - getAvailableAutoSaveDataEntryForm - - - - getAvailableStylesForm - - - + /main.vm /dhis-web-maintenance-settings/userSettings.vm /dhis-web-maintenance-settings/settingsMenu.vm