dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16050
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5986: Removed old locking implementation
------------------------------------------------------------
revno: 5986
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-02-16 13:58:37 +0100
message:
Removed old locking implementation
removed:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLock.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/package-info.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DataSetLockDeletionHandler.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DefaultDataSetLockService.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/hibernate/
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/hibernate/HibernateDataSetLockStore.java
dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock/
dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock/hibernate/
dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock/hibernate/DataSetLock.hbm.xml
dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/datalock/
dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/datalock/DataSetLockServiceTest.java
dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewTest.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/DefaultLockingManager.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/LockingManager.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/CollectiveDataLockingAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetDataSetsForPeriodTypeAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodTypesAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/UpdateLockedDataSets.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/ValidateCollectiveDataLockingAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingStatus.vm
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java
dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.java
dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java
dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.java
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriodsAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.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
=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock'
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLock.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLock.java 2011-04-22 17:02:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLock.java 1970-01-01 00:00:00 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.datalock;
-
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-public class DataSetLock
-{
- /**
- * The unique identifier for this DataSetLock
- */
- private int id;
-
- /**
- * Part of the DataSetLock's composite ID
- */
- private DataSet dataSet;
-
- /**
- * Part of the DataSetLock's composite ID
- */
- private Period period;
-
- /**
- * All Sources that are associated with DataSetLock.
- */
- private Set<OrganisationUnit> sources = new HashSet<OrganisationUnit>();
-
- /**
- * All DataSetLocks applied by users.
- */
- private String storedBy;
-
- /**
- * All DataSetLocks applied by users at time stamp.
- */
- private Date timestamp;
-
- // -------------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------------
-
- public DataSetLock()
- {
-
- }
-
- public DataSetLock( DataSet dataSet, Period period )
- {
- this.dataSet = dataSet;
- this.period = period;
- }
-
- public DataSetLock( DataSet dataSet, Period period, Set<OrganisationUnit> sources )
- {
- this.dataSet = dataSet;
- this.period = period;
- this.sources = sources;
- }
-
- // -------------------------------------------------------------------------
- // hashCode and equals
- // -------------------------------------------------------------------------
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
-
- result = result * prime + dataSet.hashCode();
- result = result * prime + period.hashCode();
-
- return result;
- }
-
- @Override
- public boolean equals( Object o )
- {
- if ( this == o )
- {
- return true;
- }
-
- if ( o == null )
- {
- return false;
- }
-
- if ( !(o instanceof DataSetLock) )
- {
- return false;
- }
-
- final DataSetLock other = (DataSetLock) o;
-
- return dataSet.equals( other.dataSet ) && period.equals( other.period );
- }
-
-
-
- // -------------------------------------------------------------------------
- // Getters and setters
- // -------------------------------------------------------------------------
-
- public int getId()
- {
- return id;
- }
-
- public void setId( int id )
- {
- this.id = id;
- }
-
- public DataSet getDataSet()
- {
- return dataSet;
- }
-
- public void setDataSet( DataSet dataSet )
- {
- this.dataSet = dataSet;
- }
-
- public Period getPeriod()
- {
- return period;
- }
-
- public void setPeriod( Period period )
- {
- this.period = period;
- }
-
- public Set<OrganisationUnit> getSources()
- {
- return sources;
- }
-
- public void setSources( Set<OrganisationUnit> sources )
- {
- this.sources = sources;
- }
-
- 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;
- }
-}
-
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockService.java 2011-04-22 17:02:27 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockService.java 1970-01-01 00:00:00 +0000
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.datalock;
-
-import java.util.Collection;
-import java.util.Set;
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-
-public interface DataSetLockService
-{
- String ID = DataSetLockService.class.getName();
-
- // -------------------------------------------------------------------------
- // DataSetLock
- // -------------------------------------------------------------------------
-
- /**
- * Adds a DataSetLock.
- *
- * @param dataSetLock The dataSetLock to add.
- * @return The generated unique identifier for this DataSetLock.
- */
- int addDataSetLock( DataSetLock dataSetLock );
-
- /**
- * Updates a DataSetLock.
- *
- * @param dataSetLock The DataSetLock to update.
- */
- void updateDataSetLock( DataSetLock dataSetLock );
-
- /**
- * Deletes a DataSetLock.
- *
- * @param dataSetLock The DataSetLock to delete.
- */
- void deleteDataSetLock( DataSetLock dataSetLock );
-
- /**
- * Get a DataSetLock
- *
- * @param id The unique identifier for the DataSetLock to get.
- * @return The DataSetLock with the given id or null if it does not exist.
- */
- DataSetLock getDataSetLock( int id );
-
- /**
- * Returns a Collection of DataSetLocks with the given DataSet.
- *
- * @param name The dataSetLock.
- * @return A Collection of DataSetLock with the given DataSet.
- */
- Collection<DataSetLock> getDataSetLockByDataSet( DataSet dataSet );
-
- /**
- * Returns Collection of DataSetLock with the given period.
- *
- * @param period The DataSetLock.
- * @return Collection of DataSetLock with the given DataSetLock.
- */
- Collection<DataSetLock> getDataSetLockByPeriod( Period period );
-
- /**
- * Returns the DataSetLock with the given dataSet and period.
- *
- * @param dataSet and period The DataSetLock.
- * @return The DataSetLock with the given DataSetLock.
- */
- DataSetLock getDataSetLockByDataSetAndPeriod( DataSet dataSet, Period period );
-
- /**
- * Returns the DataSetLock with the given dataSet, period, and source
- *
- * @param dataSet, period, source The DataSetLock.
- * @return The DataSetLock with the given DataSetLock.
- */
- DataSetLock getDataSetLockByDataSetPeriodAndSource( DataSet dataSet, Period period, OrganisationUnit source );
-
- /**
- * Returns all DataSetLocks associated with the specified source.
- */
- Collection<DataSetLock> getDataSetLocksBySource( OrganisationUnit source );
-
- /**
- * Returns all DataSetLocks associated with the specified sources.
- */
- Collection<DataSetLock> getDataSetLocksBySources( Collection<OrganisationUnit> sources );
-
- /**
- * Returns the number of Sources among the specified Sources associated with
- * the specified DataSetLock.
- */
- int getSourcesAssociatedWithDataSetLock( DataSetLock dataSetLock, Collection<OrganisationUnit> sources );
-
- /**
- * Get all DataSetLocks.
- *
- * @return A collection containing all DataSetLocks.
- */
- Collection<DataSetLock> getAllDataSetLocks();
-
- /**
- * Get all DataSetLocks with corresponding identifiers.
- *
- * @param identifiers the collection of identifiers.
- * @return a collection of DataSetLock.
- */
- Collection<DataSetLock> getDataSetLocks( Collection<Integer> identifiers );
-
- /**
- * Returns a distinct collection of data elements associated with the data
- * sets with the given corresponding data set identifiers.
- *
- * @param dataSetIdentifiers the data set Lock identifiers.
- * @return a distinct collection of data sets.
- */
- Collection<DataSet> getDistinctDataSets( Collection<Integer> dataSetLockIdentifiers );
-
- /**
- * Apply lock to data sets
- *
- * @param dataSets The collection of data sets.
- * @param periods The list of periods.
- * @param selectedSources The selected organization unit from tree.
- * @param userName The user name.
- */
- void applyCollectiveDataLock( Collection<DataSet> dataSets, Collection<Period> periods, Set<OrganisationUnit> selectedSources, String userName );
-
- /**
- * Remove lock from data sets.
- *
- * @param dataSets The collection of data sets.
- * @param periods The list of periods.
- * @param selectedSources The selected organization unit from tree.
- * @param userName The user name.
- */
- void removeCollectiveDataLock( Collection<DataSet> dataSets, Collection<Period> periods, Set<OrganisationUnit> selectedSources, String userName );
-}
-
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockStore.java 2011-04-22 21:04:14 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/DataSetLockStore.java 1970-01-01 00:00:00 +0000
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.datalock;
-
-import java.util.Collection;
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-public interface DataSetLockStore
-{
- String ID = DataSetLockStore.class.getName();
-
- // -------------------------------------------------------------------------
- // DataSetLockStore
- // -------------------------------------------------------------------------
-
- /**
- * Adds a DataSetLock.
- *
- * @param dataSetLock The dataSetLock to add.
- * @return The generated unique identifier for this DataSetLock.
- */
- int addDataSetLock( DataSetLock dataSetLock );
-
- /**
- * Updates a DataSetLock.
- *
- * @param dataSetLock The DataSetLock to update.
- */
- void updateDataSetLock( DataSetLock dataSetLock );
-
- /**
- * Deletes a DataSetLock.
- *
- * @param dataSetLock The DataSetLock to delete.
- */
- void deleteDataSetLock( DataSetLock dataSetLock );
-
- /**
- * Get a DataSetLock
- *
- * @param id The unique identifier for the DataSetLock to get.
- * @return The DataSetLock with the given id or null if it does not exist.
- */
- DataSetLock getDataSetLock( int id );
-
- /**
- * Returns a Collection of DataSetLocks with the given DataSet.
- *
- * @param name The dataSetLock.
- * @return A Collection of DataSetLock with the given DataSet.
- */
- Collection<DataSetLock> getDataSetLockByDataSet( DataSet dataSet );
-
- /**
- * Returns a Collection of DataSetLock with the given period.
- *
- * @param period The DataSetLock.
- * @return A Collection of DataSetLock with the given DataSetLock.
- */
- Collection<DataSetLock> getDataSetLockByPeriod( Period period );
-
- /**
- * Returns the DataSetLock with the given dataSet and period.
- *
- * @param dataSet and period The DataSetLock.
- * @return The DataSetLock with the given DataSetLock.
- */
- DataSetLock getDataSetLockByDataSetAndPeriod( DataSet dataSet, Period period );
-
- /**
- * Returns the DataSetLock with the given dataSet, period, and source
- *
- * @param dataSet, period, source The DataSetLock.
- * @return The DataSetLock with the given DataSetLock.
- */
- DataSetLock getDataSetLockByDataSetPeriodAndSource( DataSet dataSet, Period period, OrganisationUnit source );
-
- /**
- * Returns all DataSetLocks associated with the specified source.
- */
- Collection<DataSetLock> getDataSetLocksBySource( OrganisationUnit source );
-
- /**
- * Get all DataSetLocks.
- *
- * @return A collection containing all DataSetLocks.
- */
- Collection<DataSetLock> getAllDataSetLocks();
-
-}
\ No newline at end of file
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/package-info.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/package-info.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datalock/package-info.java 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @author bobj
- */
-
-@XmlSchema(
- namespace = "http://dhis2.org/schema/dxf/2.0",
- xmlns = {
- @XmlNs(namespaceURI = "http://dhis2.org/schema/dxf/2.0", prefix = "d")
- },
- elementFormDefault = XmlNsForm.QUALIFIED)
-
-package org.hisp.dhis.datalock;
-
-import javax.xml.bind.annotation.XmlSchema;
-import javax.xml.bind.annotation.XmlNs;
-import javax.xml.bind.annotation.XmlNsForm;
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java 2012-02-16 12:58:37 +0000
@@ -1,4 +1,5 @@
package org.hisp.dhis.sqlview;
+
/*
* Copyright (c) 2004-2012, University of Oslo
* All rights reserved.
@@ -40,7 +41,8 @@
*/
@XmlRootElement( name = "sqlView", namespace = Dxf2Namespace.NAMESPACE )
@XmlAccessorType( value = XmlAccessType.NONE )
-public class SqlView extends BaseIdentifiableObject
+public class SqlView
+ extends BaseIdentifiableObject
{
// -------------------------------------------------------------------------
// Variables
@@ -75,7 +77,7 @@
final int prime = 31;
int result = 1;
result = prime * result + id;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ( ( name == null ) ? 0 : name.hashCode() );
return result;
}
@@ -97,29 +99,13 @@
final SqlView other = (SqlView) obj;
- if ( id != other.id )
- {
- return false;
- }
- if ( name == null )
- {
- if ( other.name != null )
- {
- return false;
- }
- }
- else if ( !name.equals( other.name ) )
- {
- return false;
- }
-
- return true;
+ return name.equals( other.name );
}
@Override
public String toString()
{
- return "[ Name: " + name + ",\n\n sqlQuery: " + sqlQuery + " ]";
+ return "[ Name: " + name + ", sql query: " + sqlQuery + " ]";
}
// -------------------------------------------------------------------------
=== removed directory 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock'
=== removed file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DataSetLockDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DataSetLockDeletionHandler.java 2011-04-22 17:02:27 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DataSetLockDeletionHandler.java 1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
-package org.hisp.dhis.datalock;
-
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.system.deletion.DeletionHandler;
-
-public class DataSetLockDeletionHandler
- extends DeletionHandler
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataSetLockService dataSetLockService;
-
- public void setDataSetLockService( DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
- // -------------------------------------------------------------------------
- // DeletionHandler
- // -------------------------------------------------------------------------
-
- @Override
- protected String getClassName()
- {
- return DataSetLock.class.getSimpleName();
- }
-
- @Override
- public void deletePeriod( Period period )
- {
- for ( DataSetLock dataSetLock : dataSetLockService.getDataSetLockByPeriod( period ) )
- {
- dataSetLockService.deleteDataSetLock( dataSetLock );
- }
- }
-
- @Override
- public void deleteOrganisationUnit( OrganisationUnit unit )
- {
- for ( DataSetLock dataSetLock : dataSetLockService.getDataSetLocksBySource( unit ) )
- {
- dataSetLockService.deleteDataSetLock( dataSetLock );
- }
- }
-
- public void deleteDataSet( DataSet dataSet )
- {
- for ( DataSetLock dataSetLock : dataSetLockService.getDataSetLockByDataSet( dataSet ) )
- {
- dataSetLockService.deleteDataSetLock( dataSetLock );
- }
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DefaultDataSetLockService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DefaultDataSetLockService.java 2011-04-22 17:02:27 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/DefaultDataSetLockService.java 1970-01-01 00:00:00 +0000
@@ -1,239 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.datalock;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-
-@Transactional
-public class DefaultDataSetLockService
- implements DataSetLockService
-{
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataSetLockStore dataSetLockStore;
-
- public void setDataSetLockStore( DataSetLockStore dataSetLockStore )
- {
- this.dataSetLockStore = dataSetLockStore;
- }
-
- // -------------------------------------------------------------------------
- // DataSet
- // -------------------------------------------------------------------------
-
- public int addDataSetLock( DataSetLock dataSetLock )
- {
- int id = dataSetLockStore.addDataSetLock( dataSetLock );
-
- return id;
- }
-
- public void updateDataSetLock( DataSetLock dataSetLock )
- {
- dataSetLockStore.updateDataSetLock( dataSetLock );
- }
-
- public void deleteDataSetLock( DataSetLock dataSetLock )
- {
- dataSetLockStore.deleteDataSetLock( dataSetLock );
- }
-
- public Collection<DataSetLock> getAllDataSetLocks()
- {
- return dataSetLockStore.getAllDataSetLocks();
- }
-
- public DataSetLock getDataSetLock( int id )
- {
- return dataSetLockStore.getDataSetLock( id );
- }
-
- public Collection<DataSetLock> getDataSetLockByDataSet( DataSet dataSet )
- {
- return dataSetLockStore.getDataSetLockByDataSet( dataSet );
- }
-
- public Collection<DataSetLock> getDataSetLockByPeriod( Period period )
- {
- return dataSetLockStore.getDataSetLockByPeriod( period );
- }
-
- public DataSetLock getDataSetLockByDataSetAndPeriod( DataSet dataSet, Period period )
- {
- return dataSetLockStore.getDataSetLockByDataSetAndPeriod( dataSet, period );
- }
-
- public DataSetLock getDataSetLockByDataSetPeriodAndSource( DataSet dataSet, Period period, OrganisationUnit source )
- {
- return dataSetLockStore.getDataSetLockByDataSetPeriodAndSource( dataSet, period, source );
- }
-
- public Collection<DataSetLock> getDataSetLocks( Collection<Integer> identifiers )
- {
- if ( identifiers == null )
- {
- return getAllDataSetLocks();
- }
-
- Collection<DataSetLock> objects = new ArrayList<DataSetLock>();
-
- for ( Integer id : identifiers )
- {
- objects.add( getDataSetLock( id ) );
- }
-
- return objects;
- }
-
- public Collection<DataSetLock> getDataSetLocksBySource( OrganisationUnit source )
- {
- return dataSetLockStore.getDataSetLocksBySource( source );
- }
-
- public Collection<DataSetLock> getDataSetLocksBySources( Collection<OrganisationUnit> sources )
- {
- Set<DataSetLock> dataSetLocks = new HashSet<DataSetLock>();
-
- for ( OrganisationUnit source : sources )
- {
- dataSetLocks.addAll( dataSetLockStore.getDataSetLocksBySource( source ) );
- }
-
- return dataSetLocks;
- }
-
- public Collection<DataSet> getDistinctDataSets( Collection<Integer> dataSetLockIdentifiers )
- {
- Collection<DataSetLock> dataSetLocks = getDataSetLocks( dataSetLockIdentifiers );
-
- Set<DataSet> dataSets = new HashSet<DataSet>();
-
- for ( DataSetLock dataSetLock : dataSetLocks )
- {
- dataSets.add( dataSetLock.getDataSet() );
- }
-
- return dataSets;
- }
-
- public int getSourcesAssociatedWithDataSetLock( DataSetLock dataSetLock, Collection<OrganisationUnit> sources )
- {
- int count = 0;
-
- for ( OrganisationUnit source : sources )
- {
- if ( dataSetLock.getSources().contains( source ) )
- {
- count++;
- }
- }
-
- return count;
- }
-
- public void applyCollectiveDataLock( Collection<DataSet> dataSets, Collection<Period> periods,
- Set<OrganisationUnit> selectedSources, String userName )
- {
- for ( DataSet dataSet : dataSets )
- {
- Set<OrganisationUnit> dataSetOrganisationUnits = dataSet.getSources();
- Set<OrganisationUnit> selOrgUnitSource = new HashSet<OrganisationUnit>();
-
- selOrgUnitSource.addAll( selectedSources );
- selOrgUnitSource.retainAll( dataSetOrganisationUnits );
-
- for ( Period period : periods )
- {
- DataSetLock dataSetLock = this.getDataSetLockByDataSetAndPeriod( dataSet, period );
- if ( dataSetLock != null )
- {
- Set<OrganisationUnit> lockedOrganisationUnitsSource = dataSetLock.getSources();
- selOrgUnitSource.removeAll( lockedOrganisationUnitsSource );
- dataSetLock.getSources().addAll( selOrgUnitSource );
- dataSetLock.setTimestamp( new Date() );
- dataSetLock.setStoredBy( userName );
- this.updateDataSetLock( dataSetLock );
- }
- else
- {
- dataSetLock = new DataSetLock();
- dataSetLock.setPeriod( period );
- dataSetLock.setSources( selOrgUnitSource );
- dataSetLock.setDataSet( dataSet );
- dataSetLock.setTimestamp( new Date() );
- dataSetLock.setStoredBy( userName );
- this.addDataSetLock( dataSetLock );
- }
- }
- }
-
- }
-
- public void removeCollectiveDataLock( Collection<DataSet> dataSets, Collection<Period> periods,
- Set<OrganisationUnit> selectedSources, String userName )
- {
- for ( DataSet dataSet : dataSets )
- {
- Set<OrganisationUnit> dataSetOrganisationUnits = dataSet.getSources();
- Set<OrganisationUnit> selOrgUnitSource = new HashSet<OrganisationUnit>();
-
- selOrgUnitSource.addAll( selectedSources );
- selOrgUnitSource.retainAll( dataSetOrganisationUnits );
-
- for ( Period period : periods )
- {
- DataSetLock dataSetLock = this.getDataSetLockByDataSetAndPeriod( dataSet, period );
- if ( dataSetLock != null )
- {
- Set<OrganisationUnit> lockedOrganisationUnitsSource = dataSetLock.getSources();
- selOrgUnitSource.retainAll( lockedOrganisationUnitsSource );
- dataSetLock.getSources().removeAll( selOrgUnitSource );
- dataSetLock.setTimestamp( new Date() );
- dataSetLock.setStoredBy( userName );
- this.updateDataSetLock( dataSetLock );
- }
- }
- }
- }
-}
=== removed directory 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/hibernate'
=== removed file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/hibernate/HibernateDataSetLockStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/hibernate/HibernateDataSetLockStore.java 2011-08-12 19:30:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datalock/hibernate/HibernateDataSetLockStore.java 1970-01-01 00:00:00 +0000
@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.datalock.hibernate;
-
-import java.util.Collection;
-
-import org.hibernate.Criteria;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockStore;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-public class HibernateDataSetLockStore
- implements DataSetLockStore
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SessionFactory sessionFactory;
-
- public void setSessionFactory( SessionFactory sessionFactory )
- {
- this.sessionFactory = sessionFactory;
- }
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- // -------------------------------------------------------------------------
- // Support methods for reloading periods
- // -------------------------------------------------------------------------
-
- private final Period reloadPeriod( Period period )
- {
- Session session = sessionFactory.getCurrentSession();
-
- if ( session.contains( period ) )
- {
- return period; // Already in session, no reload needed
- }
-
- return periodService.getPeriod( period.getStartDate(), period.getEndDate(), period.getPeriodType() );
- }
-
- // -------------------------------------------------------------------------
- // DataSetLock
- // -------------------------------------------------------------------------
-
- public int addDataSetLock( DataSetLock dataSetLock )
- {
- dataSetLock.setPeriod( reloadPeriod( dataSetLock.getPeriod() ) );
-
- Session session = sessionFactory.getCurrentSession();
-
- return (Integer) session.save( dataSetLock );
- }
-
- public void updateDataSetLock( DataSetLock dataSetLock )
- {
- dataSetLock.setPeriod( reloadPeriod( dataSetLock.getPeriod() ) );
-
- Session session = sessionFactory.getCurrentSession();
-
- session.update( dataSetLock );
- }
-
- public void deleteDataSetLock( DataSetLock dataSetLock )
- {
- Session session = sessionFactory.getCurrentSession();
-
- session.delete( dataSetLock );
- }
-
- @SuppressWarnings( "unchecked" )
- public Collection<DataSetLock> getAllDataSetLocks()
- {
- Session session = sessionFactory.getCurrentSession();
-
- return session.createCriteria( DataSetLock.class ).list();
- }
-
- public DataSetLock getDataSetLock( int id )
- {
- Session session = sessionFactory.getCurrentSession();
-
- return (DataSetLock) session.get( DataSetLock.class, id );
- }
-
- @SuppressWarnings( "unchecked" )
- public Collection<DataSetLock> getDataSetLockByDataSet( DataSet dataSet )
- {
- Session session = sessionFactory.getCurrentSession();
-
- Criteria criteria = session.createCriteria( DataSetLock.class );
- criteria.add( Restrictions.eq( "dataSet", dataSet ) );
-
- return criteria.list();
- }
-
- @SuppressWarnings( "unchecked" )
- public Collection<DataSetLock> getDataSetLockByPeriod( Period period )
- {
- Session session = sessionFactory.getCurrentSession();
-
- Period storedPeriod = reloadPeriod( period );
-
- Criteria criteria = session.createCriteria( DataSetLock.class );
- criteria.add( Restrictions.eq( "period", storedPeriod ) );
-
- return criteria.list();
- }
-
- public DataSetLock getDataSetLockByDataSetAndPeriod( DataSet dataSet, Period period )
- {
- Session session = sessionFactory.getCurrentSession();
-
- Period storedPeriod = reloadPeriod( period );
-
- Criteria criteria = session.createCriteria( DataSetLock.class );
- criteria.add( Restrictions.eq( "dataSet", dataSet ) );
- criteria.add( Restrictions.eq( "period", storedPeriod ) );
-
- return (DataSetLock) criteria.uniqueResult();
- }
-
- public DataSetLock getDataSetLockByDataSetPeriodAndSource( DataSet dataSet, Period period, OrganisationUnit source )
- {
- Period storedPeriod = reloadPeriod( period );
-
- String hql = "from DataSetLock d ";
- hql += "where dataSet = :dataSet ";
- hql += "and period = :period ";
- hql += "and :source in elements(d.sources)";
-
- Query query = sessionFactory.getCurrentSession().createQuery( hql );
- query.setEntity( "dataSet", dataSet );
- query.setEntity( "period", storedPeriod );
- query.setEntity( "source", source );
-
- return (DataSetLock) query.uniqueResult();
- }
-
- @SuppressWarnings( "unchecked" )
- public Collection<DataSetLock> getDataSetLocksBySource( OrganisationUnit source )
- {
- String hql = "from DataSetLock d where :source in elements(d.sources)";
-
- Query query = sessionFactory.getCurrentSession().createQuery( hql );
- query.setEntity( "source", source );
-
- return query.list();
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml 2012-02-02 20:01:36 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml 2012-02-16 12:58:37 +0000
@@ -5,17 +5,6 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd">
- <!-- DataLoking -->
-
- <bean id="org.hisp.dhis.datalock.DataSetLockStore" class="org.hisp.dhis.datalock.hibernate.HibernateDataSetLockStore">
- <property name="sessionFactory" ref="sessionFactory" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- </bean>
-
- <bean id="org.hisp.dhis.datalock.DataSetLockService" class="org.hisp.dhis.datalock.DefaultDataSetLockService">
- <property name="dataSetLockStore" ref="org.hisp.dhis.datalock.DataSetLockStore" />
- </bean>
-
<!-- ResourceTable -->
<bean id="org.hisp.dhis.resourcetable.ResourceTableStore" class="org.hisp.dhis.resourcetable.jdbc.JdbcResourceTableStore">
@@ -130,10 +119,6 @@
<property name="jdbcTemplate" ref="jdbcTemplate" />
</bean>
- <bean id="org.hisp.dhis.datalock.DataSetLockDeletionHandler" class="org.hisp.dhis.datalock.DataSetLockDeletionHandler">
- <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
- </bean>
-
<!-- DeletionManager -->
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
@@ -143,7 +128,6 @@
<list>
<list>
<ref local="org.hisp.dhis.dataarchive.ArchivedDataValueDeletionHandler" />
- <ref local="org.hisp.dhis.datalock.DataSetLockDeletionHandler" />
</list>
</list>
</property>
=== removed directory 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock'
=== removed directory 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock/hibernate'
=== removed file 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock/hibernate/DataSetLock.hbm.xml'
--- dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock/hibernate/DataSetLock.hbm.xml 2011-05-28 21:25:46 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/datalock/hibernate/DataSetLock.hbm.xml 1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
-<?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.datalock.DataSetLock" table="datasetlock">
-
- <id name="id" column="datasetlockid">
- <generator class="native" />
- </id>
-
- <many-to-one name="dataSet" class="org.hisp.dhis.dataset.DataSet" column="datasetid"
- not-null="true" foreign-key="fk_dataset_datasetid" />
-
- <many-to-one name="period" class="org.hisp.dhis.period.Period" column="periodid" not-null="true"
- foreign-key="fk_dataset_periodid" />
-
- <set name="sources" table="datasetlocksource">
- <key column="datasetlockid" foreign-key="fk_datasetlocksource_datasetlockid" />
- <many-to-many column="sourceid" class="org.hisp.dhis.organisationunit.OrganisationUnit" foreign-key="fk_datasetlock_organisationunit"/>
- </set>
-
- <property name="storedBy" column="storedby" length="31" />
-
- <property name="timestamp" column="lastupdated" type="date" />
-
- </class>
-</hibernate-mapping>
=== removed directory 'dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/datalock'
=== removed file 'dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/datalock/DataSetLockServiceTest.java'
--- dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/datalock/DataSetLockServiceTest.java 2012-01-23 09:50:50 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/datalock/DataSetLockServiceTest.java 1970-01-01 00:00:00 +0000
@@ -1,465 +0,0 @@
-package org.hisp.dhis.datalock;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id$
- */
-@Ignore
-public class DataSetLockServiceTest
- extends DhisSpringTest
-{
- protected DataSetLockService dataSetLockService;
-
- protected DataSet dataSetA;
-
- protected DataSet dataSetB;
-
- protected DataSet dataSetC;
-
- protected Period periodA;
-
- protected Period periodB;
-
- protected Period periodC;
-
- protected Period periodD;
-
- protected OrganisationUnit unitA;
-
- protected OrganisationUnit unitB;
-
- protected OrganisationUnit unitC;
-
- protected OrganisationUnit unitD;
-
- protected OrganisationUnit unitE;
-
- protected OrganisationUnit unitF;
-
- protected OrganisationUnit unitG;
-
- protected OrganisationUnit unitH;
-
- protected OrganisationUnit unitI;
-
- protected String user1;
-
- protected String user2;
-
- protected String user3;
-
- protected String user4;
-
- protected String user5;
-
- @Override
- public void setUpTest()
- throws Exception
- {
- dataSetService = (DataSetService) getBean( DataSetService.ID );
-
- dataSetLockService = (DataSetLockService) getBean( DataSetLockService.ID );
-
- periodService = (PeriodService) getBean( PeriodService.ID );
-
- organisationUnitService = (OrganisationUnitService) getBean( OrganisationUnitService.ID );
-
- // ---------------------------------------------------------------------
- // Setup Periods
- // ---------------------------------------------------------------------
-
- Iterator<PeriodType> periodTypeIt = periodService.getAllPeriodTypes().iterator();
- PeriodType periodTypeA = periodTypeIt.next(); // Daily
- PeriodType periodTypeB = periodTypeIt.next(); // Weekly
-
- Date mar01 = super.getDate( 2005, 3, 1 );
- Date mar31 = super.getDate( 2005, 3, 31 );
- Date apr01 = super.getDate( 2005, 4, 1 );
- Date apr30 = super.getDate( 2005, 4, 30 );
- Date may01 = super.getDate( 2005, 5, 1 );
- Date may31 = super.getDate( 2005, 5, 31 );
-
- periodA = super.createPeriod( periodTypeA, mar01, mar31 );
- periodB = super.createPeriod( periodTypeA, apr01, apr30 );
- periodC = super.createPeriod( periodTypeB, mar01, may31 );
- periodD = super.createPeriod( periodTypeB, may01, may31 );
-
- periodService.addPeriod( periodA );
- periodService.addPeriod( periodB );
- periodService.addPeriod( periodC );
- periodService.addPeriod( periodD );
-
- // ---------------------------------------------------------------------
- // Setup DataSets
- // ---------------------------------------------------------------------
-
- dataSetA = super.createDataSet( 'A', periodTypeA );
- dataSetB = super.createDataSet( 'B', periodTypeB );
- dataSetC = super.createDataSet( 'C', periodTypeB );
-
- dataSetService.addDataSet( dataSetA );
- dataSetService.addDataSet( dataSetB );
- dataSetService.addDataSet( dataSetC );
-
- // ---------------------------------------------------------------------
- // Setup OrganisationUnits
- // ---------------------------------------------------------------------
-
- unitA = super.createOrganisationUnit( 'A' );
- unitB = super.createOrganisationUnit( 'B', unitA );
- unitC = super.createOrganisationUnit( 'C', unitA );
- unitD = super.createOrganisationUnit( 'D', unitB );
- unitE = super.createOrganisationUnit( 'E', unitB );
- unitF = super.createOrganisationUnit( 'F', unitB );
- unitG = super.createOrganisationUnit( 'G', unitF );
- unitH = super.createOrganisationUnit( 'H', unitF );
- unitI = super.createOrganisationUnit( 'I' );
-
- organisationUnitService.addOrganisationUnit( unitA );
- organisationUnitService.addOrganisationUnit( unitB );
- organisationUnitService.addOrganisationUnit( unitC );
- organisationUnitService.addOrganisationUnit( unitD );
- organisationUnitService.addOrganisationUnit( unitE );
- organisationUnitService.addOrganisationUnit( unitF );
- organisationUnitService.addOrganisationUnit( unitG );
- organisationUnitService.addOrganisationUnit( unitH );
- organisationUnitService.addOrganisationUnit( unitI );
-
- // ---------------------------------------------------------------------
- // Setup Users
- // ---------------------------------------------------------------------
-
- user1 = "admin";
- user2 = "User2";
- user3 = "User3";
- user4 = "User4";
- user5 = "User5";
- }
-
- // -------------------------------------------------------------------------
- // Supportive methods
- // -------------------------------------------------------------------------
-
- public void initOrgunitSet( Set<OrganisationUnit> units, OrganisationUnit... sources )
- {
- for ( OrganisationUnit s : sources )
- {
- units.add( s );
- }
- }
-
- private void assertEq( DataSetLock dataSetLock, DataSet dataSet, Period period, Set<OrganisationUnit> sources )
- {
- assertEquals( dataSet, dataSetLock.getDataSet() );
- assertEquals( period, dataSetLock.getPeriod() );
- assertEquals( sources, dataSetLock.getSources() );
- }
-
- // -------------------------------------------------------------------------
- // DataSetLock
- // -------------------------------------------------------------------------
-
- @Test
- public void testAddDataSetLock()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC, unitI );
-
- DataSetLock dataSetLockAA = createDataSetLock( dataSetA, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockAB = createDataSetLock( dataSetA, periodB, lockSources, user1, new Date() );
- DataSetLock dataSetLockBA = createDataSetLock( dataSetB, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockBB = createDataSetLock( dataSetB, periodB, lockSources, user1, new Date() );
-
- int idAA = dataSetLockService.addDataSetLock( dataSetLockAA );
- int idAB = dataSetLockService.addDataSetLock( dataSetLockAB );
- int idBA = dataSetLockService.addDataSetLock( dataSetLockBA );
- int idBB = dataSetLockService.addDataSetLock( dataSetLockBB );
-
- dataSetLockAA = dataSetLockService.getDataSetLock( idAA );
- dataSetLockAB = dataSetLockService.getDataSetLock( idAB );
- dataSetLockBA = dataSetLockService.getDataSetLock( idBA );
- dataSetLockBB = dataSetLockService.getDataSetLock( idBB );
-
- assertEquals( idAA, dataSetLockAA.getId() );
- assertEq( dataSetLockAA, dataSetA, periodA, lockSources );
- assertEquals( idAB, dataSetLockAB.getId() );
- assertEq( dataSetLockAB, dataSetA, periodB, lockSources );
-
- assertEquals( idBA, dataSetLockBA.getId() );
- assertEq( dataSetLockBA, dataSetB, periodA, lockSources );
- assertEquals( idBB, dataSetLockBB.getId() );
- assertEq( dataSetLockBB, dataSetB, periodB, lockSources );
- }
-
- @Test
- public void testUpdateDataSetLock()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC );
-
- DataSetLock dataSetLock = createDataSetLock( dataSetC, periodC, lockSources, user2, new Date() );
-
- int id = dataSetLockService.addDataSetLock( dataSetLock );
- dataSetLock = dataSetLockService.getDataSetLock( id );
-
- assertEq( dataSetLock, dataSetC, periodC, lockSources );
-
- lockSources.add( unitI );
- dataSetLock.getSources().add( unitI );
-
- dataSetLockService.updateDataSetLock( dataSetLock );
- dataSetLock = dataSetLockService.getDataSetLock( id );
-
- assertTrue( dataSetLock.getSources().containsAll( lockSources ) );
- }
-
- @Test
- public void testDeleteAndGetDataSetLock()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC );
-
- DataSetLock dataSetLockAA = createDataSetLock( dataSetA, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockAB = createDataSetLock( dataSetA, periodB, lockSources, user1, new Date() );
-
- int idAA = dataSetLockService.addDataSetLock( dataSetLockAA );
- int idAB = dataSetLockService.addDataSetLock( dataSetLockAB );
-
- assertNotNull( dataSetLockService.getDataSetLock( idAA ) );
- assertNotNull( dataSetLockService.getDataSetLock( idAB ) );
-
- dataSetLockService.deleteDataSetLock( dataSetLockService.getDataSetLock( idAA ) );
-
- assertNull( dataSetLockService.getDataSetLock( idAA ) );
- assertNotNull( dataSetLockService.getDataSetLock( idAB ) );
-
- dataSetLockService.deleteDataSetLock( dataSetLockService.getDataSetLock( idAB ) );
-
- assertNull( dataSetLockService.getDataSetLock( idAA ) );
- assertNull( dataSetLockService.getDataSetLock( idAB ) );
- }
-
- @Test
- public void testGetDataSetLockByDataSet()
- throws Exception
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC, unitI );
-
- DataSetLock dataSetLockAB = createDataSetLock( dataSetA, periodB, lockSources, user1, new Date() );
- DataSetLock dataSetLockBA = createDataSetLock( dataSetB, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockBB = createDataSetLock( dataSetB, periodB, lockSources, user1, new Date() );
-
- int idAB = dataSetLockService.addDataSetLock( dataSetLockAB );
- int idBA = dataSetLockService.addDataSetLock( dataSetLockBA );
- int idBB = dataSetLockService.addDataSetLock( dataSetLockBB );
-
- Collection<DataSetLock> dataSetLocks1 = new HashSet<DataSetLock>( dataSetLockService
- .getDataSetLockByDataSet( dataSetA ) );
-
- assertTrue( dataSetLocks1.remove( dataSetLockService.getDataSetLock( idAB ) ) );
-
- dataSetLocks1 = new HashSet<DataSetLock>( dataSetLockService.getDataSetLockByDataSet( dataSetB ) );
- Collection<DataSetLock> dataSetLocks2 = new HashSet<DataSetLock>();
- dataSetLocks2.add( dataSetLockService.getDataSetLock( idBA ) );
- dataSetLocks2.add( dataSetLockService.getDataSetLock( idBB ) );
-
- assertTrue( dataSetLocks1.containsAll( dataSetLocks2 ) );
-
- }
-
- @Test
- public void testGetDataSetLockByPeriod()
- throws Exception
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC, unitI );
-
- DataSetLock dataSetLockAB = createDataSetLock( dataSetA, periodB, lockSources, user1, new Date() );
- DataSetLock dataSetLockBA = createDataSetLock( dataSetB, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockBB = createDataSetLock( dataSetB, periodB, lockSources, user1, new Date() );
-
- int idAB = dataSetLockService.addDataSetLock( dataSetLockAB );
- int idBA = dataSetLockService.addDataSetLock( dataSetLockBA );
- int idBB = dataSetLockService.addDataSetLock( dataSetLockBB );
-
- Collection<DataSetLock> dataSetLocks1 = new HashSet<DataSetLock>( dataSetLockService
- .getDataSetLockByPeriod( periodB ) );
- Collection<DataSetLock> dataSetLocks2 = new HashSet<DataSetLock>();
-
- dataSetLocks2.add( dataSetLockService.getDataSetLock( idAB ) );
- dataSetLocks2.add( dataSetLockService.getDataSetLock( idBB ) );
-
- assertTrue( dataSetLocks1.removeAll( dataSetLocks2 ) );
-
- dataSetLocks2.clear();
- dataSetLocks2.add( dataSetLockService.getDataSetLock( idBA ) );
- assertTrue( dataSetLocks2.containsAll( dataSetLockService.getDataSetLockByPeriod( periodA ) ) );
-
- }
-
- @Test
- public void testGetAllDataSetLocks()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC, unitI );
-
- DataSetLock dataSetLockAA = createDataSetLock( dataSetA, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockAB = createDataSetLock( dataSetA, periodB, lockSources, user1, new Date() );
- DataSetLock dataSetLockBA = createDataSetLock( dataSetB, periodA, lockSources, user2, new Date() );
- DataSetLock dataSetLockBB = createDataSetLock( dataSetB, periodB, lockSources, user2, new Date() );
- DataSetLock dataSetLockCC = createDataSetLock( dataSetC, periodC, lockSources, user3, new Date() );
-
- dataSetLockService.addDataSetLock( dataSetLockAA );
- dataSetLockService.addDataSetLock( dataSetLockAB );
- dataSetLockService.addDataSetLock( dataSetLockBA );
- dataSetLockService.addDataSetLock( dataSetLockBB );
- dataSetLockService.addDataSetLock( dataSetLockCC );
-
- Collection<DataSetLock> dataSetLocks = dataSetLockService.getAllDataSetLocks();
-
- assertEquals( dataSetLocks.size(), 5 );
- assertTrue( dataSetLocks.contains( dataSetLockAA ) );
- assertTrue( dataSetLocks.contains( dataSetLockAB ) );
- assertTrue( dataSetLocks.contains( dataSetLockBA ) );
- assertTrue( dataSetLocks.contains( dataSetLockBB ) );
- assertTrue( dataSetLocks.contains( dataSetLockCC ) );
- }
-
- @Test
- public void testGetDataSetLocks()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC, unitI );
-
- DataSetLock dataSetLockAA = createDataSetLock( dataSetA, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockBB = createDataSetLock( dataSetB, periodB, lockSources, user2, new Date() );
- DataSetLock dataSetLockCC = createDataSetLock( dataSetC, periodC, lockSources, user3, new Date() );
-
- int idAA = dataSetLockService.addDataSetLock( dataSetLockAA );
- int idBB = dataSetLockService.addDataSetLock( dataSetLockBB );
- int idCC = dataSetLockService.addDataSetLock( dataSetLockCC );
-
- Collection<Integer> dataSetLockIds = new ArrayList<Integer>();
- Collection<DataSetLock> dataSetLocks = new HashSet<DataSetLock>();
-
- dataSetLockIds.add( idAA );
- dataSetLockIds.add( idBB );
- dataSetLockIds.add( idCC );
-
- dataSetLocks = dataSetLockService.getAllDataSetLocks();
-
- assertEquals( dataSetLockIds.size(), 3 );
- assertTrue( dataSetLocks.containsAll( dataSetLockService.getDataSetLocks( dataSetLockIds ) ) );
- }
-
- @Test
- public void testGetDataSetLockByDataSetAndPeriod()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC, unitI );
-
- DataSetLock dataSetLock = createDataSetLock( dataSetA, periodB, lockSources, user1, new Date() );
-
- int id = dataSetLockService.addDataSetLock( dataSetLock );
- dataSetLock = dataSetLockService.getDataSetLock( id );
-
- assertNotNull( dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSetLock.getDataSet(), dataSetLock
- .getPeriod() ) );
-
- }
-
- @Test
- public void testGetDataSetLockByDataSetPeriodAndSource()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC );
-
- DataSetLock dataSetLockAA = createDataSetLock( dataSetA, periodA, lockSources, user1, new Date() );
-
- int idAA = dataSetLockService.addDataSetLock( dataSetLockAA );
- dataSetLockAA = dataSetLockService.getDataSetLock( idAA );
-
- assertNotNull( dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSetA, periodA, unitC ) );
-
- lockSources.add( unitI );
- lockSources.remove( unitC );
- DataSetLock dataSetLockBB = createDataSetLock( dataSetB, periodB, lockSources, user2, new Date() );
-
- dataSetLockService.addDataSetLock( dataSetLockBB );
- assertNull( dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSetB, periodB, unitC ) );
- }
-
- @Test
- public void testGetDataSetLocksBySource()
- {
- Set<OrganisationUnit> lockSources = new HashSet<OrganisationUnit>();
- initOrgunitSet( lockSources, unitB, unitC, unitI );
-
- DataSetLock dataSetLockAA = createDataSetLock( dataSetA, periodA, lockSources, user1, new Date() );
- DataSetLock dataSetLockBB = createDataSetLock( dataSetB, periodB, lockSources, user2, new Date() );
- DataSetLock dataSetLockCC = createDataSetLock( dataSetC, periodC, lockSources, user3, new Date() );
-
- int idAA = dataSetLockService.addDataSetLock( dataSetLockAA );
- int idBB = dataSetLockService.addDataSetLock( dataSetLockBB );
- int idCC = dataSetLockService.addDataSetLock( dataSetLockCC );
-
- Collection<DataSetLock> dataSetLocks = new HashSet<DataSetLock>( dataSetLockService
- .getDataSetLocksBySource( unitI ) );
-
- assertEquals( 3, dataSetLocks.size() );
- assertTrue( dataSetLocks.contains( dataSetLockService.getDataSetLock( idAA ) ) );
- assertTrue( dataSetLocks.contains( dataSetLockService.getDataSetLock( idBB ) ) );
- assertTrue( dataSetLocks.contains( dataSetLockService.getDataSetLock( idCC ) ) );
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.java'
--- dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.java 2012-02-16 12:58:37 +0000
@@ -35,6 +35,7 @@
import java.util.Collection;
+import org.hisp.dhis.DhisSpringTest;
import org.junit.Test;
/**
@@ -42,15 +43,29 @@
* @version $Id$
*/
public class SqlViewServiceTest
- extends SqlViewTest
+ extends DhisSpringTest
{
+ private SqlViewService sqlViewService;
+
+ protected static final String SQL1 = "SELECT * FROM _categorystructure;; ; ;;; ;; ; ";
+
+ protected static final String SQL2 = "SELECT COUNT(_ous.*) AS so_dem FROM _orgunitstructure AS _ous";
+
+ protected static final String SQL3 = "SELECT COUNT(_cocn.*) AS so_dem, _icgss.indicatorid AS in_id"
+ + "FROM _indicatorgroupsetstructure AS _icgss, _categoryoptioncomboname AS _cocn "
+ + "GROUP BY _icgss.indicatorid;";
+
+ protected static final String SQL4 = "SELECT de.name, dv.sourceid, dv.value, p.startdate "
+ + "FROM dataelement AS de, datavalue AS dv, period AS p "
+ + "WHERE de.dataelementid=dv.dataelementid "
+ + "AND dv.periodid=p.periodid LIMIT 10";
+
@Override
public void setUpTest()
- throws Exception
{
- setUpSqlViewTest();
+ sqlViewService = (SqlViewService) getBean( SqlViewService.ID );
}
-
+
// -------------------------------------------------------------------------
// Supportive methods
// -------------------------------------------------------------------------
@@ -69,8 +84,8 @@
@Test
public void testAddSqlView()
{
- SqlView sqlViewA = createSqlView( 'A', sql1 );
- SqlView sqlViewB = createSqlView( 'B', sql2 );
+ SqlView sqlViewA = createSqlView( 'A', SQL1 );
+ SqlView sqlViewB = createSqlView( 'B', SQL2 );
int idA = sqlViewService.saveSqlView( sqlViewA );
int idB = sqlViewService.saveSqlView( sqlViewB );
@@ -79,22 +94,22 @@
sqlViewB = sqlViewService.getSqlView( idB );
assertEquals( idA, sqlViewA.getId() );
- assertEq( 'A', sqlViewA, sql1 );
+ assertEq( 'A', sqlViewA, SQL1 );
assertEquals( idB, sqlViewB.getId() );
- assertEq( 'B', sqlViewB, sql2 );
+ assertEq( 'B', sqlViewB, SQL2 );
}
@Test
public void testUpdateSqlView()
{
- SqlView sqlView = createSqlView( 'A', sql1 );
+ SqlView sqlView = createSqlView( 'A', SQL1 );
int id = sqlViewService.saveSqlView( sqlView );
sqlView = sqlViewService.getSqlView( id );
- assertEq( 'A', sqlView, sql1 );
+ assertEq( 'A', sqlView, SQL1 );
sqlView.setName( "SqlViewC" );
@@ -108,8 +123,8 @@
@Test
public void testDeleteAndGetSqlView()
{
- SqlView sqlViewA = createSqlView( 'A', sql3 );
- SqlView sqlViewB = createSqlView( 'B', sql4 );
+ SqlView sqlViewA = createSqlView( 'A', SQL3 );
+ SqlView sqlViewB = createSqlView( 'B', SQL4 );
int idA = sqlViewService.saveSqlView( sqlViewA );
int idB = sqlViewService.saveSqlView( sqlViewB );
@@ -132,8 +147,8 @@
public void testGetSqlViewByName()
throws Exception
{
- SqlView sqlViewA = createSqlView( 'A', sql1 );
- SqlView sqlViewB = createSqlView( 'B', sql2 );
+ SqlView sqlViewA = createSqlView( 'A', SQL1 );
+ SqlView sqlViewB = createSqlView( 'B', SQL2 );
int idA = sqlViewService.saveSqlView( sqlViewA );
int idB = sqlViewService.saveSqlView( sqlViewB );
@@ -146,10 +161,10 @@
@Test
public void testGetAllSqlViews()
{
- SqlView sqlViewA = createSqlView( 'A', sql1 );
- SqlView sqlViewB = createSqlView( 'B', sql2 );
- SqlView sqlViewC = createSqlView( 'C', sql3 );
- SqlView sqlViewD = createSqlView( 'D', sql4 );
+ SqlView sqlViewA = createSqlView( 'A', SQL1 );
+ SqlView sqlViewB = createSqlView( 'B', SQL2 );
+ SqlView sqlViewC = createSqlView( 'C', SQL3 );
+ SqlView sqlViewD = createSqlView( 'D', SQL4 );
sqlViewService.saveSqlView( sqlViewA );
sqlViewService.saveSqlView( sqlViewB );
@@ -167,7 +182,7 @@
@Test
public void testMakeUpForQueryStatement()
{
- SqlView sqlViewA = createSqlView( 'A', sql1 );
+ SqlView sqlViewA = createSqlView( 'A', SQL1 );
sqlViewA.setSqlQuery( sqlViewService.makeUpForQueryStatement( sqlViewA.getSqlQuery() ) );
@@ -183,8 +198,8 @@
@Test
public void testSetUpViewTableName()
{
- SqlView sqlViewC = createSqlView( 'C', sql3 );
- SqlView sqlViewD = createSqlView( 'D', sql4 );
+ SqlView sqlViewC = createSqlView( 'C', SQL3 );
+ SqlView sqlViewD = createSqlView( 'D', SQL4 );
sqlViewService.saveSqlView( sqlViewC );
sqlViewService.saveSqlView( sqlViewD );
@@ -200,10 +215,10 @@
@Test
public void testGetAllSqlViewNames()
{
- SqlView sqlViewA = createSqlView( 'A', sql4 );
- SqlView sqlViewB = createSqlView( 'B', sql4 );
- SqlView sqlViewC = createSqlView( 'C', sql4 );
- SqlView sqlViewD = createSqlView( 'D', sql4 );
+ SqlView sqlViewA = createSqlView( 'A', SQL4 );
+ SqlView sqlViewB = createSqlView( 'B', SQL4 );
+ SqlView sqlViewC = createSqlView( 'C', SQL4 );
+ SqlView sqlViewD = createSqlView( 'D', SQL4 );
sqlViewService.saveSqlView( sqlViewA );
sqlViewService.saveSqlView( sqlViewB );
=== removed file 'dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewTest.java'
--- dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewTest.java 2010-10-04 08:56:54 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewTest.java 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
-package org.hisp.dhis.sqlview;
-
-/*
- * Copyright (c) 2004-2008, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.DhisSpringTest;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id$
- */
-public abstract class SqlViewTest
- extends DhisSpringTest
-{
- protected SqlViewService sqlViewService;
-
- protected static final String sql1 = "SELECT * FROM _categorystructure;; ; ;;; ;; ; ";
-
- protected static final String sql2 = "SELECT COUNT(_ous.*) AS so_dem FROM _orgunitstructure AS _ous";
-
- protected static final String sql3 = "SELECT COUNT(_cocn.*) AS so_dem, _icgss.indicatorid AS in_id"
- + "FROM _indicatorgroupsetstructure AS _icgss, _categoryoptioncomboname AS _cocn "
- + "GROUP BY _icgss.indicatorid;";
-
- protected static final String sql4 = "SELECT de.name, dv.sourceid, dv.value, p.startdate "
- + "FROM dataelement AS de, datavalue AS dv, period AS p "
- + "WHERE de.dataelementid=dv.dataelementid "
- + "AND dv.periodid=p.periodid LIMIT 10";
-
- public void setUpSqlViewTest()
- throws Exception
- {
- sqlViewService = (SqlViewService) getBean( SqlViewService.ID );
- }
-}
=== removed directory 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking'
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/DefaultLockingManager.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/DefaultLockingManager.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/DefaultLockingManager.java 1970-01-01 00:00:00 +0000
@@ -1,167 +0,0 @@
-package org.hisp.dhis.importexport.locking;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.datalock.DataSetLockService;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.importexport.mapping.ObjectMappingGenerator;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class DefaultLockingManager
- implements LockingManager
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private ObjectMappingGenerator objectMappingGenerator;
-
- public void setObjectMappingGenerator( ObjectMappingGenerator objectMappingGenerator )
- {
- this.objectMappingGenerator = objectMappingGenerator;
- }
-
- private DataSetService dataSetService;
-
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
- }
-
- private DataElementService dataElementService;
-
- public void setDataElementService( DataElementService dataElementService )
- {
- this.dataElementService = dataElementService;
- }
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- private OrganisationUnitService organisationUnitService;
-
- public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
-
- private DataSetLockService dataSetLockService;
-
- public void setDataSetLockService( DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
- // -------------------------------------------------------------------------
- // LockingManager implementation
- // -------------------------------------------------------------------------
-
- @Transactional
- public boolean currentImportContainsLockedData()
- {
- Collection<Period> periods =
- periodService.getPeriods( objectMappingGenerator.getPeriodMapping( false ).values() );
-
- Collection<OrganisationUnit> organisationUnits =
- organisationUnitService.getOrganisationUnits( objectMappingGenerator.getOrganisationUnitMapping( false ).values() );
-
- Collection<DataSet> dataSets = getRelevantDataSets();
-
- // TODO improve performance by using direct JDBC or load Maps into memory
-
- for ( DataSet dataSet : dataSets )
- {
- for ( Period period : periods )
- {
- for ( OrganisationUnit unit : organisationUnits )
- {
- if ( dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, period, unit ) != null )
- {
- return true;
- }
- }
- }
- }
-
- return false;
- }
-
- // -------------------------------------------------------------------------
- // Supportive methods
- // -------------------------------------------------------------------------
-
- /**
- * Returns a Collection of DataSets where the relevant DataElements
- * has intersecting elements.
- */
- private Collection<DataSet> getRelevantDataSets()
- {
- Collection<DataElement> dataElements =
- dataElementService.getDataElements( objectMappingGenerator.getDataElementMapping( false ).values() );
-
- Collection<DataSet> dataSets = new ArrayList<DataSet>();
-
- for ( DataSet dataSet : dataSetService.getAllDataSets() )
- {
- if ( intersects( dataSet.getDataElements(), dataElements ) )
- {
- dataSets.add( dataSet );
- }
- }
-
- return dataSets;
- }
-
- /**
- * Tests whether the first Collection has intersecting elements with the
- * second Collection.
- */
- private boolean intersects( Collection<?> collection1, Collection<?> collection2 )
- {
- return CollectionUtils.intersection( collection1, collection2 ).size() > 0;
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/LockingManager.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/LockingManager.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/locking/LockingManager.java 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-package org.hisp.dhis.importexport.locking;
-
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public interface LockingManager
-{
- boolean currentImportContainsLockedData();
-}
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml 2012-01-05 20:39:23 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml 2012-02-16 12:58:37 +0000
@@ -334,19 +334,6 @@
<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
</bean>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- Locking -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <bean id="org.hisp.dhis.importexport.locking.LockingManager" class="org.hisp.dhis.importexport.locking.DefaultLockingManager">
- <property name="objectMappingGenerator" ref="org.hisp.dhis.importexport.mapping.ObjectMappingGenerator" />
- <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
- <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
- </bean>
-
<bean id="org.hisp.dhis.importexport.dxf2.service.DataValueSetService" class="org.hisp.dhis.importexport.dxf2.service.DataValueSetService">
<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2011-11-04 11:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/FacilityReportingServiceImpl.java 2012-02-16 12:58:37 +0000
@@ -86,8 +86,6 @@
private org.hisp.dhis.i18n.I18nService i18nService;
- private org.hisp.dhis.datalock.DataSetLockService dataSetLockService;
-
private org.hisp.dhis.mobile.service.ModelMapping modelMapping;
private CompleteDataSetRegistrationService registrationService;
@@ -311,13 +309,6 @@
log.info( "Recieved data value set for: " + unit.getName() + ", " + dataSet.getName() + ", "
+ period.getIsoDate() );
- if ( dataSetLocked( unit, dataSet, period ) )
- {
- log.info( "Failed to save data value set: " + unit.getName() + ", " + dataSet.getName() + ", "
- + period.getIsoDate() + " - Data value set locked." );
- throw NotAllowedException.DATASET_LOCKED;
- }
-
Map<Integer, org.hisp.dhis.dataelement.DataElement> dataElementMap = getDataElementIdMapping( dataSet );
for ( DataValue dataValue : dataSetValue.getDataValues() )
@@ -409,11 +400,6 @@
// Supportive method
// -------------------------------------------------------------------------
- private boolean dataSetLocked( OrganisationUnit unit, org.hisp.dhis.dataset.DataSet dataSet, Period selectedPeriod )
- {
- return dataSetLockService.getDataSetLockByDataSetPeriodAndSource( dataSet, selectedPeriod, unit ) != null;
- }
-
private boolean emptyString( String value )
{
return value == null || value.trim().isEmpty();
@@ -474,12 +460,6 @@
}
@Required
- public void setDataSetLockService( org.hisp.dhis.datalock.DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
- @Required
public void setModelMapping( org.hisp.dhis.mobile.service.ModelMapping modelMapping )
{
this.modelMapping = modelMapping;
=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml 2012-02-11 13:58:02 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml 2012-02-16 12:58:37 +0000
@@ -12,7 +12,6 @@
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
- <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
<property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
<property name="modelMapping" ref="org.hisp.dhis.mobile.service.ModelMapping" />
</bean>
=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.java'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/dbms/HibernateDbmsManager.java 2012-02-16 12:58:37 +0000
@@ -78,6 +78,7 @@
emptyTable( "importobject" );
emptyTable( "importdatavalue" );
emptyTable( "constant" );
+ emptyTable( "sqlview" );
emptyTable( "datavalue_audit" );
emptyTable( "datavalue" );
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2012-02-16 12:58:37 +0000
@@ -53,7 +53,6 @@
import org.hisp.dhis.dataelement.DataElementGroupSet;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.dataentryform.DataEntryFormService;
-import org.hisp.dhis.datalock.DataSetLock;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
@@ -929,30 +928,6 @@
/**
* @param uniqueCharacter A unique character to identify the object.
- * @param dataSet
- * @param period
- * @param sources
- * @param storedBy
- * @param timestamp
- *
- * @return a dataSetLock instance
- */
- protected static DataSetLock createDataSetLock( DataSet dataSet, Period period, Set<OrganisationUnit> sources,
- String storedBy, Date timestamp )
- {
- DataSetLock dataSetLock = new DataSetLock();
-
- dataSetLock.setDataSet( dataSet );
- dataSetLock.setPeriod( period );
- dataSetLock.setSources( sources );
- dataSetLock.setStoredBy( storedBy );
- dataSetLock.setTimestamp( timestamp );
-
- return dataSetLock;
- }
-
- /**
- * @param uniqueCharacter A unique character to identify the object.
*
* @return a concept instance
*/
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java 2012-02-16 12:07:10 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/GetDataValuesForDataSetAction.java 2012-02-16 12:58:37 +0000
@@ -27,8 +27,9 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.datalock.DataSetLockService;
+import java.util.Collection;
+import java.util.Date;
+
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
@@ -42,8 +43,7 @@
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodType;
-import java.util.Collection;
-import java.util.Date;
+import com.opensymphony.xwork2.Action;
/**
* @author Lars Helge Overland
@@ -82,14 +82,7 @@
{
this.registrationService = registrationService;
}
-
- private DataSetLockService dataSetLockService;
-
- public void setDataSetLockService( DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
+
private OrganisationUnitService organisationUnitService;
public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -191,18 +184,6 @@
minMaxDataElements = minMaxDataElementService.getMinMaxDataElements( organisationUnit, dataSet.getDataElements() );
// ---------------------------------------------------------------------
- // Data locking info
- // ---------------------------------------------------------------------
-
- if ( dataSet != null && period != null && organisationUnit != null )
- {
- if ( dataSetService.isLocked( organisationUnit, dataSet, period ) )
- {
- locked = true;
- }
- }
-
- // ---------------------------------------------------------------------
// Data set completeness info
// ---------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2012-02-16 12:07:10 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2012-02-16 12:58:37 +0000
@@ -36,7 +36,6 @@
<property name="minMaxDataElementService" ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
<property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
- <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java 2012-02-15 13:19:34 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java 2012-02-16 12:58:37 +0000
@@ -28,8 +28,6 @@
import com.opensymphony.xwork2.Action;
import org.apache.commons.lang.Validate;
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockService;
import org.hisp.dhis.dataset.CompleteDataSetRegistration;
import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
import org.hisp.dhis.dataset.DataSet;
@@ -69,13 +67,6 @@
this.dataSetService = dataSetService;
}
- private DataSetLockService dataSetLockService;
-
- public void setDataSetLockService( DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
private CompleteDataSetRegistrationService registrationService;
public void setRegistrationService( CompleteDataSetRegistrationService registrationService )
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2012-01-22 19:37:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2012-02-16 12:58:37 +0000
@@ -27,8 +27,15 @@
package org.hisp.dhis.light.dataentry.action;
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionContext;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.struts2.ServletActionContext;
@@ -37,9 +44,11 @@
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockService;
-import org.hisp.dhis.dataset.*;
+import org.hisp.dhis.dataset.CompleteDataSetRegistration;
+import org.hisp.dhis.dataset.CompleteDataSetRegistrationService;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.Section;
import org.hisp.dhis.datavalue.DataValue;
import org.hisp.dhis.datavalue.DataValueService;
import org.hisp.dhis.datavalue.DeflatedDataValue;
@@ -52,8 +61,8 @@
import org.hisp.dhis.user.CurrentUserService;
import org.hisp.dhis.util.ContextUtils;
-import javax.servlet.http.HttpServletRequest;
-import java.util.*;
+import com.opensymphony.xwork2.Action;
+import com.opensymphony.xwork2.ActionContext;
/**
* @author mortenoh
@@ -107,13 +116,6 @@
this.dataSetService = dataSetService;
}
- private DataSetLockService dataSetLockService;
-
- public void setDataSetLockService( DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
private CompleteDataSetRegistrationService registrationService;
public void setRegistrationService( CompleteDataSetRegistrationService registrationService )
@@ -284,9 +286,6 @@
dataSet = dataSetService.getDataSet( dataSetId );
- // this should never happen, but validate that that dataset is not locked
- Validate.isTrue( !dataSetLocked( organisationUnit, dataSet, period ) );
-
String storedBy = currentUserService.getCurrentUsername();
if ( StringUtils.isBlank( storedBy ) )
@@ -475,17 +474,4 @@
return SUCCESS;
}
-
- private boolean dataSetLocked( OrganisationUnit organisationUnit, DataSet dataSet, Period period )
- {
- // HACK workaround since get dataSetLock by unit/dataSet/period fails
- DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period );
-
- if ( dataSetLock != null && dataSetLock.getSources().contains( organisationUnit ) )
- {
- return true;
- }
-
- return false;
- }
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2012-02-02 20:01:36 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2012-02-16 12:58:37 +0000
@@ -48,7 +48,6 @@
<property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
<property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
</bean>
@@ -89,7 +88,6 @@
<property name="categoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
<property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
<property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
=== removed directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock'
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/CollectiveDataLockingAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/CollectiveDataLockingAction.java 2011-04-22 17:02:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/CollectiveDataLockingAction.java 1970-01-01 00:00:00 +0000
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.dataadmin.action.lock;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.hisp.dhis.datalock.DataSetLockService;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.oust.manager.SelectionTreeManager;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.user.CurrentUserService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Brajesh Murari
- * @author Dang Duy Hieu
- * @version $Id$
- */
-public class CollectiveDataLockingAction
- implements Action
-{
- Collection<Period> periods = new ArrayList<Period>();
-
- Collection<DataSet> dataSets = new ArrayList<DataSet>();
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SelectionTreeManager selectionTreeManager;
-
- public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
- {
- this.selectionTreeManager = selectionTreeManager;
- }
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- private DataSetService dataSetService;
-
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
- }
-
- private DataSetLockService dataSetLockService;
-
- public void setDataSetLockService( DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
- private CurrentUserService currentUserService;
-
- public void setCurrentUserService( CurrentUserService currentUserService )
- {
- this.currentUserService = currentUserService;
- }
-
- // -------------------------------------------------------------------------
- // I18n
- // -------------------------------------------------------------------------
-
- private I18n i18n;
-
- public void setI18n( I18n i18n )
- {
- this.i18n = i18n;
- }
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private Collection<Integer> selectedPeriods = new ArrayList<Integer>();
-
- public void setSelectedPeriods( Collection<Integer> selectedPeriods )
- {
- this.selectedPeriods = selectedPeriods;
- }
-
- private Collection<Integer> selectedDataSets = new ArrayList<Integer>();
-
- public void setSelectedDataSets( Collection<Integer> selectedDataSets )
- {
- this.selectedDataSets = selectedDataSets;
- }
-
- private boolean selectBetweenLockUnlock;
-
- public void setSelectBetweenLockUnlock( boolean selectBetweenLockUnlock )
- {
- this.selectBetweenLockUnlock = selectBetweenLockUnlock;
- }
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private String message;
-
- public String getMessage()
- {
- return message;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- for ( Integer periodId : selectedPeriods )
- {
- periods.add( periodService.getPeriod( periodId.intValue() ) );
- }
-
- for ( Integer dataSetId : selectedDataSets )
- {
- dataSets.add( dataSetService.getDataSet( dataSetId.intValue() ) );
- }
-
- String currentUserName = currentUserService.getCurrentUsername();
-
- Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager.getSelectedOrganisationUnits();
-
- this.executeCollectiveDataLock( new HashSet<OrganisationUnit>( selectedOrganisationUnits ), currentUserName );
-
- return SUCCESS;
- }
-
- // -------------------------------------------------------------------------
- // Supportive methods
- // -------------------------------------------------------------------------
-
- private void executeCollectiveDataLock( Set<OrganisationUnit> sources, String currentUserName )
- {
- if ( selectBetweenLockUnlock )
- {
- dataSetLockService.applyCollectiveDataLock( dataSets, periods, sources, currentUserName );
-
- message = i18n.getString( "information_successfully_locked" );
- }
- else
- {
- dataSetLockService.removeCollectiveDataLock( dataSets, periods, sources, currentUserName );
-
- message = i18n.getString( "information_successfully_unlocked" );
- }
- }
-}
\ No newline at end of file
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetDataSetsForPeriodTypeAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetDataSetsForPeriodTypeAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetDataSetsForPeriodTypeAction.java 1970-01-01 00:00:00 +0000
@@ -1,94 +0,0 @@
-package org.hisp.dhis.dataadmin.action.lock;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.period.PeriodService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author
- * @version $Id$
- */
-public class GetDataSetsForPeriodTypeAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataSetService dataSetService;
-
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
- }
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- // -------------------------------------------------------------------------
- // Input/output
- // -------------------------------------------------------------------------
-
- private String periodType;
-
- public void setPeriodType( String periodType )
- {
- this.periodType = periodType;
- }
-
- private Collection<DataSet> dataSets = new ArrayList<DataSet>();
-
- public Collection<DataSet> getDataSets()
- {
- return dataSets;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- if ( periodType != null && !periodType.isEmpty() )
- {
- dataSets = dataSetService.getAssignedDataSetsByPeriodType( periodService.getPeriodTypeByName( periodType ) );
- }
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodTypesAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodTypesAction.java 2011-05-30 07:01:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodTypesAction.java 1970-01-01 00:00:00 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.dataadmin.action.lock;
-
-import java.util.Collection;
-
-import org.hisp.dhis.oust.manager.SelectionTreeManager;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-public class GetPeriodTypesAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- private SelectionTreeManager selectionTreeManager;
-
- public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
- {
- this.selectionTreeManager = selectionTreeManager;
- }
- // -------------------------------------------------------------------------
- // Input/output
- // -------------------------------------------------------------------------
-
- private Collection<PeriodType> periodTypes;
-
- public Collection<PeriodType> getPeriodTypes()
- {
- return periodTypes;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- periodTypes = periodService.getAllPeriodTypes();
-
- selectionTreeManager.clearSelectedOrganisationUnits();
-
- return SUCCESS;
- }
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/GetPeriodsForLockAction.java 1970-01-01 00:00:00 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package org.hisp.dhis.dataadmin.action.lock;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
-import org.hisp.dhis.i18n.I18nFormat;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.period.comparator.PeriodComparator;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-public class GetPeriodsForLockAction
- implements Action
-{
- private final static String ALL = "ALL";
-
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- private I18nFormat format;
-
- public void setFormat( I18nFormat format )
- {
- this.format = format;
- }
-
- // -------------------------------------------------------------------------
- // Input & output
- // -------------------------------------------------------------------------
-
- private String name;
-
- public String getName()
- {
- return name;
- }
-
- public void setName( String name )
- {
- this.name = name;
- }
-
- private List<Period> periods = new ArrayList<Period>();
-
- public List<Period> getPeriods()
- {
- return periods;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- if ( name == null || name.equals( ALL ) )
- {
- Collection<PeriodType> periodTypes = periodService.getAllPeriodTypes();
-
- for ( PeriodType type : periodTypes )
- {
- periods.addAll( periodService.getPeriodsByPeriodType( type ) );
- }
- }
- else
- {
- PeriodType periodType = periodService.getPeriodTypeByName( name );
-
- List<Period> allPeriodsOfSelectedPeriodType = new ArrayList<Period>( periodService
- .getPeriodsByPeriodType( periodType ) );
-
- for ( Period p : allPeriodsOfSelectedPeriodType )
- {
- if ( !(p.getStartDate().compareTo( new Date() ) > 0) )
- {
- periods.add( p );
- }
- }
- }
-
- for ( Period period : periods )
- {
- period.setName( format.formatPeriod( period ) );
- }
-
- Collections.sort( periods, new PeriodComparator() );
-
- return SUCCESS;
- }
-
-}
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/UpdateLockedDataSets.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/UpdateLockedDataSets.java 2011-11-23 18:07:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/UpdateLockedDataSets.java 1970-01-01 00:00:00 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.dataadmin.action.lock;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockService;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
-import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Brajesh Murari
- * @version $Id$
- */
-public class UpdateLockedDataSets
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private DataSetService dataSetService;
-
- public void setDataSetService( DataSetService dataSetService )
- {
- this.dataSetService = dataSetService;
- }
-
- private PeriodService periodService;
-
- public void setPeriodService( PeriodService periodService )
- {
- this.periodService = periodService;
- }
-
- private DataSetLockService dataSetLockService;
-
- public void setDataSetLockService( DataSetLockService dataSetLockService )
- {
- this.dataSetLockService = dataSetLockService;
- }
-
- // -------------------------------------------------------------------------
- // Input/output
- // -------------------------------------------------------------------------
-
- private Collection<String> unlockedDataSets = new ArrayList<String>();
-
- public void setUnlockedDataSets( Collection<String> unlockedDataSets )
- {
- this.unlockedDataSets = unlockedDataSets;
- }
-
- public Collection<String> getUnlockedDataSets()
- {
- return unlockedDataSets;
- }
-
- private Integer periodId;
-
- public void setPeriodId( Integer periodId )
- {
- this.periodId = periodId;
- }
-
- public Integer getPeriodId()
- {
- return periodId;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- throws Exception
- {
- Period period = new Period();
-
- if ( periodId != null )
- {
- period = periodService.getPeriod( periodId );
- }
- else
- {
- return SUCCESS;
- }
-
- period = periodService.getPeriod( periodId.intValue() );
-
- // -------------------------------------------------------------------------------
- // For data set movement from locked to unlocked data set list box and
- // vice versa according to lock status
- // -------------------------------------------------------------------------------
-
- for ( String id : unlockedDataSets )
- {
- DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( id ) );
- DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period );
-
- if ( dataSetLock != null )
- {
- dataSetService.updateDataSet( dataSet );
- dataSetLock.getSources().removeAll( dataSetLock.getSources() );
- dataSetLockService.deleteDataSetLock( dataSetLock );
- }
- }
-
- return SUCCESS;
- }
-}
-
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/ValidateCollectiveDataLockingAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/ValidateCollectiveDataLockingAction.java 2010-10-05 10:04:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lock/ValidateCollectiveDataLockingAction.java 1970-01-01 00:00:00 +0000
@@ -1,129 +0,0 @@
-/*
- * Copyright (c) 2004-2009, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.hisp.dhis.dataadmin.action.lock;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.oust.manager.SelectionTreeManager;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Dang Duy Hieu
- * @version $Id$
- */
-public class ValidateCollectiveDataLockingAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SelectionTreeManager selectionTreeManager;
-
- public void setSelectionTreeManager( SelectionTreeManager selectionTreeManager )
- {
- this.selectionTreeManager = selectionTreeManager;
- }
-
- // -------------------------------------------------------------------------
- // I18n
- // -------------------------------------------------------------------------
-
- private I18n i18n;
-
- public void setI18n( I18n i18n )
- {
- this.i18n = i18n;
- }
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private Collection<Integer> selectedPeriods = new ArrayList<Integer>();
-
- public void setSelectedPeriods( Collection<Integer> selectedPeriods )
- {
- this.selectedPeriods = selectedPeriods;
- }
-
- private Collection<Integer> selectedDataSets = new ArrayList<Integer>();
-
- public void setSelectedDataSets( Collection<Integer> selectedDataSets )
- {
- this.selectedDataSets = selectedDataSets;
- }
-
- // -------------------------------------------------------------------------
- // Input
- // -------------------------------------------------------------------------
-
- private String message;
-
- public String getMessage()
- {
- return message;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- public String execute()
- {
- if ( selectedPeriods == null || selectedPeriods.size() == 0 )
- {
- message = i18n.getString( "period_not_selected" );
-
- return INPUT;
- }
-
- if ( selectedDataSets == null || selectedDataSets.size() == 0 )
- {
- message = i18n.getString( "dataset_not_selected" );
-
- return INPUT;
- }
-
- Collection<OrganisationUnit> selectedUnits = new HashSet<OrganisationUnit>();
- selectedUnits = selectionTreeManager.getSelectedOrganisationUnits();
-
- if ( selectedUnits == null || selectedUnits.size() == 0 )
- {
- message = i18n.getString( "organisation_not_selected" );
-
- return INPUT;
- }
-
- return SUCCESS;
- }
-}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriodsAction.java 2012-02-08 13:38:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriodsAction.java 2012-02-16 12:58:37 +0000
@@ -27,8 +27,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-import com.opensymphony.xwork2.Action;
-import org.hisp.dhis.dataset.CompleteDataSetRegistration;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
import org.hisp.dhis.dataset.DataSet;
import org.hisp.dhis.dataset.DataSetService;
import org.hisp.dhis.i18n.I18nFormat;
@@ -37,10 +40,7 @@
import org.hisp.dhis.system.filter.PastAndCurrentPeriodFilter;
import org.hisp.dhis.system.util.FilterUtils;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
+import com.opensymphony.xwork2.Action;
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2012-02-14 02:58:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2012-02-16 12:58:37 +0000
@@ -3,44 +3,6 @@
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
- <!-- Locking -->
-
- <bean id="org.hisp.dhis.dataadmin.action.lock.GetPeriodTypesAction"
- class="org.hisp.dhis.dataadmin.action.lock.GetPeriodTypesAction"
- scope="prototype">
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
- </bean>
-
- <bean id="org.hisp.dhis.dataadmin.action.lock.GetDataSetsForPeriodTypeAction"
- class="org.hisp.dhis.dataadmin.action.lock.GetDataSetsForPeriodTypeAction"
- scope="prototype">
- <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- </bean>
-
- <bean id="org.hisp.dhis.dataadmin.action.lock.CollectiveDataLockingAction"
- class="org.hisp.dhis.dataadmin.action.lock.CollectiveDataLockingAction"
- scope="prototype">
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
- <property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
- <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
- <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
- </bean>
-
- <bean id="org.hisp.dhis.dataadmin.action.lock.GetPeriodsForLockAction"
- class="org.hisp.dhis.dataadmin.action.lock.GetPeriodsForLockAction"
- scope="prototype">
- <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
- </bean>
-
- <bean id="org.hisp.dhis.dataadmin.action.lock.ValidateCollectiveDataLockingAction"
- class="org.hisp.dhis.dataadmin.action.lock.ValidateCollectiveDataLockingAction"
- scope="prototype">
- <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
- </bean>
-
<!-- Maintenance -->
<bean id="org.hisp.dhis.dataadmin.action.maintenance.PerformMaintenanceAction"
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2012-02-14 02:58:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml 2012-02-16 12:58:37 +0000
@@ -14,56 +14,6 @@
<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
</action>
- <!-- Locking -->
-
- <action name="displayLockingForm" class="org.hisp.dhis.dataadmin.action.lock.GetPeriodTypesAction">
- <result name="success" type="velocity">/main.vm</result>
- <param name="page">/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm</param>
- <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
- <param name="javascripts">../dhis-web-commons/oust/oust.js,
- javascript/datasetLockReport.js,
- javascript/collectiveDataLockingForm.js</param>
- </action>
-
- <action name="getDataSetsForPeriodType" class="org.hisp.dhis.dataadmin.action.lock.GetDataSetsForPeriodTypeAction">
- <result name="success" type="velocity">
- /dhis-web-maintenance-dataadmin/responseDataSet.vm
- </result>
- <param name="onExceptionReturn">plainTextError</param>
-
- </action>
-
- <action name="collectiveDataLocking" class="org.hisp.dhis.dataadmin.action.lock.CollectiveDataLockingAction">
- <result name="success" type="velocity">/main.vm </result>
- <param name="page">/dhis-web-maintenance-dataadmin/collectiveDataLockingStatus.vm</param>
- <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
- <param name="requiredAuthorities">F_DATAADMIN_LOCK</param>
- </action>
-
- <action name="collectiveDataLockingForUnlocking" class="org.hisp.dhis.dataadmin.action.lock.CollectiveDataLockingAction">
- <result name="success" type="velocity">/main.vm </result>
- <param name="page">/dhis-web-maintenance-dataadmin/collectiveDataLockingStatus.vm</param>
- <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
- <param name="requiredAuthorities">F_DATAADMIN_UNLOCK</param>
- </action>
-
- <action name="getPeriodsForLock" class="org.hisp.dhis.dataadmin.action.lock.GetPeriodsForLockAction">
- <result name="success" type="velocity">
- /dhis-web-commons/ajax/xmlPeriods.vm
- </result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
- <action name="validateCollectiveDataLocking" class="org.hisp.dhis.dataadmin.action.lock.ValidateCollectiveDataLockingAction">
- <result name="success" type="velocity-json">
- /dhis-web-commons/ajax/jsonResponseSuccess.vm
- </result>
- <result name="input" type="velocity-json">
- /dhis-web-commons/ajax/jsonResponseInput.vm
- </result>
- <param name="onExceptionReturn">plainTextError</param>
- </action>
-
<!-- Maintenance -->
<action name="displayMaintenanceForm" class="org.hisp.dhis.dataadmin.action.NoAction">
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm 2011-03-29 07:05:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm 1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
-<script type="text/javascript">
- var i18n_organisation_unit_not_selected = '$encoder.jsEscape( $i18n.getString( "organisation_unit_not_selected" ) , "'")';
- var i18n_period_not_selected = '$encoder.jsEscape( $i18n.getString( "period_not_selected" ) , "'")';
- var i18n_dataset_not_selected = '$encoder.jsEscape( $i18n.getString( "dataset_not_selected" ) , "'")';
- var i18n_lock = '$encoder.jsEscape( $i18n.getString( "lock" ) , "'")';
- var i18n_unlock = '$encoder.jsEscape( $i18n.getString( "unlock" ) , "'")';
-</script>
-
-<h3>$i18n.getString( "data_locking_form" ) #openHelp( "dataLocking" )</h3>
-
-<form id="lockingForm" name="lockingForm" action="collectiveDataLocking.action" method="POST">
- <input type="hidden" id="selectBetweenLockUnlock" name="selectBetweenLockUnlock"/>
- <table>
- <tr>
- <td valign="top">
- <table valign="top">
- <tr><th>$i18n.getString( "period_type" )</th></tr>
- <tr>
- <td>
- <select id="periodTypeId" name="periodTypeId" style="min-width:325px" onchange="getPeriods()">
- <option value="">[ $i18n.getString( "select_period_type" ) ]</option>
- #foreach ( $periodType in $periodTypes )
- <option value="$periodType.name"#if( $currentPeriodTypeId == $type.name ) selected="selected"#end>$periodType.name</option>
- #end
- </select>
- </td>
- </tr>
-
- <tr><td> </td></tr>
-
- <tr><th>$i18n.getString( "available_periods" )</th><td></td><th>$i18n.getString( "selected_periods" )</th></tr>
-
- <tr>
- <td>
- <select id="availablePeriods" name="availablePeriods" multiple="multiple" style="min-width:325px;height:11.25em" disabled="true" ondblclick="moveSelectedById( this.id, 'selectedPeriods' )">
- </select>
- </td>
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString('move_selected')" style="width:50px" onclick="moveSelectedById( 'availablePeriods', 'selectedPeriods' )" /><br/>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" style="width:50px" onclick="moveSelectedById( 'selectedPeriods', 'availablePeriods' )" /><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="moveAllById( 'availablePeriods', 'selectedPeriods' )"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="moveAllById( 'selectedPeriods', 'availablePeriods' )"/>
- </td>
- <td>
- <select id="selectedPeriods" name="selectedPeriods" size="2" multiple="multiple" style="min-width:325px;height:11.25em" ondblclick="moveSelectedById( this.id, 'availablePeriods' )"></select>
- </td>
- </tr>
-
- <tr><td> </td></tr>
-
- <tr><th>$i18n.getString( "available_datasets" )</th><td></td><th>$i18n.getString( "selected_datasets" )</th></tr>
- <tr>
- <td>
- <select id="availableDataSets" name="availableDataSets" multiple="multiple" style="min-width:325px;height:12.5em" ondblclick="moveSelectedById( this.id, 'selectedDataSets' )" disabled="true"></select>
- </td>
- <td style="text-align:center">
- <input type="button" value=">" title="$i18n.getString('move_selected')" style="width:50px" onclick="moveSelectedById( 'availableDataSets', 'selectedDataSets' )" /><br/>
- <input type="button" value="<" title="$i18n.getString('remove_selected')" style="width:50px" onclick="moveSelectedById( 'selectedDataSets', 'availableDataSets' )" /><br/>
- <input type="button" value=">>" title="$i18n.getString('move_all')" style="width:50px" onclick="moveAllById( 'availableDataSets', 'selectedDataSets' )"/><br/>
- <input type="button" value="<<" title="$i18n.getString('remove_all')" style="width:50px" onclick="moveAllById( 'selectedDataSets', 'availableDataSets' )"/>
- </td>
- <td>
- <select id="selectedDataSets" name="selectedDataSets" size="2" multiple="multiple" style="min-width:325px;height:11.25em" ondblclick="moveSelectedById( this.id, 'availableDataSets' )"></select>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <td>#organisationUnitSelectionTree( true, true, false )</td>
- </tr>
- <tr></tr>
- <tr>
- <td>
- <input type="submit" id="lock" name="lock" onclick="setClickedButtonElementValue( true )" value="$i18n.getString( 'lock' )" style="width:10em" disabled="true" />
- #if( $auth.hasAccess( "dhis-web-maintenance-dataadmin", "collectiveDataLockingForUnlocking") )
- <input type="submit" id="unlock" name="unlock" onclick="setClickedButtonElementValue( false )" value="$i18n.getString( 'unlock' )" style="width:10em" disabled="true"/>
- #end
- </td>
- </tr>
- </table>
-</form>
-
-<span id="message"></span>
=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingStatus.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingStatus.vm 2011-03-28 15:28:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingStatus.vm 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
-
-<h3>$i18n.getString( "data_locking_form" ) #openHelp( "dataLocking" )</h3>
-
-<div align="left"><h3>$message</h3></div>
-
-<p>
- <input type="button" value="$i18n.getString( 'back' )" onclick="window.location.href='displayLockingForm.action'" style="width:100px" />
-</p>