dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #01937
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 633: Implemented service method in orgunitgroupset service.
------------------------------------------------------------
revno: 633
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-09-07 17:53:27 +0200
message:
Implemented service method in orgunitgroupset service.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java
dhis-2/dhis-services/dhis-service-organisationunit/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.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/organisationunit/OrganisationUnitGroupService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java 2009-05-13 15:51:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupService.java 2009-09-07 15:53:27 +0000
@@ -205,4 +205,13 @@
* @return an OrganisationUnitGroup.
*/
OrganisationUnitGroup getOrganisationUnitGroup( OrganisationUnitGroupSet groupSet, OrganisationUnit unit );
+
+ /**
+ * Returns a Collection of compulsory OrganisationUnitGroupSets whichs groups
+ * the given OrganisationUnit is not a member of.
+ *
+ * @param organisationUnit the OrganisationUnit.
+ * @return a Collection of OrganisationUnitGroupSets.
+ */
+ Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSetsNotAssignedTo( OrganisationUnit organisationUnit );
}
=== modified file 'dhis-2/dhis-services/dhis-service-organisationunit/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java'
--- dhis-2/dhis-services/dhis-service-organisationunit/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java 2009-06-10 22:25:07 +0000
+++ dhis-2/dhis-services/dhis-service-organisationunit/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java 2009-09-07 15:53:27 +0000
@@ -229,4 +229,24 @@
return null;
}
+
+ public Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSetsNotAssignedTo( OrganisationUnit organisationUnit )
+ {
+ Collection<OrganisationUnitGroupSet> groupSets = new ArrayList<OrganisationUnitGroupSet>();
+
+ groupSetLoop : for ( OrganisationUnitGroupSet groupSet : getCompulsoryOrganisationUnitGroupSets() )
+ {
+ for ( OrganisationUnitGroup group : groupSet.getOrganisationUnitGroups() )
+ {
+ if ( group.getMembers().contains( organisationUnit ) )
+ {
+ continue groupSetLoop;
+ }
+ }
+
+ groupSets.add( groupSet );
+ }
+
+ return groupSets;
+ }
}