コード例 #1
0
  /**
   * This method is called by the process action and render action listeners, aka during the
   * processDecode() phase of our UI framework
   *
   * <p>It goes throughs all the request parameters and add to the public render parameters Map the
   * one that are supported by the targeted portlet
   */
  public static void setupPublicRenderParams(
      UIPortlet uiPortlet, Map<String, String[]> requestParams) {
    if (ParameterValidation.existsAndIsNotEmpty(requestParams)) {
      UIPortal uiPortal = Util.getUIPortal();
      Map<String, String[]> publicParams = uiPortal.getPublicParameters();

      for (String key : requestParams.keySet()) {
        String[] value = requestParams.get(key);
        if (uiPortlet.supportsPublicParam(key)) {
          if (value.length > 0) {
            publicParams.put(key, value);
          } else {
            publicParams.remove(key);
          }
        }
      }
    }
  }