@@ -684,7 +684,7 @@ protected void runSearch() {
684684 clearCache ();
685685 loadPageNumber (1 );
686686
687- updateSearchCriteriaPane ( );
687+ lastSearchCriteria . setText ( messageFilter . toString ( connectors , " \n " , true ) );
688688 auditSearch ();
689689 }
690690 }
@@ -723,183 +723,6 @@ protected void auditSearch(String channelId, String channelName) {
723723 }
724724 }
725725
726- protected void updateSearchCriteriaPane () {
727- StringBuilder text = new StringBuilder ();
728- Calendar startDate = messageFilter .getStartDate ();
729- Calendar endDate = messageFilter .getEndDate ();
730- String padding = "\n " ;
731-
732- text .append ("Max Message Id: " );
733- text .append (messageFilter .getMaxMessageId ());
734-
735- if (messageFilter .getMinMessageId () != null ) {
736- text .append (padding + "Min Message Id: " );
737- text .append (messageFilter .getMinMessageId ());
738- }
739-
740- String startDateFormatString = mirthTimePicker1 .isEnabled () ? "yyyy-MM-dd HH:mm" : "yyyy-MM-dd" ;
741- String endDateFormatString = mirthTimePicker2 .isEnabled () ? "yyyy-MM-dd HH:mm" : "yyyy-MM-dd" ;
742-
743- DateFormat startDateFormat = new SimpleDateFormat (startDateFormatString );
744- DateFormat endDateFormat = new SimpleDateFormat (endDateFormatString );
745-
746- text .append (padding + "Date Range: " );
747-
748- if (startDate == null ) {
749- text .append ("(any)" );
750- } else {
751- text .append (startDateFormat .format (startDate .getTime ()));
752- if (!mirthTimePicker1 .isEnabled ()) {
753- text .append (" (all day)" );
754- }
755- }
756-
757- text .append (" to " );
758-
759- if (endDate == null ) {
760- text .append ("(any)" );
761- } else {
762- text .append (endDateFormat .format (endDate .getTime ()));
763- if (!mirthTimePicker2 .isEnabled ()) {
764- text .append (" (all day)" );
765- }
766- }
767-
768- text .append (padding + "Statuses: " );
769-
770- if (messageFilter .getStatuses () == null ) {
771- text .append ("(any)" );
772- } else {
773- text .append (StringUtils .join (messageFilter .getStatuses (), ", " ));
774- }
775-
776- if (messageFilter .getTextSearch () != null ) {
777- text .append (padding + "Text Search: " + messageFilter .getTextSearch ());
778- }
779-
780- text .append (getConnectorSearchCriteriaText (padding ));
781-
782- if (messageFilter .getOriginalIdLower () != null || messageFilter .getOriginalIdUpper () != null ) {
783- text .append (padding + "Original Id: " );
784- if (messageFilter .getOriginalIdUpper () == null ) {
785- text .append ("Greater than " + messageFilter .getOriginalIdLower ());
786- } else if (messageFilter .getOriginalIdLower () == null ) {
787- text .append ("Less than " + messageFilter .getOriginalIdUpper ());
788- } else {
789- text .append ("Between " + messageFilter .getOriginalIdLower () + " and " + messageFilter .getOriginalIdUpper ());
790- }
791- }
792-
793- if (messageFilter .getImportIdLower () != null || messageFilter .getImportIdUpper () != null ) {
794- text .append (padding + "Import Id: " );
795- if (messageFilter .getImportIdUpper () == null ) {
796- text .append ("Greater than " + messageFilter .getImportIdLower ());
797- } else if (messageFilter .getImportIdLower () == null ) {
798- text .append ("Less than " + messageFilter .getImportIdUpper ());
799- } else {
800- text .append ("Between " + messageFilter .getImportIdLower () + " and " + messageFilter .getImportIdUpper ());
801- }
802- }
803-
804- if (messageFilter .getServerId () != null ) {
805- text .append (padding + "Server Id: " + messageFilter .getServerId ());
806- }
807-
808- Integer sendAttemptsLower = messageFilter .getSendAttemptsLower ();
809- Integer sendAttemptsUpper = messageFilter .getSendAttemptsUpper ();
810-
811- if (sendAttemptsLower != null || sendAttemptsUpper != null ) {
812- text .append (padding + "# of Send Attempts: " );
813-
814- if (sendAttemptsLower != null ) {
815- text .append (sendAttemptsLower );
816- } else {
817- text .append ("(any)" );
818- }
819-
820- text .append (" - " );
821-
822- if (sendAttemptsUpper != null ) {
823- text .append (sendAttemptsUpper );
824- } else {
825- text .append ("(any)" );
826- }
827- }
828-
829- if (messageFilter .getContentSearch () != null ) {
830- List <ContentSearchElement > contentSearch = messageFilter .getContentSearch ();
831-
832- for (ContentSearchElement element : contentSearch ) {
833- for (String value : element .getSearches ()) {
834- text .append (padding + ContentType .fromCode (element .getContentCode ()) + " contains \" " + value + "\" " );
835- }
836- }
837- }
838-
839- if (messageFilter .getMetaDataSearch () != null ) {
840- List <MetaDataSearchElement > elements = messageFilter .getMetaDataSearch ();
841-
842- for (MetaDataSearchElement element : elements ) {
843- text .append (padding + element .getColumnName () + " " + MetaDataSearchOperator .fromString (element .getOperator ()).toString () + " " );
844- if (element .getValue () instanceof Calendar ) {
845- Calendar date = (Calendar ) element .getValue ();
846- text .append (new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss" ).format (date .getTime ()));
847- } else {
848- text .append (element .getValue ());
849- }
850- if (element .getIgnoreCase ()) {
851- text .append (" (Ignore Case)" );
852- }
853- }
854- }
855-
856- if (messageFilter .getAttachment ()) {
857- text .append (padding + "Has Attachment" );
858- }
859-
860- if (messageFilter .getError ()) {
861- text .append (padding + "Has Error" );
862- }
863-
864- lastSearchCriteria .setText (text .toString ());
865- }
866-
867- protected String getConnectorSearchCriteriaText (String padding ) {
868- StringBuilder text = new StringBuilder ();
869- text .append (padding + "Connectors: " );
870-
871- if (messageFilter .getIncludedMetaDataIds () == null ) {
872- if (messageFilter .getExcludedMetaDataIds () == null ) {
873- text .append ("(any)" );
874- } else {
875- List <Integer > excludedMetaDataIds = messageFilter .getExcludedMetaDataIds ();
876- List <String > connectorNames = new ArrayList <String >();
877-
878- for (Entry <Integer , String > connectorEntry : connectors .entrySet ()) {
879- if (!excludedMetaDataIds .contains (connectorEntry .getKey ())) {
880- connectorNames .add (connectorEntry .getValue ());
881- }
882- }
883-
884- text .append (StringUtils .join (connectorNames , ", " ));
885- }
886- } else if (messageFilter .getIncludedMetaDataIds ().isEmpty ()) {
887- text .append ("(none)" );
888- } else {
889- List <Integer > includedMetaDataIds = messageFilter .getIncludedMetaDataIds ();
890- List <String > connectorNames = new ArrayList <String >();
891-
892- for (Entry <Integer , String > connectorEntry : connectors .entrySet ()) {
893- if (includedMetaDataIds .contains (connectorEntry .getKey ())) {
894- connectorNames .add (connectorEntry .getValue ());
895- }
896- }
897-
898- text .append (StringUtils .join (connectorNames , ", " ));
899- }
900- return text .toString ();
901- }
902-
903726 public void jumpToPageNumber () {
904727 if (messages .getPageCount () != null && messages .getPageCount () > 0 && StringUtils .isNotEmpty (pageNumberField .getText ())) {
905728 loadPageNumber (Math .min (Math .max (Integer .parseInt (pageNumberField .getText ()), 1 ), messages .getPageCount ()));
0 commit comments