001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $
018 */
019
020package org.nuxeo.ecm.webapp.filemanager;
021
022import java.io.InputStream;
023
024import javax.faces.event.ActionEvent;
025
026import org.jboss.seam.annotations.remoting.WebRemote;
027import org.nuxeo.ecm.platform.ui.web.api.SimpleFileManager;
028
029public interface FileManageActions extends SimpleFileManager {
030
031    /**
032     * @since 6.0
033     */
034    public static final String NUXEO_JSF_TMP_DIR_PROP = "nuxeo.jsf.tmp.dir";
035
036    @Override
037    String display();
038
039    /**
040     * Adds a new File.
041     *
042     * @return the page that displays the documents
043     */
044    String addFile();
045
046    void setFileUpload(InputStream fileUpload);
047
048    InputStream getFileUpload();
049
050    void setFileName(String fileName);
051
052    String getFileName();
053
054    /**
055     * Setter to get the filename to remove, works in conjunction with {@link #removeOneOrAllUploadedFiles(ActionEvent)}
056     * .
057     *
058     * @since 5.9.2
059     */
060    void setFileToRemove(String fileToRemove);
061
062    /**
063     * Removes one of all uploaded files, depending on previous call to {@link #setFileToRemove(String)}.
064     * <p>
065     * This is useful to remove files in an Ajax context to avoid Seam remoting, and still get the selected entry from
066     * JavaScript variables (see NXP-13234).
067     *
068     * @since 5.9.2
069     */
070    String removeOneOrAllUploadedFiles(ActionEvent action);
071
072    @WebRemote
073    String addFolderFromPlugin(String fullName, String morePath);
074
075    @WebRemote
076    String addFileFromPlugin(String content, String mimetype, String fullName, String morePath, Boolean UseBase64);
077
078    @WebRemote
079    boolean canWrite();
080
081    @WebRemote
082    String moveWithId(String docId, String containerId);
083
084    @WebRemote
085    String copyWithId(String docId);
086
087    @WebRemote
088    String pasteWithId(String docId);
089
090    @WebRemote
091    String removeUploadedFile(String fileName);
092
093    @WebRemote
094    String removeAllUploadedFile();
095
096    @WebRemote
097    String removeSingleUploadedFile();
098
099}