Changeset 645

Show
Ignore:
Timestamp:
06/23/06 00:16:17
Author:
douglm
Message:

Closer to getting personal calendars in uportal

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/common/src/edu/rpi/sss/util/servlets/XSLTFilter.java

    r2 r645  
    326326                            bytes.length); 
    327327        } 
     328        //getLogger().debug(new String(bytes)); 
    328329 
    329330        TransformerException te = null; 
  • trunk/calendar3/deployment/webuser/uportal2/struts-portlet.tld

    r614 r645  
    2525<tag> 
    2626<name>form</name> 
    27 <tagclass>org.apache.portals.bridges.struts.taglib.FormTag</tagclass> 
     27<tagclass>ca.mun.portal.strutsbridge.taglib.CalFormTag</tagclass> 
    2828<bodycontent>JSP</bodycontent> 
    2929<attribute> 
     
    504504<tag> 
    505505<name>link</name> 
    506 <tagclass>org.apache.portals.bridges.struts.taglib.LinkTag</tagclass> 
     506<tagclass>ca.mun.portal.strutsbridge.taglib.CalLinkTag</tagclass> 
    507507<attribute> 
    508508<name>actionURL</name> 
  • trunk/calendar3/uportal/src/ca/mun/portal/strutsbridge/taglib/CalRewriteTag.java

    r598 r645  
    1616package ca.mun.portal.strutsbridge.taglib; 
    1717 
     18import java.net.MalformedURLException; 
     19import java.net.URL; 
     20 
    1821import javax.servlet.ServletRequest; // for javadoc 
    1922import javax.servlet.jsp.JspException; 
     
    3033 * @author <a href="mailto:ate@douma.nu">Ate Douma</a> 
    3134 * @author <a href="mailto:satish@mun.ca">Satish Sekharan</a> 
     35 * @author Mike Douglass    douglm at rpi.edu 
    3236 * @version $Id: RewriteTag.java 2005-10-25 12:31:13Z satish $ 
    3337 */ 
     
    125129   */ 
    126130  public int doStartTag() throws JspException { 
    127     if ( PortletServlet.isPortletRequest(pageContext.getRequest())) { 
    128       String url = null
    129       BodyContent bodyContent = pageContext.pushBody(); 
     131    if (!PortletServlet.isPortletRequest(pageContext.getRequest())) { 
     132      return super.doStartTag()
     133    } 
    130134 
    131       try { 
    132         super.doStartTag(); 
    133         url = bodyContent.getString(); 
     135    String urlStr = null; 
     136    BodyContent bodyContent = pageContext.pushBody(); 
    134137 
    135         /* replace with a relative URL 
    136          * (quick and dirty fix for now - change this later) 
    137          */ 
    138         url = url.replaceFirst("http://(.*)/","/"); 
    139         url = url.replaceFirst("https://(.*)/","/"); 
     138    try { 
     139      super.doStartTag(); 
     140      URL url = new URL(bodyContent.getString()); 
    140141 
    141         url = TagsSupport.getURL(pageContext, url, urlType); 
    142  
    143         /* remove embedded anchor because calendar xsl stylesheet 
    144          * adds extra parameters later during transformation 
    145          */ 
    146         int hash = url.indexOf('#'); 
    147         if ( hash > -1 ) { 
    148           url = url.substring(0,hash); 
    149         } 
    150  
    151         /* Remove bedework dummy request parameter - 
    152          * it's an encoded form of ?be=d */ 
    153         url = url.replaceAll(bedeworkDummyPar, ""); 
    154  
    155         //Generate valid xml markup for transformation 
    156         url = url.replaceAll("&","&amp;"); 
    157  
    158       } finally { 
    159         pageContext.popBody(); 
     142      String path = url.getPath(); 
     143      if (path.endsWith(".rdo")) { 
     144        setRenderURL("true"); 
     145      } else if (path.endsWith(".rdo")) { 
     146        setActionURL("true"); 
    160147      } 
    161148 
    162       TagUtils.getInstance().write(pageContext, url); 
    163       return (SKIP_BODY); 
    164     } else { 
    165       return super.doStartTag(); 
     149      /* We want a context relative url */ 
     150      urlStr = url.getFile(); 
     151 
     152      System.out.println("RRRRRRRRRRRRRRRRRUrlStr = " + urlStr); 
     153 
     154      /* Drop the context 
     155       */ 
     156      int pos = urlStr.indexOf('/'); 
     157      if (pos > 0) { 
     158        urlStr = urlStr.substring(pos); 
     159      } 
     160 
     161      urlStr = TagsSupport.getURL(pageContext, urlStr, urlType); 
     162 
     163      /* remove embedded anchor because calendar xsl stylesheet 
     164       * adds extra parameters later during transformation 
     165       */ 
     166      pos = urlStr.indexOf('#'); 
     167      if (pos > -1) { 
     168        urlStr = urlStr.substring(0, pos); 
     169      } 
     170 
     171      /* Remove bedework dummy request parameter - 
     172       * it's an encoded form of ?b=de */ 
     173      urlStr = urlStr.replaceAll(bedeworkDummyPar, ""); 
     174 
     175      //Generate valid xml markup for transformationthrow new 
     176      urlStr = urlStr.replaceAll("&", "&amp;"); 
     177 
     178      System.out.println("RRRRRRRRRRRRRRRRRUrlStr = " + urlStr); 
     179    } catch (MalformedURLException mue) { 
     180      throw new JspException(mue); 
     181    } finally { 
     182      pageContext.popBody(); 
    166183    } 
     184 
     185    TagUtils.getInstance().write(pageContext, urlStr); 
     186 
     187    return (SKIP_BODY); 
    167188  } 
    168189