Revision 8854 branches/v10/extensions/extWFS2/src/com/iver/cit/gvsig/gui/panels/WFSFilterPanel.java

View differences:

WFSFilterPanel.java
711 711
			// Ignore the first and last apostrophes
712 712
			if (text.length() > 2) {
713 713
				text = text.substring(1, text.length() -1);
714
				System.out.println("TEXTO SIN APOSTROFES: " + text);
715 714
				
716 715
				// Convert the string to ISO 8859_1 codification
717 716
				text = URLEncoder.encode(text, "8859_1");
......
743 742
		int lastIndex = 0;
744 743
		boolean endInnerLoop;
745 744
		
746
		System.out.println("ENTRADA: " + expression);
747
		
748 745
		// Encodes all inner strings to the equivalent codification in ISO-8859_1 with each ' symbol converted to ''
749 746
		while (index != -1) {
750 747
			index = expression.indexOf("'", index);
751 748
			
752 749
			// Add the parts of the chain of characters that not are string
753
			// Get the last of the chain of characters (after the last string in the chain of characters)
754
//			if (index == -1)
755
//				result += translateString(expression.substring(lastIndex, expression.length()));
756
//			else {
757
//				// (All spaces together are considerates as only one)				
758
//				result += translateString(expression.substring(lastIndex, index).replaceAll(" [ ]+", " "));
759
//			}
760 750
			if (index == -1) {
761 751
				result += expression.substring(lastIndex, expression.length());
762 752
			}
......
792 782
				lastIndex = index;
793 783
			}
794 784
		}
795

  
796 785
		
797
		System.out.println("CONVERTIDO: " + result);
798
		
799 786
		//Se transforman los nombres de los campos en las variables xix que analizar?n
800 787
		//Se quitan los Date(fecha) y se mete la fecha correspondiente
801 788
		result = translateDates(result);
802 789
		result = translateNumber(result);
803 790
		result = translateWord(result, "true", "1");
804 791
		result = translateWord(result, "false", "0");
805
		
806
		System.out.println("DEVUELVE: " + result);
807 792

  
808
//		String replacement;
809
//		Pattern patron = Pattern.compile("[^<>!]=");
810
//		Matcher m = patron.matcher(expression);
811
//		int index = 0;
812
//
813
//		while (m.find(index)) {
814
//			index = m.start();
815
//			replacement = expression.charAt(index) + "==";
816
//			m.replaceFirst(replacement);
817
//			index++;
818
//		}
819
//
820
//		expression = expression.replaceAll("[^<>!]=", "==");
821

  
822 793
		logger.debug(result);
823 794

  
824 795
		return result;

Also available in: Unified diff