dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26796
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13254: Mobile, changed from bean to static methods for class without interface
------------------------------------------------------------
revno: 13254
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-16 16:15:54 +0100
message:
Mobile, changed from bean to static methods for class without interface
modified:
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.java
dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml
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/resources/META-INF/dhis/beans.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2013-12-16 15:15:54 +0000
@@ -148,8 +148,6 @@
private ProgramStageService programStageService;
- private org.hisp.dhis.mobile.service.ModelMapping modelMapping;
-
private PatientIdentifierTypeService patientIdentifierTypeService;
private CurrentUserService currentUserService;
@@ -229,12 +227,6 @@
this.patientMobileSettingService = patientMobileSettingService;
}
- @Required
- public void setModelMapping( org.hisp.dhis.mobile.service.ModelMapping modelMapping )
- {
- this.modelMapping = modelMapping;
- }
-
public void setSetting( PatientMobileSetting setting )
{
this.setting = setting;
@@ -1235,7 +1227,7 @@
// Option set
if ( programStageDataElement.getDataElement().getOptionSet() != null )
{
- mobileDataElement.setOptionSet( modelMapping.getOptionSet( programStageDataElement.getDataElement() ) );
+ mobileDataElement.setOptionSet( ModelMapping.getOptionSet( programStageDataElement.getDataElement() ) );
}
else
{
@@ -1245,7 +1237,7 @@
// Category Option Combo
if ( programStageDataElement.getDataElement().getCategoryCombo() != null )
{
- mobileDataElement.setCategoryOptionCombos( modelMapping
+ mobileDataElement.setCategoryOptionCombos( ModelMapping
.getCategoryOptionCombos( programStageDataElement.getDataElement() ) );
}
else
@@ -1521,7 +1513,7 @@
if ( programStageDataElement.getDataElement().getOptionSet() != null )
{
mobileDataElement
- .setOptionSet( modelMapping.getOptionSet( programStageDataElement.getDataElement() ) );
+ .setOptionSet( ModelMapping.getOptionSet( programStageDataElement.getDataElement() ) );
}
else
{
@@ -1529,7 +1521,7 @@
}
if ( programStageDataElement.getDataElement().getCategoryCombo() != null )
{
- mobileDataElement.setCategoryOptionCombos( modelMapping
+ mobileDataElement.setCategoryOptionCombos( ModelMapping
.getCategoryOptionCombos( programStageDataElement.getDataElement() ) );
}
else
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java 2013-10-29 10:27:23 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java 2013-12-16 15:15:54 +0000
@@ -55,8 +55,6 @@
private org.hisp.dhis.program.ProgramService programService;
- private org.hisp.dhis.mobile.service.ModelMapping modelMapping;
-
// -------------------------------------------------------------------------
// ProgramService
// -------------------------------------------------------------------------
@@ -159,7 +157,7 @@
org.hisp.dhis.dataelement.DataElement dataElement = programStagedataElement.getDataElement();
- DataElement de = modelMapping.getDataElement( dataElement );
+ DataElement de = ModelMapping.getDataElement( dataElement );
de.setCompulsory( programStagedataElement.isCompulsory() );
@@ -233,7 +231,7 @@
org.hisp.dhis.dataelement.DataElement dataElement = programStageDataElement.getDataElement();
- org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStageDataElement de = modelMapping.getDataElementLWUIT( dataElement );
+ org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStageDataElement de = ModelMapping.getDataElementLWUIT( dataElement );
de.setCompulsory( programStageDataElement.isCompulsory() );
@@ -281,10 +279,4 @@
{
this.programService = programService;
}
-
- @Required
- public void setModelMapping( org.hisp.dhis.mobile.service.ModelMapping modelMapping )
- {
- this.modelMapping = modelMapping;
- }
}
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2013-10-01 16:44:42 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2013-12-16 15:15:54 +0000
@@ -93,8 +93,6 @@
private org.hisp.dhis.i18n.I18nService i18nService;
- private org.hisp.dhis.mobile.service.ModelMapping modelMapping;
-
private CompleteDataSetRegistrationService registrationService;
private CurrentUserService currentUserService;
@@ -311,7 +309,7 @@
{
dataElement = i18n( i18nService, locale, dataElement );
- DataElement de = modelMapping.getDataElement( dataElement );
+ DataElement de = ModelMapping.getDataElement( dataElement );
// For facility Reporting, no data elements are mandatory
@@ -505,12 +503,6 @@
}
@Required
- public void setModelMapping( org.hisp.dhis.mobile.service.ModelMapping modelMapping )
- {
- this.modelMapping = modelMapping;
- }
-
- @Required
public void setRegistrationService( CompleteDataSetRegistrationService registrationService )
{
this.registrationService = registrationService;
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ModelMapping.java 2013-12-16 15:15:54 +0000
@@ -41,7 +41,7 @@
public class ModelMapping
{
- public DataElement getDataElement( org.hisp.dhis.dataelement.DataElement dataElement )
+ public static DataElement getDataElement( org.hisp.dhis.dataelement.DataElement dataElement )
{
DataElement de = new DataElement();
de.setId( dataElement.getId() );
@@ -58,7 +58,7 @@
return de;
}
- public ProgramStageDataElement getDataElementLWUIT( org.hisp.dhis.dataelement.DataElement dataElement )
+ public static ProgramStageDataElement getDataElementLWUIT( org.hisp.dhis.dataelement.DataElement dataElement )
{
ProgramStageDataElement de = new ProgramStageDataElement();
de.setId( dataElement.getId() );
@@ -76,7 +76,7 @@
return de;
}
- public OptionSet getOptionSet( org.hisp.dhis.dataelement.DataElement dataElement )
+ public static OptionSet getOptionSet( org.hisp.dhis.dataelement.DataElement dataElement )
{
org.hisp.dhis.option.OptionSet dhisOptionSet = dataElement.getOptionSet();
OptionSet mobileOptionSet = new OptionSet();
@@ -94,7 +94,7 @@
return mobileOptionSet;
}
- public ModelList getCategoryOptionCombos( org.hisp.dhis.dataelement.DataElement dataElement )
+ public static ModelList getCategoryOptionCombos( org.hisp.dhis.dataelement.DataElement dataElement )
{
DataElementCategoryCombo categoryCombo = dataElement.getCategoryCombo();
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml 2013-10-10 05:42:48 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml 2013-12-16 15:15:54 +0000
@@ -12,7 +12,6 @@
<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
<property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
- <property name="modelMapping" ref="org.hisp.dhis.mobile.service.ModelMapping" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="oUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService"></property>
</bean>
@@ -31,7 +30,6 @@
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
<property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
- <property name="modelMapping" ref="org.hisp.dhis.mobile.service.ModelMapping" />
<property name="patientIdentifierTypeService" ref="org.hisp.dhis.patient.PatientIdentifierTypeService"></property>
<property name="patientAttributeService" ref="org.hisp.dhis.patient.PatientAttributeService"></property>
<property name="relationshipTypeService" ref="org.hisp.dhis.relationship.RelationshipTypeService"></property>
@@ -43,11 +41,8 @@
<bean id="org.hisp.dhis.mobile.api.IProgramService" class="org.hisp.dhis.mobile.service.DefaultProgramService">
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
- <property name="modelMapping" ref="org.hisp.dhis.mobile.service.ModelMapping" />
</bean>
- <bean id="org.hisp.dhis.mobile.service.ModelMapping" class="org.hisp.dhis.mobile.service.ModelMapping"/>
-
<bean id="org.hisp.dhis.mobile.service.PatientMobileSettingService" class="org.hisp.dhis.mobile.service.DefaultPatientMobileSettingService">
<property name="patientMobileSettingStore" ref="org.hisp.dhis.mobile.service.PatientMobileSettingStore" />
</bean>
=== modified 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 2013-09-20 15:13:05 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java 2013-12-16 15:15:54 +0000
@@ -28,19 +28,19 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.mobile.service.ModelMapping;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.program.ProgramStageService;
-import org.springframework.beans.factory.annotation.Required;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
public class NamebasedUtils
{
@@ -63,14 +63,6 @@
this.programStageService = programStageService;
}
- private org.hisp.dhis.mobile.service.ModelMapping modelMapping;
-
- @Required
- public void setModelMapping( org.hisp.dhis.mobile.service.ModelMapping modelMapping )
- {
- this.modelMapping = modelMapping;
- }
-
public ProgramStage getProgramStage( int programId, int programStageId )
{
//Program program = programService.getProgram( programId, "" );
@@ -173,6 +165,7 @@
return des;
}
+
public List<org.hisp.dhis.api.mobile.model.DataElement> transformDataElementsToMobileModel( List<ProgramStageDataElement> programStageDataElements)
{
List<org.hisp.dhis.api.mobile.model.DataElement> des = new ArrayList<org.hisp.dhis.api.mobile.model.DataElement>();
@@ -183,7 +176,7 @@
DataElement dataElement = programStagedataElement.getDataElement();
- org.hisp.dhis.api.mobile.model.DataElement de = modelMapping.getDataElement( dataElement );
+ org.hisp.dhis.api.mobile.model.DataElement de = ModelMapping.getDataElement( dataElement );
de.setCompulsory( programStagedataElement.isCompulsory() );
=== 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-09 06:44:46 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-12-16 15:15:54 +0000
@@ -191,7 +191,6 @@
<bean id="org.hisp.dhis.light.utils.NamebasedUtils" class="org.hisp.dhis.light.utils.NamebasedUtils">
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
- <property name="modelMapping" ref="org.hisp.dhis.mobile.service.ModelMapping" />
</bean>
<bean