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.core;
18
19 import java.util.Collection;
20
21 import javax.jcr.Node;
22
23 import org.exoplatform.container.component.ComponentPlugin;
24 import org.exoplatform.services.jcr.ext.common.SessionProvider;
25
26 /**
27 * Created by The eXo Platform SAS.
28 *
29 * @author : Hoa.Pham
30 * hoa.pham@exoplatform.com
31 * May 28, 2008
32 */
33 public interface WebSchemaConfigService {
34
35 /**
36 * Adds the web schema handler.
37 *
38 * @param plugin the plugin
39 *
40 * @throws Exception the exception
41 */
42 public void addWebSchemaHandler(ComponentPlugin plugin) throws Exception;
43
44 /**
45 * Gets the all web schema handler.
46 *
47 * @return the all web schema handler
48 *
49 * @throws Exception the exception
50 */
51 public Collection<WebSchemaHandler> getAllWebSchemaHandler() throws Exception;
52
53 /**
54 * Gets the web schema handler by type.
55 *
56 * @param clazz the clazz
57 *
58 * @return the web schema handler by type
59 */
60 public <T extends WebSchemaHandler> T getWebSchemaHandlerByType(Class<T> clazz);
61
62 /**
63 * Call this method when a node is created in observed tree.
64 *
65 * @param node the node
66 * @param sessionProvider the session provider
67 *
68 * @throws Exception the exception
69 */
70 public void createSchema(SessionProvider sessionProvider, final Node node) throws Exception;
71
72 /**
73 * Update schema when a node is modified.
74 *
75 * @param node the node
76 * @param sessionProvider the session provider
77 *
78 * @throws Exception the exception
79 */
80 public void updateSchemaOnModify(SessionProvider sessionProvider, final Node node) throws Exception;
81
82 /**
83 * Update schema on when a node is removed.
84 *
85 * @param node the node
86 * @param sessionProvider the session provider
87 *
88 * @throws Exception the exception
89 */
90 public void updateSchemaOnRemove(SessionProvider sessionProvider, final Node node) throws Exception;
91 }