From: <mol...@us...> - 2009-08-26 11:02:34
|
Revision: 1316 http://openutils.svn.sourceforge.net/openutils/?rev=1316&view=rev Author: molaschi Date: 2009-08-26 11:02:26 +0000 (Wed, 26 Aug 2009) Log Message: ----------- remove unused pages Removed Paths: ------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.java trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.html trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/UploadZipFilePage.html Deleted: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.java 2009-08-26 11:02:00 UTC (rev 1315) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.java 2009-08-26 11:02:26 UTC (rev 1316) @@ -1,142 +0,0 @@ -/** - * Copyright Openmind http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package net.sourceforge.openutils.mgnlmedia.media.pages; - -import info.magnolia.cms.beans.runtime.Document; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.security.AccessDeniedException; -import info.magnolia.context.MgnlContext; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Enumeration; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import javax.jcr.RepositoryException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.sourceforge.openutils.mgnlmedia.media.lifecycle.MediaModule; -import net.sourceforge.openutils.mgnlmedia.media.utils.MediaLoadUtils; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; - - -/** - * @author molaschi - * @version $Id$ - */ -public class MediaLoadZipFilePage extends MessagesTemplatedMVCHandler -{ - - private Document zipFile; - - /** - * @param name - * @param request - * @param response - */ - public MediaLoadZipFilePage(String name, HttpServletRequest request, HttpServletResponse response) - { - super(name, request, response); - // TODO Auto-generated constructor stub - } - - public String loadZip() - { - - InputStream zipStream = null; - try - { - HierarchyManager mgr = MgnlContext.getSystemContext().getHierarchyManager(MediaModule.REPO); - File temp = File.createTempFile("zipmedia", ".zip"); - FileOutputStream fos = new FileOutputStream(temp); - - zipStream = zipFile.getStream(); - IOUtils.copy(zipStream, fos); - - IOUtils.closeQuietly(fos); - ZipFile zip = new ZipFile(temp); - Enumeration< ? extends ZipEntry> entries = zip.entries(); - while (entries.hasMoreElements()) - { - ZipEntry entry = entries.nextElement(); - - String path = entry.getName(); - path = StringUtils.replace(path, "\\", "/"); - if (!path.startsWith("/")) - { - path = "/" + path; - } - - if (!entry.isDirectory()) - { - - InputStream inputStream = zip.getInputStream(entry); - - String parent = StringUtils.substringBeforeLast(path, "/"); - String filename = StringUtils.substringAfterLast(path, "/"); - - MediaLoadUtils.loadEntry(inputStream, StringUtils.defaultIfEmpty(parent, "/"), filename, false); - - } - } - } - catch (IOException e) - { - - } - catch (AccessDeniedException e) - { - - } - catch (RepositoryException e) - { - - } - finally - { - IOUtils.closeQuietly(zipStream); - } - - return this.show(); - } - - /** - * Returns the zipFile. - * @return the zipFile - */ - public Document getZipFile() - { - return zipFile; - } - - /** - * Sets the zipFile. - * @param zipFile the zipFile to set - */ - public void setZipFile(Document zipFile) - { - this.zipFile = zipFile; - } - -} Deleted: trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.html =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.html 2009-08-26 11:02:00 UTC (rev 1315) +++ trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/MediaLoadZipFilePage.html 2009-08-26 11:02:26 UTC (rev 1316) @@ -1,22 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html> - <head> - <title>Magnolia</title> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <link href="${this.request.contextPath}/.resources/admin-css/admin-all.css" type="text/css" rel="stylesheet" /> - </head> - <body id="mgnl" class="mgnlBgLight mgnlImportExport"> - <h2>$ {this.messages.get("media.loadzip")}</h2> - <div class="pageframe"> - <form method="post" action="" enctype="multipart/form-data"> - <div class="formelement"> - <label for="zipFile">$ {this.messages.get("media.loadzip.zipFile")} - </label> - <input name="zipFile" type="file" /> - </div> - <input type="hidden" name="command" value="loadZip" /> - <input type="submit" name="loadZip" value='$ {this.messages.get("media.loadzip.doUpload")}' /> - </form> - </div> - </body> -</html> \ No newline at end of file Deleted: trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/UploadZipFilePage.html =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/UploadZipFilePage.html 2009-08-26 11:02:00 UTC (rev 1315) +++ trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/media/pages/UploadZipFilePage.html 2009-08-26 11:02:26 UTC (rev 1316) @@ -1,94 +0,0 @@ -<html> - <head> - <link media="screen, projection" href="${this.request.contextPath}/.resources/media/css/upload.css" type="text/css" - rel="stylesheet"><!-- --> - </link> - <script type="text/javascript" src="${this.request.contextPath}/.resources/media/js/mootools-1.2-core.js"><!-- --> - </script> - <script type="text/javascript" src="${this.request.contextPath}/.resources/media/js/mootools-1.2-more.js"><!-- --> - </script> - <script type="text/javascript" src="${this.request.contextPath}/.resources/media/js/upload/Swiff.Uploader.js"><!-- --> - </script> - <script type="text/javascript" src="${this.request.contextPath}/.resources/media/js/upload/Fx.ProgressBar.js"><!-- --> - </script> - <script type="text/javascript" src="${this.request.contextPath}/.resources/media/js/upload/FancyUpload2.js"><!-- --> - </script> - <script type="text/javascript"> - // <![CDATA[ -window.addEvent('load', function() { - - var swiffy = new FancyUpload2($('demo-status'), $('demo-list'), { - 'url': $('form-demo').action, - 'fieldName': 'photoupload', - 'path': '${this.request.contextPath}/.resources/media/js/upload/Swiff.Uploader.swf', - 'onLoad': function() { - $('demo-status').removeClass('hide'); - $('demo-fallback').destroy(); - }, - 'multiple': false - }); - - /** - * Various interactions - */ - - $('demo-browse-all').addEvent('click', function() { - swiffy.browse({'Zip file (*.zip)': '*.zip'}); - return false; - }); - - $('demo-clear').addEvent('click', function() { - swiffy.removeFile(); - return false; - }); - - $('demo-upload').addEvent('click', function() { - swiffy.upload(); - return false; - }); - -}); -// ]]> - </script> - </head> - <body> - <form action="${this.request.contextPath}/.magnolia/pages/mediaBrowserPage.html" method="post" enctype="multipart/form-data" - id="form-demo"> - <input type="hidden" name="command" value="saveZip" /> - <input id="parentPath" type="hidden" name="parentPath" value="{parentPath}" /> - <fieldset id="demo-fallback"> - <legend>File Upload</legend> - <p> - Selected your photo to upload. - <br /> - <strong>This form is just an example fallback for the unobtrusive behaviour of FancyUpload.</strong> - </p> - <label for="demo-photoupload"> - Upload Photos: - <input type="file" name="zipFile" id="demo-photoupload" /> - </label> - </fieldset> - <div id="demo-status" class="hide"> - <p> - <a href="#" id="demo-browse-all">Browse Files</a> - | - <a href="#" id="demo-clear">Clear List</a> - | - <a href="#" id="demo-upload">Upload</a> - </p> - <div> - <strong class="overall-title">Overall progress</strong> - <br /> - <img src="${this.request.contextPath}/.resources/media/assets/progress-bar/bar.gif" class="progress overall-progress" /> - </div> - <div> - <strong class="current-title">File Progress</strong> - <br /> - <img src="${this.request.contextPath}/.resources/media/assets/progress-bar/bar.gif" class="progress current-progress" /> - </div> - <div class="current-text"></div> - </div> - <ul id="demo-list"></ul> - </form> - </body> -</html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |