KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > coplets > basket > BasketManager


1 /*
2  * Copyright 2004-2005 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.cocoon.portal.coplets.basket;
17
18 import java.util.List JavaDoc;
19
20 /**
21  * This is the manager for content-stores: baskets, briefcases and folders
22  * You can retrieve the current basket, briefcase or folder for the user
23  * from this manager.
24  *
25  * @version CVS $Id: BasketManager.java 291593 2005-09-26 10:49:55Z cziegeler $
26  */

27 public interface BasketManager {
28     
29     /** The component role */
30     String JavaDoc ROLE = BasketManager.class.getName();
31     
32     /** This key is used to store the current basket in the session */
33     String JavaDoc BASKET_KEY = BasketManager.class.getName() + "/Basket";
34
35     /** This key is used to store the current briefcase in the session */
36     String JavaDoc BRIEFCASE_KEY = BasketManager.class.getName() + "/Briefcase";
37
38     /** This key is used to store the current folder in the session */
39     String JavaDoc FOLDER_KEY = BasketManager.class.getName() + "/Folder";
40
41     /** This key is used to store all briefcases in the session (of the admin) */
42     String JavaDoc ALL_BRIEFCASES_KEY = BasketManager.class.getName() + "/All";
43
44     /**
45      * Return the basket of the current user
46      */

47     Basket getBasket();
48    
49     /**
50      * Return the briefcase of the current user
51      */

52     Briefcase getBriefcase();
53
54     /**
55      * Return the folder of the current user
56      */

57     Folder getFolder();
58
59     /**
60      * Return all briefcases.
61      * This is a list of {@link ContentStoreDescription} objects.
62      */

63     List JavaDoc getBriefcaseDescriptions();
64
65     /**
66      * An action info consists of a name and a url
67      */

68     public static class ActionInfo {
69         public final String JavaDoc name;
70         public final String JavaDoc url;
71         
72         public ActionInfo(String JavaDoc n, String JavaDoc u) {
73             this.name = n;
74             this.url = u;
75         }
76     }
77
78     /**
79      * Return all configured actions for a basket - this is a list of
80      * {@link ActionInfo}s.
81      */

82     List JavaDoc getBasketActions();
83
84     /**
85      * Get the info
86      */

87     ActionInfo getBasketAction(String JavaDoc name);
88     
89     /**
90      * Return all configured actions for a briefcase - this is a list of
91      * {@link ActionInfo}s.
92      */

93     List JavaDoc getBriefcaseActions();
94
95     /**
96      * Get the info
97      */

98     ActionInfo getBriefcaseAction(String JavaDoc name);
99
100     void addBatch(ContentItem item,
101                   int frequencyInDays,
102                   ActionInfo action);
103     
104     /**
105      * Update/save the content store
106      */

107     void update(ContentStore store);
108 }
109
Popular Tags