Java 类javax.portlet.BaseURL 实例源码

项目:gvnix1    文件:RooUrlTag.java   
/**
 * Copies the parameters from map to the BaseURL.
 * 
 * @param url BaseURL
 * @return void
 */
protected void setUrlParameters(BaseURL url) {
    Set<String> keySet = parametersMap.keySet();

    for (String key : keySet) {
        List<String> valueList = parametersMap.get(key);
        String[] valueArray = valueList.toArray(new String[0]);
        url.setParameter(key, valueArray);
    }
}
项目:portals-pluto    文件:BaseURLTag.java   
/**
 * Sets the secure flag on the URl as required
 * 
 * @throws JspException
 */
protected void handleSecureFlag() throws JspException {

     BaseURL url = getUrl();

     if (secure != null && !secure.equalsIgnoreCase("true") && !secure.equalsIgnoreCase("false")) {
        StringBuilder txt = new StringBuilder(128);
        txt.append("Invalid secure option: ").append(secure);
        txt.append(", valid options: true, false");
        throw new JspException(txt.toString());
     }

     if(url == null){
        throw new IllegalStateException("internal error: url not set");
     }

     if (var != null) {
           pageContext.removeAttribute(var, PageContext.PAGE_SCOPE);
       }

     if (secure != null) {
           try {                   
               url.setSecure(isSecure());                    
           } catch (PortletSecurityException e) {
               // ignore exception as Pluto doesn't support setSecure
               // throw new JspException(e);                    
           }
       }
}
项目:portals-pluto    文件:BaseURLTag.java   
/**
   * Copies the properties from map to the BaseURL.
   * @param url BaseURL
   * @return void
   */
  protected void setUrlProperties(BaseURL url) {
    Set<String> keySet = propertiesMap.keySet();

for(String key : keySet){

    List<String> valueList = propertiesMap.get(key);

    for(String value:valueList){
        url.addProperty(key, value);
    }
}
  }
项目:portals-pluto    文件:BaseURLWrapper.java   
/**
 * Sets the wrapped object.
 * 
 * @param wrapped   the wrapped object to set.
 * @throws java.lang.IllegalArgumentException   if the BaseURL is null.
 */
public void setWrapped(BaseURL wrapped) {
   if (wrapped == null) {
      throw new java.lang.IllegalArgumentException("BaseURL to wrap is null");
   }
  this.wrapped = wrapped;
}
项目:portals-pluto    文件:TestPortletURLGenerationListener.java   
private boolean isURLGenTc(BaseURL url) {
   boolean ok = false;
   String[] vals = (String[]) url.getParameterMap().get("tc");
   if ((vals != null) && (vals.length > 0) && vals[0].contains("PortletURLGenerationListener")) {
      ok = true;
   }
   return ok;
}
项目:portals-pluto    文件:TestPortletURLGenerationListener2.java   
private boolean isURLGenTc(BaseURL url) {
   boolean ok = false;
   String[] vals = (String[]) url.getParameterMap().get("tc");
   if ((vals != null) && (vals.length > 0) && vals[0].contains("PortletURLGenerationListener")) {
      vals = (String[]) url.getParameterMap().get("PUGL");
      if ((vals != null) && (vals.length > 0) && vals[0].matches("^(?:Action|Render|Resource)$")) {
         ok = true;
      }
   }
   return ok;
}
项目:portals-pluto    文件:ResourceURLTag286.java   
@Override
protected void setUrl(BaseURL url) {
    this.resourceURL = (ResourceURL)url;
}
项目:portals-pluto    文件:PortletURLTag168.java   
@Override
protected BaseURL getUrl() {
   return portletURL;
}
项目:portals-pluto    文件:PortletURLTag168.java   
@Override
protected void setUrl(BaseURL url) {
   this.portletURL = (PortletURL) url;
}
项目:portals-pluto    文件:RenderURLTag362.java   
/**
 * prevent additional copying
 */
@Override
protected void setUrlParameters(BaseURL url) {
}
项目:portals-pluto    文件:ActionURLTag362.java   
/**
 * prevent additional copying
 */
@Override
protected void setUrlParameters(BaseURL url) {
}
项目:portals-pluto    文件:BaseURLTag.java   
@Override
public int doEndTag() throws JspException{

    BaseURL url = getUrl();

    if(url == null){
        throw new IllegalStateException("internal error: url not set");
    }

    setUrlParameters(url);      
    setUrlProperties(url);

    HttpServletResponse response = 
        (HttpServletResponse) pageContext.getResponse();

    //  properly encoding urls to allow non-cookie enabled sessions - PLUTO-252 
    String urlString = response.encodeURL(url.toString());

        if(Boolean.parseBoolean(escapeXml))
        {
         urlString = doEscapeXml(urlString);
    }

    if (var == null) {
           try {                
               JspWriter writer = pageContext.getOut();
               writer.print(urlString);
           } catch (IOException ioe) {
               throw new JspException(
                   "Portlet/ResourceURL-Tag Exception: cannot write to the output writer.");
           }
       } 
    else {
           pageContext.setAttribute(var, urlString,
                                    PageContext.PAGE_SCOPE);
       }

    /*cleanup*/
    propertiesMap.clear();
    parametersMap.clear();
    removedParametersList.clear();

    setUrl(null);

       return EVAL_PAGE;
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Deprecated
@Override
public void setParameter(String name, String value) {
   ((BaseURL)wrapped).setParameter(name, value);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Deprecated
@Override
public void setParameter(String name, String... values) {
   ((BaseURL)wrapped).setParameter(name, values);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Deprecated
@Override
public void setParameters(Map<String, String[]> parameters) {
   ((BaseURL)wrapped).setParameters(parameters);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Override
public void setSecure(boolean secure) throws PortletSecurityException {
   ((BaseURL)wrapped).setSecure(secure);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Deprecated
@Override
public Map<String, String[]> getParameterMap() {
   return ((BaseURL)wrapped).getParameterMap();
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Override
public void write(Writer out) throws IOException {
   ((BaseURL)wrapped).write(out);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Override
public void write(Writer out, boolean escapeXML) throws IOException {
   ((BaseURL)wrapped).write(out, escapeXML);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Override
public Appendable append(Appendable out) throws IOException {
   return ((BaseURL)wrapped).append(out);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Override
public Appendable append(Appendable out, boolean escapeXML) throws IOException {
   return ((BaseURL)wrapped).append(out, escapeXML);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Override
public void addProperty(String key, String value) {
   ((BaseURL)wrapped).addProperty(key, value);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
@Override
public void setProperty(String key, String value) {
   ((BaseURL)wrapped).setProperty(key, value);
}
项目:portals-pluto    文件:BaseURLTag.java   
/**
   * Copies the parameters from map to the BaseURL.
   * @param url BaseURL
   * @return void
   */
  @SuppressWarnings("deprecation")
 protected void setUrlParameters(BaseURL url) {

    Set<String> keySet = parametersMap.keySet();

for(String key : keySet){

    List<String> valueList = parametersMap.get(key);

    String[] valueArray = valueList.toArray(new String[0]);

    url.setParameter(key, valueArray);
}
  }
项目:portals-pluto    文件:BaseURLTag.java   
/**
* @return the url
*/
  protected abstract BaseURL getUrl();
项目:portals-pluto    文件:BaseURLTag.java   
/**
* @param url the url to set
*/
  protected abstract void setUrl(BaseURL url);
项目:portals-pluto    文件:BaseURLWrapper.java   
/**
 * @param wrapped   the wrapped object to set.
 * @throws java.lang.IllegalArgumentException   if the BaseURL is null.
 */
public BaseURLWrapper(BaseURL wrapped) {
   super(wrapped);
}
项目:portals-pluto    文件:BaseURLWrapper.java   
/**
 * Gets the wrapped object.
 * 
 * @return the wrapped object.
 */
@Override
public BaseURL getWrapped() {
   return ((BaseURL)wrapped);
}