← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5885: (wip) dataset lock exception ui (update is missing)

 

------------------------------------------------------------
revno: 5885
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-08 19:04:46 +0700
message:
  (wip) dataset lock exception ui (update is missing)
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetDataSets.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionListAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriods.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/RemoveLockExceptionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/UpdateLockExceptionAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addLockExceptionForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonDataSets.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonLockException.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/lockException.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateLockExceptionForm.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/LockException.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js
  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/org/hisp/dhis/dataadmin/i18n_module.properties
  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/webapp/dhis-web-maintenance-dataadmin/index.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java	2012-02-01 09:54:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSetService.java	2012-02-08 12:04:46 +0000
@@ -27,13 +27,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
-import java.util.List;
-
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.PeriodType;
 
+import java.util.Collection;
+import java.util.List;
+
 /**
  * @author Lars Helge Overland
  * @version $Id: DataSetService.java 6255 2008-11-10 16:01:24Z larshelg $
@@ -48,7 +48,7 @@
 
     /**
      * Adds a DataSet.
-     * 
+     *
      * @param dataSet The DataSet to add.
      * @return The generated unique identifier for this DataSet.
      */
@@ -56,21 +56,21 @@
 
     /**
      * Updates a DataSet.
-     * 
+     *
      * @param dataSet The DataSet to update.
      */
     void updateDataSet( DataSet dataSet );
 
     /**
      * Deletes a DataSet.
-     * 
+     *
      * @param dataSet The DataSet to delete.
      */
     void deleteDataSet( DataSet dataSet );
 
     /**
      * Get a DataSet
-     * 
+     *
      * @param id The unique identifier for the DataSet to get.
      * @return The DataSet with the given id or null if it does not exist.
      */
@@ -78,18 +78,18 @@
 
     /**
      * Get a DataSet
-     * 
-     * @param id The unique identifier for the DataSet to get.
+     *
+     * @param id               The unique identifier for the DataSet to get.
      * @param i18nDataElements whether to i18n the data elements of this data set.
-     * @param i18nIndicators whether to i18n the indicators of this data set.
-     * @param i18nOrgUnits whether to i18n the org units of this data set.
+     * @param i18nIndicators   whether to i18n the indicators of this data set.
+     * @param i18nOrgUnits     whether to i18n the org units of this data set.
      * @return The DataSet with the given id or null if it does not exist.
      */
     DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nIndicators, boolean i18nOrgUnits );
-    
+
     /**
      * Returns the DataSet with the given UID.
-     * 
+     *
      * @param uid the UID.
      * @return the DataSet with the given UID, or null if no match.
      */
@@ -97,7 +97,7 @@
 
     /**
      * Returns a DataSets with the given name.
-     * 
+     *
      * @param name The name.
      * @return A DataSet with the given name.
      */
@@ -105,7 +105,7 @@
 
     /**
      * Returns the DataSet with the given short name.
-     * 
+     *
      * @param shortName The short name.
      * @return The DataSet with the given short name.
      */
@@ -113,7 +113,7 @@
 
     /**
      * Returns the DataSet with the given code.
-     * 
+     *
      * @param shortName The code.
      * @return The DataSet with the given code.
      */
@@ -132,14 +132,14 @@
 
     /**
      * Get all DataSets.
-     * 
+     *
      * @return A collection containing all DataSets.
      */
     Collection<DataSet> getAllDataSets();
 
     /**
      * Gets all DataSets associated with the given PeriodType.
-     * 
+     *
      * @param periodType the PeriodType.
      * @return a collection of DataSets.
      */
@@ -147,7 +147,7 @@
 
     /**
      * Get all DataSets with corresponding identifiers.
-     * 
+     *
      * @param identifiers the collection of identifiers.
      * @return a collection of indicators.
      */
@@ -155,7 +155,7 @@
 
     /**
      * Get list of available ie. unassigned datasets.
-     * 
+     *
      * @return A List containing all avialable DataSets.
      */
     List<DataSet> getAvailableDataSets();
@@ -163,7 +163,7 @@
     /**
      * Get list of assigned (ie. which had corresponding dataentryform)
      * datasets.
-     * 
+     *
      * @return A List containing assigned DataSets.
      */
     List<DataSet> getAssignedDataSets();
@@ -171,7 +171,7 @@
     /**
      * Get list of assigned (ie. which had corresponding dataentryform) datasets
      * for specific period type.
-     * 
+     *
      * @return A List containing assigned DataSets for specific period type.
      */
     List<DataSet> getAssignedDataSetsByPeriodType( PeriodType periodType );
@@ -183,8 +183,8 @@
      * member of more than one data set, which period type being returned is
      * undefined. If null is passed as the second argument, all data sets will
      * be searched.
-     * 
-     * @param dataElement the data element to find the period type for.
+     *
+     * @param dataElement        the data element to find the period type for.
      * @param dataSetIdentifiers the data set identifiers to search through.
      * @return the period type of the given data element.
      */
@@ -193,7 +193,7 @@
     /**
      * Returns a distinct collection of data elements associated with the data
      * sets with the given corresponding data set identifiers.
-     * 
+     *
      * @param dataSetIdentifiers the data set identifiers.
      * @return a distinct collection of data elements.
      */
@@ -202,7 +202,7 @@
     /**
      * Returns a collection of data elements associated with the given
      * corresponding data set.
-     * 
+     *
      * @param dataSet the data set object.
      * @return a collection of data elements.
      */
@@ -227,4 +227,61 @@
     int getDataSetCount();
 
     Collection<DataSet> getDataSetsBetween( int first, int max );
+
+    // -------------------------------------------------------------------------
+    // DataSet LockExceptions
+    // -------------------------------------------------------------------------
+
+    /**
+     * Add new lock exception
+     *
+     * @param lockException LockException instance to add
+     * @return
+     */
+    public int addLockException( LockException lockException );
+
+    /**
+     * Update lock exception
+     *
+     * @param lockException LockException instance to update
+     */
+    public void updateLockException( LockException lockException );
+
+    /**
+     * Delete lock exception
+     *
+     * @param lockException LockException instance to delete
+     */
+    public void deleteLockException( LockException lockException );
+
+    /**
+     * Get LockException by ID
+     *
+     * @param id ID of LockException to get
+     * @return LockException with given ID, or null if not found
+     */
+    public LockException getLockException( int id );
+
+    /**
+     * Get number of LockExceptions in total
+     *
+     * @return Total count of LockExceptions
+     */
+    public int getLockExceptionCount();
+
+    /**
+     * Returns all lock exceptions
+     *
+     * @return List of all the lock exceptions
+     */
+    public Collection<LockException> getAllLockExceptions();
+
+    /**
+     * Get all LockExceptions withing a specific range
+     *
+     * @param first Index to start at
+     * @param max   Number of results wanted
+     * @return Collection of LockExceptions withing the range specificed
+     */
+    public Collection<LockException> getLockExceptionsBetween( int first, int max );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/LockException.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/LockException.java	2012-02-05 13:27:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/LockException.java	2012-02-08 12:04:46 +0000
@@ -48,6 +48,11 @@
 
     }
 
+    public String getName()
+    {
+        return dataSet.getName() + " - " + organisationUnit.getName() + " - " + period.getName();
+    }
+
     public int getId()
     {
         return id;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java	2012-02-01 09:54:34 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java	2012-02-08 12:04:46 +0000
@@ -27,15 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.i18n.I18nUtils.*;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
+import org.apache.commons.lang.Validate;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.dataelement.DataElement;
@@ -49,6 +41,10 @@
 import org.hisp.dhis.user.CurrentUserService;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.*;
+
+import static org.hisp.dhis.i18n.I18nUtils.*;
+
 /**
  * @author Lars Helge Overland
  * @version $Id: DefaultDataSetService.java 6255 2008-11-10 16:01:24Z larshelg $
@@ -70,6 +66,13 @@
         this.dataSetStore = dataSetStore;
     }
 
+    private LockExceptionStore lockExceptionStore;
+
+    public void setLockExceptionStore( LockExceptionStore lockExceptionStore )
+    {
+        this.lockExceptionStore = lockExceptionStore;
+    }
+
     private I18nService i18nService;
 
     public void setI18nService( I18nService service )
@@ -116,34 +119,34 @@
     {
         return i18n( i18nService, dataSetStore.get( id ) );
     }
-    
+
     public DataSet getDataSet( String uid )
     {
         return i18n( i18nService, dataSetStore.getByUid( uid ) );
     }
-    
+
     public DataSet getDataSet( int id, boolean i18nDataElements, boolean i18nIndicators, boolean i18nOrgUnits )
     {
         DataSet dataSet = getDataSet( id );
-        
+
         if ( i18nDataElements )
         {
             i18n( i18nService, dataSet.getDataElements() );
         }
-        
+
         if ( i18nIndicators )
         {
             i18n( i18nService, dataSet.getIndicators() );
         }
-        
+
         if ( i18nOrgUnits )
         {
             i18n( i18nService, dataSet.getSources() );
         }
-        
+
         return dataSet;
     }
-    
+
     public DataSet getDataSetByName( String name )
     {
         return i18n( i18nService, dataSetStore.getByName( name ) );
@@ -258,7 +261,7 @@
         List<DataSet> dataSetListByPeriodType = new ArrayList<DataSet>( getDataSetsByPeriodType( periodType ) );
 
         Iterator<DataSet> dataSetIterator = dataSetListByPeriodType.iterator();
-        while( dataSetIterator.hasNext() )
+        while ( dataSetIterator.hasNext() )
         {
             DataSet dataSet = dataSetIterator.next();
             if ( dataSet.getSources() == null || dataSet.getSources().size() == 0 )
@@ -269,7 +272,7 @@
 
         return dataSetListByPeriodType;
     }
-    
+
     public Collection<DataElement> getDistinctDataElements( Collection<Integer> dataSetIdentifiers )
     {
         Collection<DataSet> dataSets = getDataSets( dataSetIdentifiers );
@@ -287,13 +290,13 @@
     public Collection<DataElement> getDataElements( DataSet dataSet )
     {
         return i18n( i18nService, dataSet.getDataElements() );
-    }    
-    
-    public Collection<DataSet> getDataSetsForMobile( OrganisationUnit source ) 
+    }
+
+    public Collection<DataSet> getDataSetsForMobile( OrganisationUnit source )
     {
-        return i18n( i18nService, dataSetStore.getDataSetsForMobile(source) );		
+        return i18n( i18nService, dataSetStore.getDataSetsForMobile( source ) );
     }
-    
+
     public Collection<DataSet> getDataSetsForMobile()
     {
         return i18n( i18nService, dataSetStore.getDataSetsForMobile() );
@@ -322,4 +325,57 @@
     {
         return getObjectsBetweenByName( i18nService, dataSetStore, name, first, max );
     }
+
+    // -------------------------------------------------------------------------
+    // DataSet LockExceptions
+    // -------------------------------------------------------------------------
+
+    @Override
+    public int addLockException( LockException lockException )
+    {
+        Validate.notNull( lockException );
+
+        return lockExceptionStore.save( lockException );
+    }
+
+    @Override
+    public void updateLockException( LockException lockException )
+    {
+        Validate.notNull( lockException );
+
+        lockExceptionStore.update( lockException );
+    }
+
+    @Override
+    public void deleteLockException( LockException lockException )
+    {
+        Validate.notNull( lockException );
+
+        lockExceptionStore.delete( lockException );
+    }
+
+    @Override
+    public LockException getLockException( int id )
+    {
+        return lockExceptionStore.get( id );
+    }
+
+    @Override
+    public int getLockExceptionCount()
+    {
+        return lockExceptionStore.getCount();
+    }
+
+    @Override
+    public Collection<LockException> getAllLockExceptions()
+    {
+        return lockExceptionStore.getAll();
+    }
+
+    @Override
+    public Collection<LockException> getLockExceptionsBetween( int first, int max )
+    {
+        // FIXME extend lockExceptionStore to include HQL query for this
+        return getAllLockExceptions();
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2012-02-08 04:05:53 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2012-02-08 12:04:46 +0000
@@ -314,6 +314,7 @@
 
   <bean id="org.hisp.dhis.dataset.DataSetService" class="org.hisp.dhis.dataset.DefaultDataSetService">
     <property name="dataSetStore" ref="org.hisp.dhis.dataset.DataSetStore" />
+    <property name="lockExceptionStore" ref="org.hisp.dhis.dataset.LockExceptionStore" />
     <property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
     <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
   </bean>

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2011-08-19 11:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/oust/oust.js	2012-02-08 12:04:46 +0000
@@ -102,8 +102,9 @@
             unitIds[i] = json.selectedUnits[i].id;
 			selectedOrganisationUnit.push( unitIds[i] );	
         }
-		
+
         listenerFunction( unitIds );
+        jQuery("body").trigger("oust.selected", unitIds);
     }
 
     function getTagId( unitId )

=== added directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception'
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/AddLockExceptionAction.java	2012-02-08 12:04:46 +0000
@@ -0,0 +1,120 @@
+package org.hisp.dhis.dataadmin.action.lockexception;
+
+/*
+ * 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 com.opensymphony.xwork2.Action;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.LockException;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class AddLockExceptionAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private int organisationUnitId;
+
+    public void setOrganisationUnitId( int organisationUnitId )
+    {
+        this.organisationUnitId = organisationUnitId;
+    }
+
+    private int dataSetId;
+
+    public void setDataSetId( int dataSetId )
+    {
+        this.dataSetId = dataSetId;
+    }
+
+    private String periodId;
+
+    public void setPeriodId( String periodId )
+    {
+        this.periodId = periodId;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute() throws Exception
+    {
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
+        DataSet dataSet = dataSetService.getDataSet( dataSetId );
+        Period period = periodService.getPeriodByExternalId( periodId );
+
+        if ( organisationUnit == null || dataSet == null || period == null )
+        {
+            return ERROR;
+        }
+
+        LockException lockException = new LockException();
+        lockException.setOrganisationUnit( organisationUnit );
+        lockException.setDataSet( dataSet );
+        lockException.setPeriod( period );
+
+        dataSetService.addLockException( lockException );
+
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetDataSets.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetDataSets.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetDataSets.java	2012-02-08 12:04:46 +0000
@@ -0,0 +1,119 @@
+package org.hisp.dhis.dataadmin.action.lockexception;
+
+/*
+ * 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 com.opensymphony.xwork2.Action;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.user.CurrentUserService;
+import org.hisp.dhis.user.UserCredentials;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class GetDataSets
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private int id;
+
+    public void setId( int id )
+    {
+        this.id = id;
+    }
+
+    private List<DataSet> dataSets;
+
+    public List<DataSet> getDataSets()
+    {
+        return dataSets;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute() throws Exception
+    {
+        dataSets = getDataSetsForCurrentUser( id );
+
+        return SUCCESS;
+    }
+
+    public List<DataSet> getDataSetsForCurrentUser( int id )
+    {
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( id );
+
+        if ( organisationUnit == null )
+        {
+            return new ArrayList<DataSet>();
+        }
+
+        List<DataSet> dataSets = new ArrayList<DataSet>();
+
+        if ( organisationUnit.getDataSets() != null )
+        {
+            dataSets.addAll( organisationUnit.getDataSets() );
+        }
+
+        UserCredentials userCredentials = currentUserService.getCurrentUser().getUserCredentials();
+
+        if ( !userCredentials.isSuper() )
+        {
+            dataSets.retainAll( userCredentials.getAllDataSets() );
+        }
+
+        return dataSets;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionAction.java	2012-02-08 12:04:46 +0000
@@ -0,0 +1,88 @@
+package org.hisp.dhis.dataadmin.action.lockexception;
+
+/*
+ * 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 com.opensymphony.xwork2.Action;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.LockException;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class GetLockExceptionAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Integer id;
+
+    public void setId( Integer id )
+    {
+        this.id = id;
+    }
+
+    private LockException lockException;
+
+    public LockException getLockException()
+    {
+        return lockException;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute() throws Exception
+    {
+        if ( id != null )
+        {
+            lockException = dataSetService.getLockException( id );
+
+            if ( lockException == null )
+            {
+                return INPUT;
+            }
+        }
+
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionListAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetLockExceptionListAction.java	2012-02-08 12:04:46 +0000
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2004-2011, 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.lockexception;
+
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.LockException;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.paging.ActionPagingSupport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author mortenoh
+ */
+public class GetLockExceptionListAction
+    extends ActionPagingSupport<LockException>
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private List<LockException> lockExceptions;
+
+    public List<LockException> getLockExceptions()
+    {
+        return lockExceptions;
+    }
+
+    private String key;
+
+    public String getKey()
+    {
+        return key;
+    }
+
+    public void setKey( String key )
+    {
+        this.key = key;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute()
+    {
+        lockExceptions = new ArrayList<LockException>( dataSetService.getAllLockExceptions() );
+
+        for ( LockException lockException : lockExceptions )
+        {
+            lockException.getPeriod().setName( format.formatPeriod( lockException.getPeriod() ) );
+        }
+
+        if ( usePaging )
+        {
+            paging = createPaging( dataSetService.getLockExceptionCount() );
+            lockExceptions = lockExceptions.subList( paging.getStartPos(), paging.getEndPos() );
+        }
+
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriods.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriods.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/GetPeriods.java	2012-02-08 12:04:46 +0000
@@ -0,0 +1,125 @@
+package org.hisp.dhis.dataadmin.action.lockexception;
+
+/*
+ * 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 com.opensymphony.xwork2.Action;
+import org.hisp.dhis.dataset.CompleteDataSetRegistration;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.period.CalendarPeriodType;
+import org.hisp.dhis.period.Period;
+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;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class GetPeriods
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    private I18nFormat format;
+
+    public void setFormat( I18nFormat format )
+    {
+        this.format = format;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private int id;
+
+    public void setId( int id )
+    {
+        this.id = id;
+    }
+
+    private List<Period> periods;
+
+    public List<Period> getPeriods()
+    {
+        return periods;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute() throws Exception
+    {
+        periods = getPeriodsForDataSet( id );
+
+        for ( Period period : periods )
+        {
+            period.setName( format.formatPeriod( period ) );
+        }
+
+        return SUCCESS;
+    }
+
+    public List<Period> getPeriodsForDataSet( int id )
+    {
+        DataSet dataSet = dataSetService.getDataSet( id );
+
+        if ( dataSet == null )
+        {
+            return new ArrayList<Period>();
+        }
+
+        CalendarPeriodType periodType = (CalendarPeriodType) dataSet.getPeriodType();
+        List<Period> periods = periodType.generateLast5Years( new Date() );
+        FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() );
+        Collections.reverse( periods );
+
+        if ( periods.size() > 10 )
+        {
+            periods = periods.subList( 0, 10 );
+        }
+
+        return periods;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/RemoveLockExceptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/RemoveLockExceptionAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/RemoveLockExceptionAction.java	2012-02-08 12:04:46 +0000
@@ -0,0 +1,78 @@
+package org.hisp.dhis.dataadmin.action.lockexception;
+
+/*
+ * 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 com.opensymphony.xwork2.Action;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.LockException;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class RemoveLockExceptionAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private int lockExceptionId;
+
+    public void setLockExceptionId( int lockExceptionId )
+    {
+        this.lockExceptionId = lockExceptionId;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute() throws Exception
+    {
+        LockException lockException = dataSetService.getLockException( lockExceptionId );
+
+        if ( lockException != null )
+        {
+            dataSetService.deleteLockException( lockException );
+        }
+
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/UpdateLockExceptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/UpdateLockExceptionAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/lockexception/UpdateLockExceptionAction.java	2012-02-08 12:04:46 +0000
@@ -0,0 +1,127 @@
+package org.hisp.dhis.dataadmin.action.lockexception;
+
+/*
+ * 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 com.opensymphony.xwork2.Action;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.LockException;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class UpdateLockExceptionAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private DataSetService dataSetService;
+
+    public void setDataSetService( DataSetService dataSetService )
+    {
+        this.dataSetService = dataSetService;
+    }
+
+    private OrganisationUnitService organisationUnitService;
+
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private int lockExceptionId;
+
+    public void setLockExceptionId( int lockExceptionId )
+    {
+        this.lockExceptionId = lockExceptionId;
+    }
+
+    private int organisationUnitId;
+
+    public void setOrganisationUnitId( int organisationUnitId )
+    {
+        this.organisationUnitId = organisationUnitId;
+    }
+
+    private int dataSetId;
+
+    public void setDataSetId( int dataSetId )
+    {
+        this.dataSetId = dataSetId;
+    }
+
+    private String periodId;
+
+    public void setPeriodId( String periodId )
+    {
+        this.periodId = periodId;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action Implementation
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute() throws Exception
+    {
+        LockException lockException = dataSetService.getLockException( lockExceptionId );
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
+        DataSet dataSet = dataSetService.getDataSet( dataSetId );
+        Period period = periodService.getPeriodByExternalId( periodId );
+
+        if ( lockException == null || organisationUnit == null || dataSet == null || period == null )
+        {
+            return ERROR;
+        }
+
+        lockException.setOrganisationUnit( organisationUnit );
+        lockException.setDataSet( dataSet );
+        lockException.setPeriod( period );
+
+        dataSetService.updateLockException( lockException );
+
+        return SUCCESS;
+    }
+}

=== 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-06 02:56:02 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml	2012-02-08 12:04:46 +0000
@@ -282,6 +282,48 @@
     <property name="constantService" ref="org.hisp.dhis.constant.ConstantService" />
   </bean>
 
+  <!-- DataSet LockExceptions -->
+
+  <bean id="org.hisp.dhis.dataadmin.action.lockexception.GetLockExceptionListAction" class="org.hisp.dhis.dataadmin.action.lockexception.GetLockExceptionListAction"
+    scope="prototype">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.dataadmin.action.lockexception.AddLockExceptionAction" class="org.hisp.dhis.dataadmin.action.lockexception.AddLockExceptionAction"
+    scope="prototype">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.dataadmin.action.lockexception.GetLockExceptionAction" class="org.hisp.dhis.dataadmin.action.lockexception.GetLockExceptionAction"
+    scope="prototype">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.dataadmin.action.lockexception.RemoveLockExceptionAction" class="org.hisp.dhis.dataadmin.action.lockexception.RemoveLockExceptionAction"
+    scope="prototype">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.dataadmin.action.lockexception.UpdateLockExceptionAction" class="org.hisp.dhis.dataadmin.action.lockexception.UpdateLockExceptionAction"
+    scope="prototype">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.dataadmin.action.lockexception.GetDataSets" class="org.hisp.dhis.dataadmin.action.lockexception.GetDataSets"
+    scope="prototype">
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+  </bean>
+
+  <bean id="org.hisp.dhis.dataadmin.action.lockexception.GetPeriods" class="org.hisp.dhis.dataadmin.action.lockexception.GetPeriods"
+    scope="prototype">
+    <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
+  </bean>
+
   <!-- Dynamic Attributes -->
 
   <bean id="org.hisp.dhis.dataadmin.action.attribute.GetAttributeListAction" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeListAction"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2012-02-08 04:05:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2012-02-08 12:04:46 +0000
@@ -393,4 +393,6 @@
 must_include_option = Please include one or more category options
 edit_option_set = Edit option set
 number_of_members = The number of members
-object_not_deleted_associated_by_objects=Object not deleted because it is associated by objects of type 
\ No newline at end of file
+object_not_deleted_associated_by_objects=Object not deleted because it is associated by objects of type >>>>>>> MERGE-SOURCE
+lock_exception_management=Lock Exception Management
+lock_exception=Lock Exception

=== 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-08 04:05:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2012-02-08 12:04:46 +0000
@@ -476,6 +476,65 @@
       <param name="requiredAuthorities">F_CONSTANT_DELETE</param>
     </action>
 
+    <!-- DataSet LockExceptions -->
+
+    <action name="lockException" class="org.hisp.dhis.dataadmin.action.lockexception.GetLockExceptionListAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
+      <param name="page">/dhis-web-maintenance-dataadmin/lockException.vm</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+    </action>
+
+    <action name="showAddLockExceptionForm" class="org.hisp.dhis.dataadmin.action.NoAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
+      <param name="page">/dhis-web-maintenance-dataadmin/addLockExceptionForm.vm</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+      <param name="requiredAuthorities">F_DATASET_ADD</param>
+    </action>
+
+    <action name="showUpdateLockExceptionForm" class="org.hisp.dhis.dataadmin.action.lockexception.GetLockExceptionAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
+      <param name="page">/dhis-web-maintenance-dataadmin/updateLockExceptionForm.vm</param>
+      <param name="stylesheets">../dhis-web-commons/paging/paging.css</param>
+      <param name="requiredAuthorities">F_DATASET_UPDATE</param>
+    </action>
+
+    <action name="addLockException" class="org.hisp.dhis.dataadmin.action.lockexception.AddLockExceptionAction">
+      <result name="success" type="redirect">lockException.action</result>
+      <result name="error" type="redirect">index.action</result>
+      <param name="requiredAuthorities">F_DATASET_ADD</param>
+    </action>
+
+    <action name="updateLockException" class="org.hisp.dhis.dataadmin.action.lockexception.UpdateLockExceptionAction">
+      <result name="success" type="redirect">lockException.action</result>
+      <result name="error" type="redirect">index.action</result>
+      <param name="requiredAuthorities">F_DATASET_UPDATE</param>
+    </action>
+
+    <action name="removeLockException" class="org.hisp.dhis.dataadmin.action.lockexception.RemoveLockExceptionAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+      <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+      <param name="requiredAuthorities">F_DATASET_DELETE</param>
+    </action>
+
+    <action name="getDataSets" class="org.hisp.dhis.dataadmin.action.lockexception.GetDataSets">
+      <result name="success" type="velocity-json">jsonDataSets.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>
+
+    <action name="getPeriods" class="org.hisp.dhis.dataadmin.action.lockexception.GetPeriods">
+      <result name="success" type="velocity-json">jsonPeriods.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>
+
+    <action name="getLockException" class="org.hisp.dhis.dataadmin.action.lockexception.GetLockExceptionAction">
+      <result name="success" type="velocity-json">jsonLockException.vm</result>
+      <param name="onExceptionReturn">plainTextError</param>
+    </action>
+
     <!-- Dynamic Attributes -->
 
     <action name="attribute" class="org.hisp.dhis.dataadmin.action.attribute.GetAttributeListAction">

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addLockExceptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addLockExceptionForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addLockExceptionForm.vm	2012-02-08 12:04:46 +0000
@@ -0,0 +1,120 @@
+<script type="text/javascript">
+    jQuery(document).ready(	function()
+    {
+        jQuery("body").bind("oust.selected", ouChanged);
+        jQuery("#dataSets").bind("change", dataSetChanged);
+        jQuery("#periods").bind("change", periodChanged);
+    });
+
+    function ouChanged(e, ou)
+    {
+        jQuery("#organisationUnitId").val(ou);
+
+        jQuery.getJSON('getDataSets.action?id=' + ou, function(data) {
+            jQuery("#dataSets").children().remove();
+
+            if(data.dataSets.length == 0) {
+                resetDataSets();
+            } else {
+                for(var n in data.dataSets)
+                {
+                    var option = jQuery("<option />").attr("value", data.dataSets[n].id).text(data.dataSets[n].name)
+                    jQuery("#dataSets").append(option);
+                }
+
+                jQuery("#dataSets").removeAttr("disabled");
+            }
+
+            jQuery("#dataSets").trigger("change");
+        });
+    }
+
+    function dataSetChanged(e)
+    {
+        var dataSetId = jQuery("#dataSets option:selected").val();
+        jQuery("#periods").children().remove();
+
+        if(!isNaN(dataSetId)) {
+            jQuery.getJSON('getPeriods.action?id=' + dataSetId, function(data) {
+                if(data.periods.length == 0) {
+                    resetPeriods();
+                } else {
+                    for(var n in data.periods) {
+                        var option = jQuery("<option />").attr("value", data.periods[n].externalId).text(data.periods[n].name);
+                        jQuery("#periods").append(option);
+                    }
+
+                    jQuery("#periods").removeAttr("disabled");
+                }
+
+                jQuery("#periods").trigger("change");
+            });
+        } else {
+            resetPeriods();
+            jQuery("#periods").trigger("change");
+        }
+    }
+
+    function periodChanged(e)
+    {
+        var periods = jQuery("#periods");
+
+        if(periods.attr("disabled")) {
+            jQuery("#submit").attr("disabled", true);
+        } else {
+            jQuery("#submit").removeAttr("disabled");
+        }
+    }
+
+    function resetDataSets() {
+        var option = jQuery("<option>-- Please select an organisation unit with a dataset --</option>");
+        jQuery("#dataSets").append(option);
+        jQuery("#dataSets").attr("disabled", true);
+    }
+
+    function resetPeriods() {
+        var option = jQuery("<option>-- Please select a dataset --</option>");
+        jQuery("#periods").append(option);
+        jQuery("#periods").attr("disabled", true);
+    }
+</script>
+
+<h3>$i18n.getString( "create_new_lock_exception" )</h3>
+
+<form id="addLockExceptionForm" action="addLockException.action" method="post" >
+<input type="hidden" id="organisationUnitId" name="organisationUnitId" />
+
+<table>
+	<col style="width: 100px"/>
+	<col/>
+
+    <tr>
+        <td>#organisationUnitSelectionTree( true, false, true )</td>
+    </tr>
+
+    <tr>
+        <td>
+            <select id="dataSets" name="dataSetId" disabled="disabled" style="width: 100%;">
+                <option>-- Please select an organisation unit --</option>
+            </select>
+        </td>
+    </tr>
+
+    <tr>
+        <td>
+            <select id="periods" name="periodId" disabled="disabled" style="width: 100%;">
+                <option>-- Please select a dataset--</option>
+            </select>
+        </td>
+    </tr>
+
+	<tr>
+		<td colspan="2">
+			<br/>
+			<input type="submit" id="submit" disabled="disabled" value="$i18n.getString( 'add' )" style="width:10em"/>
+			<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='lockException.action'" style="width:10em"/>
+		</td>
+	</tr>
+</table>
+
+</form>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm	2012-02-06 02:56:02 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm	2012-02-08 12:04:46 +0000
@@ -19,7 +19,8 @@
     #introListImgItem( "displayDuplicateDataEliminationForm.action" "duplicate_data_elimination" "duplicatedataelimination" )
     #introListImgItem( "viewStatistics.action" "data_statistics" "datastatistics" )
     #introListImgItem( "displayLockingForm.action" "data_locking" "datalocking" )
-    #introListImgItem( "zeroValueStorageManagement.action" "zero_storage_management" "zerovaluestorage" ) 
+    #introListImgItem( "lockException.action" "lock_exception" "lockexception" )
+    #introListImgItem( "zeroValueStorageManagement.action" "zero_storage_management" "zerovaluestorage" )
     #introListImgItem( "displayPruneOrganisationUnitForm.action" "organisation_unit_pruning" "organisationunitpruning" )
 	#introListImgItem( "getMinMaxValidationParams.action" "min_max_value_generation" "minmaxvaluegeneration" ) 
     #introListImgItem( "showCache.action" "cache_statistics" "cachestatistics" )

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonDataSets.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonDataSets.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonDataSets.vm	2012-02-08 12:04:46 +0000
@@ -0,0 +1,9 @@
+#set( $size = $dataSets.size() )
+{ "dataSets": [
+#foreach( $dataSet in $dataSets )
+  {
+    "id": $!{dataSet.id},
+    "name": "$!encoder.jsonEncode( ${dataSet.displayName} )"
+  }#if( $velocityCount < $size ),#end
+#end
+] }

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonLockException.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonLockException.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonLockException.vm	2012-02-08 12:04:46 +0000
@@ -0,0 +1,9 @@
+{ "lockException":
+  {
+	"id": "${lockException.id}",
+	"name": "$!encoder.jsonEncode( ${lockException.name} )",
+    "organisationUnit": "$!{lockException.organisationUnit.name}",
+    "dataSet": "$!{lockException.dataSet.name}",
+    "period": "$!{lockException.period.externalId}"
+  }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/jsonPeriods.vm	2012-02-08 12:04:46 +0000
@@ -0,0 +1,9 @@
+#set( $size = $periods.size() )
+{ "periods": [
+#foreach( $period in $periods )
+  {
+    "name": "$!format.formatPeriod( ${period} )",
+    "externalId": "$!{period.externalId}"
+  }#if( $velocityCount < $size ),#end
+#end
+] }

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/lockException.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/lockException.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/lockException.vm	2012-02-08 12:04:46 +0000
@@ -0,0 +1,83 @@
+<script type="text/javascript">
+	jQuery(document).ready(function() {
+		tableSorter( 'listTable' );
+	});
+
+    var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_lock_exception" ) , "'")';
+
+    function removeLockException( lockExceptionId, lockExceptionName )
+    {
+        removeItem( lockExceptionId, lockExceptionName, i18n_confirm_delete, 'removeLockException.action' );
+    }
+
+    function showLockExceptionDetails( lockExceptionId )
+	{
+		jQuery.post( 'getLockException.action', { id:lockExceptionId },
+			function( json ) {
+                setInnerHTML( 'organisationUnitField', json.lockException.organisationUnit );
+                setInnerHTML( 'dataSetField', json.lockException.dataSet );
+                setInnerHTML( 'periodField', json.lockException.period );
+				showDetails();
+		});
+	}
+
+</script>
+
+<h3>$i18n.getString( "lock_exception_management" ) #openHelp( "lock_exception" )</h3>
+
+<table class="mainPageTable">
+	<tr>
+		<td style="vertical-align:top">
+			<table width="100%">
+				<tr>
+					<td>#filterDiv( "lockException" )</td>
+					<td colspan="4" style="text-align:right">
+						<input type="button" value="$i18n.getString( 'add_new' )" onclick="window.location.href='showAddLockExceptionForm.action'" style="width:80px"/>
+					</td>
+				</tr>
+			</table>
+			<table class="listTable" id="listTable">
+				<col/>
+				<col width="96px"/>			
+                <thead>				
+				<tr>
+					<th>$i18n.getString( "name" )</th>
+					<th class="{sorter: false}">$i18n.getString( "operations" )</th>
+				</tr>
+                </thead>
+				<tbody id="list">
+				#foreach( $lockException in $lockExceptions )
+				<tr id="tr${lockException.id}">
+					<td onclick="javascript:showLockExceptionDetails( $lockException.id )">$encoder.htmlEncode( $lockException.name )</td>
+					<td style="text-align:right">
+						<a href="showUpdateLockExceptionForm.action?id=$lockException.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
+                        <a href="javascript:removeLockException( $lockException.id, '$encoder.jsEncode( $lockException.name )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
+                        <a href="javascript:showLockExceptionDetails( $lockException.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
+					</td>
+				</tr>
+				#end
+				</tbody>
+			</table>
+			<p></p>
+			#parse( "/dhis-web-commons/paging/paging.vm" )
+		</td>
+
+        <td style="width:20em; padding-left:2em; vertical-align:top">
+            <div id="detailsArea" style="display:none">
+                <div style="float:right">
+                    <a href="javascript:hideDetails()" title="$i18n.getString( 'hide_details' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_details' )"/></a>
+                </div>
+                <p><label>$i18n.getString( "organisation_unit" ):</label><br/><span id="organisationUnitField"></span></p>
+                <p><label>$i18n.getString( "data_set" ):</label><br/><span id="dataSetField"></span></p>
+                <p><label>$i18n.getString( "period" ):</label><br/><span id="periodField"></span></p>
+            </div>
+
+           <div id="warningArea" style="position:fixed;right:10px;top:200px;display:none">
+              <div style="float:right">
+                  <a href="javascript:hideWarning()" title="$i18n.getString( 'hide_warning' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_warning' )"/></a>
+              </div>
+              <p><span id="warningField"></span></p>
+          </div>
+        </td>
+	</tr>
+</table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm	2012-02-06 02:56:02 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm	2012-02-08 12:04:46 +0000
@@ -13,6 +13,7 @@
     <li><a href="displayDuplicateDataEliminationForm.action">$i18n.getString( "duplicate_data_elimination" )&nbsp;</a></li>
 	<li><a href="viewStatistics.action">$i18n.getString( "data_statistics" )&nbsp;</a></li>
     <li><a href="displayLockingForm.action">$i18n.getString( "data_locking" )&nbsp;</a></li>
+    <li><a href="lockException.action">$i18n.getString( "lock_exception" )&nbsp;</a></li>
 	<li><a href="zeroValueStorageManagement.action">$i18n.getString( "zero_storage_management" )&nbsp;</a></li>
 	<li><a href="displayPruneOrganisationUnitForm.action">$i18n.getString( "organisation_unit_pruning" )&nbsp;</a></li>
 	<li><a href="getMinMaxValidationParams.action">$i18n.getString( "min_max_value_generation")&nbsp;</a></li>

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateLockExceptionForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateLockExceptionForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateLockExceptionForm.vm	2012-02-08 12:04:46 +0000
@@ -0,0 +1,29 @@
+<script type="text/javascript">
+	jQuery(document).ready(	function()
+	{
+
+    });
+</script>
+
+<h3>$i18n.getString( "edit_lock_exception" )</h3>
+
+<form id="updateLockExceptionForm" action="updateLockException.action" method="post" >
+
+<table>
+	<col style="width: 100px"/>
+	<col/>
+
+	<tr>
+		<th colspan="2">$i18n.getString( "details" )</th>
+	</tr>
+
+	<tr>
+		<td colspan="2">
+			<br/>
+			<input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/>
+			<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='lockException.action'" style="width:10em"/>
+		</td>
+	</tr>
+</table>
+
+</form>