← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15416: Added ValidtionCritera importer and property to MetaData

 

------------------------------------------------------------
revno: 15416
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-05-26 15:35:31 +0200
message:
  Added ValidtionCritera importer and property to MetaData
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java
  dhis-2/dhis-services/dhis-service-dxf2/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-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java	2014-05-26 11:54:16 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/MetaData.java	2014-05-26 13:35:31 +0000
@@ -33,7 +33,6 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import com.google.common.collect.Lists;
-
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.chart.Chart;
 import org.hisp.dhis.common.DimensionalObject;
@@ -59,7 +58,6 @@
 import org.hisp.dhis.document.Document;
 import org.hisp.dhis.dxf2.events.event.Event;
 import org.hisp.dhis.eventreport.EventReport;
-import org.hisp.dhis.schema.Schema;
 import org.hisp.dhis.filter.MetaDataFilter;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
@@ -82,6 +80,7 @@
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reporttable.ReportTable;
+import org.hisp.dhis.schema.Schema;
 import org.hisp.dhis.sqlview.SqlView;
 import org.hisp.dhis.trackedentity.TrackedEntity;
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
@@ -89,6 +88,7 @@
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserAuthorityGroup;
 import org.hisp.dhis.user.UserGroup;
+import org.hisp.dhis.validation.ValidationCriteria;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleGroup;
 
@@ -105,11 +105,11 @@
     private Date created;
 
     private List<Schema> schemas = Lists.newArrayList();
-    
+
     private List<Attribute> attributes = new ArrayList<Attribute>();
 
     private List<DataApprovalLevel> dataApprovalLevels = new ArrayList<DataApprovalLevel>();
-    
+
     private List<Document> documents = new ArrayList<Document>();
 
     private List<Constant> constants = new ArrayList<Constant>();
@@ -199,17 +199,19 @@
     private List<DataSet> dataSets = new ArrayList<DataSet>();
 
     private List<MetaDataFilter> metaDataFilters = new ArrayList<MetaDataFilter>();
-    
+
     private List<Event> events = new ArrayList<Event>();
 
     private List<EventReport> eventReports = new ArrayList<EventReport>();
-    
+
     private List<Program> programs = new ArrayList<Program>();
 
     private List<ProgramStage> programStages = new ArrayList<ProgramStage>();
 
     private List<RelationshipType> relationshipTypes = new ArrayList<RelationshipType>();
 
+    private List<ValidationCriteria> validationCriterias = new ArrayList<ValidationCriteria>();
+
     private List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
 
     private List<TrackedEntityAttribute> trackedEntityAttributes = new ArrayList<TrackedEntityAttribute>();
@@ -868,7 +870,20 @@
     {
         this.relationshipTypes = relationshipTypes;
     }
-    
+
+    @JsonProperty
+    @JacksonXmlElementWrapper( localName = "validationCriterias", namespace = DxfNamespaces.DXF_2_0 )
+    @JacksonXmlProperty( localName = "validationCriteria", namespace = DxfNamespaces.DXF_2_0 )
+    public List<ValidationCriteria> getValidationCriterias()
+    {
+        return validationCriterias;
+    }
+
+    public void setValidationCriterias( List<ValidationCriteria> validationCriterias )
+    {
+        this.validationCriterias = validationCriterias;
+    }
+
     @JsonProperty
     @JacksonXmlElementWrapper( localName = "events", namespace = DxfNamespaces.DXF_2_0 )
     @JacksonXmlProperty( localName = "event", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml	2014-05-26 12:44:15 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml	2014-05-26 13:35:31 +0000
@@ -219,6 +219,10 @@
     <constructor-arg name="importerClass" type="java.lang.Class" value="org.hisp.dhis.relationship.RelationshipType" />
   </bean>
 
+  <bean id="validationCriteriaImporter" class="org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter" scope="prototype">
+    <constructor-arg name="importerClass" type="java.lang.Class" value="org.hisp.dhis.validation.ValidationCriteria" />
+  </bean>
+
   <bean id="trackedEntityImporter" class="org.hisp.dhis.dxf2.metadata.importers.DefaultIdentifiableObjectImporter"
     scope="prototype">
     <constructor-arg name="importerClass" type="java.lang.Class" value="org.hisp.dhis.trackedentity.TrackedEntity" />