View Javadoc
1   package org.exoplatform.services.wcm.extensions.publication;
2   
3   import java.util.List;
4   
5   import javax.jcr.Node;
6   
7   import org.exoplatform.container.component.ComponentPlugin;
8   import org.exoplatform.services.wcm.extensions.publication.context.impl.ContextConfig.Context;
9   import org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig.Lifecycle;
10  
11  /**
12   * Manages lifecycle and context of the publication.
13   *
14   * @LevelAPI Platform
15   */
16  public interface PublicationManager {
17  
18    /**
19     * Adds definitions of a lifecycle to the publication plugin.
20     *
21     * @param plugin The component plugin that defines the lifecycle.
22     */
23    public void addLifecycle(ComponentPlugin plugin);
24  
25    /**
26     * Removes definitions of a lifecycle from the publication plugin.
27     *
28     * @param plugin The component plugin that defines the lifecycle.
29     */
30    public void removeLifecycle(ComponentPlugin plugin);
31  
32    /**
33     * Adds definitions of a context to the publication plugin.
34     *
35     * @param plugin The component plugin that defines the context.
36     */
37    public void addContext(ComponentPlugin plugin);
38  
39    /**
40     * Removes definitions of a context from the publication plugin.
41     *
42     * @param plugin The component plugin that defines the context.
43     */
44    public void removeContext(ComponentPlugin plugin);
45  
46    /**
47     * Gets all lifecycles.
48     *
49     * @return The list of lifecycles.
50     */
51    public List<Lifecycle> getLifecycles();
52  
53    /**
54     * Gets all contexts.
55     *
56     * @return The list of contexts.
57     */
58    public List<Context> getContexts();
59  
60    /**
61     * Gets a context by a given name.
62     *
63     * @param name Name of the context.
64     * @return The context.
65     */
66    public Context getContext(String name);
67  
68    /**
69     * Gets a lifecycle by a given name.
70     *
71     * @return The lifecycle.
72     */
73    public Lifecycle getLifecycle(String name);
74  
75    /**
76     * Gets all lifecycles of a user by a specified state.
77     *
78     * @param remoteUser The given user.
79     * @param state The specified state by which all lifecycles are got.
80     * @return The list of lifecycles.
81     */
82    public List<Lifecycle> getLifecyclesFromUser(String remoteUser, String state);
83  
84    /**
85     * Gets all content nodes.
86     *
87     * @param fromstate The current state of the content.
88     * @param tostate The state by which lifecycles are retrieved from a user.
89     * @param date Any given date.
90     * The publication dates of returned content nodes are smaller than this given date.
91     * @param user The last user who changes the state.
92     * @param lang Language of the content nodes.
93     * @param workspace The workspace where content nodes are got.
94     * @return The list of content nodes.
95     * @throws Exception
96     */
97    public List<Node> getContents(String fromstate,
98        String tostate,
99        String date,
100       String user,
101       String lang,
102       String workspace) throws Exception;
103 }