View Javadoc
1   /*
2    * Copyright (C) 2003-2008 eXo Platform SAS.
3    *
4    * This program is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Affero General Public License
6    * as published by the Free Software Foundation; either version 3
7    * of the License, or (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 General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program; if not, see<http://www.gnu.org/licenses/>.
16   */
17  package org.exoplatform.services.ecm.publication;
18  
19  import javax.jcr.Node;
20  
21  import org.exoplatform.webui.core.UIComponent;
22  import org.exoplatform.webui.form.UIForm;
23  
24  /**
25   * Created by The eXo Platform SAS
26   * Author : Romain Dénarié
27   *          romain.denarie@exoplatform.com
28   * 7 mai 08
29   */
30  public interface PublicationPresentationService {
31  
32    /**
33     * Retrieves the WebUI form corresponding to the current state of the
34     * specified node.
35     * The method first inspects the specified Node. If it does not contain
36     * a publication mixin, then it throws a NotInPublicationLifecycleException
37     * exception. Else, it retrieves the lifecycle name from the mixin,
38     * selects the appropriate publication plugin and delegates the call to it.
39     *
40     * @param node the Node from which the state UI should be retrieved
41     * @return a WebUI form corresponding to the current state and node.
42     * @throws NotInPublicationLifecycleException in case the Node has not
43     * been registered in any lifecycle yet (in other words, if no publication
44     * mixin has been found).
45     */
46    public UIForm getStateUI(Node node, UIComponent component) throws NotInPublicationLifecycleException, Exception;
47  
48    /**
49     * Add a Publication Plugin to the service.
50     * The method caches all added plugins.
51     *
52     * @param p the plugin to add
53     */
54    public void addPublicationPlugin(PublicationPlugin p);
55  
56  }