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.wcm.publication;
18
19 import java.util.List;
20
21 import javax.jcr.Node;
22
23 import org.exoplatform.portal.config.model.Page;
24 import org.exoplatform.services.ecm.publication.PublicationPlugin;
25 import org.exoplatform.services.wcm.publication.listener.post.PostCreateContentEventListener;
26 import org.exoplatform.services.wcm.publication.listener.post.PostEditContentEventListener;
27
28 /**
29 * Created by The eXo Platform SAS
30 * Author : Hoa Pham
31 * hoa.pham@exoplatform.com
32 * Sep 29, 2008
33 */
34
35 /**
36 * Base class of Webpage Publication plugins.
37 * Webpage publication plugins implement a publication lifecycle. Each time a new
38 * custom lifecycle needs to be defined, a new plugin has to be implemented
39 * and registered with the Publication Service.
40 */
41 public abstract class WebpagePublicationPlugin extends PublicationPlugin {
42
43 /**
44 * Update the lifecycle of the content depending of its current state.
45 * This method is generally called when the node has been modified (saved).
46 *
47 * @param node the node
48 * @param remoteUser the remote user
49 *
50 * @throws Exception the exception
51 *
52 * @see PostCreateContentEventListener
53 * @see PostEditContentEventListener
54 */
55 public abstract void updateLifecyleOnChangeContent(Node node, String remoteUser) throws Exception;
56
57 /**
58 * Update the lifecycle of the content depending of its current state.
59 * This method is generally called when the node has been modified (saved).
60 *
61 * @param node the node
62 * @param remoteUser the remote user
63 * @param newState the new state
64 *
65 * @throws Exception the exception
66 *
67 * @see PostCreateContentEventListener
68 * @see PostEditContentEventListener
69 */
70 public abstract void updateLifecyleOnChangeContent(Node node, String remoteUser, String newState) throws Exception;
71
72 /**
73 * Gets the lifecycle type.
74 *
75 * @return the lifecycle type
76 */
77 public abstract String getLifecycleType();
78
79 /**
80 * Gets the list page navigation uri.
81 *
82 * @param page the page
83 * @param remoteUser the remote user
84 *
85 * @return the list page navigation uri
86 *
87 * @throws Exception the exception
88 */
89 public abstract List<String> getListUserNavigationUri(Page page, String remoteUser) throws Exception;
90 }