=== added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/RenameExcelTemplateAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/RenameExcelTemplateAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/RenameExcelTemplateAction.java 2010-03-03 04:33:39 +0000 @@ -0,0 +1,122 @@ +package org.hisp.dhis.reportexcel.filemanager.action; + +/* + * Copyright (c) 2004-2007, 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.io.File; + +import org.hisp.dhis.options.SystemSettingManager; +import org.hisp.dhis.reportexcel.action.ActionSupport; +import org.hisp.dhis.reportexcel.state.SelectionManager; +import org.hisp.dhis.reportexcel.utils.FileUtils; + +/** + * @author Dang Duy Hieu + * @version $Id + * @since 2010-02-05 + */ +public class RenameExcelTemplateAction + extends ActionSupport +{ + // ------------------------------------------- + // Dependency + // ------------------------------------------- + + private SystemSettingManager systemSettingManager; + + public void setSystemSettingManager( SystemSettingManager systemSettingManager ) + { + this.systemSettingManager = systemSettingManager; + } + + private SelectionManager selectionManager; + + public void setSelectionManager( SelectionManager selectionManager ) + { + this.selectionManager = selectionManager; + } + + // ------------------------------------------- + // Getter && Setter + // ------------------------------------------- + private String newFileName; + + public void setNewFileName( String newFileName ) + { + this.newFileName = newFileName; + } + + private String curFileName; + + public void setCurFileName( String curFileName ) + { + this.curFileName = curFileName; + } + + private String renamingMode; + + public void setRenamingMode( String renamingMode ) + { + this.renamingMode = renamingMode; + } + + // ------------------------------------------- + // Action implementation + // ------------------------------------------- + + @Override + public String execute() + throws Exception + { + message = ""; + + String templateDirectory = (String) systemSettingManager + .getSystemSetting( SystemSettingManager.KEY_REPORT_TEMPLATE_DIRECTORY ); + + File curFile = new File( templateDirectory + File.separator + curFileName ); + File newFile = new File( templateDirectory + File.separator + newFileName ); + + selectionManager.setRenameFilePath( curFile.getAbsolutePath() ); + + if ( FileUtils.rename( curFile, newFile ) ) + { + message = "rename_successful"; + } + else + { + message = "rename_failed"; + return ERROR; + } + + if ( renamingMode.equals( "RNUS" ) ) + { + return NONE; + } + + return SUCCESS; + } + +} === added file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/UpdateReportExcelByTemplateAction.java' --- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/UpdateReportExcelByTemplateAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/java/org/hisp/dhis/reportexcel/filemanager/action/UpdateReportExcelByTemplateAction.java 2010-03-03 04:33:39 +0000 @@ -0,0 +1,92 @@ +package org.hisp.dhis.reportexcel.filemanager.action; + +/* + * Copyright (c) 2004-2007, 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 org.hisp.dhis.reportexcel.ReportExcelService; +import org.hisp.dhis.reportexcel.action.ActionSupport; + +/** + * @author Dang Duy Hieu + * @version $Id + * @since 2010-02-24 + */ +public class UpdateReportExcelByTemplateAction + extends ActionSupport +{ + // ------------------------------------------- + // Dependency + // ------------------------------------------- + + private ReportExcelService reportService; + + public void setReportService( ReportExcelService reportService ) + { + this.reportService = reportService; + } + + // ------------------------------------------- + // Getter && Setter + // ------------------------------------------- + + private String curTemplateName; + + public void setCurTemplateName( String curTemplateName ) + { + this.curTemplateName = curTemplateName; + } + + private String newTemplateName; + + public void setNewTemplateName( String newTemplateName ) + { + this.newTemplateName = newTemplateName; + } + + // ------------------------------------------- + // Action implementation + // ------------------------------------------- + + @Override + public String execute() + throws Exception + { + message = ""; + + if ( newTemplateName.isEmpty() ) + { + message = "verify_filename"; + return ERROR; + } + + reportService.updateReportExcelSystemByTemplate( curTemplateName, newTemplateName ); + + message = "update_successful"; + + return SUCCESS; + } + +} === added directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/assign' === added directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/assign/multidataset' === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/assign/multidataset/ShowAssignMultiDataSetForOrgunitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/assign/multidataset/ShowAssignMultiDataSetForOrgunitAction.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/assign/multidataset/ShowAssignMultiDataSetForOrgunitAction.java 2010-03-03 04:33:39 +0000 @@ -0,0 +1,155 @@ +package org.hisp.dhis.dataset.action.assign.multidataset; + +/* + * Copyright (c) 2004-2007, 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 org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler; +import org.hisp.dhis.organisationunit.OrganisationUnitGroup; +import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; +import org.hisp.dhis.organisationunit.OrganisationUnitLevel; +import org.hisp.dhis.organisationunit.OrganisationUnitService; +import org.hisp.dhis.organisationunit.comparator.OrganisationUnitGroupNameComparator; + +import com.opensymphony.xwork2.ActionSupport; + +/** + * @author Dang Duy Hieu + * @version $Id$ + */ +public class ShowAssignMultiDataSetForOrgunitAction + extends ActionSupport +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + // ------------------------------------------------------------------------- + // Dependency + // ------------------------------------------------------------------------- + + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + private Comparator dataSetComparator; + + public void setDataSetComparator( Comparator dataSetComparator ) + { + this.dataSetComparator = dataSetComparator; + } + + private DisplayPropertyHandler displayPropertyHandler; + + public void setDisplayPropertyHandler( DisplayPropertyHandler displayPropertyHandler ) + { + this.displayPropertyHandler = displayPropertyHandler; + } + + private OrganisationUnitService organisationUnitService; + + public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) + { + this.organisationUnitService = organisationUnitService; + } + + private OrganisationUnitGroupService organisationUnitGroupService; + + public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) + { + this.organisationUnitGroupService = organisationUnitGroupService; + } + + // ------------------------------------------------------------------------- + // Input & Output + // ------------------------------------------------------------------------- + + private List availableDataSets; + + private List levels; + + private List groups; + + // ------------------------------------------------------------------------- + // Getter & Setter + // ------------------------------------------------------------------------- + + public List getAvailableDataSets() + { + return availableDataSets; + } + + public List getLevels() + { + return levels; + } + + public List getGroups() + { + return groups; + } + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + public String execute() + { + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Get list of datasets + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + availableDataSets = new ArrayList( dataSetService.getAllDataSets() ); + + Collections.sort( availableDataSets, dataSetComparator ); + + displayPropertyHandler.handle( availableDataSets ); + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + // Setup the association tree + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + levels = new ArrayList( organisationUnitService.getOrganisationUnitLevels() ); + + groups = new ArrayList( organisationUnitGroupService.getAllOrganisationUnitGroups() ); + + Collections.sort(groups, new OrganisationUnitGroupNameComparator() ); + + return SUCCESS; + } +} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2010-02-22 09:19:15 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2010-03-03 04:33:39 +0000 @@ -391,4 +391,19 @@ + + + + + + + + + + + + + \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-02-10 18:04:44 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/struts.xml 2010-03-03 04:33:39 +0000 @@ -317,5 +317,13 @@ dataSet.action + + /main.vm + /dhis-web-maintenance-dataset/showAssignMultiDataSetForm.vm + /dhis-web-maintenance-dataset/menu.vm + javascript/dataSet.js + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/menu.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/menu.vm 2009-11-03 09:05:08 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/menu.vm 2010-03-03 04:33:39 +0000 @@ -3,4 +3,6 @@ \ No newline at end of file === added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/showAssignMultiDataSetForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/showAssignMultiDataSetForm.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/showAssignMultiDataSetForm.vm 2010-03-03 04:33:39 +0000 @@ -0,0 +1,160 @@ +

$i18n.getString( "assign_multidataset" )

+ +
+ + + + + + + + + + + + + + + + + +
$i18n.getString( "available_datasets" )$i18n.getString( "selected_datasets" )
< $i18n.getString( "filters" ) >
+ + +
+ +
+
+ +

+ + + + + + + + + + + +
+ + + + +
+ + + +
+
+ + +
+

+ +

+ +
+ + + +