[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21453: AdxService, code style

2015-12-15 Thread noreply

revno: 21453
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-12-15 09:06:20 +0100
message:
  AdxService, code style
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/PeriodType.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultAdxDataService.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DataValueSetController.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-api/src/main/java/org/hisp/dhis/period/PeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/PeriodType.java	2015-09-16 15:14:04 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/PeriodType.java	2015-12-15 08:06:20 +
@@ -62,7 +62,7 @@
 {
 // Cache for period lookup, uses calendar.name() + periodType.getName() + date.getTime() as key
 private static Cache PERIOD_CACHE = CacheBuilder.newBuilder()
-.expireAfterAccess( 5, TimeUnit.MINUTES )
+.expireAfterAccess( 1, TimeUnit.HOURS )
 .initialCapacity( 1 )
 .maximumSize( 3 )
 .build();

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultAdxDataService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultAdxDataService.java	2015-12-14 21:53:09 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/adx/DefaultAdxDataService.java	2015-12-15 08:06:20 +
@@ -93,10 +93,6 @@
 {
 private static final Log log = LogFactory.getLog( DefaultAdxDataService.class );
 
-// -
-// Constants
-// -
-
 private static final int TOTAL_MINUTES_TO_WAIT = 5;
 
 // -
@@ -133,94 +129,102 @@
 {
 // TODO: defensive code around possible missing CODEs
 
-// caching map used to lookup category attributes per catoptcombo
-Map > catOptMap = new HashMap<> ();
-
-XMLWriter adxWriter = XMLFactory.getXMLWriter(out);
-
-adxWriter.openElement(AdxDataService.ROOT);
-adxWriter.writeAttribute("xmlns", AdxDataService.NAMESPACE);
-
-for (DataSet dataSet : params.getDataSets())
+//TODO: Use dhis commons CachingMap
+
+// caching map used to lookup category attributes per cat opt combo
+Map> catOptMap = new HashMap<>();
+
+XMLWriter adxWriter = XMLFactory.getXMLWriter( out );
+
+adxWriter.openElement( AdxDataService.ROOT );
+adxWriter.writeAttribute( "xmlns", AdxDataService.NAMESPACE );
+
+for ( DataSet dataSet : params.getDataSets() )
 {
 DataElementCategoryCombo categoryCombo = dataSet.getCategoryCombo();
 
-List categories=categoryCombo.getCategories();
- 
-for (DataElementCategoryOptionCombo aoc : categoryCombo.getOptionCombos())
+List categories = categoryCombo.getCategories();
+
+for ( DataElementCategoryOptionCombo aoc : categoryCombo.getOptionCombos() )
 {
 Set catopts = aoc.getCategoryOptions();
-Map attributeDimensions;
+
+Map attributeDimensions;
+
 int aocId = aoc.getId();
-if (catOptMap.containsKey(aocId))
+
+if ( catOptMap.containsKey( aocId ) )
 {
-attributeDimensions = catOptMap.get(aocId);
+attributeDimensions = catOptMap.get( aocId );
 }
 else
 {
-attributeDimensions = getExplodedCategoryAttributes(aoc);
-catOptMap.put(aocId, attributeDimensions);
+attributeDimensions = getExplodedCategoryAttributes( aoc );
+catOptMap.put( aocId, attributeDimensions );
 }
-
-for (OrganisationUnit orgUnit : params.getOrganisationUnits()) 
+
+for ( OrganisationUnit orgUnit : params.getOrganisationUnits() )
 {
-for (Period period : params.getPeriods()) 
+for ( Period period : params.getPeriods() )
 {
-adxWriter.openElement(AdxDataService.GROUP);
-adxWriter.writeAttribute(AdxDataService.DATASET, dataSet.getCode());
-adxWriter.writeAttribute(AdxDataService.PERIOD, Ad

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21454: support filtering in DataElementOperandController

2015-12-15 Thread noreply

revno: 21454
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Tue 2015-12-15 09:08:01 +0100
message:
  support filtering in DataElementOperandController
modified:
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementOperandController.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/webapi/controller/DimensionController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java	2015-12-15 07:58:37 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java	2015-12-15 08:08:01 +
@@ -90,21 +90,13 @@
 @SuppressWarnings( "unchecked" )
 protected List getEntityList( WebMetaData metaData, WebOptions options, List filters, List orders ) throws QueryParserException
 {
-List entityList;
+List dimensionalObjects;
 Query query = queryService.getQueryFromUrl( DimensionalObject.class, filters, orders );
 query.setDefaultOrder();
 query.setObjects( dimensionService.getAllDimensions() );
-
-if ( options.getOptions().containsKey( "query" ) )
-{
-entityList = Lists.newArrayList( manager.filter( getEntityClass(), options.getOptions().get( "query" ) ) );
-}
-else
-{
-entityList = (List) queryService.query( query );
-}
-
-return entityList;
+dimensionalObjects = (List) queryService.query( query );
+
+return dimensionalObjects;
 }
 
 @Override

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementOperandController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementOperandController.java	2015-11-22 12:26:22 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/DataElementOperandController.java	2015-12-15 08:08:01 +
@@ -28,15 +28,15 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
+import com.google.common.collect.Lists;
 import org.hisp.dhis.commons.collection.CollectionUtils;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementGroup;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.query.Order;
+import org.hisp.dhis.query.Query;
+import org.hisp.dhis.query.QueryParserException;
 import org.hisp.dhis.schema.descriptors.DataElementOperandSchemaDescriptor;
 import org.hisp.dhis.webapi.controller.AbstractCrudController;
 import org.hisp.dhis.webapi.webdomain.WebMetaData;
@@ -45,24 +45,26 @@
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 
-import com.google.common.collect.Lists;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Morten Olav Hansen 
  */
 @Controller
 @RequestMapping( value = DataElementOperandSchemaDescriptor.API_ENDPOINT )
-public class DataElementOperandController 
+public class DataElementOperandController
 extends AbstractCrudController
 {
 @Autowired
 private DataElementCategoryService dataElementCategoryService;
 
 @Override
-protected List getEntityList( WebMetaData metaData, WebOptions options, List filters, List orders )
+@SuppressWarnings( "unchecked" )
+protected List getEntityList( WebMetaData metaData, WebOptions options, List filters, List orders ) throws QueryParserException
 {
-List dataElementOperands = Lists.newArrayList();
-
+List dataElementOperands = new ArrayList<>();
+
 if ( options.isTrue( "persisted" ) )
 {
 dataElementOperands = Lists.newArrayList( manager.getAll( DataElementOperand.class ) );
@@ -70,7 +72,7 @@
 else
 {
 boolean totals = options.isTrue( "totals" );
-
+
 String deGroup = CollectionUtils.popStartsWith( filters, "dataElement.dataElementGroups.id:eq:" );
 deGroup = deGroup != null ? deGroup.substring( "dataElement.dataElementGroups.id:eq:".length() ) : null;
 
@@ -86,6 +88,12 @@
 }
 }
 
+Query query = queryService.getQueryFromUrl( getEntityClass(), filters, orders );
+query.setDefaultOrder();
+query.setObjects( dataElementOperands );
+
+dataElementOperands = (List) querySer

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21455: minor fix

2015-12-15 Thread noreply

revno: 21455
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Tue 2015-12-15 09:10:55 +0100
message:
  minor fix
modified:
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/Query.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-services/dhis-service-core/src/main/java/org/hisp/dhis/query/Query.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/Query.java	2015-11-12 04:47:12 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/query/Query.java	2015-12-15 08:10:55 +
@@ -29,9 +29,7 @@
  */
 
 import com.google.common.base.MoreObjects;
-import com.google.common.base.Optional;
 import org.hisp.dhis.common.IdentifiableObject;
-import org.hisp.dhis.schema.Property;
 import org.hisp.dhis.schema.Schema;
 
 import java.util.ArrayList;
@@ -161,16 +159,13 @@
 return this;
 }
 
-Optional name = Optional.fromNullable( schema.getPersistedProperty( "name" ) );
-Optional created = Optional.fromNullable( schema.getPersistedProperty( "created" ) );
-
-if ( name.isPresent() )
+if ( schema.havePersistedProperty( "name" ) )
 {
-addOrder( Order.asc( name.get() ) );
+addOrder( Order.asc( schema.getPersistedProperty( "name" ) ) );
 }
-else if ( created.isPresent() )
+if ( schema.havePersistedProperty( "created" ) )
 {
-addOrder( Order.desc( created.get() ) );
+addOrder( Order.desc( schema.getPersistedProperty( "created" ) ) );
 }
 
 return this;

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] DHIS2 OAuth Grant type authorized_code

2015-12-15 Thread Ngoc Thanh Nguyen
HI all

Is there a way in DHIS2 that allows defining a callback for OAuth? If this
possible, we can have multiple dhis2 instances that share a single user
base. This will work like OAuth in Google+ or Facebook.

Thanh
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Process failed: StatementCallback

2015-12-15 Thread Lars Helge Øverland
Hi John,

could you try to first delete the SQL view called "itenget
organisationunit" or similar, run analytics again and see if that avoids
the error?

regards,

Lars

On Mon, Dec 14, 2015 at 5:14 PM, Gichangi John 
wrote:

> Hi
>
> Each time i run the Analytics tables update the following error of process
> failed
>
> Process failed: StatementCallback; uncategorized SQLException for SQL
> [CREATE VIEW "_view_itengetorganisationunit" AS SELECT
> ou.organisationunitid, ou.name, ou.parentid, ou.shortname,
> ou.coordinates, ou.lastupdated, ou.latitude, ou.longitude, ou.created,
> ou.uid, ous.level, ou.featuretype , ou.code from _orgunitstructure ous join
> organisationunit ou on ous.organisationunitid=ou.organisationunitid]; SQL
> state [25P02]; error code [0]; ERROR: current transaction is aborted,
> commands ignored until end of transaction block; nested exception is
> org.postgresql.util.PSQLException: ERROR: current transaction is aborted,
> commands ignored until end of transaction block
>
>
> What could be causing this failure
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org 
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21456: made it more clear that manager.getByAttributeValue is only applicable for unique attribute value...

2015-12-15 Thread noreply

revno: 21456
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Tue 2015-12-15 11:01:19 +0100
message:
  made it more clear that manager.getByAttributeValue is only applicable for 
unique attribute values (renamed getByUniqueAttributeValue)
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectManager.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java
  
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.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-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java	2015-12-03 03:12:51 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java	2015-12-15 10:01:19 +
@@ -81,7 +81,7 @@
  */
 T getByCode( String code );
 
-T getByAttributeValue( Attribute attribute, String value );
+T getByUniqueAttributeValue( Attribute attribute, String value );
 
 /**
  * Retrieves a List of all objects (sorted on name).

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectManager.java	2015-12-04 05:41:43 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObjectManager.java	2015-12-15 10:01:19 +
@@ -67,7 +67,7 @@
 
  T getByName( Class clazz, String name );
 
- T getByAttributeValue( Class clazz, Attribute attribute, String value );
+ T getByUniqueAttributeValue( Class clazz, Attribute attribute, String value );
 
  T search( Class clazz, String query );
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java	2015-12-04 05:41:43 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/DefaultIdentifiableObjectManager.java	2015-12-15 10:01:19 +
@@ -242,7 +242,7 @@
 
 @Override
 @SuppressWarnings( "unchecked" )
-public  T getByAttributeValue( Class clazz, Attribute attribute, String value )
+public  T getByUniqueAttributeValue( Class clazz, Attribute attribute, String value )
 {
 GenericIdentifiableObjectStore store = getIdentifiableObjectStore( clazz );
 
@@ -251,7 +251,7 @@
 return null;
 }
 
-return (T) store.getByAttributeValue( attribute, value );
+return (T) store.getByUniqueAttributeValue( attribute, value );
 }
 
 @Override
@@ -848,7 +848,7 @@
 }
 if ( idScheme.is( IdentifiableProperty.ATTRIBUTE ) )
 {
-return store.getByAttributeValue( attribute, value );
+return store.getByUniqueAttributeValue( attribute, value );
 }
 else if ( idScheme.is( IdentifiableProperty.ID ) )
 {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java	2015-12-03 04:18:07 +
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/hibernate/HibernateIdentifiableObjectStore.java	2015-12-15 10:01:19 +
@@ -175,7 +175,7 @@
 
 @Override
 @SuppressWarnings( "unchecked" )
-public T getByAttributeValue( Attribute attribute, String value )
+public T getByUniqueAttributeValue( Attribute attribute, String value )
 {
 if ( attribute == null || StringUtils.isEmpty( value ) || !attribute.isUnique() )
 {

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java	2015-12-03 03:21:32 +
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dataelement/DataElementStoreTest.java	2015-12-15 10:01:19 +
@@ -534,15 +534,15 @@
 dataElementStore.update( da

[Dhis2-devs] [Bug 1526242] [NEW] changing the password of admin user to district

2015-12-15 Thread Mohamed Bangura
Public bug reported:

Hello all,

Can someone please help me with the sql query to change the password of
the admin user to district.I have an old one that i have been using but
when i used it now,it is not.Can someone please help me with the updated
one.The previous one that i was using is shown below.

UPDATE users 
set password = '48e8f1207baef1ef7fe478a57d19f2e5' 
where username = 'admin';

** Affects: dhis2
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1526242

Title:
  changing the password of admin user to district

Status in DHIS:
  New

Bug description:
  Hello all,

  Can someone please help me with the sql query to change the password
  of the admin user to district.I have an old one that i have been using
  but when i used it now,it is not.Can someone please help me with the
  updated one.The previous one that i was using is shown below.

  UPDATE users 
  set password = '48e8f1207baef1ef7fe478a57d19f2e5' 
  where username = 'admin';

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1526242/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Bug 1526242] [NEW] changing the password of admin user to district

2015-12-15 Thread Knut Staring
Hello Mohammed,

This is NOT a bug. Please rather send questions to DHIS 2 developers <
dhis2-devs@lists.launchpad.net>.

Do this to set password to district for user admin:

update users set
password='$2a$10$wjLPViry3bkYEcjwGRqnYO1bT2Kl.ZY0kO.fwFDfMX53hitfx5.3C'
where username='admin';

Then restart tomcat to make sure the application cache is cleared.

Then log in with admin/district.

regards,
Knut

On Tue, Dec 15, 2015 at 11:00 AM, Mohamed Bangura 
wrote:

> Public bug reported:
>
> Hello all,
>
> Can someone please help me with the sql query to change the password of
> the admin user to district.I have an old one that i have been using but
> when i used it now,it is not.Can someone please help me with the updated
> one.The previous one that i was using is shown below.
>
> UPDATE users
> set password = '48e8f1207baef1ef7fe478a57d19f2e5'
> where username = 'admin';
>
> ** Affects: dhis2
>  Importance: Undecided
>  Status: New
>
> --
> You received this bug notification because you are a member of DHIS 2
> developers, which is subscribed to DHIS.
> https://bugs.launchpad.net/bugs/1526242
>
> Title:
>   changing the password of admin user to district
>
> Status in DHIS:
>   New
>
> Bug description:
>   Hello all,
>
>   Can someone please help me with the sql query to change the password
>   of the admin user to district.I have an old one that i have been using
>   but when i used it now,it is not.Can someone please help me with the
>   updated one.The previous one that i was using is shown below.
>
>   UPDATE users
>   set password = '48e8f1207baef1ef7fe478a57d19f2e5'
>   where username = 'admin';
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/dhis2/+bug/1526242/+subscriptions
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522
Skype: knutstar
http://dhis2.org
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21457: tracker-capture: better handling of right/columns (un)sticky

2015-12-15 Thread noreply

revno: 21457
committer: Abyot Asalefew Gizaw 
branch nick: dhis2
timestamp: Tue 2015-12-15 11:54:23 +0100
message:
  tracker-capture: better handling of right/columns (un)sticky
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css


--
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-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-12-11 15:18:54 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-12-15 10:54:23 +
@@ -413,11 +413,7 @@
 return;
 });
 };
-
-$scope.stickUnstick = function(){
-$scope.stickyDisabled = !$scope.stickyDisabled;
-};
-
+
 $scope.showHideWidgets = function(){
 var modalInstance = $modal.open({
 templateUrl: "components/dashboard/dashboard-widgets.html",

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html	2015-12-11 08:53:57 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html	2015-12-15 10:54:23 +
@@ -1,58 +1,28 @@
 
-
-
-
-
-{{'back'| translate}}
-
-
-
-
-
-
-{{programs.length > 0 ? 'please_select_a_program' : 'no_program_exists' | translate}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{showHideWidgetsLabel}}
-{{'save_layout_as_default'| translate}}
-{{selectedTei.inactive ? 'activate_tei' : 'deactivate_tei' | translate}} {{trackedEntity.name}}
-
-
-
-
-
-
-
 
 
 
-
+
 
 
-
+
+
+{{'back'| translate}}
+
+
+
+
+
+
+{{programs.length > 0 ? 'please_select_a_program' : 'no_program_exists' | translate}}
+
+
+
+
 
 

@@ -61,18 +31,42 @@
 
 
 
-
-   
+
+
+
+
+
+
+
+
+
+
+
+
+
+{{showHideWidgetsLabel}}
+{{'save_layout_as_default'| translate}}
+{{selectedTei.inactive ? 'activate_tei' : 'deactivate_tei' | translate}} {{trackedEntity.name}}
+
+
+
+
+
+
+
 
 

 
+
 
-   
+
+
 
 
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-12-14 15:08:54 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css	2015-12-15 10:54:23 +
@@ -581,7 +581,11 @@
 }
 
 .add-default-left-padding {
-	padding-left: 15px !important;
+padding-left: 15px !important;
+}
+
+.add-default-right-padding {
+padding-right: 15px !important;
 }
 
 .visit-details {

_

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21458: require importoption for add/update enrollments/tei

2015-12-15 Thread noreply

revno: 21458
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Tue 2015-12-15 15:46:39 +0100
message:
  require importoption for add/update enrollments/tei
modified:
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/EnrollmentService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/JacksonEnrollmentService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/event/AbstractEventService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/trackedentity/AbstractTrackedEntityInstanceService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/trackedentity/JacksonTrackedEntityInstanceService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/trackedentity/TrackedEntityInstanceService.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationMultiEventsServiceTest.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/RegistrationSingleEventServiceTest.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/test/java/org/hisp/dhis/dxf2/events/TrackedEntityInstanceServiceTest.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/EnrollmentController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/event/TrackedEntityInstanceController.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2015-12-14 15:03:55 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java	2015-12-15 14:46:39 +
@@ -30,12 +30,12 @@
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-
 import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.common.OrganisationUnitSelectionMode;
 import org.hisp.dhis.common.exception.InvalidIdentifierReferenceException;
 import org.hisp.dhis.commons.collection.CachingMap;
 import org.hisp.dhis.dbms.DbmsManager;
+import org.hisp.dhis.dxf2.common.ImportOptions;
 import org.hisp.dhis.dxf2.events.event.Note;
 import org.hisp.dhis.dxf2.events.trackedentity.Attribute;
 import org.hisp.dhis.dxf2.events.trackedentity.TrackedEntityInstance;
@@ -200,14 +200,19 @@
 // -
 
 @Override
-public ImportSummaries addEnrollments( List enrollments )
+public ImportSummaries addEnrollments( List enrollments, ImportOptions importOptions )
 {
+if ( importOptions == null )
+{
+importOptions = new ImportOptions();
+}
+
 ImportSummaries importSummaries = new ImportSummaries();
 int counter = 0;
 
 for ( Enrollment enrollment : enrollments )
 {
-importSummaries.addImportSummary( addEnrollment( enrollment ) );
+importSummaries.addImportSummary( addEnrollment( enrollment, importOptions ) );
 
 if ( counter % FLUSH_FREQUENCY == 0 )
 {
@@ -221,8 +226,13 @@
 }
 
 @Override
-public ImportSummary addEnrollment( Enrollment enrollment )
+public ImportSummary addEnrollment( Enrollment enrollment, ImportOptions importOptions )
 {
+if ( importOptions == null )
+{
+importOptions = new ImportOptions();
+}
+
 ImportSummary importSummary = new ImportSummary();
 
 org.hisp.dhis.trackedentity.TrackedEntityInstance entityInstance = getTrackedEntityInstance( enrollment.getTrackedEntityInstance() );
@@ -312,14 +322,19 @@
 // -
 
 @Override
-public ImportSummaries updateEnrollments( List enrollments )
+public ImportSummaries updateEnrollments( List enrollments, ImportOptions importOptions )
 {
+if ( importOptions == null )
+{
+importOptions = new ImportOptions();
+}
+
 ImportSummaries importSummaries = new ImportSummaries();
 int counter = 0;
 
 for ( Enrollment enrollment : enrollments )
 {
-importSummaries.addImportSummary( updateEnrollment( enrollment ) );
+import

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21459: Avoid rounding for Number type

2015-12-15 Thread noreply

revno: 21459
committer: Markus Bekken 
branch nick: dhis2
timestamp: Tue 2015-12-15 16:26:01 +0100
message:
  Avoid rounding for Number type
modified:
  
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js


--
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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-12-05 16:20:29 +
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-12-15 15:26:01 +
@@ -272,8 +272,12 @@
 obj.valueType === 'INTEGER_POSITIVE' ||
 obj.valueType === 'INTEGER_NEGATIVE' ||
 obj.valueType === 'INTEGER_ZERO_OR_POSITIVE'){
-if( dhis2.validation.isNumber(val)  ){
-val = parseInt(val);
+if( dhis2.validation.isNumber(val)){
+if(obj.valueType === 'NUMBER'){
+val = parseFloat(val);
+}else{
+val = parseInt(val);
+}
 }
 }
 if(val && obj.optionSetValue && obj.optionSet && obj.optionSet.id && optionSets[obj.optionSet.id].options  ){

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1526402] Re: multi organisation unit form - form name doesn't render

2015-12-15 Thread Lars Helge Øverland
** Changed in: dhis2
Milestone: None => 2.22

** Changed in: dhis2
 Assignee: (unassigned) => Morten Olav Hansen (mortenoh)

** Changed in: dhis2
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1526402

Title:
  multi organisation unit form - form name doesn't render

Status in DHIS:
  New

Bug description:
  On a multi organisation form,  form names are not rendering. This can
  be reproduced in 2.21 demo site, by setting a Form Name to a data
  element - see attached image.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1526402/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Meta Data Export Question

2015-12-15 Thread Timothy Harding
Hello DHIS2 Devs and Community!

I've been doing some digging and it appears that this is about the easiest
way to do this. I've got a question for the devs though: Is it a bug or
intended behavior that when I export a dataset with dependencies it sends
me a file sans CategoryOptionCombos?




*Timothy Harding*
Sr. Systems Analyst, BAO Systems
+1 202-536-1541 | thard...@baosystems.com | http://www.baosystems.com | Skype:
hardi...@gmail.com | 2900 K Street, Suite 404, Washington D.C. 20007

On Wed, Nov 18, 2015 at 11:36 AM, Timothy Harding 
wrote:

> Hello Hello!, Hot on the heels of my previous query, I have another one
> associated with CatOptionCombos
>
> *What is the best way to migrate a single dataset and its constituents
> from one DHIS2 system to another such that I can then export datavalues
> from the source to the target DHIS2 instance?* I can get most of the way
> there with the following:
>
> 1. Select Dataset as a detailed metadata export:
> [image: Inline image 1]
>
> 2. Export with all dependencies
> [image: Inline image 2]
>
> 3. Import the resulting file into a different DHIS2 instance
>
> This process will fail initially, but with manual edits, you can work
> around the gotchas listed below:
>
>- The users are considered a dependency and exported, if the roles
>aren't the same between the two systems it creates problems, so I typically
>delete the  section. They only cause problems when updating
>certain bits of metadata, the system will complain that it can't find the
>user, but otherwise will import just fine. Perhaps something like the
>following? Just throwing it out there 😁
>
> [image: Inline image 3]
>
>- Categories and Category Options are out of order in the XML output,
>but the system seems to reorder them on import, so no issues here
>- *CategoryOptionCombos are not exported*, with all the other
>dependencies. Further more, there is no "CategoryOptionCombos", (or
>"CategoryOptions)" listed to choose from in the metadata detailed exporter
>😞. Sure these can all be generated with the maintenance operation,
>but the result will be CatOptionCombos with *completely different UIDs*
>than the source system, which would break any ability to upload data from
>the source server. Furthermore, there are *some *references to
>categoryOptionCombo in the dataset XML with dependencies file if you have
>any , but this won't import them, just cause
>the system not to find the categoryOptionCombo it is referencing.
>- I work around this by doing something like this:
>   
> https://apps.dhis2.org/demo/api/categoryOptionCombos.xml?fields=name,id,displayName,categoryCombo[name,id],categoryOptions[name,id]&paging=false&filter=categoryCombo.id:eq:m2jTvAj5kkm
>   and repeat for each category combo covered by this dataset, and cut and
>   paste the results into the XML file generated in step 2. This is hugely
>   time consuming if there are a lot of catcombos used by the dataset in
>   question. Sadly the API wont let me filter on just a dataset, because 
> there
>   is no reverse link between category combos and data elements (one way 
> only)
>- Defaults for Category Options, Categories, Category Combinations
>need to be updated (Find&Replace) with the UIDs in use by the target
>system. Not sure exactly how to fix this, other than making an exception in
>the import process for any of those three with the name "default".
>Otherwise it is manual work on the export file each time.
>
> * ERROR 2015-11-18 09:53:57,138 ERROR: duplicate key value violates unique
> constraint "uk_pbj3u1nk9vnuof8f47utvowmv"
>   Detail: Key (name)=(default) already exists. (SqlExceptionHelper.java
> [taskScheduler-1])
>
>- dissaggregation vs DISSAGGREGATION, in v2.20, the *exporter *keeps
>them lowercase, and the *importer *now expects uppercase. Why the
>distinction though?
>
> * ERROR 2015-11-18 09:45:36,496
> com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not
> construct instance of org.hisp.dhis.common.DataDimensionType from String
> value 'disaggregation': value not one of declared Enum instance names:
> [DISAGGREGATION, ATTRIBUTE]
>
> Once I contend with all the gotchas I listed, *I am able to get an import
> from a source DHIS2 installation to the Target DHIS2 installation with the
> proper UIDs for the categoryOptionCombos*, but it makes me think that
> there has to be an easier way. Am I missing a button or a step somewhere?
> The "default" UIDs and the catoptioncombos are the hairiest part of the
> whole process and probably wouldn't be easy for most users.
>
> The only other thing I can think of is to use the vanilla metadata
> exporter, but this is not feasible when there are 15 datasets in the source
> system and I only need to export 1.
>
> [image: Inline image 4]
>
>
> *Timothy Harding*
> Sr. Systems Analyst, BAO Systems
> +1 202-536-1541 | thard...@baosystems.com | ht

[Dhis2-devs] [Bug 1526402] [NEW] multi organisation unit form - form name doesn't render

2015-12-15 Thread Rodolfo Melia
Public bug reported:

On a multi organisation form,  form names are not rendering. This can be
reproduced in 2.21 demo site, by setting a Form Name to a data element -
see attached image.

** Affects: dhis2
 Importance: Undecided
 Status: New

** Attachment added: "Multi Org Unit forms - Form name not rendering.png"
   
https://bugs.launchpad.net/bugs/1526402/+attachment/4535145/+files/Multi%20Org%20Unit%20forms%20-%20Form%20name%20not%20rendering.png

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1526402

Title:
  multi organisation unit form - form name doesn't render

Status in DHIS:
  New

Bug description:
  On a multi organisation form,  form names are not rendering. This can
  be reproduced in 2.21 demo site, by setting a Form Name to a data
  element - see attached image.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1526402/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21460: Set proper max length for category option group set resource table col

2015-12-15 Thread noreply

revno: 21460
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-12-15 22:06:24 +0100
message:
  Set proper max length for category option group set resource table col
modified:
  
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/table/CategoryOptionGroupSetResourceTable.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-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/table/CategoryOptionGroupSetResourceTable.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/table/CategoryOptionGroupSetResourceTable.java	2015-12-11 11:32:19 +
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/table/CategoryOptionGroupSetResourceTable.java	2015-12-15 21:06:24 +
@@ -68,7 +68,7 @@
 
 for ( CategoryOptionGroupSet groupSet : objects )
 {
-statement += columnQuote + groupSet.getName() + columnQuote + " varchar(160), ";
+statement += columnQuote + groupSet.getName() + columnQuote + " varchar(230), ";
 statement += columnQuote + groupSet.getUid() + columnQuote + " character(11), ";
 }
 

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1526596] [NEW] Can't export event

2015-12-15 Thread Le Hong Em
Public bug reported:

I used the Event Export feature in Import-Export module to export event
of a program and I got an exception screen with message:

// 20151216101856
// 
https://dhis2.co/malaria/api/events.xml.gz?attachment=events.xml.gz&program=HprGTJ9ndsH&orgUnit=IWp9dQGM0bS&ouMode=DESCENDANTS&startDate=2015-12-16&endDate=2015-12-16&links=false

{
  "httpStatus": "Conflict",
  "httpStatusCode": 409,
  "status": "ERROR",
  "message": "User has no access to program: HprGTJ9ndsH"
}
The message says"User has no access to program: HprGTJ9ndsH", but my account is 
superuser and already assigned that program to Superuser user role.

This message from DHIS 2 Version 2.21 R20945

** Affects: dhis2
 Importance: Undecided
 Status: New

** Description changed:

  I used the Event Export feature in Import-Export module to export event
  of a program and I got an exception screen with message:
  
  // 20151216101856
  // 
https://dhis2.co/malaria/api/events.xml.gz?attachment=events.xml.gz&program=HprGTJ9ndsH&orgUnit=IWp9dQGM0bS&ouMode=DESCENDANTS&startDate=2015-12-16&endDate=2015-12-16&links=false
  
  {
-   "httpStatus": "Conflict",
-   "httpStatusCode": 409,
-   "status": "ERROR",
-   "message": "User has no access to program: HprGTJ9ndsH"
+   "httpStatus": "Conflict",
+   "httpStatusCode": 409,
+   "status": "ERROR",
+   "message": "User has no access to program: HprGTJ9ndsH"
  }
  The message says"User has no access to program: HprGTJ9ndsH", but my account 
is superuser and already assigned that program to Superuser user role.
+ 
+ This message from DHIS 2 Version 2.21 R20945

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1526596

Title:
  Can't export event

Status in DHIS:
  New

Bug description:
  I used the Event Export feature in Import-Export module to export
  event of a program and I got an exception screen with message:

  // 20151216101856
  // 
https://dhis2.co/malaria/api/events.xml.gz?attachment=events.xml.gz&program=HprGTJ9ndsH&orgUnit=IWp9dQGM0bS&ouMode=DESCENDANTS&startDate=2015-12-16&endDate=2015-12-16&links=false

  {
    "httpStatus": "Conflict",
    "httpStatusCode": 409,
    "status": "ERROR",
    "message": "User has no access to program: HprGTJ9ndsH"
  }
  The message says"User has no access to program: HprGTJ9ndsH", but my account 
is superuser and already assigned that program to Superuser user role.

  This message from DHIS 2 Version 2.21 R20945

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1526596/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 21461: Update EnrollmentService to support IdScheme for matching, means that 'search mode' does not work...

2015-12-15 Thread noreply

revno: 21461
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-12-16 08:53:48 +0100
message:
  Update EnrollmentService to support IdScheme for matching, means that 'search 
mode' does not work anymore, now supports explicit matching with uid, code, 
attribute: etc. Also updates IdSchemes to support 
trackedEntity/trackedEntityAttribute.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdSchemes.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/ImportOptions.java
  
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.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-api/src/main/java/org/hisp/dhis/common/IdSchemes.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdSchemes.java	2015-12-04 05:41:43 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdSchemes.java	2015-12-16 07:53:48 +
@@ -47,6 +47,10 @@
 
 private IdScheme programStageIdScheme = IdScheme.UID;
 
+private IdScheme trackedEntity = IdScheme.UID;
+
+private IdScheme trackedEntityAttribute = IdScheme.UID;
+
 public IdSchemes()
 {
 }
@@ -122,6 +126,28 @@
 return this;
 }
 
+public IdSchemes setTrackedEntity( String idScheme )
+{
+this.trackedEntity = IdScheme.from( idScheme );
+return this;
+}
+
+public IdScheme getTrackedEntity()
+{
+return trackedEntity;
+}
+
+public IdSchemes setTrackedEntityAttribute( String idScheme )
+{
+this.trackedEntityAttribute = IdScheme.from( idScheme );
+return this;
+}
+
+public IdScheme getTrackedEntityAttribute()
+{
+return trackedEntityAttribute;
+}
+
 public static String getValue( String uid, String code, IdentifiableProperty identifiableProperty )
 {
 return getValue( uid, code, IdScheme.from( identifiableProperty ) );

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/ImportOptions.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/ImportOptions.java	2015-12-04 05:41:43 +
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/common/ImportOptions.java	2015-12-16 07:53:48 +
@@ -172,45 +172,52 @@
 // Set methods
 //--
 
+public ImportOptions setIdSchemes( IdSchemes idSchemes )
+{
+this.idSchemes = idSchemes;
+return this;
+}
+
+public ImportOptions setIdScheme( String idScheme )
+{
+idSchemes.setIdScheme( idScheme );
+return this;
+}
+
+public ImportOptions setDataElementIdScheme( String idScheme )
+{
+idSchemes.setDataElementIdScheme( idScheme );
+return this;
+}
+
+public ImportOptions setCategoryOptionComboIdScheme( String idScheme )
+{
+idSchemes.setCategoryOptionComboIdScheme( idScheme );
+return this;
+}
+
+public ImportOptions setOrgUnitIdScheme( String idScheme )
+{
+idSchemes.setOrgUnitIdScheme( idScheme );
+return this;
+}
+
+public ImportOptions setProgramIdScheme( String idScheme )
+{
+idSchemes.setProgramIdScheme( idScheme );
+return this;
+}
+
 public ImportOptions setProgramStageIdScheme( String idScheme )
 {
 idSchemes.setProgramStageIdScheme( idScheme );
 return this;
 }
 
-public ImportOptions setProgramIdScheme( String idScheme )
-{
-idSchemes.setProgramIdScheme( idScheme );
-return this;
-}
-
-public ImportOptions setOrgUnitIdScheme( String idScheme )
-{
-idSchemes.setOrgUnitIdScheme( idScheme );
-return this;
-}
-
-public ImportOptions setCategoryOptionComboIdScheme( String idScheme )
-{
-idSchemes.setCategoryOptionComboIdScheme( idScheme );
-return this;
-}
-
-public ImportOptions setDataElementIdScheme( String idScheme )
-{
-idSchemes.setDataElementIdScheme( idScheme );
-return this;
-}
-
-public ImportOptions setIdScheme( String idScheme )
-{
-idSchemes.setIdScheme( idScheme );
-return this;
-}
-
-public void setIdSchemes( IdSchemes idSchemes )
-{
-this.idSchemes = idSchemes == null ? new IdSchemes() : idSchemes;
+public ImportOptions setTrackedEntityAttribute( String idScheme )
+{
+idSchemes.setTrackedEntityAttribute( idScheme );
+return this;
 }
 
 public ImportOptions setDryRun( boolean dryRun )

=== modified file 'dhis-2/dhis-