info.associate_wit_sequence = Associate with Sequence
label.search_result = Search Result
label.found_structures_summary = Found Structures Summary
+ label.configure_displayed_columns = Configure Displayed Columns
+ label.start_jalview = Start Jalview
+ label.biojs_html_export = BioJS
++action.back = Back
++label.hide_insertions = Hide Insertions
++label.mark_as_representative = Mark as representative
++label.open_jabaws_web_page = Open JABAWS web page
++label.opens_the_jabaws_server_homepage = Opens the JABAWS server's homepage in web browser
++label.pdb_sequence_getcher = PDB Sequence Fetcher
++label.result = result
++label.results = results
++label.structure_chooser = Structure Chooser
++label.select = Select :
++label.invert = Invert
++label.select_pdb_file = Select PDB File
++info.select_filter_option = Select Filter Option/Manual Entry
++info.associate_wit_sequence = Associate with Sequence
++label.search_result = Search Result
++label.found_structures_summary = Found Structures Summary
+label.configure_displayed_columns = Configure Displayed Columns
*/
package jalview.io;
+
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.util.UrlLink;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
- import java.util.Vector;
++
+
/**
* generate HTML reports for a sequence
*
}
else
{
-- for (String urlstring : (Vector<String>) feature.links)
++ for (String urlstring : feature.links)
{
try
{
}
if (offscreenRender && offscreenImage == null)
-- {
- if (lastSequenceFeatures[sfindex].begin <= start
- && lastSequenceFeatures[sfindex].end >= start)
++ {
+ if (sequenceFeature.begin <= start
+ && sequenceFeature.end >= start)
{
// this is passed out to the overview and other sequence renderers
// (e.g. molecule viewer) to get displayed colour for rendered
*/
public static String parseJsonExceptionString(String jsonErrorResponse)
{
- String errorMessage = "RunTime error";
+ StringBuilder errorMessage = new StringBuilder(
+ "\n============= PDB Rest Client RunTime error =============\n");
++
try
{
JSONParser jsonParser = new JSONParser();
JSONObject jsonObj = (JSONObject) jsonParser.parse(jsonErrorResponse);
JSONObject errorResponse = (JSONObject) jsonObj.get("error");
- errorMessage = errorResponse.get("msg").toString();
+
JSONObject responseHeader = (JSONObject) jsonObj
.get("responseHeader");
- errorMessage += responseHeader.get("params").toString();
+ JSONObject paramsObj = (JSONObject) responseHeader.get("params");
+ String status = responseHeader.get("status").toString();
+ String message = errorResponse.get("msg").toString();
+ String query = paramsObj.get("q").toString();
+ String fl = paramsObj.get("fl").toString();
+
+ errorMessage.append("Status: ").append(status).append("\n");
+ errorMessage.append("Message: ").append(message).append("\n");
+ errorMessage.append("query: ").append(query).append("\n");
+ errorMessage.append("fl: ").append(fl).append("\n");
++
} catch (ParseException e)
{
e.printStackTrace();
String parsedErrorResponse = PDBRestClient
.parseJsonExceptionString(jsonErrorResponse);
- String expectedErrorMsg = "org.apache.solr.search.SyntaxError: Cannot parse 'text:abc OR text:go:abc AND molecule_sequence:['' TO *]': Encountered \" \":\" \": \"\" at line 1, column 19.{\"q\":\"text:abc OR text:go:abc AND molecule_sequence:['' TO *]\",\"fl\":\"pdb_id\",\"sort\":\"\",\"rows\":\"100\",\"wt\":\"json\"}";
+ System.out.println(parsedErrorResponse);
+
+ String expectedErrorMsg = "\n============= PDB Rest Client RunTime error =============\n"
+ + "Status: 400\n"
+ + "Message: org.apache.solr.search.SyntaxError: Cannot parse 'text:abc OR text:go:abc AND molecule_sequence:['' TO *]': Encountered \" \":\" \": \"\" at line 1, column 19.\n"
+ + "query: text:abc OR text:go:abc AND molecule_sequence:['' TO *]\n"
+ + "fl: pdb_id\n";
+
assertEquals(expectedErrorMsg, parsedErrorResponse);
}