roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r821562 - in /roller/trunk/apps/weblogger: src/java/org/apache/roller/weblogger/ui/struts2/editor/ web/WEB-INF/jsps/editor/
Date Sun, 04 Oct 2009 17:19:33 GMT
Author: snoopdave
Date: Sun Oct  4 17:19:32 2009
New Revision: 821562

URL: http://svn.apache.org/viewvc?rev=821562&view=rev
Log:
Upload Media File link should upload into current directory and when upload is complete, links
should lead you back to that directory

Modified:
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
    roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileAddSuccess.jsp
    roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileSidebar.jsp

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java?rev=821562&r1=821561&r2=821562&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
Sun Oct  4 17:19:32 2009
@@ -24,6 +24,7 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -61,6 +62,8 @@
     private List<MediaFile> newImages = new ArrayList<MediaFile>();
 
     private List<MediaFile> newFiles = new ArrayList<MediaFile>();
+
+    private String directoryPath =  null;
     
 
     public MediaFileAdd() {
@@ -79,9 +82,16 @@
             MediaFileManager mgr = WebloggerFactory.getWeblogger().getMediaFileManager();
             if (!StringUtils.isEmpty(bean.getDirectoryId())) {
                 setDirectory(mgr.getMediaFileDirectory(bean.getDirectoryId()));
+
+            } else if (StringUtils.isNotEmpty(directoryPath)) {
+                setDirectory(mgr.getMediaFileDirectoryByPath(getActionWeblog(), directoryPath));
+
             } else {
                 setDirectory(mgr.createRootMediaFileDirectory(getActionWeblog()));
             }
+            directoryPath = getDirectory().getPath();
+            bean.setDirectoryId(getDirectory().getId());
+
         } catch (WebloggerException ex) {
             log.error("Error looking up media file directory", ex);
         }
@@ -271,4 +281,18 @@
     public void setNewFiles(List<MediaFile> newFiles) {
         this.newFiles = newFiles;
     }
+
+    /**
+     * @return the directoryPath
+     */
+    public String getDirectoryPath() {
+        return directoryPath;
+    }
+
+    /**
+     * @param directoryPath the directoryPath to set
+     */
+    public void setDirectoryPath(String directoryPath) {
+        this.directoryPath = directoryPath;
+    }
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java?rev=821562&r1=821561&r2=821562&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java
(original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java
Sun Oct  4 17:19:32 2009
@@ -175,13 +175,16 @@
             MediaFileDirectory directory;
             if (this.directoryId != null) {
                 directory = manager.getMediaFileDirectory(this.directoryId);
+
             } else if (this.directoryPath != null) {
                 directory = manager.getMediaFileDirectoryByPath(getActionWeblog(), this.directoryPath);
                 this.directoryId = directory.getId();
+
             } else {
                 directory = manager.getMediaFileRootDirectory(getActionWeblog());
                 this.directoryId = directory.getId();
             }
+            this.directoryPath = directory.getPath();
 
             this.childDirectories = new ArrayList<MediaFileDirectory>();
             this.childDirectories.addAll(directory.getChildDirectories());

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=821562&r1=821561&r2=821562&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 Sun Oct  4
17:19:32 2009
@@ -156,6 +156,7 @@
             <li>
                 <s:url id="mediaFileAddURL" action="mediaFileAdd">
                     <s:param name="weblog" value="%{actionWeblog.handle}" />
+                    <s:param name="directoryPath" value="%{directoryPath}" />
                 </s:url>
                 <s:a href="%{mediaFileAddURL}">
                     <s:text name="mediaFileSuccess.addAnother" />
@@ -165,6 +166,7 @@
             <li>
                 <s:url id="mediaFileViewURL" action="mediaFileView">
                     <s:param name="weblog" value="%{actionWeblog.handle}" />
+                    <s:param name="directoryId" value="%{bean.directoryId}" />
                 </s:url>
                 <s:a href="%{mediaFileViewURL}">
                     <s:text name="mediaFileSuccess.mediaFileView" />

Modified: roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileSidebar.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileSidebar.jsp?rev=821562&r1=821561&r2=821562&view=diff
==============================================================================
--- roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileSidebar.jsp (original)
+++ roller/trunk/apps/weblogger/web/WEB-INF/jsps/editor/MediaFileSidebar.jsp Sun Oct  4 17:19:32
2009
@@ -28,10 +28,12 @@
 
                 <s:url id="mediaFileAddURL" action="mediaFileAdd">
                     <s:param name="weblog" value="%{actionWeblog.handle}" />
+                    <s:param name="directoryPath" value="%{directoryPath}" />
                 </s:url>
-                <a href='<s:property value="%{mediaFileAddURL}" />'
+                <a href='<s:property escape="false" value="%{mediaFileAddURL}" />'
                     <s:if test="actionName.equals('mediaFileAdd')">style='font-weight:bold;'</s:if>
>
-                    <s:text name="mediaFileSidebar.add" /></a>
+                    <s:text name="mediaFileSidebar.add" />
+                </a>
 
                 <hr size="1" noshade="noshade" />
                 <br />



Mime
View raw message