dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00282
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 91: dhis-web-dataentry: Removed unused method
------------------------------------------------------------
revno: 91
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-03-19 18:03:53 +0100
message:
dhis-web-dataentry: Removed unused method
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java
------------------------------------------------------------
revno: 90.1.1
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-03-19 18:02:24 +0100
message:
dhis-web-dataentry: Minor fix
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java
------------------------------------------------------------
revno: 88.1.1
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-03-19 17:59:16 +0100
message:
dhis-web-dataentry: Removed unused method
modified:
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java 2009-03-19 13:32:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java 2009-03-19 17:02:24 +0000
@@ -38,8 +38,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategory;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -156,6 +154,43 @@
getSession().remove( SESSION_KEY_SELECTED_DATASET_ID );
}
+ public List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit )
+ {
+ List<DataSet> dataSets = new ArrayList<DataSet>( dataSetService.getDataSetsBySource( organisationUnit ) );
+
+ if ( !currentUserService.currentUserIsSuper() )
+ {
+ UserCredentials userCredentials = userStore.getUserCredentials( currentUserService.getCurrentUser() );
+
+ Set<DataSet> dataSetUserAuthorityGroups = new HashSet<DataSet>();
+
+ for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() )
+ {
+ dataSetUserAuthorityGroups.addAll( userAuthorityGroup.getDataSets() );
+ }
+
+ dataSets.retainAll( dataSetUserAuthorityGroups );
+ }
+
+ // ---------------------------------------------------------------------
+ // Remove DataSets which don't have a CalendarPeriodType
+ // ---------------------------------------------------------------------
+
+ Iterator<DataSet> iterator = dataSets.iterator();
+
+ while ( iterator.hasNext() )
+ {
+ DataSet dataSet = iterator.next();
+
+ if ( !( dataSet.getPeriodType() instanceof CalendarPeriodType) )
+ {
+ iterator.remove();
+ }
+ }
+
+ return dataSets;
+ }
+
// -------------------------------------------------------------------------
// Period
// -------------------------------------------------------------------------
@@ -307,64 +342,4 @@
{
return ActionContext.getContext().getSession();
}
-
- public boolean hasDataSetMultiDimensionalDataElement( DataSet dataSet )
- {
- int numberOfTotalColumns = 1;
-
- if ( dataSet.getDataElements().size() > 0 )
- {
- for ( DataElement de : dataSet.getDataElements() )
- {
- for ( DataElementCategory category : de.getCategoryCombo().getCategories() )
- {
- numberOfTotalColumns = numberOfTotalColumns * category.getCategoryOptions().size();
- }
-
- if ( numberOfTotalColumns > 1 )
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- public List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit )
- {
- List<DataSet> dataSets = new ArrayList<DataSet>( dataSetService.getDataSetsBySource( organisationUnit ) );
-
- if ( !currentUserService.currentUserIsSuper() )
- {
- UserCredentials userCredentials = userStore.getUserCredentials( currentUserService.getCurrentUser() );
-
- Set<DataSet> dataSetUserAuthorityGroups = new HashSet<DataSet>();
-
- for ( UserAuthorityGroup userAuthorityGroup : userCredentials.getUserAuthorityGroups() )
- {
- dataSetUserAuthorityGroups.addAll( userAuthorityGroup.getDataSets() );
- }
-
- dataSets.retainAll( dataSetUserAuthorityGroups );
- }
-
- // ---------------------------------------------------------------------
- // Remove DataSets which don't have a CalendarPeriodType
- // ---------------------------------------------------------------------
-
- Iterator<DataSet> iterator = dataSets.iterator();
-
- while ( iterator.hasNext() )
- {
- DataSet dataSet = iterator.next();
-
- if ( !( dataSet.getPeriodType() instanceof CalendarPeriodType) )
- {
- iterator.remove();
- }
- }
-
- return dataSets;
- }
}
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java 2009-03-19 13:32:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java 2009-03-19 16:59:16 +0000
@@ -39,14 +39,28 @@
*/
public interface SelectedStateManager
{
+ // -------------------------------------------------------------------------
+ // OrganisationUnit
+ // -------------------------------------------------------------------------
+
OrganisationUnit getSelectedOrganisationUnit();
+
+ // -------------------------------------------------------------------------
+ // DataSet
+ // -------------------------------------------------------------------------
void setSelectedDataSet( DataSet dataSet );
DataSet getSelectedDataSet();
void clearSelectedDataSet();
+
+ List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit );
+ // -------------------------------------------------------------------------
+ // Period
+ // -------------------------------------------------------------------------
+
void setSelectedPeriodIndex( Integer index );
Integer getSelectedPeriodIndex();
@@ -60,6 +74,4 @@
void nextPeriodSpan();
void previousPeriodSpan();
-
- List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit );
}
--
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.