Changeset 25066


Ignore:
Timestamp:
02/09/12 15:38:08 (9 years ago)
Author:
sjm84
Message:

%26 characters are now turned back into ampersands and there is now better error checking on the JSON conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/DocumentMaker.java

    r24993 r25066  
    372372        HashMap params = GSXML.extractParams(param_list, false);
    373373        String transactionString = (String) params.get("transactions");
    374 
    375         Gson gson = new Gson();
    376         Type type = new TypeToken<List<Map<String, String>>>()
    377         {
    378         }.getType();
    379         List<Map<String, String>> transactions = gson.fromJson(transactionString, type);
     374        transactionString = transactionString.replace("%26", "&");
     375
     376        List<Map<String, String>> transactions = null;
     377        try
     378        {
     379            Gson gson = new Gson();
     380            Type type = new TypeToken<List<Map<String, String>>>()
     381            {
     382            }.getType();
     383            transactions = gson.fromJson(transactionString, type);
     384        }
     385        catch(Exception ex)
     386        {
     387            ex.printStackTrace();
     388        }
    380389
    381390        ArrayList<String> collectionsToBuild = new ArrayList<String>();
     
    439448                   
    440449                    _GSDM.documentXMLSetText(oid, collection, newContent, userContext);
    441                    
    442                     System.err.println(newContent);
    443450                }
    444451
Note: See TracChangeset for help on using the changeset viewer.