示例#1
0
 protected Map parseParameters(String parameters) {
   Map result = new HashMap();
   if (parameters != null) {
     String[] tokens = StringUtils.split(parameters, "&");
     for (int i = 0; i < tokens.length; i++) {
       String[] vals = StringUtils.split(tokens[i], "=");
       result.put(vals[0], vals[1]);
     }
   }
   return result;
 }
  public String generate(ContextTag contextTag, TopicMapReferenceIF tmRefObj, String template)
      throws NavigatorRuntimeException {

    String link = template;

    // replace topicmap id placeholder with real value
    if (tmRefObj != null) {
      String topicmapId = tmRefObj.getId();
      link = StringUtils.replace(link, LINK_TOPICMAP_KEY, topicmapId);
    }

    // replace model placeholder with real value
    UserIF user = FrameworkUtils.getUser(contextTag.getPageContext());
    String model = user.getModel();
    link = StringUtils.replace(link, LINK_MODEL_KEY, model);

    return link;
  }