From: <die...@us...> - 2011-02-08 14:28:37
|
Revision: 3320 http://openutils.svn.sourceforge.net/openutils/?rev=3320&view=rev Author: diego_schivo Date: 2011-02-08 14:28:30 +0000 (Tue, 08 Feb 2011) Log Message: ----------- MEDIA-214 playlist save Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/dialog/SearchPlaylistDialogMVC.java trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.java trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/dialog/SearchPlaylistDialogMVC.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/dialog/SearchPlaylistDialogMVC.java 2011-02-08 13:50:06 UTC (rev 3319) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/dialog/SearchPlaylistDialogMVC.java 2011-02-08 14:28:30 UTC (rev 3320) @@ -20,16 +20,19 @@ package net.sourceforge.openutils.mgnlmedia.playlist.dialog; import info.magnolia.cms.core.Content; +import info.magnolia.cms.gui.misc.Sources; import info.magnolia.module.admininterface.SaveHandler; import info.magnolia.module.admininterface.dialogs.ConfiguredDialog; import java.io.IOException; +import java.io.PrintWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sourceforge.openutils.mgnlmedia.playlist.PlaylistConstants; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -97,7 +100,19 @@ @Override public void renderHtml(String view) throws IOException { - // TODO Auto-generated method stub - super.renderHtml(view); + if (VIEW_CLOSE_WINDOW.equals(view)) + { + PrintWriter out = this.getResponse().getWriter(); + + out.println("<html>"); //$NON-NLS-1$ + out.println(new Sources(this.getRequest().getContextPath()).getHtmlJs()); + out.println("<script type=\"text/javascript\">"); //$NON-NLS-1$ + out.println("parent.location.href = '/open/.magnolia/pages/playlistsBrowser.html?openPath=" + form.getParameter("parentFolder") + "/" + form.getParameter("playlistName") + "'"); //$NON-NLS-1$ + out.println("</script></html>"); //$NON-NLS-1$ + } + else + { + super.renderHtml(view); + } } } Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.java 2011-02-08 13:50:06 UTC (rev 3319) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.java 2011-02-08 14:28:30 UTC (rev 3320) @@ -24,7 +24,10 @@ import net.sourceforge.openutils.mgnlmedia.media.pages.MessagesTemplatedMVCHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * @author dschivo */ @@ -32,10 +35,35 @@ { /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(PlaylistsBrowserPage.class); + + private String openPath; + + /** * */ public PlaylistsBrowserPage(String name, HttpServletRequest request, HttpServletResponse response) { super(name, request, response); } + + /** + * Returns the openPath. + * @return the openPath + */ + public String getOpenPath() + { + return openPath; + } + + /** + * Sets the openPath. + * @param openPath the openPath to set + */ + public void setOpenPath(String openPath) + { + this.openPath = openPath; + } } Modified: trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html 2011-02-08 13:50:06 UTC (rev 3319) +++ trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html 2011-02-08 14:28:30 UTC (rev 3320) @@ -10,6 +10,7 @@ <script type="text/javascript"> // <![CDATA[ var viewport; +var openPath = "${this.openPath!''}"; Ext.onReady(function(){ viewport = new Ext.Viewport({ @@ -45,8 +46,8 @@ ] }); setTimeout(function() { - frames['playlistTreeView'].location.href = '${this.request.contextPath}/.magnolia/trees/playlists.html?mgnlCK=' + (new Date()).getTime(); - frames['playlistView'].location.href = '${this.request.contextPath}/.magnolia/pages/playlistView.html?mgnlCK=' + (new Date()).getTime(); + frames['playlistTreeView'].location.href = '${this.request.contextPath}/.magnolia/trees/playlists.html?pathOpen=' + openPath + '&pathCurrent=' + openPath + '&pathSelected=' + openPath + '&mgnlCK=' + (new Date()).getTime(); + frames['playlistView'].location.href = '${this.request.contextPath}/.magnolia/pages/playlistView.html?path=' + openPath + '&mgnlCK=' + (new Date()).getTime(); }, 100); }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |