View Javadoc

1   /*
2    * Copyright 2000-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.portals.graffito.jcr.persistence.impl;
17  
18  import org.apache.commons.logging.Log;
19  import org.apache.commons.logging.LogFactory;
20  
21  import org.apache.portals.graffito.jcr.exception.CustomNodeTypeCreationException;
22  import org.apache.portals.graffito.jcr.persistence.CustomNodeTypeCreator;
23  import org.apache.portals.graffito.jcr.persistence.PersistenceManager;
24  
25  /*** Default implementation of the jackrabbit custom node creator.
26   *
27   * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
28   * @version $Id: Exp $
29   */
30  public class CustomNodeTypeCreatorImpl implements CustomNodeTypeCreator {
31      
32      /*** Logger.
33       */
34      private final static Log log = LogFactory.getLog(CustomNodeTypeCreatorImpl.class); 
35      
36      /*** Session to the jcr repository.
37       */
38      private PersistenceManagerImpl jcrSession;
39      
40      /*** Creates a new instance of CustomNodeTypeCreatorImpl. */
41      public CustomNodeTypeCreatorImpl()
42      {
43      }
44      
45      /*** Creates a new instance of CustomNodeTypeCreatorImpl with a jcr session. 
46       * @param jcrSession JcrSession
47       */
48      public CustomNodeTypeCreatorImpl(PersistenceManagerImpl jcrSession)
49      {
50          this.jcrSession = jcrSession;
51      }
52  
53      /*** This method is supposed to create custom node types on repository
54       * setup.
55       * 
56       * @throws org.apache.portals.graffito.jcr.exception.CustomNodeTypeCreationException 
57       * @return true/false
58       */
59      public boolean createInitialJcrCustomNodeTypes() throws CustomNodeTypeCreationException
60      {
61         
62          // TODO
63          
64          return true;
65      }
66  
67      /*** Method to add a jcr custom node type to an existing jcr repository.
68       * 
69       * @throws org.apache.portals.graffito.jcr.exception.CustomNodeTypeCreationException 
70       * @return true/false
71       */
72      public boolean addJcrCustomNodeType() throws CustomNodeTypeCreationException
73      {
74          
75          // TODO
76          
77          return false;
78      }
79      
80      /*** Setter for property jcrSession.
81       * 
82       * @param jcrSession JcrSession
83       */
84      public void setJcrSession(PersistenceManagerImpl jcrSession)
85      {
86          this.jcrSession = jcrSession;
87      }
88  
89      /*** Getter for property jcrSession.
90       * 
91       * @return jcrSession
92       */
93      public PersistenceManager getJcrSession()
94      {
95          return jcrSession;
96      }
97  }