View Javadoc
1   /*
2    * Copyright (C) 2003-2014 eXo Platform SAS.
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU Affero General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU Affero General Public License for more details.
13   *
14   * You should have received a copy of the GNU Affero General Public License
15   * along with this program. If not, see <http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.services.cms.clipboard;
18  
19  import java.util.Set;
20  
21  import org.exoplatform.services.cms.clipboard.jcr.model.ClipboardCommand;
22  
23  /**
24   * Created by The eXo Platform SAS
25   * Author : eXoPlatform
26   *          exo@exoplatform.com
27   * Jan 28, 2014  
28   */
29  public interface ClipboardService {
30    
31    /**
32     * Adds a clipboard command for user
33     * @param userId user to add command
34     * @param command the command 
35     * @param isVirtual if the command is virtual
36     */
37    public void addClipboardCommand(String userId, ClipboardCommand command, boolean isVirtual);
38    
39    /**
40     * Gets the last clipboard command of user
41     * @param userId user to get command
42     * @return the ClipboardCommand
43     */
44    public ClipboardCommand getLastClipboard(String userId);
45  
46    /**
47     * Gets the list of clipboard command added by given user
48     * check in clipboard. if a node was deleted, remove all clipboardCommands relate to that node in clipboard 
49     * @param userId the user who added the commands
50     * @param isVirtual if the commands are virtual
51     * @return the list of ClipboardCommand
52     */
53    public Set<ClipboardCommand> getClipboardList(String userId, boolean isVirtual);
54    
55    /**
56     * Clears the list of clipboard command
57     * @param userId the user who added the commands
58     * @param isVirtual if the commands are virtual
59     */
60    public void clearClipboardList(String userId, boolean isVirtual);
61    
62    /**
63     * Remove one command form clipboard
64     * @param userId the user who added the commands
65     * @param command the command
66     * command need to remove
67     */
68    public void removeClipboardCommand(String userId, ClipboardCommand command);
69  }