2011-10-04 Miguel de Dios <miguel.dedios@artica.es>

* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java:
	fixed the events about BadXML with returns.
	 
	* res/values-es/strings.xml: fixed typo in the value "develop...".



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5042 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2011-10-05 16:28:35 +00:00
parent ac0444a57c
commit 9de8742ebf
3 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2011-10-04 Miguel de Dios <miguel.dedios@artica.es>
* src/pandroid_event_viewer/pandorafms/PandroidEventviewerActivity.java:
fixed the events about BadXML with returns.
* res/values-es/strings.xml: fixed typo in the value "develop...".
2011-10-04 Miguel de Dios <miguel.dedios@artica.es>
* src/pandroid_event_viewer/pandorafms/Main.java: fixed the status value

View File

@ -77,7 +77,7 @@
<string name="max_time_old_event_str">Máx tiempo de antiguedad</string>
<string name="licensed_under_gpl_str">Licenciado bajo GPL v2</string>
<string name="develop_team_str">Desarrado por: Miguel de Dios</string>
<string name="develop_team_str">Desarrollado por: Miguel de Dios</string>
<string name="alert_recovered_str">Alerta recuperada</string>
<string name="alert_manual_validation_str">Alerta validada manualmente</string>

View File

@ -18,6 +18,8 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
@ -339,7 +341,26 @@ public class PandroidEventviewerActivity extends TabActivity implements Serializ
return_api = return_api.replaceAll("\\<.*?\\>", ""); //Clean html tags.
//Work around for the crap of \n in this event bad xml
return_api = return_api.replaceAll("Unable to process XML data file.*?line 187 thread 5", "Bad XML");
//return_api = return_api.replaceAll("Unable to process XML data file [^\n]*\n[^\n]*line 187 thread .\n", "Bad XML");
Pattern pattern = Pattern.compile("Unable to process XML data file '(.*)'");
Matcher matcher;
String filename;
boolean endReplace = false; int i22 = 0;
while (!endReplace) { Log.e("loop", i22 + ""); i22++;
matcher = pattern.matcher(return_api);
if (matcher.find()) {
filename = matcher.group(1);
return_api = return_api.replaceFirst("Unable to process XML data file[^\n]*\n[^\n]*line 187 thread .*\n", "Bad XML: " + filename);
}
else {
endReplace = true;
}
}
Log.e("return_api", return_api);