xlawrence    2005/04/27 10:17:33 CEST

  Modified files:        (Branch: JAHIA-4-1-BRANCH)
    src/view/jsp         blog_listing_rss_2_0.jsp 
  Log:
  corrected post URL generation
  
  Revision  Changes    Path
  1.1.2.2   +41 -15    
corporate_portal_templates/src/view/jsp/blog_listing_rss_2_0.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/blog_listing_rss_2_0.jsp.diff?r1=1.1.2.1&r2=1.1.2.2&f=h
  
  
  
  Index: blog_listing_rss_2_0.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/corporate_portal_templates/src/view/jsp/Attic/blog_listing_rss_2_0.jsp,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- blog_listing_rss_2_0.jsp  27 Apr 2005 07:51:22 -0000      1.1.2.1
  +++ blog_listing_rss_2_0.jsp  27 Apr 2005 08:17:32 -0000      1.1.2.2
  @@ -13,6 +13,43 @@
       public String toXml(String html) {
           return JahiaTools.text2XMLEntityRef(JahiaTools.html2text(html), 0);
       }
  +    
  +    /**
  +     * Changes the page of the ParamBean
  +     */
  +    public void changePage(ParamBean jParams, int pageID) {
  +        try {
  +            ContentPage blogContentPage = ContentPage.getPage(pageID);       
  +            if (blogContentPage != null) {
  +                jParams.changePage(blogContentPage);
  +            }
  +        } catch (JahiaException e) {
  +            e.printStackTrace();    
  +        }
  +    }
  +    
  +    /**
  +     * Constructs the full URL of the current page
  +     */
  +    public String getURL(ParamBean jParams) {
  +        StringBuffer buffer = new StringBuffer();
  +        try {
  +            buffer.append(jParams.getRequest().getScheme());
  +            buffer.append("://");
  +            buffer.append(jParams.getRequest().getServerName());
  +            buffer.append(":");
  +            buffer.append(jParams.getRequest().getServerPort());
  +
  +            String cacheStatus = jParams.getCacheStatus();
  +            jParams.setCacheStatus(jParams.CACHE_BYPASS);
  +            buffer.append(jParams.getContentPage().getURL(jParams));
  +            jParams.setCacheStatus(cacheStatus);
  +            
  +        } catch (JahiaException e) {
  +            e.printStackTrace();    
  +        }
  +        return buffer.toString();
  +    }
   %>
   
   <%
  @@ -23,22 +60,10 @@
        pageTitle = "";
    }
   
  -StringBuffer buffer = new StringBuffer();
  -buffer.append(jParams.getRequest().getScheme());
  -buffer.append("://");
  -buffer.append(jParams.getRequest().getServerName());
  -buffer.append(":");
  -buffer.append(jParams.getRequest().getServerPort());
  -
  -String cacheStatus = jParams.getCacheStatus();
  -jParams.setCacheStatus(jParams.CACHE_BYPASS);
  -buffer.append(jData.page().getURL(jParams));
  -jParams.setCacheStatus(cacheStatus);
  -
   %>
       <channel>
            <title><%=toXml(pageTitle)%></title>
  -             <link><%=buffer.toString()%></link>
  +             <link><%=getURL(jParams)%></link>
                <description>Blog: <%=toXml(pageTitle)%></description>
                <dc:language><%=jParams.getLocale().toString()%></dc:language>
                <dc:rights>Copyright 2002-2005, Jahia Ltd - All rights 
reserved</dc:rights>
  @@ -72,10 +97,11 @@
   
           while (entriesEnum.hasMoreElements()) {
               JahiaContainer entry = (JahiaContainer)entriesEnum.nextElement();
  +            changePage(jParams, entry.getPageID());
   %>
           <item>
                    <title><%=toXml(entry.getFieldValue("title", ""))%></title>
  -                     
<link><%=buffer.toString()%>?entryId=<%=entry.getID()%></link>
  +                     
<link><%=getURL(jParams)%>?entryId=<%=entry.getID()%></link>
                        <guid 
isPermaLink="false"><%=entry.getID()%>@<%=jParams.getRequest().getServerName()%></guid>
                        
<description><![CDATA[<%=toXml(removeTags(entry.getFieldValue("body", 
"")))%>]]></description>
   
  @@ -121,7 +147,7 @@
   
   %>
                        <slash:comments><%=totalComments%></slash:comments>
  -                     
<comments><%=buffer.toString()%>?entryId=<%=entry.getID()%>#comments</comments>
  +                     
<comments><%=getURL(jParams)%>?entryId=<%=entry.getID()%>#comments</comments>
            </item>
   <%
           }
  

Reply via email to