nextapp.echoservlet
Interface UrlTranslator


public interface UrlTranslator


Method Summary
 boolean isTranslatable(java.util.Map parameterMap)
          Example implemenation for a ProductScreenUrlTranslator : return parameterMap.containsKey("productId")
 Screen translateToScreen(java.util.Map parameterMap)
          Example implemenation : ProductScreen ret = null; if (isTranslatable(parameterMap)) { ret = new ProductScreen(); String productId = ((String[]) parameterMap.get("productId"))[0]; // init the screen with the right product.
 java.lang.String translateToUrl(Screen screen)
          You can get the service URI using the following snippet : String ret = ClientObjects.getServiceUri(UrlTranslatorService.getInstance(), ""); and add your screen specific parameters to it.
 

Method Detail

isTranslatable

boolean isTranslatable(java.util.Map parameterMap)
Example implemenation for a ProductScreenUrlTranslator : return parameterMap.containsKey("productId")

Parameters:
parameterMap -
Returns:

translateToScreen

Screen translateToScreen(java.util.Map parameterMap)
Example implemenation : ProductScreen ret = null; if (isTranslatable(parameterMap)) { ret = new ProductScreen(); String productId = ((String[]) parameterMap.get("productId"))[0]; // init the screen with the right product. ret.setProductId(productId); } return ret;

Parameters:
parameterMap -
Returns:

translateToUrl

java.lang.String translateToUrl(Screen screen)
You can get the service URI using the following snippet : String ret = ClientObjects.getServiceUri(UrlTranslatorService.getInstance(), ""); and add your screen specific parameters to it. Example for a ProductScreen with product 12548 : ret = ret + "&productId=12548";

Parameters:
screen -
Returns: