dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #08933
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2258: Small rename.
------------------------------------------------------------
revno: 2258
committer: Jo Størset <storset@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2010-12-02 17:28:40 +0530
message:
Small rename.
removed:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/Mapping.java
added:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ModelMapping.java
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java
--
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-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java 2010-11-27 04:15:31 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/DefaultProgramService.java 2010-12-02 11:58:40 +0000
@@ -99,7 +99,7 @@
org.hisp.dhis.dataelement.DataElement dataElement = programStagedataElement.getDataElement();
- DataElement de = Mapping.getDataElement( dataElement );
+ DataElement de = ModelMapping.getDataElement( dataElement );
de.setCompulsory( programStagedataElement.isCompulsory() );
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java 2010-12-02 10:53:14 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/FacilityReportingServiceImpl.java 2010-12-02 11:58:40 +0000
@@ -180,7 +180,7 @@
{
dataElement = i18n( i18nService, locale, dataElement );
- DataElement de = Mapping.getDataElement( dataElement );
+ DataElement de = ModelMapping.getDataElement( dataElement );
// For facility Reporting, no data elements are mandatory
de.setCompulsory( false );
=== removed file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/Mapping.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/Mapping.java 2010-11-27 04:15:31 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/Mapping.java 1970-01-01 00:00:00 +0000
@@ -1,78 +0,0 @@
-package org.hisp.dhis.web.api.service;
-
-/*
- * Copyright (c) 2004-2010, 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;
-import java.util.Set;
-
-import org.hisp.dhis.web.api.model.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.web.api.model.Model;
-import org.hisp.dhis.web.api.model.ModelList;
-
-public class Mapping
-{
-
- public static DataElement getDataElement( org.hisp.dhis.dataelement.DataElement dataElement )
- {
- DataElement de = new DataElement();
- de.setId( dataElement.getId() );
- de.setName( dataElement.getName() );
- de.setType( dataElement.getType() );
-
- de.setCategoryOptionCombos( getCategoryOptionCombos( dataElement ) );
- return de;
- }
-
- public static ModelList getCategoryOptionCombos( org.hisp.dhis.dataelement.DataElement dataElement )
- {
- Set<DataElementCategoryOptionCombo> deCatOptCombs = dataElement.getCategoryCombo().getOptionCombos();
-
-// if ( deCatOptCombs.size() < 2 )
-// {
-// return null;
-// }
-
- // Client DataElement
- ModelList deCateOptCombo = new ModelList();
- List<Model> listCateOptCombo = new ArrayList<Model>();
- deCateOptCombo.setModels( listCateOptCombo );
-
- for ( DataElementCategoryOptionCombo oneCatOptCombo : deCatOptCombs )
- {
- Model oneCateOptCombo = new Model();
- oneCateOptCombo.setId( oneCatOptCombo.getId() );
- oneCateOptCombo.setName( oneCatOptCombo.getName() );
- listCateOptCombo.add( oneCateOptCombo );
- }
- return deCateOptCombo;
- }
-
-
-}
=== added file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ModelMapping.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ModelMapping.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/service/ModelMapping.java 2010-12-02 11:58:40 +0000
@@ -0,0 +1,78 @@
+package org.hisp.dhis.web.api.service;
+
+/*
+ * Copyright (c) 2004-2010, 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;
+import java.util.Set;
+
+import org.hisp.dhis.web.api.model.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.web.api.model.Model;
+import org.hisp.dhis.web.api.model.ModelList;
+
+public class ModelMapping
+{
+
+ public static DataElement getDataElement( org.hisp.dhis.dataelement.DataElement dataElement )
+ {
+ DataElement de = new DataElement();
+ de.setId( dataElement.getId() );
+ de.setName( dataElement.getName() );
+ de.setType( dataElement.getType() );
+
+ de.setCategoryOptionCombos( getCategoryOptionCombos( dataElement ) );
+ return de;
+ }
+
+ public static ModelList getCategoryOptionCombos( org.hisp.dhis.dataelement.DataElement dataElement )
+ {
+ Set<DataElementCategoryOptionCombo> deCatOptCombs = dataElement.getCategoryCombo().getOptionCombos();
+
+// if ( deCatOptCombs.size() < 2 )
+// {
+// return null;
+// }
+
+ // Client DataElement
+ ModelList deCateOptCombo = new ModelList();
+ List<Model> listCateOptCombo = new ArrayList<Model>();
+ deCateOptCombo.setModels( listCateOptCombo );
+
+ for ( DataElementCategoryOptionCombo oneCatOptCombo : deCatOptCombs )
+ {
+ Model oneCateOptCombo = new Model();
+ oneCateOptCombo.setId( oneCatOptCombo.getId() );
+ oneCateOptCombo.setName( oneCatOptCombo.getName() );
+ listCateOptCombo.add( oneCateOptCombo );
+ }
+ return deCateOptCombo;
+ }
+
+
+}