001/*
002 * (C) Copyright 2006-2007 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id: JOOoConvertPluginImpl.java 18651 2007-05-13 20:28:53Z sfermigier $
020 */
021
022package org.nuxeo.ecm.webapp.filemanager;
023
024import java.io.InputStream;
025
026import javax.faces.event.ActionEvent;
027
028import org.jboss.seam.annotations.remoting.WebRemote;
029import org.nuxeo.ecm.platform.ui.web.api.SimpleFileManager;
030
031public interface FileManageActions extends SimpleFileManager {
032
033    /**
034     * @since 6.0
035     */
036    public static final String NUXEO_JSF_TMP_DIR_PROP = "nuxeo.jsf.tmp.dir";
037
038    @Override
039    String display();
040
041    /**
042     * Adds a new File.
043     *
044     * @return the page that displays the documents
045     */
046    String addFile();
047
048    void setFileUpload(InputStream fileUpload);
049
050    InputStream getFileUpload();
051
052    void setFileName(String fileName);
053
054    String getFileName();
055
056    /**
057     * Setter to get the filename to remove, works in conjunction with {@link #removeOneOrAllUploadedFiles(ActionEvent)}
058     * .
059     *
060     * @since 5.9.2
061     */
062    void setFileToRemove(String fileToRemove);
063
064    /**
065     * Removes one of all uploaded files, depending on previous call to {@link #setFileToRemove(String)}.
066     * <p>
067     * This is useful to remove files in an Ajax context to avoid Seam remoting, and still get the selected entry from
068     * JavaScript variables (see NXP-13234).
069     *
070     * @since 5.9.2
071     */
072    String removeOneOrAllUploadedFiles(ActionEvent action);
073
074    @WebRemote
075    String addFolderFromPlugin(String fullName, String morePath);
076
077    @WebRemote
078    String addFileFromPlugin(String content, String mimetype, String fullName, String morePath, Boolean UseBase64);
079
080    @WebRemote
081    boolean canWrite();
082
083    @WebRemote
084    String moveWithId(String docId, String containerId);
085
086    @WebRemote
087    String copyWithId(String docId);
088
089    @WebRemote
090    String pasteWithId(String docId);
091
092    @WebRemote
093    String removeUploadedFile(String fileName);
094
095    @WebRemote
096    String removeAllUploadedFile();
097
098    @WebRemote
099    String removeSingleUploadedFile();
100
101}