dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41072
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20897: remove unused TrackedEntityAudit code
------------------------------------------------------------
revno: 20897
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-10-30 13:19:41 +0700
message:
remove unused TrackedEntityAudit code
removed:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAudit.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java
modified:
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAudit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAudit.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAudit.java 1970-01-01 00:00:00 +0000
@@ -1,124 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * Copyright (c) 2004-2015, 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.Date;
-
-/**
- * @author Chau Thu Tran
- *
- * @version TrackedEntityAudit.java 8:56:01 AM Sep 26, 2012 $
- */
-public class TrackedEntityAudit
-{
- public static final String MODULE_ENTITY_INSTANCE_DASHBOARD = "tracked_entity_instance_dashboard";
-
- private int id;
-
- private TrackedEntityInstance entityInstance;
-
- private String visitor;
-
- private Date date;
-
- private String accessedModule;
-
- // -------------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------------
-
- public TrackedEntityAudit()
- {
-
- }
-
- public TrackedEntityAudit( TrackedEntityInstance entityInstance, String visitor, Date date, String accessedModule )
- {
- this.entityInstance = entityInstance;
- this.visitor = visitor;
- this.date = date;
- this.accessedModule = accessedModule;
- }
-
- // TODO implement hashCode and equals
-
- // -------------------------------------------------------------------------
- // Getters && Setters
- // -------------------------------------------------------------------------
-
- public int getId()
- {
- return id;
- }
-
- public void setId( int id )
- {
- this.id = id;
- }
-
- public TrackedEntityInstance getEntityInstance()
- {
- return entityInstance;
- }
-
- public void setEntityInstance( TrackedEntityInstance entityInstance )
- {
- this.entityInstance = entityInstance;
- }
-
- public Date getDate()
- {
- return date;
- }
-
- public void setDate( Date date )
- {
- this.date = date;
- }
-
- public String getVisitor()
- {
- return visitor;
- }
-
- public void setVisitor( String visitor )
- {
- this.visitor = visitor;
- }
-
- public String getAccessedModule()
- {
- return accessedModule;
- }
-
- public void setAccessedModule( String accessedModule )
- {
- this.accessedModule = accessedModule;
- }
-}
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java 2015-06-16 13:17:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditService.java 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * Copyright (c) 2004-2015, 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.Date;
-import java.util.List;
-
-/**
- * @author Chau Thu Tran
- *
- * @version TrackedEntityAuditService.java 9:01:49 AM Sep 26, 2012 $
- */
-public interface TrackedEntityAuditService
-{
- String ID = TrackedEntityAuditService.class.getName();
-
- /**
- * Adds an {@link TrackedEntityAudit}
- *
- * @param trackedEntityAudit The to TrackedEntityAudit add.
- *
- * @return A generated unique id of the added {@link TrackedEntityAudit}.
- */
- int saveTrackedEntityAudit( TrackedEntityAudit trackedEntityAudit );
-
- /**
- * Deletes a {@link TrackedEntityAudit}.
- *
- * @param trackedEntityAudit the TrackedEntityAudit to delete.
- */
- void deleteTrackedEntityAudit( TrackedEntityAudit trackedEntityAudit );
-
- /**
- * Returns a {@link TrackedEntityAudit}.
- *
- * @param id the id of the TrackedEntityAudit to return.
- *
- * @return the TrackedEntityAudit with the given id
- */
- TrackedEntityAudit getTrackedEntityAudit( int id );
-
- /**
- * Get all instance audits of a instance
- *
- * @param instance TrackedEntityInstance
- *
- * @return List of TrackedEntityAudit
- */
- List<TrackedEntityAudit> getTrackedEntityAudits( TrackedEntityInstance instance );
-
- /**
- * Get instance audit of a instance
- *
- * @param instanceId The id of instance
- * @param visitor The user who accessed to see a certain information of the
- * instance
- * @param date The data this user visited
- * @param accessedModule The module this user accessed
- *
- * @return TrackedEntityAudit
- */
- TrackedEntityAudit getTrackedEntityAudit( Integer instanceId, String visitor, Date date, String accessedModule );
-
-}
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java 2015-06-16 13:17:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStore.java 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * Copyright (c) 2004-2015, 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.Date;
-import java.util.List;
-
-import org.hisp.dhis.common.GenericStore;
-
-/**
- * @author Chau Thu Tran
- *
- * @version TrackedEntityAuditStore.java 9:04:53 AM Sep 26, 2012 $
- */
-public interface TrackedEntityAuditStore
- extends GenericStore<TrackedEntityAudit>
-{
- /**
- * Get all tracked entity audits of a instance
- *
- * @param instance TrackedEntityInstance
- *
- * @return List of TrackedEntityInstanceAudit
- */
- List<TrackedEntityAudit> get( TrackedEntityInstance instance );
-
- /**
- * Get tracked entity audit of a instance
- *
- * @param instanceId The id of instance
- * @param visitor The user who accessed to see a certain information of the
- * instance
- * @param date The data this user visited
- * @param accessedModule The module this user accessed
- *
- * @return TrackedEntityInstanceAudit
- */
- TrackedEntityAudit get( Integer instanceId, String visitor, Date date, String accessedModule );
-}
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityAuditService.java 1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * Copyright (c) 2004-2015, 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.Date;
-import java.util.List;
-
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * @author Chau Thu Tran
- */
-@Transactional
-public class DefaultTrackedEntityAuditService
- implements TrackedEntityAuditService
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private TrackedEntityAuditStore auditStore;
-
- public void setAuditStore( TrackedEntityAuditStore auditStore )
- {
- this.auditStore = auditStore;
- }
-
- // -------------------------------------------------------------------------
- // Implementation methods
- // -------------------------------------------------------------------------
-
- @Override
- public int saveTrackedEntityAudit( TrackedEntityAudit audit )
- {
- return auditStore.save( audit );
- }
-
- @Override
- public void deleteTrackedEntityAudit( TrackedEntityAudit audit )
- {
- auditStore.delete( audit );
- }
-
- @Override
- public TrackedEntityAudit getTrackedEntityAudit( int id )
- {
- return auditStore.get( id );
- }
-
- @Override
- public List<TrackedEntityAudit> getTrackedEntityAudits( TrackedEntityInstance instance )
- {
- return auditStore.get( instance );
- }
-
- @Override
- public TrackedEntityAudit getTrackedEntityAudit( Integer instanceId, String visitor, Date date, String accessedModule )
- {
- return auditStore.get( instanceId, visitor, date, accessedModule );
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditDeletionHandler.java 2015-09-10 16:35:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityAuditDeletionHandler.java 1970-01-01 00:00:00 +0000
@@ -1,77 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * Copyright (c) 2004-2015, 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.Collection;
-import java.util.Iterator;
-
-import org.hisp.dhis.system.deletion.DeletionHandler;
-
-/**
- * @author Chau Thu Tran
- */
-public class TrackedEntityAuditDeletionHandler
- extends DeletionHandler
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private TrackedEntityAuditService auditService;
-
- public void setAuditService( TrackedEntityAuditService auditService )
- {
- this.auditService = auditService;
- }
-
- // -------------------------------------------------------------------------
- // DeletionHandler implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String getClassName()
- {
- return TrackedEntityAudit.class.getSimpleName();
- }
-
- @Override
- public void deleteTrackedEntityInstance( TrackedEntityInstance instance )
- {
- Collection<TrackedEntityAudit> audits = auditService.getTrackedEntityAudits( instance );
-
- Iterator<TrackedEntityAudit> iterator = audits.iterator();
-
- while ( iterator.hasNext() )
- {
- TrackedEntityAudit audit = iterator.next();
- iterator.remove();
- auditService.deleteTrackedEntityAudit( audit );
- }
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityAuditStore.java 1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
-package org.hisp.dhis.trackedentity.hibernate;
-
-/*
- * Copyright (c) 2004-2015, 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.Date;
-import java.util.List;
-
-import org.hibernate.criterion.Order;
-import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
-import org.hisp.dhis.trackedentity.TrackedEntityAudit;
-import org.hisp.dhis.trackedentity.TrackedEntityAuditStore;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
-
-/**
- * @author Chau Thu Tran
- */
-public class HibernateTrackedEntityAuditStore
- extends HibernateGenericStore<TrackedEntityAudit>
- implements TrackedEntityAuditStore
-{
- @SuppressWarnings( "unchecked" )
- @Override
- public List<TrackedEntityAudit> get( TrackedEntityInstance entityInstance )
- {
- return getCriteria( Restrictions.eq( "entityInstance", entityInstance ) ).addOrder( Order.desc( "date" ) ).list();
- }
-
- @Override
- public TrackedEntityAudit get( Integer entityInstanceId, String visitor, Date date, String accessedModule )
- {
- return (TrackedEntityAudit) getCriteria(
- Restrictions.eq( "entityInstance.id", entityInstanceId ),
- Restrictions.eq( "visitor", visitor ),
- Restrictions.eq( "date", date ),
- Restrictions.eq( "accessedModule", accessedModule ) ).uniqueResult();
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditServiceTest.java 1970-01-01 00:00:00 +0000
@@ -1,159 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * Copyright (c) 2004-2015, 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 org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-import java.util.List;
-
-import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.joda.time.DateTime;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * @author Chau Thu Tran
- */
-public class TrackedEntityAuditServiceTest
- extends DhisSpringTest
-{
- @Autowired
- private TrackedEntityAuditService auditService;
-
- @Autowired
- private TrackedEntityInstanceService entityInstanceService;
-
- @Autowired
- private OrganisationUnitService organisationUnitService;
-
- private TrackedEntityAudit auditA;
-
- private TrackedEntityAudit auditB;
-
- private TrackedEntityInstance entityInstanceA;
-
- private TrackedEntityInstance entityInstanceB;
-
- private int entityInstanceAId;
-
- private Date today;
-
- @Override
- public void setUpTest()
- {
- OrganisationUnit organisationUnit = createOrganisationUnit( 'A' );
- organisationUnitService.addOrganisationUnit( organisationUnit );
-
- entityInstanceA = createTrackedEntityInstance( 'A', organisationUnit );
- entityInstanceAId = entityInstanceService.addTrackedEntityInstance( entityInstanceA );
-
- entityInstanceB = createTrackedEntityInstance( 'B', organisationUnit );
- entityInstanceService.addTrackedEntityInstance( entityInstanceB );
-
- DateTime testDate = DateTime.now();
- testDate.withTimeAtStartOfDay();
- today = testDate.toDate();
-
- auditA = new TrackedEntityAudit( entityInstanceA, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
- auditB = new TrackedEntityAudit( entityInstanceB, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
- }
-
- @Test
- public void testSaveTrackedEntityAudit()
- {
- int idA = auditService.saveTrackedEntityAudit( auditA );
- int idB = auditService.saveTrackedEntityAudit( auditB );
-
- assertNotNull( auditService.getTrackedEntityAudit( idA ) );
- assertNotNull( auditService.getTrackedEntityAudit( idB ) );
- }
-
- @Test
- public void testDeleteTrackedEntityAudit()
- {
- int idA = auditService.saveTrackedEntityAudit( auditA );
- int idB = auditService.saveTrackedEntityAudit( auditB );
-
- assertNotNull( auditService.getTrackedEntityAudit( idA ) );
- assertNotNull( auditService.getTrackedEntityAudit( idB ) );
-
- auditService.deleteTrackedEntityAudit( auditA );
-
- assertNull( auditService.getTrackedEntityAudit( idA ) );
- assertNotNull( auditService.getTrackedEntityAudit( idB ) );
-
- auditService.deleteTrackedEntityAudit( auditB );
-
- assertNull( auditService.getTrackedEntityAudit( idA ) );
- assertNull( auditService.getTrackedEntityAudit( idB ) );
- }
-
- @Test
- public void testGetTrackedEntityAuditById()
- {
- int idA = auditService.saveTrackedEntityAudit( auditA );
- int idB = auditService.saveTrackedEntityAudit( auditB );
-
- assertEquals( auditA, auditService.getTrackedEntityAudit( idA ) );
- assertEquals( auditB, auditService.getTrackedEntityAudit( idB ) );
- }
-
- @Test
- public void testGetTrackedEntityAuditsByEntityInstance()
- {
- auditService.saveTrackedEntityAudit( auditA );
- auditService.saveTrackedEntityAudit( auditB );
-
- List<TrackedEntityAudit> audits = auditService.getTrackedEntityAudits( entityInstanceA );
- assertEquals( 1, audits.size() );
- assertTrue( audits.contains( auditA ) );
-
- audits = auditService.getTrackedEntityAudits( entityInstanceB );
- assertEquals( 1, audits.size() );
- assertTrue( audits.contains( auditB ) );
- }
-
- @Test
- public void testGetTrackedEntityAuditByModule()
- {
- auditService.saveTrackedEntityAudit( auditA );
- auditService.saveTrackedEntityAudit( auditB );
-
- TrackedEntityAudit audit = auditService.getTrackedEntityAudit( entityInstanceAId, "test", today,
- TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
- assertEquals( auditA, audit );
-
- }
-}
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java 2015-06-23 15:59:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityAuditStoreTest.java 1970-01-01 00:00:00 +0000
@@ -1,116 +0,0 @@
-package org.hisp.dhis.trackedentity;
-
-/*
- * Copyright (c) 2004-2015, 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 org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-import java.util.List;
-
-import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.joda.time.DateTime;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * @author Chau Thu Tran
- */
-public class TrackedEntityAuditStoreTest
- extends DhisSpringTest
-{
- @Autowired
- private TrackedEntityAuditStore auditStore;
-
- @Autowired
- private TrackedEntityInstanceService entityInstanceService;
-
- @Autowired
- private OrganisationUnitService organisationUnitService;
-
- private TrackedEntityAudit auditA;
-
- private TrackedEntityAudit auditB;
-
- private TrackedEntityInstance entityInstanceA;
-
- private TrackedEntityInstance entityInstanceB;
-
- private int entityInstanceAId;
-
- private Date today;
-
- @Override
- public void setUpTest()
- {
- OrganisationUnit organisationUnit = createOrganisationUnit( 'A' );
- organisationUnitService.addOrganisationUnit( organisationUnit );
-
- entityInstanceA = createTrackedEntityInstance( 'A', organisationUnit );
- entityInstanceAId = entityInstanceService.addTrackedEntityInstance( entityInstanceA );
-
- entityInstanceB = createTrackedEntityInstance( 'B', organisationUnit );
- entityInstanceService.addTrackedEntityInstance( entityInstanceB );
-
- DateTime testDate = DateTime.now();
- testDate.withTimeAtStartOfDay();
- today = testDate.toDate();
-
- auditA = new TrackedEntityAudit( entityInstanceA, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
- auditB = new TrackedEntityAudit( entityInstanceB, "test", today, TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
- }
-
- @Test
- public void testGetEntityInstanceAuditsByEntityInstance()
- {
- auditStore.save( auditA );
- auditStore.save( auditB );
-
- List<TrackedEntityAudit> entityInstanceAudits = auditStore.get( entityInstanceA );
- assertEquals( 1, entityInstanceAudits.size() );
- assertTrue( entityInstanceAudits.contains( auditA ) );
-
- entityInstanceAudits = auditStore.get( entityInstanceB );
- assertEquals( 1, entityInstanceAudits.size() );
- assertTrue( entityInstanceAudits.contains( auditB ) );
- }
-
- @Test
- public void testGetAuditByModule()
- {
- auditStore.save( auditA );
- auditStore.save( auditB );
-
- TrackedEntityAudit entityInstanceAudit = auditStore.get( entityInstanceAId, "test", today,
- TrackedEntityAudit.MODULE_ENTITY_INSTANCE_DASHBOARD );
- assertEquals( auditA, entityInstanceAudit );
- }
-}
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java 2015-09-14 18:06:48 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java 2015-10-30 06:19:41 +0000
@@ -93,7 +93,6 @@
import org.hisp.dhis.trackedentity.TrackedEntity;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import org.hisp.dhis.trackedentity.TrackedEntityAttributeGroup;
-import org.hisp.dhis.trackedentity.TrackedEntityAudit;
import org.hisp.dhis.trackedentity.TrackedEntityInstance;
import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
import org.hisp.dhis.trackedentitydatavalue.TrackedEntityDataValue;
@@ -716,15 +715,6 @@
{
}
- public void deleteTrackedEntityAudit( TrackedEntityAudit audit )
- {
- }
-
- public String allowDeleteTrackedEntityAudit( TrackedEntityAudit audit )
- {
- return null;
- }
-
public void deleteIntepretation( Interpretation interpretation )
{
}