← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13733: csd: include commonName in organization.service

 

------------------------------------------------------------
revno: 13733
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-01-15 13:48:58 +0700
message:
  csd: include commonName in organization.service
modified:
  dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Name.java
  dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Service.java
  dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.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-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Name.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Name.java	2014-01-14 12:58:25 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Name.java	2014-01-15 06:48:58 +0000
@@ -28,6 +28,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.springframework.util.Assert;
+
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -64,6 +66,12 @@
     {
     }
 
+    public Name( CommonName commonName )
+    {
+        Assert.notNull( commonName );
+        getCommonNames().add( commonName );
+    }
+
     public List<CommonName> getCommonNames()
     {
         return commonNames;

=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Service.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Service.java	2014-01-14 08:36:11 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Service.java	2014-01-15 06:48:58 +0000
@@ -46,6 +46,9 @@
     @XmlAttribute( name = "oid" )
     private String oid;
 
+    @XmlElement( name = "name", namespace = "urn:ihe:iti:csd:2013" )
+    private List<Name> names = new ArrayList<Name>();
+
     @XmlElement( name = "language", namespace = "urn:ihe:iti:csd:2013" )
     private Language language;
 
@@ -66,6 +69,16 @@
         this.oid = oid;
     }
 
+    public List<Name> getNames()
+    {
+        return names;
+    }
+
+    public void setNames( List<Name> names )
+    {
+        this.names = names;
+    }
+
     public Language getLanguage()
     {
         return language;

=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.java	2014-01-14 13:42:15 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.java	2014-01-15 06:48:58 +0000
@@ -148,6 +148,7 @@
 
                 Service service = new Service();
                 service.setOid( dataSet.getCode() );
+                service.getNames().add( new Name( new CommonName( dataSet.getDisplayName() ) ) );
 
                 organization.getServices().add( service );
             }