FileDocCategorySizeDatePackage
RicoUtil.javaAPI DocExample2495Tue May 23 08:58:00 BST 2006com.oreilly.ajax

RicoUtil

public class RicoUtil extends Object

Fields Summary
Constructors Summary
Methods Summary
public static java.lang.StringbuildRicoObjectXML(java.util.HashMap map, java.lang.String message)

        StringBuffer ricoXML = new StringBuffer("<ajax-response>\r\n <response type=\"object\" id=\"locationUpdater\"><location ");
        String key = "";
        String value = "";
        // loop through all the map entries.
        Iterator it = map.entrySet().iterator();

        while (it.hasNext())
        {
            Map.Entry e = (Map.Entry) it.next();
            value = (String) e.getValue();
            key = (String) e.getKey();
            ricoXML.append(key+"=\""+ value +"\" " );
        }
        ricoXML.append("/></response>\r\n</ajax-response>");
        return ricoXML.toString();
    
public static java.lang.StringbuildRicoXML(java.util.HashMap map, java.lang.String message)

        StringBuffer ricoXML = new StringBuffer("<ajax-response>");
        String key = "";
        String value = "";
        // loop through all the map entries.
        Iterator it = map.entrySet().iterator();

        while (it.hasNext())
        {
            Map.Entry e = (Map.Entry) it.next();
            value = (String) e.getValue();
            key = (String) e.getKey();
            ricoXML.append("\r\n <response type=\"element\" id=\"" + key + "\">" + value + "</response>");
        }
        ricoXML.append("\r\n <response type=\"element\" id=\"message\" name=\"message\">"+message+"</response>");
        ricoXML.append("\r\n</ajax-response>");
        return ricoXML.toString();
    
public static java.lang.StringbuildRicoXML(java.util.HashMap map, java.lang.String element, java.lang.String message)

        StringBuffer ricoXML = new StringBuffer("<ajax-response>");
        String key = "";
        String value = "";
        // loop through all the map entries.
        Iterator it = map.entrySet().iterator();

        while (it.hasNext())
        {
            Map.Entry e = (Map.Entry) it.next();
            value = (String) e.getValue();
            key = (String) e.getKey();
            ricoXML.append("\r\n <response type=\"element\" id=\"" + key + "\">" + "<input type=\"text\" id=\"inner"+key+"\" name=\"inner"+key+"\" value=\""+value+"\" /></response>");
        }
        ricoXML.append("\r\n <response type=\"element\" id=\"message\" name=\"message\">"+message+"</response>");
        ricoXML.append("\r\n</ajax-response>");
        return ricoXML.toString();