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.portal;
18
19 import java.util.Collection;
20 import java.util.List;
21
22 import javax.jcr.Node;
23
24 import org.exoplatform.portal.config.model.PortalConfig;
25 import org.exoplatform.services.jcr.ext.common.SessionProvider;
26
27 /*
28 * Created by The eXo Platform SAS
29 * @author : Hoa.Pham
30 * hoa.pham@exoplatform.com
31 * Jun 19, 2008
32 */
33 /**
34 * The Interface LivePortalManagerService.
35 */
36 public interface LivePortalManagerService {
37
38 /**
39 * Gets the live shared portal on current repository.
40 *
41 * @param sessionProvider the session provider
42 * @return the live shared portal
43 * @throws Exception the exception
44 */
45 public Node getLiveSharedPortal(final SessionProvider sessionProvider) throws Exception;
46
47 /**
48 * Gets the all live portals path.
49 *
50 * @return the live portals path
51 * @throws Exception the exception
52 */
53 public String getPortalNameByPath(String portalPath) throws Exception;
54 public String getPortalPathByName(String portalName) throws Exception;
55
56 public Collection<String> getLivePortalsPath() throws Exception;
57
58 /**
59 * Gets the all live portals on current repository.
60 *
61 * @param sessionProvider the session provider
62 * @return the live portals
63 * @throws Exception the exception
64 */
65 public List<Node> getLivePortals(final SessionProvider sessionProvider) throws Exception;
66
67 /**
68 * Gets the live portal by name.
69 *
70 * @param portalName the portal name
71 * @param sessionProvider the session provider
72 * @return the live portal
73 * @throws Exception the exception
74 */
75 public Node getLivePortal(final SessionProvider sessionProvider, final String portalName) throws Exception;
76
77 /**
78 * Gets the live shared portal on specific repository.
79 *
80 * @param repository the repository
81 * @param sessionProvider the session provider
82 * @return the live shared portal
83 * @throws Exception the exception
84 */
85 public Node getLiveSharedPortal(final SessionProvider sessionProvider, final String repository) throws Exception;
86
87 public Node getLivePortalByChild(Node childNode) throws Exception;
88 /**
89 * Gets the live portals on specific repository.
90 *
91 * @param repository the repository
92 * @param sessionProvider the session provider
93 * @return the live portals
94 * @throws Exception the exception
95 */
96 public List<Node> getLivePortals(final SessionProvider sessionProvider, final String repository) throws Exception;
97
98 /**
99 * Gets the live portal on specific repository.
100 *
101 * @param repository the repository
102 * @param portalName the portal name
103 * @param sessionProvider the session provider
104 * @return the live portal
105 * @throws Exception the exception
106 */
107 public Node getLivePortal(final SessionProvider sessionProvider,
108 final String repository,
109 final String portalName) throws Exception;
110
111 /**
112 * Adds the live portal on current repository.
113 *
114 * @param portalConfig the portal config
115 * @param sessionProvider the session provider
116 * @throws Exception the exception
117 */
118 public void addLivePortal(final SessionProvider sessionProvider, final PortalConfig portalConfig) throws Exception;
119
120 /**
121 * Removes the live portal on current repository.
122 *
123 * @param portalConfig the portal config
124 * @param sessionProvider the session provider
125 * @throws Exception the exception
126 */
127 public void removeLivePortal(final SessionProvider sessionProvider, final PortalConfig portalConfig) throws Exception;
128 }