dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30867
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15699: Remove SearchTrackedEntityInstanceAction class in tracker module.
------------------------------------------------------------
revno: 15699
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-06-16 20:05:53 +0800
message:
Remove SearchTrackedEntityInstanceAction class in tracker module.
removed:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchRelationshipEntityInstanceAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchRelationshipEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchRelationshipEntityInstanceAction.java 2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchRelationshipEntityInstanceAction.java 1970-01-01 00:00:00 +0000
@@ -1,187 +0,0 @@
-package org.hisp.dhis.caseentry.action.trackedentity;
-
-/*
- * Copyright (c) 2004-2014, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.hisp.dhis.relationship.Relationship;
-import org.hisp.dhis.relationship.RelationshipService;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
-import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
-import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
-import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- * @version $ SearchRelationshipEntityInstanceAction.java May 13, 2011 2:38:12 PM $
- *
- */
-public class SearchRelationshipEntityInstanceAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private TrackedEntityInstanceService entityInstanceService;
-
- public void setEntityInstanceService( TrackedEntityInstanceService entityInstanceService )
- {
- this.entityInstanceService = entityInstanceService;
- }
-
- private TrackedEntityAttributeService attributeService;
-
- public void setAttributeService( TrackedEntityAttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- private TrackedEntityAttributeValueService attributeValueService;
-
- public void setAttributeValueService( TrackedEntityAttributeValueService attributeValueService )
- {
- this.attributeValueService = attributeValueService;
- }
-
- private RelationshipService relationshipService;
-
- public void setRelationshipService( RelationshipService relationshipService )
- {
- this.relationshipService = relationshipService;
- }
-
- // -------------------------------------------------------------------------
- // Input/Output
- // -------------------------------------------------------------------------
-
- private Integer entityInstanceId;
-
- public void setEntityInstanceId( Integer entityInstanceId )
- {
- this.entityInstanceId = entityInstanceId;
- }
-
- private String searchText;
-
- public void setSearchText( String searchText )
- {
- this.searchText = searchText;
- }
-
- public String getSearchText()
- {
- return searchText;
- }
-
- private Integer searchingAttributeId;
-
- public Integer getSearchingAttributeId()
- {
- return searchingAttributeId;
- }
-
- public void setSearchingAttributeId( Integer searchingAttributeId )
- {
- this.searchingAttributeId = searchingAttributeId;
- }
-
- private Collection<TrackedEntityInstance> entityInstances = new ArrayList<TrackedEntityInstance>();
-
- public Collection<TrackedEntityInstance> getEntityInstances()
- {
- return entityInstances;
- }
-
- // -------------------------------------------------------------------------
- // Input/Output
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- throws Exception
- {
- if ( searchText != null && searchText.length() > 0 )
- searchText = searchText.trim();
-
- int index = searchText.indexOf( ' ' );
-
- if ( index != -1 && index == searchText.lastIndexOf( ' ' ) )
- {
- String[] keys = searchText.split( " " );
- searchText = keys[0] + " " + keys[1];
- }
-
- if ( searchText != null && !searchText.isEmpty() )
- {
- if ( searchingAttributeId != null )
- {
- TrackedEntityAttribute entityInstanceAttribute = attributeService.getTrackedEntityAttribute( searchingAttributeId );
-
- Collection<TrackedEntityAttributeValue> matching = attributeValueService.searchTrackedEntityAttributeValue(
- entityInstanceAttribute, searchText );
-
- for ( TrackedEntityAttributeValue entityInstanceAttributeValue : matching )
- {
- entityInstances.add( entityInstanceAttributeValue.getEntityInstance() );
- }
-
- }
- }
- if ( entityInstances != null && !entityInstances.isEmpty() )
- {
- TrackedEntityInstance entityInstance = entityInstanceService.getTrackedEntityInstance( entityInstanceId );
-
- entityInstances.remove( entityInstance );
-
- Collection<Relationship> relationships = relationshipService.getRelationshipsForTrackedEntityInstance( entityInstance );
-
- if ( relationships != null )
- {
- Iterator<Relationship> iter = relationships.iterator();
-
- while ( iter.hasNext() )
- {
- Relationship relationship = iter.next();
- entityInstances.remove( relationship.getEntityInstanceA() );
- entityInstances.remove( relationship.getEntityInstanceB() );
- }
- }
- }
-
- return SUCCESS;
- }
-
-}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2014-06-11 13:14:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2014-06-16 12:05:53 +0000
@@ -493,10 +493,6 @@
<property name="selectionTreeManager"
ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
</bean>
-
- <bean id="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction"
- class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction" scope="prototype">
- </bean>
<!-- Program Enrollment -->
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2014-06-11 13:14:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2014-06-16 12:05:53 +0000
@@ -545,14 +545,6 @@
</result>
<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_CHANGE_LOCATION</param>
</action>
-
- <action name="searchTrackedEntityInstance"
- class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction">
- <result name="success" type="velocity-json">
- /dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm
- </result>
- <param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_SEARCH</param>
- </action>
<!-- Program Enrollment -->
=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm 2014-06-11 13:14:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm 1970-01-01 00:00:00 +0000
@@ -1,180 +0,0 @@
-<table>
- <tr>
- <td class='text-column'>
- $i18n.getString( "the_following_tracked_entity_instances_found_in" ) <span id='orgunitInfor'></span> <span id='enrollmentInfor'></span>
- <script>
- setInnerHTML('orgunitForSearch',"$organisationUnit.name");
- var i18n_for = '$encoder.jsEscape( $i18n.getString( "for_infor" ), "'")';
- var i18n_enrollments_in = '$encoder.jsEscape( $i18n.getString( "enrollments_in" ), "'")';
- var i18n_program = '$encoder.jsEscape( $i18n.getString( "program_infor" ), "'")';
- if( getFieldValue('programIdAddTrackedEntity') != "" )
- {
- var status = jQuery('#statusEnrollment option:selected').text();
- var programName = jQuery('#programIdAddTrackedEntity option:selected').text();
- var title = i18n_for + " " + status + " " + i18n_enrollments_in + " " + programName + " " + i18n_program;
- setInnerHTML('enrollmentInfor', title);
- }
- </script>
- </td>
- </tr>
- <tr>
- <td class='text-column' >
- #if( $!total != 0)
- $i18n.getString( "total_result" ): $!total
- #else
- $i18n.getString("no_result_found")
- #end
- </td>
- </tr>
-</table>
-
-#if( $entityInstances.size() > 0 )
-<table class="mainPageTable">
- <tr>
- <td>
- <table class="listTable" id="entityInstanceList" width='100%'>
- <col width="30"/>
- #if($program)
- #foreach( $programAttribute in $program.attributes )
- #if($programAttribute.displayInList=='true')
- <col/>
- #end
- #end
- #else
- #foreach( $attribute in $attributes)
- <col/>
- #end
- #end
-
- <col width="200"/>
-
- <thead>
- <tr>
- <th>#</th>
- #if($program)
- #foreach( $programAttribute in $program.attributes )
- #if($programAttribute.displayInList=='true')
- <th id="attributeName">$encoder.htmlEncode($programAttribute.attribute.displayName)</th>
- #end
- #end
- #else
- #foreach( $attribute in $attributes)
- <th id="attributeName">$encoder.htmlEncode($attribute.displayName)</th>
- #end
- #end
-
- <th style="text-align:center">$i18n.getString( "operations" )</th>
- </tr>
- </thead>
-
- <tbody id="list">
- #foreach( $entityInstance in $entityInstances )
- <tr id="tr${entityInstance.id}">
-
- <td>
- #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )
- $nr
- </td>
- #if($program)
- #foreach( $programAttribute in $program.attributes )
- #set($value="")
- #if($programAttribute.displayInList=='true')
- <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )">
- #foreach( $attributeValue in $entityInstance.attributeValues)
- #if($!attributeValue.attribute.id==$programAttribute.attribute.id)
- #set($value=$attributeValue.value)
- #if( $programAttribute.attribute.valueType == 'bool')
- #set($value=$i18n.getString($attributeValue.value))
- #elseif( $programAttribute.attribute.valueType == 'users')
- #set($value=$mapUsers.get($attributeValue.value))
- #end
- #end
- #end
- <a>$!encoder.htmlEncode($value)</a>
- </td>
- #end
- #end
- #else
- #foreach( $attribute in $attributes)
- #set($value="")
- <td style="cursor:pointer;" onclick="javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )">
- #foreach( $attributeValue in $entityInstance.attributeValues)
- #if($!attributeValue.attribute.id==$attribute.id)
- #set($value=$attributeValue.value)
- #if( $attribute.valueType == 'bool')
- #set($value=$i18n.getString($attributeValue.value))
- #elseif( $attribute.valueType == 'users')
- #set($value=$mapUsers.get($attributeValue.value))
- #end
- #end
- #end
- <a>$!encoder.htmlEncode($value)</a>
- </td>
- #end
- #end
-
- <td>
- <a href="javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )" title='$i18n.getString( "dashboard" )'><img src="../images/enroll.png" alt='$i18n.getString( "dashboard" )'></a>
- <a href="javascript:isDashboard=false;showUpdateTrackedEntityInstanceForm( '$entityInstance.uid' )" title='$i18n.getString( "edit_profile" )'><img src="../images/edit.png" alt='$i18n.getString( "edit_profile" )'></a>
- <a href="javascript:setFieldValue( 'isShowTrackedEntityInstanceList', 'false' ); showRelationshipList('$entityInstance.uid')" title='$i18n.getString( "manage_relationship" )'><img src="../images/relationship.png" alt='$i18n.getString( "manage_relationship" )'></a>
- #if( $auth.hasAccess( "dhis-web-caseentry", "getTrackedEntityInstanceLocation" ) )
- <a href="javascript:isDashboard=false;getTrackedEntityInstanceLocation( '$entityInstance.uid' );" title='$i18n.getString( "change_location" )'><img src="../icons/dataentry.png" alt='$i18n.getString( "change_tracked_entity_instance_location" )' style='width:25px; height:25px'></a>
- #end
- <a href="javascript:removeTrackedEntityInstance( '$entityInstance.uid' )" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
- <a href="javascript:showTrackedEntityInstanceHistory( '$entityInstance.uid' )" title='$i18n.getString( "tracked_entity_instance_details_and_history" )'><img src="../images/information.png" alt='$i18n.getString( "tracked_entity_instance_details_and_history" )'></a>
- </td>
-
- </tr>
- #end
- </tbody>
-
- </table>
- </td>
- </tr>
- <tr>
- <td colspan="6">
- <p></p>
- <div class="paging-container">
- #parse( "/dhis-web-commons/paging/paging.vm" )
- </div>
- </td>
- <td></td>
- </tr>
-</table>
-<div id="detailsInfo"></div>
-
-#end
-<script type="text/javascript">
- jQuery(document).ready(function(){
- setTableStyles();
- });
- var i18n_tracked_entity_instance_details_and_history = '$encoder.jsEscape( $i18n.getString( "tracked_entity_instance_details_and_history" ) , "'" )';
- var i18n_id = '$encoder.jsEscape( $i18n.getString( "id" ), "'")';
- var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ), "'")';
- var i18n_select = '[' + '$encoder.jsEscape( $i18n.getString( "select" ), "'")' + ']';
- var i18n_program_stages_history_plan = '$encoder.jsEscape( $i18n.getString( "program_stages_history_plan" ) , "'")';
- var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
- var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
- var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
- var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
- var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
- var i18n_value_must_unit_interval = '$encoder.jsEscape( $i18n.getString( "value_must_unit_interval" ) , "'")';
- var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n " + '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '" + dateFormat.replace('yy', 'yyyy') + " '" ;
- var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
- var i18n_saving_value_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_error_code" ) , "'")';
- var i18n_searching_tracked_entity_instance_failed = '$encoder.jsEscape( $i18n.getString( "searching_tracked_entity_instance_failed" ) , "'")';
- var i18n_complete_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_confirm_message" ) , "'")';
- var i18n_quit_confirm_message = '$encoder.jsEscape( $i18n.getString( "quit_confirm_message" ) , "'")';
- var i18n_error_required_field = '$encoder.jsEscape( $i18n.getString( "error_required_field" ) , "'")';
- var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")';
- var i18n_date_is_greater_then_or_equals_due_date = '$encoder.jsEscape( $i18n.getString( "date_is_greater_then_or_equals_due_date" ) , "'")';
- var i18n_program_stage = '$encoder.jsEscape( $i18n.getString( "program_stage" ) , "'")';
- var i18n_scheduled_for = '$encoder.jsEscape( $i18n.getString( "scheduled_for" ) , "'")';
- var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")';
- var i18n_create_new_event = '$encoder.jsEscape( $i18n.getString( "create_new_event" ) , "'")';
- var i18n_save_success = '$encoder.jsEscape( $i18n.getString( "save_success" ) , "'")';
- var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
- var i18n_reenrollment_confirm_message = '$encoder.jsEscape( $i18n.getString( "reenrollment_confirm_message" ) , "'")';
- var i18n_confirm_delete_tracked_entity_instance = '$encoder.jsEscape( $i18n.getString( "confirm_delete_tracked_entity_instance" ) , "'")';
- var i18n_complete_program_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_program_confirm_message" ) , "'")';
-</script>