=== removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java' === removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org' === removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp' === removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis' === removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer' === removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action' === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java 1970-01-01 00:00:00 +0000 @@ -1,509 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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 static org.hisp.dhis.system.util.DateUtils.setNames; - -import java.util.ArrayList; -import java.util.List; - -import org.hisp.dhis.chart.Chart; -import org.hisp.dhis.chart.ChartService; -import org.hisp.dhis.dataelement.DataElementService; -import org.hisp.dhis.dataset.DataSetService; -import org.hisp.dhis.i18n.I18nManager; -import org.hisp.dhis.indicator.IndicatorService; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.period.Period; -import org.hisp.dhis.period.PeriodService; -import org.hisp.dhis.period.PeriodType; -import org.hisp.dhis.period.RelativePeriods; -import org.hisp.dhis.user.CurrentUserService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - */ -public class AddOrUpdateChartAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - private IndicatorService indicatorService; - - public void setIndicatorService( IndicatorService indicatorService ) - { - this.indicatorService = indicatorService; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - private DataSetService dataSetService; - - public void setDataSetService( DataSetService dataSetService ) - { - this.dataSetService = dataSetService; - } - - private PeriodService periodService; - - public void setPeriodService( PeriodService periodService ) - { - this.periodService = periodService; - } - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - private CurrentUserService currentUserService; - - public void setCurrentUserService( CurrentUserService currentUserService ) - { - this.currentUserService = currentUserService; - } - - private I18nManager i18nManager; - - public void setI18nManager( I18nManager i18nManager ) - { - this.i18nManager = i18nManager; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String uid; - - public void setUid( String uid ) - { - this.uid = uid; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - private String type; - - public void setType( String type ) - { - this.type = type; - } - - private String series; - - public void setSeries( String series ) - { - this.series = series; - } - - private String category; - - public void setCategory( String category ) - { - this.category = category; - } - - private List indicatorIds; - - public void setIndicatorIds( List indicatorIds ) - { - this.indicatorIds = indicatorIds; - } - - private List dataElementIds; - - public void setDataElementIds( List dataElementIds ) - { - this.dataElementIds = dataElementIds; - } - - private List dataSetIds; - - public void setDataSetIds( List dataSetIds ) - { - this.dataSetIds = dataSetIds; - } - - private boolean reportingMonth; - - public void setReportingMonth( boolean reportingMonth ) - { - this.reportingMonth = reportingMonth; - } - - private boolean last12Months; - - public void setLast12Months( boolean last12Months ) - { - this.last12Months = last12Months; - } - - private boolean last3Months; - - public void setLast3Months( boolean last3Months ) - { - this.last3Months = last3Months; - } - - private boolean reportingQuarter; - - public void setReportingQuarter( boolean reportingQuarter ) - { - this.reportingQuarter = reportingQuarter; - } - - private boolean last4Quarters; - - public void setLast4Quarters( boolean last4Quarters ) - { - this.last4Quarters = last4Quarters; - } - - private boolean lastSixMonth; - - public void setLastSixMonth( boolean lastSixMonth ) - { - this.lastSixMonth = lastSixMonth; - } - - private boolean last2SixMonths; - - public void setLast2SixMonths( boolean last2SixMonths ) - { - this.last2SixMonths = last2SixMonths; - } - - private boolean thisYear; - - public void setThisYear( boolean thisYear ) - { - this.thisYear = thisYear; - } - - private boolean lastYear; - - public void setLastYear( boolean lastYear ) - { - this.lastYear = lastYear; - } - - private boolean last5Years; - - public void setLast5Years( boolean last5Years ) - { - this.last5Years = last5Years; - } - - private boolean rewind; - - public void setRewind( boolean rewind ) - { - this.rewind = rewind; - } - - private List periodIds; - - public void setPeriodIds( List periodIds ) - { - this.periodIds = periodIds; - } - - private List organisationUnitIds; - - public void setOrganisationUnitIds( List organisationUnitIds ) - { - this.organisationUnitIds = organisationUnitIds; - } - - private Boolean system; - - public void setSystem( Boolean system ) - { - this.system = system; - } - - private Boolean trendLine; - - public void setTrendLine( Boolean trendLine ) - { - this.trendLine = trendLine; - } - - private Boolean hideSubtitle; - - public void setHideSubtitle( Boolean hideSubtitle ) - { - this.hideSubtitle = hideSubtitle; - } - - private Boolean hideLegend; - - public void setHideLegend( Boolean hideLegend ) - { - this.hideLegend = hideLegend; - } - - private Boolean userOrganisationUnit; - - public void setUserOrganisationUnit( Boolean userOrganisationUnit ) - { - this.userOrganisationUnit = userOrganisationUnit; - } - - private Boolean userOrganisationUnitChildren; - - public void setUserOrganisationUnitChildren( Boolean userOrganisationUnitChildren ) - { - this.userOrganisationUnitChildren = userOrganisationUnitChildren; - } - - private Boolean showData; - - public void setShowData( Boolean showData ) - { - this.showData = showData; - } - - private String domainAxisLabel; - - public void setDomainAxisLabel( String domainAxisLabel ) - { - this.domainAxisLabel = domainAxisLabel; - } - - private String rangeAxisLabel; - - public void setRangeAxisLabel( String rangeAxisLabel ) - { - this.rangeAxisLabel = rangeAxisLabel; - } - - private Double targetLineValue; - - public void setTargetLineValue( Double targetLineValue ) - { - this.targetLineValue = targetLineValue; - } - - private String targetLineLabel; - - public void setTargetLineLabel( String targetLineLabel ) - { - this.targetLineLabel = targetLineLabel; - } - - private Double baseLineValue; - - public void setBaseLineValue( Double baseLineValue ) - { - this.baseLineValue = baseLineValue; - } - - private String baseLineLabel; - - public void setBaseLineLabel( String baseLineLabel ) - { - this.baseLineLabel = baseLineLabel; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private String chartId; - - public String getChartId() - { - return chartId; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - Chart chart; - - if ( uid != null ) - { - chart = chartService.getChart( uid ); - } - else - { - chart = new Chart(); - - chart.setName( name ); - } - - chart.setType( type ); - chart.setSeries( series ); - chart.setCategory( category ); - // chart.setFilter( filter ); - - chart.getIndicators().clear(); - - if ( indicatorIds != null ) - { - for ( String id : indicatorIds ) - { - chart.getIndicators().add( indicatorService.getIndicator( id ) ); - } - } - - chart.getDataElements().clear(); - - if ( dataElementIds != null ) - { - for ( String id : dataElementIds ) - { - chart.getDataElements().add( dataElementService.getDataElement( id ) ); - } - } - - chart.getDataSets().clear(); - - if ( dataSetIds != null ) - { - for ( String id : dataSetIds ) - { - chart.getDataSets().add( dataSetService.getDataSet( id ) ); - } - } - - RelativePeriods rp = new RelativePeriods(); - - if ( reportingMonth || last12Months || last3Months || reportingQuarter || last4Quarters || lastSixMonth || last2SixMonths || thisYear - || lastYear || last5Years ) - { - rp.setReportingMonth( reportingMonth ); - rp.setLast12Months( last12Months ); - rp.setLast3Months( last3Months ); - rp.setReportingQuarter( reportingQuarter ); - rp.setLast4Quarters( last4Quarters ); - rp.setLastSixMonth( lastSixMonth ); - rp.setLast2SixMonths( last2SixMonths ); - rp.setThisYear( thisYear ); - rp.setLastYear( lastYear ); - rp.setLast5Years( last5Years ); - } - - chart.setRelatives( rp ); - - chart.setRewindRelativePeriods( rewind ); - - chart.getPeriods().clear(); - - if ( periodIds != null ) - { - List periods = new ArrayList(); - - for ( String id : periodIds ) - { - periods.add( PeriodType.getPeriodFromIsoString( id ) ); - } - - chart.getPeriods().addAll( periodService.reloadPeriods( setNames( periods, i18nManager.getI18nFormat() ) ) ); - } - - chart.getOrganisationUnits().clear(); - - if ( organisationUnitIds != null ) - { - for ( String id : organisationUnitIds ) - { - chart.getOrganisationUnits().add( organisationUnitService.getOrganisationUnit( id ) ); - } - } - - chart.setUser( system == null ? currentUserService.getCurrentUser() : null ); - - chart.setRegression( trendLine ); - - chart.setHideSubtitle( hideSubtitle ); - - chart.setHideLegend( hideLegend ); - - chart.setUserOrganisationUnit( userOrganisationUnit ); - - chart.setUserOrganisationUnitChildren( userOrganisationUnitChildren ); - - chart.setShowData( showData ); - - chart.setDomainAxisLabel( domainAxisLabel ); - - chart.setRangeAxisLabel( rangeAxisLabel ); - - chart.setTargetLineValue( targetLineValue ); - - chart.setTargetLineLabel( targetLineLabel ); - - chart.setBaseLineValue( baseLineValue ); - - chart.setBaseLineLabel( baseLineLabel ); - - if ( uid == null ) - { - chartService.addChart( chart ); - } - else - { - chartService.updateChart( chart ); - } - - chartId = chart.getUid(); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/DeleteChartsAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/DeleteChartsAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/DeleteChartsAction.java 1970-01-01 00:00:00 +0000 @@ -1,80 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.Collection; -import org.hisp.dhis.chart.ChartService; -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - */ -public class DeleteChartsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Collection uids; - - public void setUids( Collection uids ) - { - this.uids = uids; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - if ( uids != null ) - { - for ( String uid : uids ) - { - chartService.deleteChart( chartService.getChart( uid ) ); - } - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/ExportImageAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/ExportImageAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/ExportImageAction.java 1970-01-01 00:00:00 +0000 @@ -1,158 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.awt.Color; -import java.io.OutputStream; -import java.io.StringReader; - -import javax.servlet.http.HttpServletResponse; - -import org.apache.batik.transcoder.TranscoderException; -import org.apache.batik.transcoder.TranscoderInput; -import org.apache.batik.transcoder.TranscoderOutput; -import org.apache.batik.transcoder.image.ImageTranscoder; -import org.apache.batik.transcoder.image.PNGTranscoder; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.fop.svg.PDFTranscoder; -import org.hisp.dhis.system.util.CodecUtils; -import org.hisp.dhis.util.ContextUtils; -import org.hisp.dhis.util.StreamActionSupport; - -/** - * @author Jan Henrik Overland - * @version $Id$ - */ - -public class ExportImageAction - extends StreamActionSupport -{ - private static final Log log = LogFactory.getLog( ExportImageAction.class ); - - private static final String TYPE_PNG = "png"; - - private static final String TYPE_PDF = "pdf"; - - // ------------------------------------------------------------------------- - // Output & input - // ------------------------------------------------------------------------- - - private String svg; - - public void setSvg( String svg ) - { - this.svg = svg; - } - - private String type; - - public void setType( String type ) - { - this.type = type; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - @Override - protected String execute( HttpServletResponse response, OutputStream out ) - throws Exception - { - if ( svg != null ) - { - if ( type == null || TYPE_PNG.equals( type ) ) - { - convertToPNG( new StringBuffer( svg ), out ); - } - else if ( TYPE_PDF.equals( type ) ) - { - convertToPDF( new StringBuffer( svg ), out ); - } - } - else - { - log.info( "svg = " + svg + ", type = " + type ); - - return NONE; - } - - return SUCCESS; - } - - public void convertToPNG( StringBuffer buffer, OutputStream out ) - throws TranscoderException - { - PNGTranscoder t = new PNGTranscoder(); - - t.addTranscodingHint( ImageTranscoder.KEY_BACKGROUND_COLOR, Color.WHITE ); - - TranscoderInput input = new TranscoderInput( new StringReader( buffer.toString() ) ); - - TranscoderOutput output = new TranscoderOutput( out ); - - t.transcode( input, output ); - } - - public void convertToPDF( StringBuffer buffer, OutputStream out ) - throws TranscoderException - { - PDFTranscoder t = new PDFTranscoder(); - - TranscoderInput input = new TranscoderInput( new StringReader( buffer.toString() ) ); - - TranscoderOutput output = new TranscoderOutput( out ); - - t.transcode( input, output ); - } - - @Override - protected String getContentType() - { - return type.equals( TYPE_PDF ) ? ContextUtils.CONTENT_TYPE_PDF : ContextUtils.CONTENT_TYPE_PNG; - } - - @Override - protected String getFilename() - { - String t = name != null ? CodecUtils.filenameEncode( name ) : ""; - - return "dhis2_chart_" + t + "." + CodecUtils.filenameEncode( type ); - } - - @Override - protected boolean disallowCache() - { - return true; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitChildrenAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitChildrenAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitChildrenAction.java 1970-01-01 00:00:00 +0000 @@ -1,106 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.List; - -import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - */ -public class GetOrganisationUnitChildrenAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String node; - - public void setNode( String node ) - { - this.node = node; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List units = new ArrayList(); - - public List getUnits() - { - return units; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - OrganisationUnit unit = organisationUnitService.getOrganisationUnit( node ); - - if ( unit != null ) - { - int level = organisationUnitService.getLevelOfOrganisationUnit( unit.getId() ) + 1; - - units = new ArrayList( unit.getChildren() ); - - for ( OrganisationUnit organisationUnit : units ) - { - organisationUnit.setLevel( level ); - } - - Collections.sort( units, new IdentifiableObjectNameComparator() ); - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsAction.java 1970-01-01 00:00:00 +0000 @@ -1,89 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.Collection; - -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - */ -public class GetOrganisationUnitsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Collection ids; - - public void setIds( Collection ids ) - { - this.ids = ids; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Collection object = new ArrayList(); - - public Collection getObject() - { - return object; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - object = organisationUnitService.getOrganisationUnitsByUid( ids ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsByGroupAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsByGroupAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsByGroupAction.java 1970-01-01 00:00:00 +0000 @@ -1,92 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.Collection; - -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitGroupService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - */ -public class GetOrganisationUnitsByGroupAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitGroupService organisationUnitGroupService; - - public void setOrganisationUnitGroupService( OrganisationUnitGroupService organisationUnitGroupService ) - { - this.organisationUnitGroupService = organisationUnitGroupService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String id; - - public void setId( String id ) - { - this.id = id; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Collection object = new ArrayList(); - - public Collection getObject() - { - return object; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - if ( id != null ) - { - object = organisationUnitGroupService.getOrganisationUnitGroup( id ).getMembers(); - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsByLevelAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsByLevelAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetOrganisationUnitsByLevelAction.java 1970-01-01 00:00:00 +0000 @@ -1,92 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.Collection; - -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - */ -public class GetOrganisationUnitsByLevelAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer level; - - public void setLevel( Integer level ) - { - this.level = level; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private Collection object = new ArrayList(); - - public Collection getObject() - { - return object; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - if ( level != null ) - { - object = organisationUnitService.getOrganisationUnitsAtLevel( level ); - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/InitializeAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/InitializeAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/InitializeAction.java 1970-01-01 00:00:00 +0000 @@ -1,278 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.Collection; -import java.util.List; - -import org.apache.struts2.ServletActionContext; -import org.hisp.dhis.api.utils.ContextUtils; -import org.hisp.dhis.common.DimensionalObject; -import org.hisp.dhis.common.DimensionService; -import org.hisp.dhis.i18n.I18nFormat; -import org.hisp.dhis.mapping.MapLegendSet; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitLevel; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.hisp.dhis.period.Period; -import org.hisp.dhis.period.PeriodService; -import org.hisp.dhis.period.RelativePeriods; - -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - * @version $Id$ - */ -public class InitializeAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - private PeriodService periodService; - - public void setPeriodService( PeriodService periodService ) - { - this.periodService = periodService; - } - - private DimensionService dimensionService; - - public void setDimensionService( DimensionService dimensionService ) - { - this.dimensionService = dimensionService; - } - - private I18nFormat format; - - public void setFormat( I18nFormat format ) - { - this.format = format; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String callback; - - public void setCallback( String callback ) - { - this.callback = callback; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - public String getCallback() - { - return callback; - } - - private String contextPath; - - public String getContextPath() - { - return contextPath; - } - - private Collection rootNodes; - - public Collection getRootNodes() - { - return rootNodes; - } - - private List lastMonth; - - public List getLastMonth() - { - return lastMonth; - } - - private List last12Months; - - public List getLast12Months() - { - return last12Months; - } - - private List last3Months; - - public List getLast3Months() - { - return last3Months; - } - - private List lastQuarter; - - public List getLastQuarter() - { - return lastQuarter; - } - - private List last4Quarters; - - public List getLast4Quarters() - { - return last4Quarters; - } - - private List lastSixMonth; - - public List getLastSixMonth() - { - return lastSixMonth; - } - - private List last2SixMonths; - - public List getLast2SixMonths() - { - return last2SixMonths; - } - - private List lastYear; - - public List getLastYear() - { - return lastYear; - } - - private List thisYear; - - public List getThisYear() - { - return thisYear; - } - - private List last5Years; - - public List getLast5Years() - { - return last5Years; - } - - private Collection dimensions; - - public Collection getDimensions() - { - return dimensions; - } - - private Collection legendSets; - - public Collection getLegendSets() - { - return legendSets; - } - - private Collection levels; - - public Collection getLevels() - { - return levels; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - contextPath = ContextUtils.getContextPath( ServletActionContext.getRequest() ); - - rootNodes = new ArrayList( organisationUnitService.getOrganisationUnitsAtLevel( 1 ) ); - - if ( rootNodes.size() < 1 ) - { - rootNodes.add( new OrganisationUnit() ); - } - - RelativePeriods rp = new RelativePeriods(); - - rp.clear().setReportingMonth( true ); - lastMonth = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setLast12Months( true ); - last12Months = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setLast3Months( true ); - last3Months = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setReportingQuarter( true ); - lastQuarter = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setLast4Quarters( true ); - last4Quarters = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setLastSixMonth( true ); - lastSixMonth = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setLast2SixMonths( true ); - last2SixMonths = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setLastYear( true ); - lastYear = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setThisYear( true ); - thisYear = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - rp.clear().setLast5Years( true ); - last5Years = periodService.reloadPeriods( setNames( rp.getRelativePeriods() ) ); - - dimensions = dimensionService.getAllDimensions(); - - levels = organisationUnitService.getOrganisationUnitLevels(); - - return SUCCESS; - } - - private List setNames( List periods ) - { - for ( Period period : periods ) - { - period.setName( format.formatPeriod( period ) ); - } - - return periods; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/NoAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/NoAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/NoAction.java 1970-01-01 00:00:00 +0000 @@ -1,44 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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 com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - * @version $Id$ - */ -public class NoAction - implements Action -{ - public String execute() - { - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/UpdateChartNameAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/UpdateChartNameAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/UpdateChartNameAction.java 1970-01-01 00:00:00 +0000 @@ -1,89 +0,0 @@ -package org.hisp.dhis.visualizer.action; - -/* - * Copyright (c) 2004-2013, 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.chart.Chart; -import org.hisp.dhis.chart.ChartService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Jan Henrik Overland - */ -public class UpdateChartNameAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private ChartService chartService; - - public void setChartService( ChartService chartService ) - { - this.chartService = chartService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String uid; - - public void setUid( String uid ) - { - this.uid = uid; - } - - private String name; - - public void setName( String name ) - { - this.name = name; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - if ( uid != null && name != null ) - { - Chart chart = chartService.getChart( uid ); - - chart.setName( name ); - - chartService.updateChart( chart ); - } - - return SUCCESS; - } -} === removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF' === removed directory 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis' === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis/beans.xml 2013-05-24 12:59:08 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/META-INF/dhis/beans.xml 1970-01-01 00:00:00 +0000 @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/struts.xml 2013-05-24 12:59:08 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/struts.xml 2013-12-25 23:00:32 +0000 @@ -11,92 +11,9 @@ - + app/index.html - - - - - /dhis-web-visualizer/jsonInitialize.vm - - - - - - - - /dhis-web-visualizer/jsonminOrganisationUnitChildren.vm - - - - - - /dhis-web-visualizer/jsonminOrganisationUnitPaths.vm - - - - - - /dhis-web-visualizer/jsonminOrganisationUnitPaths.vm - - - - - - /dhis-web-visualizer/jsonminOrganisationUnitPaths.vm - - - - - - - - /dhis-web-visualizer/stringChartId.vm - - F_DV_ADMIN - true - - - - - /dhis-web-visualizer/stringChartId.vm - - - - - - /dhis-web-visualizer/void.vm - - - - - - /dhis-web-visualizer/void.vm - - - - - - - - - - - - - /dhis-web-visualizer/i18n.vm - -