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.wcm.core;
18  
19  import javax.jcr.Node;
20  
21  import org.exoplatform.services.jcr.ext.common.SessionProvider;
22  
23  /**
24   * Created by The eXo Platform SAS.
25   *
26   * @author : Hoa.Pham hoa.pham@exoplatform.com Jun 3, 2008
27   */
28  public interface WebSchemaHandler {
29    /**
30     * Match handler to process the schema
31     *
32     * @param node the node
33     * @return true, if successful
34     * @throws Exception the exception
35     */
36    public boolean matchHandler(SessionProvider sessionProvider, final Node node) throws Exception;
37  
38    /**
39     * Process schema when crete node
40     *
41     * @param node the node
42     * @throws Exception the exception
43     */
44    public void onCreateNode(SessionProvider sessionProvider, final Node node) throws Exception;
45  
46    /**
47     * Update schema when modify node
48     *
49     * @param node the node
50     * @throws Exception the exception
51     */
52    public void onModifyNode(SessionProvider sessionProvider, final Node node) throws Exception;
53  
54    /**
55     * Update schema before a node is removed
56     *
57     * @param node the node
58     * @throws Exception the exception
59     */
60    public void onRemoveNode(SessionProvider sessionProvider, final Node node) throws Exception;
61  }