Changeset 645
- Timestamp:
- 06/23/06 00:16:17
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/common/src/edu/rpi/sss/util/servlets/XSLTFilter.java
r2 r645 326 326 bytes.length); 327 327 } 328 //getLogger().debug(new String(bytes)); 328 329 329 330 TransformerException te = null; trunk/calendar3/deployment/webuser/uportal2/struts-portlet.tld
r614 r645 25 25 <tag> 26 26 <name>form</name> 27 <tagclass> org.apache.portals.bridges.struts.taglib.FormTag</tagclass>27 <tagclass>ca.mun.portal.strutsbridge.taglib.CalFormTag</tagclass> 28 28 <bodycontent>JSP</bodycontent> 29 29 <attribute> … … 504 504 <tag> 505 505 <name>link</name> 506 <tagclass> org.apache.portals.bridges.struts.taglib.LinkTag</tagclass>506 <tagclass>ca.mun.portal.strutsbridge.taglib.CalLinkTag</tagclass> 507 507 <attribute> 508 508 <name>actionURL</name> trunk/calendar3/uportal/src/ca/mun/portal/strutsbridge/taglib/CalRewriteTag.java
r598 r645 16 16 package ca.mun.portal.strutsbridge.taglib; 17 17 18 import java.net.MalformedURLException; 19 import java.net.URL; 20 18 21 import javax.servlet.ServletRequest; // for javadoc 19 22 import javax.servlet.jsp.JspException; … … 30 33 * @author <a href="mailto:ate@douma.nu">Ate Douma</a> 31 34 * @author <a href="mailto:satish@mun.ca">Satish Sekharan</a> 35 * @author Mike Douglass douglm at rpi.edu 32 36 * @version $Id: RewriteTag.java 2005-10-25 12:31:13Z satish $ 33 37 */ … … 125 129 */ 126 130 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 } 130 134 131 try { 132 super.doStartTag(); 133 url = bodyContent.getString(); 135 String urlStr = null; 136 BodyContent bodyContent = pageContext.pushBody(); 134 137 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()); 140 141 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("&","&"); 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"); 160 147 } 161 148 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("&", "&"); 177 178 System.out.println("RRRRRRRRRRRRRRRRRUrlStr = " + urlStr); 179 } catch (MalformedURLException mue) { 180 throw new JspException(mue); 181 } finally { 182 pageContext.popBody(); 166 183 } 184 185 TagUtils.getInstance().write(pageContext, urlStr); 186 187 return (SKIP_BODY); 167 188 } 168 189
