roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r824557 - in /roller/trunk/apps/weblogger: src/java/org/apache/roller/weblogger/business/ src/java/org/apache/roller/weblogger/pojos/ web/WEB-INF/jsps/editor/
Date Tue, 13 Oct 2009 01:05:31 GMT
Author: snoopdave
Date: Tue Oct 13 01:05:30 2009
New Revision: 824557

URL: http://svn.apache.org/viewvc?rev=824557&view=rev
Log:
Ensure that mediafile URLs always formed by call to URLStrategy, otherwise images/thumbnails
may appear as broken on a "multisite" setup like I have with rollerweblogger.org and photophys.com
running on same Roller instance.

Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/Weblog.java
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileImageChooser.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java?rev=824557&r1=824556&r2=824557&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/MultiWeblogURLStrategy.java
Tue Oct 13 01:05:30 2009
@@ -91,8 +91,8 @@
         url.append(getWeblogURL(weblog, locale, absolute));
         url.append("entry/").append(URLUtilities.encode(entryAnchor));
         
-        return url.toString();
-    }
+    return url.toString();
+}
     
     
     /**
@@ -108,16 +108,8 @@
         }
         
         StringBuffer url = new StringBuffer();
-        
-        if(absolute) {
-            url.append(WebloggerRuntimeConfig.getAbsoluteContextURL());
-        } else {
-            url.append(WebloggerRuntimeConfig.getRelativeContextURL());
-        }
-        
-        url.append("/");
-        url.append(weblog.getHandle());
-        url.append("/mediaresource/");
+        url.append(getWeblogURL(weblog, null, absolute));
+        url.append("mediaresource");
         url.append("/");
         url.append(URLUtilities.encode(fileAnchor));
         

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/Weblog.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/Weblog.java?rev=824557&r1=824556&r2=824557&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/Weblog.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/pojos/Weblog.java Tue
Oct 13 01:05:30 2009
@@ -846,11 +846,9 @@
      * @roller.wrapPojoMethod type="simple"
      */
     public String getURL() {
-        // TODO: ATLAS reconcile entry.getPermaLink() with new URLs
-        String relPath = WebloggerRuntimeConfig.getRelativeContextURL();
-        return relPath + "/" + getHandle();
-        //return URLUtilities.getWeblogURL(this, null, false);
+        return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogURL(this, null,
false);
     }
+
     public void setURL(String url) {
         // noop
     }
@@ -860,14 +858,7 @@
      * @roller.wrapPojoMethod type="simple"
      */
     public String getAbsoluteURL() {
-        String weblogAbsoluteURL =
-            WebloggerConfig.getProperty("weblog.absoluteurl." + getHandle());
-        if (weblogAbsoluteURL != null) {
-            return weblogAbsoluteURL + "/" + getHandle();
-        } else {
-            String relPath = WebloggerRuntimeConfig.getAbsoluteContextURL();
-            return relPath + "/" + getHandle();
-        }
+        return WebloggerFactory.getWeblogger().getUrlStrategy().getWeblogURL(this, null,
true);
     }
     
     

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp?rev=824557&r1=824556&r2=824557&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp Tue Oct 13
01:05:30 2009
@@ -89,7 +89,7 @@
                 <td>
                     <%-- description of file --%>
                     <img align="left" class="mediaFileImage"
-                         src='<s:property value="%{#newImage.permalink}" />?t=true'
alt="thumbnail" />
+                         src='<s:property value="%{#newImage.thumbnailURL}" />' alt="thumbnail"
/>
 
                     <span class="label"><s:text name="mediaFileSuccess.name" /></span>
                     <s:property value="%{#newImage.name}" /><br />

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileImageChooser.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileImageChooser.jsp?rev=824557&r1=824556&r2=824557&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileImageChooser.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileImageChooser.jsp Tue Oct
13 01:05:30 2009
@@ -153,10 +153,10 @@
                         onmouseover="highlight(this, true)" onmouseout="highlight(this, false)">
 
                         <s:url id="mediaFileURL" includeContext="false"
-                            value="/%{#mediaFile.weblog.handle}/mediaresource/%{#mediaFile.id}"></s:url>
+                            value="/%{#mediaFile.permalink"></s:url>
 
                         <s:url id="mediaFileThumbnailURL"
-                            value="/%{#mediaFile.weblog.handle}/mediaresource/%{#mediaFile.id}?t=true"></s:url>
+                            value="/%{#mediaFile.thumbnailURL"></s:url>
 
                     <div class="mediaObject"
                          onclick="onSelectImage('<s:property value="#mediaFile.name"/>','<s:property
value="%{mediaFileURL}" />')" >

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp?rev=824557&r1=824556&r2=824557&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileView.jsp Tue Oct 13 01:05:30
2009
@@ -262,9 +262,7 @@
                              onclick="onClickEdit('<s:property value="#mediaFile.id"/>')"
>
 
                             <s:if test="#mediaFile.imageFile">
-                                <s:url id="mediaFileURL"
-                                    value="/%{#mediaFile.weblog.handle}/mediaresource/%{#mediaFile.id}?t=true"></s:url>
-                                <img border="0" src='<s:property value="%{mediaFileURL}"
/>'
+                                <img border="0" src='<s:property value="%{#mediaFile.thumbnailURL}"
/>'
                                      width='<s:property value="#mediaFile.thumbnailWidth"/>'
                                      height='<s:property value="#mediaFile.thumbnailHeight"/>'
/>
                             </s:if>
@@ -313,9 +311,7 @@
                              onclick="onClickEdit('<s:property value="#mediaFile.id"/>')"
>
 
                             <s:if test="#mediaFile.imageFile">
-                                <s:url id="mediaFileURL"
-                                    value="/%{#mediaFile.weblog.handle}/mediaresource/%{#mediaFile.id}?t=true"></s:url>
-                                <img border="0" src='<s:property value="%{mediaFileURL}"
/>'
+                                <img border="0" src='<s:property value="%{#mediaFile.thumbnailURL}"
/>'
                                      width='<s:property value="#mediaFile.thumbnailWidth"/>'
                                      height='<s:property value="#mediaFile.thumbnailHeight"/>'
/>
                             </s:if>
@@ -479,4 +475,4 @@
         </iframe>
     </div>
     <div class="ft"></div>
-</div>
+</div> 



Mime
View raw message