dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26623
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13168: Module for PBF Maintenance
------------------------------------------------------------
revno: 13168
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-12-07 09:10:04 +0000
message:
Module for PBF Maintenance
added:
local/in/dhis-web-maintenance-pbf/
local/in/dhis-web-maintenance-pbf/pom.xml
local/in/dhis-web-maintenance-pbf/src/
local/in/dhis-web-maintenance-pbf/src/main/
local/in/dhis-web-maintenance-pbf/src/main/java/
local/in/dhis-web-maintenance-pbf/src/main/java/org/
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/NoAction.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValue.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueService.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueStore.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java
local/in/dhis-web-maintenance-pbf/src/main/resources/
local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/
local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/
local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-maintenance-pbf/src/main/resources/org/
local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/
local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/
local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/
local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/hibernate/
local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/hibernate/TariffDataValue.hbm.xml
local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/i18n_module.properties
local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml
local/in/dhis-web-maintenance-pbf/src/main/webapp/
local/in/dhis-web-maintenance-pbf/src/main/webapp/WEB-INF/
local/in/dhis-web-maintenance-pbf/src/main/webapp/WEB-INF/web.xml
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/css/
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/images/
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript/
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/menu.vm
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/welcome.vm
--
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
=== added directory 'local/in/dhis-web-maintenance-pbf'
=== added file 'local/in/dhis-web-maintenance-pbf/pom.xml'
--- local/in/dhis-web-maintenance-pbf/pom.xml 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/pom.xml 2013-12-07 09:10:04 +0000
@@ -0,0 +1,66 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-web</artifactId>
+ <version>2.14-SNAPSHOT</version>
+ </parent>
+ <repositories>
+ <repository>
+ <id>fdvsolution.public</id>
+ <url>http://archiva.fdvs.com.ar/repository/public1/</url>
+ </repository>
+ </repositories>
+
+ <artifactId>dhis-web-maintenance-pbf</artifactId>
+ <packaging>war</packaging>
+ <name>DHIS Maintenance PBF Module</name>
+
+ <build>
+ <finalName>dhis-web-maintenance-pbf</finalName>
+ </build>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <!-- DHIS -->
+
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-service-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-web-commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-web-commons-resources</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-support-external</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hisp.dhis</groupId>
+ <artifactId>dhis-support-system</artifactId>
+ </dependency>
+
+ </dependencies>
+ <properties>
+ <rootDir>../../</rootDir>
+ </properties>
+</project>
=== added directory 'local/in/dhis-web-maintenance-pbf/src'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/NoAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/NoAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/action/NoAction.java 2013-12-07 09:10:04 +0000
@@ -0,0 +1,11 @@
+package org.hisp.dhis.pbf.action;
+
+import com.opensymphony.xwork2.Action;
+
+public class NoAction implements Action
+{
+ public String execute()
+ {
+ return SUCCESS;
+ }
+}
\ No newline at end of file
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValue.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValue.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValue.java 2013-12-07 09:10:04 +0000
@@ -0,0 +1,198 @@
+package org.hisp.dhis.pbf.api;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+
+public class TariffDataValue implements Serializable
+{
+
+ private OrganisationUnit organisationUnit;
+
+ private DataElement dataElement;
+
+ private DataElementCategoryOptionCombo optionCombo;
+
+ private OrganisationUnitGroup organisationUnitGroup;
+
+ private Date startDate;
+
+ private Date endDate;
+
+ private Double value;
+
+ private String storedBy;
+
+ private Date timestamp;
+
+ private String comment;
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+ public TariffDataValue()
+ {
+
+ }
+
+ public TariffDataValue( OrganisationUnit organisationUnit, DataElement dataElement, DataElementCategoryOptionCombo optionCombo, OrganisationUnitGroup organisationUnitGroup, Date startDate, Date endDate, Double value )
+ {
+ this.organisationUnit = organisationUnit;
+ this.dataElement = dataElement;
+ this.organisationUnitGroup = organisationUnitGroup;
+ this.startDate = startDate;
+ this.endDate = endDate;
+ this.value = value;
+ }
+
+ // -------------------------------------------------------------------------
+ // hashCode and equals
+ // -------------------------------------------------------------------------
+
+ @Override
+ public boolean equals( Object o )
+ {
+ if ( this == o )
+ {
+ return true;
+ }
+
+ if ( o == null )
+ {
+ return false;
+ }
+
+ if ( !(o instanceof TariffDataValue) )
+ {
+ return false;
+ }
+
+ final TariffDataValue other = (TariffDataValue) o;
+
+ return dataElement.equals( other.getDataElement() ) && optionCombo.equals( other.getOptionCombo() )
+ && organisationUnitGroup.equals( other.getOrganisationUnitGroup() ) && organisationUnit.equals( other.getOrganisationUnit() );
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+
+ result = result * prime + optionCombo.hashCode();
+ result = result * prime + organisationUnitGroup.hashCode();
+ result = result * prime + dataElement.hashCode();
+ result = result * prime + organisationUnit.hashCode();
+
+ return result;
+ }
+
+ // -------------------------------------------------------------------------
+ // Getters and setters
+ // -------------------------------------------------------------------------
+
+ public OrganisationUnit getOrganisationUnit()
+ {
+ return organisationUnit;
+ }
+
+ public void setOrganisationUnit( OrganisationUnit organisationUnit )
+ {
+ this.organisationUnit = organisationUnit;
+ }
+
+ public DataElement getDataElement()
+ {
+ return dataElement;
+ }
+
+ public void setDataElement( DataElement dataElement )
+ {
+ this.dataElement = dataElement;
+ }
+
+ public DataElementCategoryOptionCombo getOptionCombo()
+ {
+ return optionCombo;
+ }
+
+ public void setOptionCombo( DataElementCategoryOptionCombo optionCombo )
+ {
+ this.optionCombo = optionCombo;
+ }
+
+ public OrganisationUnitGroup getOrganisationUnitGroup()
+ {
+ return organisationUnitGroup;
+ }
+
+ public void setOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup )
+ {
+ this.organisationUnitGroup = organisationUnitGroup;
+ }
+
+ public Date getStartDate()
+ {
+ return startDate;
+ }
+
+ public void setStartDate( Date startDate )
+ {
+ this.startDate = startDate;
+ }
+
+ public Date getEndDate()
+ {
+ return endDate;
+ }
+
+ public void setEndDate( Date endDate )
+ {
+ this.endDate = endDate;
+ }
+
+ public Double getValue()
+ {
+ return value;
+ }
+
+ public void setValue( Double value )
+ {
+ this.value = value;
+ }
+
+ public String getStoredBy()
+ {
+ return storedBy;
+ }
+
+ public void setStoredBy( String storedBy )
+ {
+ this.storedBy = storedBy;
+ }
+
+ public Date getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public void setTimestamp( Date timestamp )
+ {
+ this.timestamp = timestamp;
+ }
+
+ public String getComment()
+ {
+ return comment;
+ }
+
+ public void setComment( String comment )
+ {
+ this.comment = comment;
+ }
+
+}
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueService.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueService.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueService.java 2013-12-07 09:10:04 +0000
@@ -0,0 +1,30 @@
+package org.hisp.dhis.pbf.api;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+
+public interface TariffDataValueService
+{
+ String ID = TariffDataValueService.class.getName();
+
+ void addTariffDataValue( TariffDataValue tariffDataValue );
+
+ void updateTariffDataValue( TariffDataValue tariffDataValue );
+
+ void deleteTariffDataValue( TariffDataValue tariffDataValue );
+
+ TariffDataValue getTariffDataValue( OrganisationUnit organisationUnit, DataElement dataElement, DataElementCategoryOptionCombo optionCombo, OrganisationUnitGroup organisationUnitGroup, Date startDate, Date endDate );
+
+ TariffDataValue getTariffDataValue( int organisationUnitId, int dataElementId, int categoryOptionComboId, int organisationUnitGroupId, Date startDate, Date endDate );
+
+ Collection<TariffDataValue> getAllTariffDataValues();
+
+ Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit, OrganisationUnitGroup organisationUnitGroup );
+
+ Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit, DataElement dataElement );
+}
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueStore.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueStore.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/TariffDataValueStore.java 2013-12-07 09:10:04 +0000
@@ -0,0 +1,30 @@
+package org.hisp.dhis.pbf.api;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+
+public interface TariffDataValueStore
+{
+ String ID = TariffDataValueStore.class.getName();
+
+ void addTariffDataValue( TariffDataValue tariffDataValue );
+
+ void updateTariffDataValue( TariffDataValue tariffDataValue );
+
+ void deleteTariffDataValue( TariffDataValue tariffDataValue );
+
+ TariffDataValue getTariffDataValue( OrganisationUnit organisationUnit, DataElement dataElement, DataElementCategoryOptionCombo optionCombo, OrganisationUnitGroup organisationUnitGroup, Date startDate, Date endDate );
+
+ TariffDataValue getTariffDataValue( int organisationUnitId, int dataElementId, int categoryOptionComboId, int organisationUnitGroupId, Date startDate, Date endDate );
+
+ Collection<TariffDataValue> getAllTariffDataValues();
+
+ Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit, OrganisationUnitGroup organisationUnitGroup );
+
+ Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit, DataElement dataElement );
+}
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultTariffDataValueService.java 2013-12-07 09:10:04 +0000
@@ -0,0 +1,84 @@
+package org.hisp.dhis.pbf.impl;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.pbf.api.TariffDataValue;
+import org.hisp.dhis.pbf.api.TariffDataValueService;
+import org.hisp.dhis.pbf.api.TariffDataValueStore;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional
+public class DefaultTariffDataValueService implements TariffDataValueService
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private TariffDataValueStore tariffDataValueStore;
+
+ public void setTariffDataValueStore( TariffDataValueStore tariffDataValueStore )
+ {
+ this.tariffDataValueStore = tariffDataValueStore;
+ }
+
+ // -------------------------------------------------------------------------
+ // TariffDataValue
+ // -------------------------------------------------------------------------
+
+ @Override
+ public void addTariffDataValue( TariffDataValue tariffDataValue )
+ {
+ tariffDataValueStore.addTariffDataValue( tariffDataValue );;
+ }
+
+ @Override
+ public void updateTariffDataValue( TariffDataValue tariffDataValue )
+ {
+ tariffDataValueStore.updateTariffDataValue( tariffDataValue );
+ }
+
+ @Override
+ public void deleteTariffDataValue( TariffDataValue tariffDataValue )
+ {
+ tariffDataValueStore.deleteTariffDataValue( tariffDataValue );
+ }
+
+ @Override
+ public TariffDataValue getTariffDataValue( OrganisationUnit organisationUnit, DataElement dataElement,
+ DataElementCategoryOptionCombo optionCombo, OrganisationUnitGroup organisationUnitGroup, Date startDate,
+ Date endDate )
+ {
+ return tariffDataValueStore.getTariffDataValue( organisationUnit, dataElement, optionCombo, organisationUnitGroup, startDate, endDate );
+ }
+
+ @Override
+ public TariffDataValue getTariffDataValue( int organisationUnitId, int dataElementId, int categoryOptionComboId,
+ int organisationUnitGroupId, Date startDate, Date endDate )
+ {
+ return tariffDataValueStore.getTariffDataValue( organisationUnitId, dataElementId, categoryOptionComboId, organisationUnitGroupId, startDate, endDate );
+ }
+
+ @Override
+ public Collection<TariffDataValue> getAllTariffDataValues()
+ {
+ return tariffDataValueStore.getAllTariffDataValues();
+ }
+
+ @Override
+ public Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit, OrganisationUnitGroup organisationUnitGroup )
+ {
+ return tariffDataValueStore.getTariffDataValues( organisationUnit, organisationUnitGroup );
+ }
+
+ @Override
+ public Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit, DataElement dataElement )
+ {
+ return tariffDataValueStore.getTariffDataValues( organisationUnit, dataElement );
+ }
+
+}
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateTariffDataValueStore.java 2013-12-07 09:10:04 +0000
@@ -0,0 +1,126 @@
+package org.hisp.dhis.pbf.impl;
+
+import java.util.Collection;
+import java.util.Date;
+
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.datavalue.DataValue;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.pbf.api.TariffDataValue;
+import org.hisp.dhis.pbf.api.TariffDataValueStore;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.system.objectmapper.DataValueRowMapper;
+import org.springframework.dao.EmptyResultDataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+public class HibernateTariffDataValueStore implements TariffDataValueStore
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private SessionFactory sessionFactory;
+
+ public void setSessionFactory( SessionFactory sessionFactory )
+ {
+ this.sessionFactory = sessionFactory;
+ }
+
+ // -------------------------------------------------------------------------
+ // TariffDataValue
+ // -------------------------------------------------------------------------
+
+ @Override
+ public void addTariffDataValue( TariffDataValue tariffDataValue )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.save( tariffDataValue );
+ }
+
+ @Override
+ public void updateTariffDataValue( TariffDataValue tariffDataValue )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.update( tariffDataValue );
+ }
+
+ @Override
+ public void deleteTariffDataValue( TariffDataValue tariffDataValue )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.delete( tariffDataValue );
+ }
+
+ @Override
+ public TariffDataValue getTariffDataValue( OrganisationUnit organisationUnit, DataElement dataElement,
+ DataElementCategoryOptionCombo optionCombo, OrganisationUnitGroup organisationUnitGroup, Date startDate,
+ Date endDate )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( TariffDataValue.class );
+ criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+ criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+ criteria.add( Restrictions.eq( "optionCombo", optionCombo ) );
+ criteria.add( Restrictions.eq( "organisationUnitGroup", organisationUnitGroup ) );
+ criteria.add( Restrictions.eq( "startDate", startDate ) );
+ criteria.add( Restrictions.eq( "endDate", endDate ) );
+
+ return (TariffDataValue) criteria.uniqueResult();
+ }
+
+ @Override
+ public TariffDataValue getTariffDataValue( int organisationUnitId, int dataElementId, int categoryOptionComboId,
+ int organisationUnitGroupId, Date startDate, Date endDate )
+ {
+ /**
+ * TODO
+ */
+ return null;
+ }
+
+ @Override
+ public Collection<TariffDataValue> getAllTariffDataValues()
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( TariffDataValue.class );
+
+ return criteria.list();
+ }
+
+ @Override
+ public Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit,
+ OrganisationUnitGroup organisationUnitGroup )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( DataValue.class );
+ criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+ criteria.add( Restrictions.eq( "organisationUnitGroup", organisationUnitGroup ) );
+
+ return criteria.list();
+ }
+
+ @Override
+ public Collection<TariffDataValue> getTariffDataValues( OrganisationUnit organisationUnit, DataElement dataElement )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( DataValue.class );
+ criteria.add( Restrictions.eq( "organisationUnit", organisationUnit ) );
+ criteria.add( Restrictions.eq( "dataElement", dataElement ) );
+
+ return criteria.list();
+ }
+
+}
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/resources/META-INF/dhis/beans.xml 2013-12-07 09:10:04 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+
+ <!-- PBF API -->
+
+ <bean id="org.hisp.dhis.pbf.api.TariffDataValueStore" class="org.hisp.dhis.pbf.impl.HibernateTariffDataValueStore">
+ <property name="sessionFactory" ref="sessionFactory" />
+ </bean>
+
+ <bean id="org.hisp.dhis.pbf.api.TariffDataValueService" class="org.hisp.dhis.pbf.impl.DefaultTariffDataValueService">
+ <property name="tariffDataValueStore" ref="org.hisp.dhis.pbf.api.TariffDataValueStore" />
+ </bean>
+
+
+ <!-- Home page -->
+ <bean id="org.hisp.dhis.pbf.action.NoAction" class="org.hisp.dhis.pbf.action.NoAction" scope="prototype">
+ </bean>
+
+
+</beans>
\ No newline at end of file
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources/org'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/hibernate'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/hibernate/TariffDataValue.hbm.xml'
--- local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/hibernate/TariffDataValue.hbm.xml 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/hibernate/TariffDataValue.hbm.xml 2013-12-07 09:10:04 +0000
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+ <class name="org.hisp.dhis.pbf.api.TariffDataValue" table="tariffdatavalue">
+
+ <composite-id>
+ <key-many-to-one name="organisationUnit" class="org.hisp.dhis.organisationunit.OrganisationUnit" column="organisationunitid" foreign-key="fk_tariffdatavalue_organisationunitid" />
+ <key-many-to-one name="organisationUnitGroup" class="org.hisp.dhis.organisationunit.OrganisationUnitGroup" column="orgunitgroupid" foreign-key="fk_datavalue_organisationunitgroupid" />
+ <key-many-to-one name="dataElement" class="org.hisp.dhis.dataelement.DataElement" column="dataelementid" foreign-key="fk_tariffdatavalue_dataelementid" />
+ <key-many-to-one name="optionCombo" class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="categoryoptioncomboid" foreign-key="fk_tariffdatavalue_categoryoptioncomboid" />
+ <key-property name="startDate" column="startdate" />
+ <key-property name="endDate" column="enddate" />
+ </composite-id>
+
+ <property name="value" />
+
+ <property name="storedBy" column="storedby" length="100" />
+
+ <property name="timestamp" column="lastupdated" type="timestamp" />
+
+ <property name="comment" length="360" />
+
+ </class>
+</hibernate-mapping>
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/i18n_module.properties'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml'
--- local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/resources/struts.xml 2013-12-07 09:10:04 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE struts PUBLIC
+"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
+"http://struts.apache.org/dtds/struts-2.0.dtd">
+<struts>
+
+ <include file="dhis-web-commons.xml"/>
+
+ <package name="dhis-web-maintenance-pbf" extends="dhis-web-commons" namespace="/dhis-web-maintenance-pbf">
+
+ <!-- Home page -->
+ <action name="index" class="org.hisp.dhis.pbf.action.NoAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-pbf/welcome.vm</param>
+ <param name="menu">/dhis-web-maintenance-pbf/menu.vm</param>
+ </action>
+
+ </package>
+
+</struts>
\ No newline at end of file
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/webapp'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/webapp/WEB-INF'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/WEB-INF/web.xml'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/WEB-INF/web.xml 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/WEB-INF/web.xml 2013-12-07 09:10:04 +0000
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+ <display-name>DHIS Maintenance PBF</display-name>
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>classpath*:/META-INF/dhis/beans.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>automaticAccessType</param-name>
+ <param-value>ghostAdmin</param-value>
+ </context-param>
+ <filter>
+ <filter-name>RedirectFilter</filter-name>
+ <filter-class>org.hisp.dhis.servlet.filter.HttpRedirectFilter</filter-class>
+ <init-param>
+ <param-name>redirectPath</param-name>
+ <param-value>dhis-web-maintenance-pbf/index.action</param-value>
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>OpenSessionInViewFilter</filter-name>
+ <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
+ </filter>
+ <filter>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
+ </filter>
+ <filter>
+ <filter-name>Struts</filter-name>
+ <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>RedirectFilter</filter-name>
+ <url-pattern>/</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>OpenSessionInViewFilter</filter-name>
+ <url-pattern>*.action</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>springSecurityFilterChain</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>Struts</filter-name>
+ <url-pattern>*.action</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.hisp.dhis.system.startup.StartupListener</listener-class>
+ </listener>
+
+</web-app>
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/css'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/images'
=== added directory 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/javascript'
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/menu.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/menu.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/menu.vm 2013-12-07 09:10:04 +0000
@@ -0,0 +1,6 @@
+
+<h2>$i18n.getString( "pbf_setup" )</h2>
+<ul>
+ <li><a href="dataElementTariffManagement.action">$i18n.getString( "dataelement_tariff_management" )</a></li>
+</ul>
+
=== added file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/welcome.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/welcome.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/welcome.vm 2013-12-07 09:10:04 +0000
@@ -0,0 +1,2 @@
+
+<h3>$i18n.getString( "pbf_management" )</3>