=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java 2013-12-16 17:34:32 +0000 @@ -0,0 +1,59 @@ +package org.hisp.dhis.light.utils; + +/* + * 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 java.util.List; +import java.util.Map; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.datavalue.DeflatedDataValue; +import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.period.Period; + +public interface FormUtils +{ + Map getValidationViolations( OrganisationUnit organisationUnit, + Collection dataElements, Period period ); + + List getValidationRuleViolations( OrganisationUnit organisationUnit, DataSet dataSet, Period period ); + + Map getDataValueMap( OrganisationUnit organisationUnit, DataSet dataSet, Period period ); + + List organisationUnitWithDataSetsFilter( Collection organisationUnits ); + + List getSortedOrganisationUnitsForCurrentUser(); + + List getDataSetsForCurrentUser( Integer organisationUnitId ); + + List getPeriodsForDataSet( Integer dataSetId ); + + List getPeriodsForDataSet( Integer dataSetId, int first, int max ); +} === renamed file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java' => 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtilsImpl.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java 2013-12-16 17:25:44 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtilsImpl.java 2013-12-16 17:34:32 +0000 @@ -1,5 +1,33 @@ package org.hisp.dhis.light.utils; +/* + * 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.Collections; @@ -40,7 +68,8 @@ /** * @author Morten Olav Hansen */ -public class FormUtils +public class FormUtilsImpl + implements FormUtils { public static final Integer DEFAULT_MAX_PERIODS = 10; === added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java 2013-12-16 17:34:32 +0000 @@ -0,0 +1,51 @@ +package org.hisp.dhis.light.utils; + +/* + * 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.List; +import java.util.Set; + +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.program.ProgramStage; +import org.hisp.dhis.program.ProgramStageDataElement; +import org.hisp.dhis.program.ProgramStageInstance; + +public interface NamebasedUtils +{ + ProgramStage getProgramStage( int programId, int programStageId ); + + String getTypeViolation( DataElement dataElement, String value ); + + ProgramStageInstance getNextStage( Set programStageInstances ); + + List transformDataElementsToMobileModel( Integer programStageId ); + + List transformDataElementsToMobileModel( List programStageDataElements ); + +} === renamed file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java' => 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtilsImpl.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java 2013-12-16 17:25:44 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtilsImpl.java 2013-12-16 17:34:32 +0000 @@ -43,13 +43,13 @@ import org.hisp.dhis.program.ProgramStageService; import org.hisp.dhis.system.util.MathUtils; -public class NamebasedUtils +public class NamebasedUtilsImpl + implements NamebasedUtils { // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - - //private IProgramService IprgramService; + private ProgramService programService; public void setProgramService( ProgramService programService ) @@ -66,7 +66,6 @@ public ProgramStage getProgramStage( int programId, int programStageId ) { - //Program program = programService.getProgram( programId, "" ); Program program = programService.getProgram( programId ); Collection stages = program.getProgramStages(); @@ -167,7 +166,7 @@ return des; } - public List transformDataElementsToMobileModel( List programStageDataElements) + public List transformDataElementsToMobileModel( List programStageDataElements ) { List des = new ArrayList(); === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-12-16 17:21:39 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-12-16 17:34:32 +0000 @@ -3,6 +3,31 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"> + + + + + + + + + + + + + + + + + + + + + @@ -18,23 +43,6 @@ - - - - - - - - - - - - @@ -43,7 +51,8 @@ + class="org.hisp.dhis.light.dataentry.action.GetDataSetsAction" + scope="prototype"> + class="org.hisp.dhis.light.dataentry.action.GetPeriodsAction" + scope="prototype"> + class="org.hisp.dhis.light.dataentry.action.MarkComplete" + scope="prototype"> @@ -86,7 +97,8 @@ + class="org.hisp.dhis.light.dataentry.action.UndoCompleteAction" + scope="prototype"> @@ -193,11 +205,6 @@ ref="org.hisp.dhis.user.UserService"/> - - - - - + class="org.hisp.dhis.light.settings.action.GetSettingsAction" + scope="prototype"> @@ -525,23 +533,27 @@ + class="org.hisp.dhis.light.message.action.GetMessagesAction" + scope="prototype"> + class="org.hisp.dhis.light.message.action.GetMessageAction" + scope="prototype"> + class="org.hisp.dhis.light.message.action.SendReplyAction" + scope="prototype"> + class="org.hisp.dhis.light.message.action.SendFeedbackAction" + scope="prototype">