=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityMobileSetting.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityMobileSetting.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityMobileSetting.java 1970-01-01 00:00:00 +0000 @@ -1,94 +0,0 @@ -package org.hisp.dhis.trackedentity; - -/* - * Copyright (c) 2004-2014, 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.List; - -public class TrackedEntityMobileSetting -{ - public static final long serialVersionUID = -5947521380646718129L; - - private int id; - - private Boolean autoUpdateClient = false; - - private Double versionToUpdate; - - private List attributes = new ArrayList(); - - public TrackedEntityMobileSetting() - { - } - - public int getId() - { - return id; - } - - public void setId( int id ) - { - this.id = id; - } - - public List getAttributes() - { - return attributes; - } - - public void setAttributes( List attributes ) - { - this.attributes = attributes; - } - - public Boolean getAutoUpdateClient() - { - return autoUpdateClient; - } - - public void setAutoUpdateClient( Boolean autoUpdateClient ) - { - this.autoUpdateClient = autoUpdateClient; - } - - public double getVersionToUpdate() - { - if ( versionToUpdate != null ) - { - return versionToUpdate; - } - - return 0; - } - - public void setVersionToUpdate( Double versionToUpdate ) - { - this.versionToUpdate = versionToUpdate; - } -} === removed file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/TrackedEntityMobileSettingService.java' --- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/TrackedEntityMobileSettingService.java 2014-05-20 15:38:30 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/TrackedEntityMobileSettingService.java 1970-01-01 00:00:00 +0000 @@ -1,45 +0,0 @@ -package org.hisp.dhis.api.mobile; - -/* - * Copyright (c) 2004-2014, 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.trackedentity.TrackedEntityMobileSetting; - -public interface TrackedEntityMobileSettingService -{ - int saveTrackedEntityMobileSetting( TrackedEntityMobileSetting setting ); - - void updateTrackedEntityMobileSetting( TrackedEntityMobileSetting setting ); - - Collection getCurrentSetting(); - - TrackedEntityMobileSetting get( int id ); - -} === removed file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/TrackedEntityMobileSettingStore.java' --- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/TrackedEntityMobileSettingStore.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/TrackedEntityMobileSettingStore.java 1970-01-01 00:00:00 +0000 @@ -1,40 +0,0 @@ -package org.hisp.dhis.api.mobile; - -/* - * Copyright (c) 2004-2014, 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.common.GenericStore; -import org.hisp.dhis.trackedentity.TrackedEntityMobileSetting; - -public interface TrackedEntityMobileSettingStore - extends GenericStore -{ - Collection getCurrentSetting(); -} === 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 2014-05-21 09:03:33 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java 2014-05-21 09:48:18 +0000 @@ -44,7 +44,6 @@ import org.hisp.dhis.api.mobile.ActivityReportingService; import org.hisp.dhis.api.mobile.NotAllowedException; -import org.hisp.dhis.api.mobile.TrackedEntityMobileSettingService; import org.hisp.dhis.api.mobile.model.Activity; import org.hisp.dhis.api.mobile.model.ActivityPlan; import org.hisp.dhis.api.mobile.model.ActivityValue; @@ -92,7 +91,6 @@ import org.hisp.dhis.trackedentity.TrackedEntityInstance; import org.hisp.dhis.trackedentity.TrackedEntityInstanceQueryParams; import org.hisp.dhis.trackedentity.TrackedEntityInstanceService; -import org.hisp.dhis.trackedentity.TrackedEntityMobileSetting; import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue; import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService; import org.hisp.dhis.trackedentitydatavalue.TrackedEntityDataValue; @@ -132,8 +130,6 @@ private TrackedEntityDataValueService dataValueService; - private TrackedEntityMobileSettingService mobileSettingService; - private ProgramStageSectionService programStageSectionService; private ProgramInstanceService programInstanceService; @@ -200,17 +196,6 @@ this.attValueService = attValueService; } - @Required - public void setMobileSettingService( TrackedEntityMobileSettingService mobileSettingService ) - { - this.mobileSettingService = mobileSettingService; - } - - public void setSetting( TrackedEntityMobileSetting setting ) - { - this.setting = setting; - } - public void setGroupByAttribute( TrackedEntityAttribute groupByAttribute ) { this.groupByAttribute = groupByAttribute; @@ -268,8 +253,6 @@ // MobileDataSetService // ------------------------------------------------------------------------- - private TrackedEntityMobileSetting setting; - private TrackedEntityAttribute groupByAttribute; @Override @@ -711,30 +694,9 @@ { Beneficiary beneficiary = new Beneficiary(); List patientAtts = new ArrayList(); - List atts; - beneficiary.setId( patient.getId() ); beneficiary.setName( patient.getName() ); - this.setSetting( getSettings() ); - - if ( setting != null ) - { - atts = setting.getAttributes(); - for ( TrackedEntityAttribute each : atts ) - { - TrackedEntityAttributeValue value = attValueService.getTrackedEntityAttributeValue( patient, each ); - if ( value != null ) - { - // patientAtts.add( new TrackedEntityAttribute( - // each.getName(), - // value.getValue(), each.getValueType(), - // new ArrayList() ) ); - } - } - - } - // Set attribute which is used to group beneficiary on mobile (only if // there is attribute which is set to be group factor) org.hisp.dhis.api.mobile.model.PatientAttribute beneficiaryAttribute = null; @@ -779,8 +741,6 @@ patientModel.setTrackedEntityName( "" ); } - this.setSetting( getSettings() ); - List atts = new ArrayList( patient.getAttributeValues() ); @@ -1041,16 +1001,6 @@ return mobileDataElements; } - private TrackedEntityMobileSetting getSettings() - { - TrackedEntityMobileSetting setting = null; - - Collection currentSetting = mobileSettingService.getCurrentSetting(); - if ( currentSetting != null && !currentSetting.isEmpty() ) - setting = currentSetting.iterator().next(); - return setting; - } - private boolean isNumber( String value ) { try === removed file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultTrackedEntityMobileSettingService.java' --- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultTrackedEntityMobileSettingService.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultTrackedEntityMobileSettingService.java 1970-01-01 00:00:00 +0000 @@ -1,80 +0,0 @@ -package org.hisp.dhis.mobile.service; - -/* - * Copyright (c) 2004-2014, 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.api.mobile.TrackedEntityMobileSettingService; -import org.hisp.dhis.api.mobile.TrackedEntityMobileSettingStore; -import org.hisp.dhis.trackedentity.TrackedEntityMobileSetting; -import org.springframework.transaction.annotation.Transactional; - -@Transactional -public class DefaultTrackedEntityMobileSettingService - implements TrackedEntityMobileSettingService -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private TrackedEntityMobileSettingStore mobileSettingStore; - - public void setMobileSettingStore( TrackedEntityMobileSettingStore mobileSettingStore ) - { - this.mobileSettingStore = mobileSettingStore; - } - - // ------------------------------------------------------------------------- - // Implementation methods - // ------------------------------------------------------------------------- - - @Override - public int saveTrackedEntityMobileSetting( TrackedEntityMobileSetting setting ) - { - return mobileSettingStore.save( setting ); - } - - @Override - public void updateTrackedEntityMobileSetting( TrackedEntityMobileSetting setting ) - { - mobileSettingStore.update( setting ); - } - - @Override - public Collection getCurrentSetting() - { - return mobileSettingStore.getCurrentSetting(); - } - - @Override - public TrackedEntityMobileSetting get( int id ) - { - return mobileSettingStore.get( id ); - } -} === removed file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/HibernateTrackedEntityMobileSettingStore.java' --- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/HibernateTrackedEntityMobileSettingStore.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/HibernateTrackedEntityMobileSettingStore.java 1970-01-01 00:00:00 +0000 @@ -1,53 +0,0 @@ -package org.hisp.dhis.mobile.service; - -/* - * Copyright (c) 2004-2014, 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.hibernate.Criteria; -import org.hibernate.Session; -import org.hisp.dhis.api.mobile.TrackedEntityMobileSettingStore; -import org.hisp.dhis.hibernate.HibernateGenericStore; -import org.hisp.dhis.trackedentity.TrackedEntityMobileSetting; -import org.springframework.transaction.annotation.Transactional; - -@Transactional -public class HibernateTrackedEntityMobileSettingStore - extends HibernateGenericStore - implements TrackedEntityMobileSettingStore -{ - @SuppressWarnings( "unchecked" ) - public Collection getCurrentSetting() - { - Session session = sessionFactory.getCurrentSession(); - Criteria criteria = session.createCriteria( TrackedEntityMobileSetting.class ); - criteria.setCacheable( true ); - return criteria.list(); - } -} === 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 2014-05-09 10:07:18 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml 2014-05-21 09:48:18 +0000 @@ -26,8 +26,6 @@ ref="org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService" /> - - - - - - - - - - === removed file 'dhis-2/dhis-services/dhis-service-mobile/src/main/resources/org/hisp/dhis/mobile/TrackedEntityMobileSetting.hbm.xml' --- dhis-2/dhis-services/dhis-service-mobile/src/main/resources/org/hisp/dhis/mobile/TrackedEntityMobileSetting.hbm.xml 2014-02-07 20:25:49 +0000 +++ dhis-2/dhis-services/dhis-service-mobile/src/main/resources/org/hisp/dhis/mobile/TrackedEntityMobileSetting.hbm.xml 1970-01-01 00:00:00 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java 2014-03-27 23:16:43 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java 2014-05-21 09:48:18 +0000 @@ -28,11 +28,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.util.List; - -import org.hisp.dhis.api.mobile.TrackedEntityMobileSettingService; -import org.hisp.dhis.trackedentity.TrackedEntityMobileSetting; - import com.opensymphony.xwork2.Action; /** @@ -41,21 +36,11 @@ public class J2meClientUpdateAction implements Action { - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private TrackedEntityMobileSettingService mobileSettingService; - - public void setMobileSettingService( TrackedEntityMobileSettingService mobileSettingService ) - { - this.mobileSettingService = mobileSettingService; - } // ------------------------------------------------------------------------- // Input & Output // ------------------------------------------------------------------------- - + private double version; public void setVersion( double version ) @@ -64,50 +49,48 @@ } private String autoUpdate; - + public void setAutoUpdate( String autoUpdate ) { this.autoUpdate = autoUpdate; } - - private TrackedEntityMobileSetting trackedEntityMobileSetting; - - public TrackedEntityMobileSetting getTrackedEntityMobileSetting() - { - return trackedEntityMobileSetting; - } @Override public String execute() throws Exception - { - List list; - - list = (List) mobileSettingService.getCurrentSetting(); - - if( list.size() == 0 ) - { - trackedEntityMobileSetting = new TrackedEntityMobileSetting(); - } - else - { - trackedEntityMobileSetting = list.get( 0 ); - } - if ( this.version != 0 ) - { - trackedEntityMobileSetting.setVersionToUpdate( this.version ); - } - if ( autoUpdate != null && autoUpdate.equals( "yes" ) ) - { - trackedEntityMobileSetting.setAutoUpdateClient( true ); - } - - if ( autoUpdate != null && autoUpdate.equals( "no" ) ) - { - trackedEntityMobileSetting.setAutoUpdateClient( false ); - } - - mobileSettingService.saveTrackedEntityMobileSetting( this.trackedEntityMobileSetting ); + { + + //TO DO: reimplement using SystemSetting + + // List list; + // + // list = (List) + // mobileSettingService.getCurrentSetting(); + // + // if( list.size() == 0 ) + // { + // trackedEntityMobileSetting = new TrackedEntityMobileSetting(); + // } + // else + // { + // trackedEntityMobileSetting = list.get( 0 ); + // } + // if ( this.version != 0 ) + // { + // trackedEntityMobileSetting.setVersionToUpdate( this.version ); + // } + // if ( autoUpdate != null && autoUpdate.equals( "yes" ) ) + // { + // trackedEntityMobileSetting.setAutoUpdateClient( true ); + // } + // + // if ( autoUpdate != null && autoUpdate.equals( "no" ) ) + // { + // trackedEntityMobileSetting.setAutoUpdateClient( false ); + // } + // + // mobileSettingService.saveTrackedEntityMobileSetting( + // this.trackedEntityMobileSetting ); return SUCCESS; } } === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java 2014-03-27 23:16:43 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java 1970-01-01 00:00:00 +0000 @@ -1,158 +0,0 @@ -package org.hisp.dhis.mobile.action; - -/* - * Copyright (c) 2004-2014, 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.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.hisp.dhis.api.mobile.TrackedEntityMobileSettingService; -import org.hisp.dhis.trackedentity.TrackedEntityAttribute; -import org.hisp.dhis.trackedentity.TrackedEntityAttributeService; -import org.hisp.dhis.trackedentity.TrackedEntityMobileSetting; - -import com.opensymphony.xwork2.Action; - -public class ShowMobileSettingFormAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private TrackedEntityAttributeService attributeService; - - public void setAttributeService( TrackedEntityAttributeService attributeService ) - { - this.attributeService = attributeService; - } - - private TrackedEntityMobileSettingService mobileSettingService; - - public void setMobileSettingService( TrackedEntityMobileSettingService mobileSettingService ) - { - this.mobileSettingService = mobileSettingService; - } - - // ------------------------------------------------------------------------- - // Input/Output - // ------------------------------------------------------------------------- - - private List patientAtts; - - public List getPatientAtts() - { - return patientAtts; - } - - public void setPatientAtts( List patientAtts ) - { - this.patientAtts = patientAtts; - } - - private Collection attributes; - - public Collection getAttributes() - { - return attributes; - } - - public void setAttributes( Collection attributes ) - { - this.attributes = attributes; - } - - private List allAttributes; - - public List getAllAttributes() - { - return allAttributes; - } - - public void setAllAttributes( List allAttributes ) - { - this.allAttributes = allAttributes; - } - - private TrackedEntityMobileSetting setting; - - public TrackedEntityMobileSetting getSetting() - { - return setting; - } - - public void setSetting( TrackedEntityMobileSetting setting ) - { - this.setting = setting; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - attributes = attributeService.getAllTrackedEntityAttributes(); - allAttributes = new ArrayList(attributes); - - Collection paSettings = new HashSet( mobileSettingService - .getCurrentSetting() ); - - if ( !paSettings.isEmpty() ) - { - Iterator settingsIt = paSettings.iterator(); - - if ( settingsIt.hasNext() ) - { - setting = settingsIt.next(); - - patientAtts = setting.getAttributes(); - - for ( TrackedEntityAttribute attribute : patientAtts ) - { - if ( attributes.contains( attribute ) ) - { - attributes.remove( attribute ); - } - } - } - else - { - patientAtts = new ArrayList(); - } - } - - return SUCCESS; - } - -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java 2014-03-27 23:16:43 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java 1970-01-01 00:00:00 +0000 @@ -1,158 +0,0 @@ -package org.hisp.dhis.mobile.action; - -/* - * Copyright (c) 2004-2014, 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.HashSet; -import java.util.List; - -import org.hisp.dhis.api.mobile.TrackedEntityMobileSettingService; -import org.hisp.dhis.trackedentity.TrackedEntityAttribute; -import org.hisp.dhis.trackedentity.TrackedEntityAttributeService; -import org.hisp.dhis.trackedentity.TrackedEntityMobileSetting; - -import com.opensymphony.xwork2.Action; - -public class UpdateMobileSettingAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private TrackedEntityAttributeService attributeService; - - public void setAttributeService( TrackedEntityAttributeService attributeService ) - { - this.attributeService = attributeService; - } - - private TrackedEntityMobileSettingService mobileSettingService; - - public void setMobileSettingService( TrackedEntityMobileSettingService mobileSettingService ) - { - this.mobileSettingService = mobileSettingService; - } - - // ------------------------------------------------------------------------- - // Input/Output - // ------------------------------------------------------------------------- - - private Collection selectedList = new HashSet(); - - public void setSelectedList( Collection selectedList ) - { - this.selectedList = selectedList; - } - - private Integer groupingAttributeId; - - public Integer getGroupingAttributeId() - { - return groupingAttributeId; - } - - public void setGroupingAttributeId( Integer groupingAttributeId ) - { - this.groupingAttributeId = groupingAttributeId; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - - if ( selectedList.size() > 0 ) - { - TrackedEntityMobileSetting setting; - if ( mobileSettingService.getCurrentSetting().size() > 0 ) - { - setting = mobileSettingService.getCurrentSetting().iterator().next(); - List attributes = new ArrayList(); - setting.setAttributes( attributes ); - fillValues( attributes ); - mobileSettingService.updateTrackedEntityMobileSetting( setting ); - } - else - { - setting = new TrackedEntityMobileSetting(); - List attributes = new ArrayList(); - setting.setAttributes( attributes ); - fillValues( attributes ); - mobileSettingService.saveTrackedEntityMobileSetting( setting ); - } - } - else - { - TrackedEntityMobileSetting setting; - if ( mobileSettingService.getCurrentSetting().size() > 0 ) - { - setting = mobileSettingService.getCurrentSetting().iterator().next(); - List attributes = new ArrayList(); - setting.setAttributes( attributes ); - fillValues( attributes ); - mobileSettingService.updateTrackedEntityMobileSetting( setting ); - } - else - { - setting = new TrackedEntityMobileSetting(); - List attributes = new ArrayList(); - setting.setAttributes( attributes ); - fillValues( attributes ); - mobileSettingService.saveTrackedEntityMobileSetting( setting ); - } - } - - Collection allTrackedEntityAttributes = attributeService.getAllTrackedEntityAttributes(); - - for ( TrackedEntityAttribute patientAttribute : allTrackedEntityAttributes ) - { - attributeService.updateTrackedEntityAttribute( patientAttribute ); - } - - return SUCCESS; - } - - // ------------------------------------------------------------------------- - // Supporting methods - // ------------------------------------------------------------------------- - - private void fillValues( List attributes ) - { - for ( String id : selectedList ) - { - attributes.add( attributeService.getTrackedEntityAttribute( Integer.parseInt( id ) ) ); - } - } -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml 2014-03-27 23:16:43 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml 2014-05-21 09:48:18 +0000 @@ -64,26 +64,6 @@ - - - - - - - - - - - - - - + scope="prototype"/> + plainTextError - - - - /main.vm - /dhis-web-maintenance-mobile/patientSettings.vm - /dhis-web-maintenance-mobile/menu.vm - - - - patientMobileSetting.action - - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/index.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/index.vm 2013-08-16 12:29:21 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/index.vm 2014-05-21 09:48:18 +0000 @@ -2,5 +2,4 @@
    #introListImgItem( "showMobileDataSet.action" "mobile_dataset" "mobile" ) - #introListImgItem( "patientMobileSetting.action" "patient_mobile_setting" "mobilesettings" )
\ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/menu.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/menu.vm 2013-08-13 11:54:13 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/menu.vm 2014-05-21 09:48:18 +0000 @@ -1,7 +1,6 @@

DHIS Mobile Configuration

    -
  • $i18n.getString( "patient_mobile_setting" )
  • $i18n.getString( "mobile_dataset" ) 
  • $i18n.getString( "sms_service_configuration" )
  • $i18n.getString( "view_sent_sms" )
  • === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/patientSettings.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/patientSettings.vm 2012-05-30 08:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/patientSettings.vm 1970-01-01 00:00:00 +0000 @@ -1,86 +0,0 @@ - -

    $i18n.getString( "patient_mobile_setting" ) #openHelp( "patient_mobile_setting" )

    -
    - - - - - - - - - - - - - - - - - - - - - -
    $i18n.getString( "gender" )
    $i18n.getString( "dob_type" )
    $i18n.getString( "date_of_birth" )
    $i18n.getString( "registration_date" )
    $i18n.getString( "activity_grouping_attribute" ) - -
    -
    - - ## Available DataElements - ## Filter - ## Selected DataElements - - - - - - - - - - - - - - - - - - -
    $i18n.getString( "available_patient_attributes" )$i18n.getString( "filter" )$i18n.getString( "selected_patient_attributes" )
    - - - -
    -
    -
    - -
    - - - -

    -

    -
    - -
    -