KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > services > cms > manager > CmsManager


1 /* ====================================================================
2  * The Apache Software License, Version 1.1
3  *
4  * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
5  * reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in
16  * the documentation and/or other materials provided with the
17  * distribution.
18  *
19  * 3. The end-user documentation included with the redistribution,
20  * if any, must include the following acknowledgment:
21  * "This product includes software developed by the
22  * Apache Software Foundation (http://www.apache.org/)."
23  * Alternately, this acknowledgment may appear in the software itself,
24  * if and wherever such third-party acknowledgments normally appear.
25  *
26  * 4. The names "Apache" and "Apache Software Foundation" and
27  * "Apache Jetspeed" must not be used to endorse or promote products
28  * derived from this software without prior written permission. For
29  * written permission, please contact apache@apache.org.
30  *
31  * 5. Products derived from this software may not be called "Apache" or
32  * "Apache Jetspeed", nor may "Apache" appear in their name, without
33  * prior written permission of the Apache Software Foundation.
34  *
35  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46  * SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of the Apache Software Foundation. For more
51  * information on the Apache Software Foundation, please see
52  * <http://www.apache.org/>.
53  */

54
55 package org.apache.jetspeed.services.cms.manager;
56
57 // JDK
58
import java.util.Vector JavaDoc;
59
60 //Jetspeed
61
import org.apache.jetspeed.services.cms.JetspeedCMSException;
62 import org.apache.jetspeed.om.cms.*;
63 import org.apache.turbine.util.upload.FileItem;
64
65 /**
66  * Cms manager
67  *
68  * @author <a HREF="mailto:christophe.lombart@skynet.be">Christophe Lombart</a>
69  */

70 public interface CmsManager
71 {
72
73     /**
74     * Initialise the CmsManager.
75     * @param nameSpace used assigned to the CmsManager. This namespace can be
76     * used to read parameters assigned to this namespace in the JR.prop
77     */

78     void init (String JavaDoc namespace)
79            throws JetspeedCMSException;
80
81     /**
82     * Export the CMS repository into an xml file
83     * @param userNode User reference
84     * @param xmlFileName output file
85     */

86     public void exportRepository (String JavaDoc xmlFileName)
87            throws JetspeedCMSException;
88
89     /**
90     * Populate a catalog structure from the repository
91     *
92     * @param userNode User reference
93     * @param Catalog object to populate
94     */

95      public void populateCatalog (Catalog catalog)
96            throws JetspeedCMSException;
97
98     /**
99     * Populate a catalog structure from the repository
100     *
101     * @param userNode User reference
102     * @param catalog object to populate
103     * @param withSubCatalog - retrieve or not sub-catalogs
104     * @param withContent - retrieve or not child ContentItems
105     */

106     public void populateCatalog (Catalog catalog,
107                                  boolean withSubCatalog, boolean withContent)
108            throws JetspeedCMSException;
109
110     /**
111     * Populate a catalog structure from the repository
112     *
113     * @param userNode User reference
114     * @param catalog object to populate
115     * @param withSubCatalog - retrieve or not sub-catalogs
116     * @param withContent - retrieve or not child ContentItems
117     * @param numberOfLevels - number of tree level to populate
118     */

119     public void populateCatalog (Catalog catalog,
120                                  boolean withSubCatalog, boolean withContent,
121                                  int numberOfLevels )
122            throws JetspeedCMSException ;
123
124     /**
125     * Get all children from a specific parent uri
126     *
127     * @param userNode User reference
128     * @param parentUri uri used to get children
129     */

130     public Vector JavaDoc getUriList (String JavaDoc parentUri)
131            throws JetspeedCMSException;
132
133
134     /**
135     * Get a resource object (Catalog or ContentItem) from the repository
136     * based on a uri.
137     * @param userNode User reference
138     * @param uri
139     * @return resource that match to this uri
140     */

141     public Resource getResource (String JavaDoc uri )
142            throws JetspeedCMSException ;
143
144     /**
145     * Get all catalogs defined between 2 uri (from - to)
146     *
147     * @param userNode User reference
148     * @param fromuri : first element of the interval
149     * @param toUri : last element of the interval
150     * @return catalogs found between both uri
151     */

152
153
154     public Vector JavaDoc getCatalogs(String JavaDoc fromUri, String JavaDoc toUri)
155            throws JetspeedCMSException ;
156
157     /**
158     * Get Security information assigned to an uri
159     * @param userNode User reference
160     * @param uri for which the security info is asked
161     */

162     public Vector JavaDoc getSecurity (String JavaDoc uri )
163            throws JetspeedCMSException ;
164
165     /**
166     * Grant permission to an uri
167     * @param userNode User reference
168     * @param uri on which permission has to be set
169     * @param userUri User uri reference
170     * @param actionUri Action used in the permission (read, modify, write, ...)
171     * @param inheritable true if the permission has to be apply on child uri
172     * @param negative true if the permission is negative
173     */

174     public void grantPermission (String JavaDoc objectUri , String JavaDoc userUri,
175                                  String JavaDoc actionUri, boolean inheritable,
176                                  boolean negative)
177            throws JetspeedCMSException ;
178     /**
179     * Create a new resource in the repository
180     * @param userNode User reference
181     * @param resource object describing the new resource
182     */

183     public void createResource (Resource resource)
184            throws JetspeedCMSException ;
185     /**
186     * Create a new resource in the repository with a content stream
187     * @param userNode User reference
188     * @param resource object describing the new resource
189     * @param stream stream which match to the resource content
190     */

191     public void createResource (Resource resource, FileItem stream)
192            throws JetspeedCMSException;
193
194     /**
195     * Create a new link in the repository
196     * @param userNode User reference
197     * @param link object describing the new link
198     */

199     public void createLink (Link link)
200      throws JetspeedCMSException;
201 }
202
Popular Tags