KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > modules > categories > PubCategoryBean


1 /*
2  * eAdmin/OWX
3  * Copyright (C) 1996-2003 OWX-Project Team <owx-team@gmx.net>
4  */

5
6 package com.raptus.owxv3.modules.categories;
7 import com.raptus.owxv3.api.*;
8 import java.util.*;
9
10 public class PubCategoryBean extends OmniaWebBean
11 {
12     CategorySelector catsel;
13
14     public PubCategoryBean()
15     {
16         super();
17        // LoggingManager.log("Creating categoryBean");
18
}
19
20     /**
21      * set the category selector for this bean
22      *
23      * @param catsel The category selector
24      */

25     public void setCategorySelector(CategorySelector catsel)
26     {
27         this.catsel = catsel;
28     }
29
30     /**
31      * return this bean's category selector
32      *
33      * @return The CategorySelector for this bean.
34      */

35     public CategorySelector getCategorySelector()
36     {
37         return catsel;
38     }
39
40     /*
41      * our style
42      */

43     String JavaDoc style;
44
45     /**
46      * return the used style
47      *
48      * @return a String to current used style for this bean
49      */

50     public String JavaDoc getStyleJSP()
51     {
52         //return "/modules/categories/publics/styles/YahooStyle.jsp";
53
return style;
54     }
55
56     /**
57      * set the style for this bean
58      *
59      * @param style The current style
60      */

61     public void setStyleJSP(String JavaDoc style)
62     {
63         this.style = style;
64     }
65
66     /**
67      * return the categories
68      *
69      * @return a Vector of categories
70      */

71     public Vector getCategories()
72     {
73         return catsel.getGResCategories();
74     }
75
76     /**
77      * return the category names
78      *
79      * @return a Vector fo strings containing the category names.
80      */

81     public Vector getCategoryNames()
82     {
83         Vector v = catsel.getCategoryNames();
84         //for(int i=0;i<v.size();i++)
85
//{
86
// LoggingManager.log("cat "+(String)v.elementAt(i));
87
//}
88
return catsel.getCategoryNames();
89     }
90
91     /**
92      * toggle the specified folder (category) status
93      *
94      * @param id The category id to be toggled between open/closed
95      */

96     public void togleFolder(String JavaDoc id)
97     {
98         catsel.togleFolder(id);
99     }
100
101     /**
102      * return the status of the category.
103      *
104      * @return true if folder (category)is open, false if not
105      */

106     public boolean isOpen(String JavaDoc id)
107     {
108         return catsel.isOpen(id);
109     }
110
111     /**
112      * return status of all categories
113      *
114      * @return a Vector of Strings containing the description of categories,
115      * this being used in tree view rendering
116      */

117     public Vector getFolderStatus()
118     {
119         return catsel.getFolderStatus();
120     }
121
122     /**
123      * return the list of parents
124      *
125      * @param id The category id for wich we require the parent list
126      * @param l The locale of names to be returned.
127      * @return a String Vector containing the name of all parent categories
128      * in specified locale
129      */

130     public Vector getTree(String JavaDoc id,Locale l)
131     {
132         return catsel.getTree(id,l);
133     }
134
135     /**
136      * current selected category
137      */

138     String JavaDoc selcatid=null;
139
140     /** return current selected category
141      *
142      * @return Current selected category
143      */

144     public String JavaDoc getSelCatID()
145     {
146         return selcatid;
147     }
148
149     /**
150      * set current selected category
151      *
152      * @param i Current selected category
153      */

154     public void setSelCatID(String JavaDoc s)
155     {
156         selcatid = s;
157     }
158
159     /**
160      * source url, used in url composition
161      */

162     String JavaDoc sourceurl="";
163
164     /**
165      * set Source url
166      *
167      * @param url String containing the source url
168      */

169     public void setSourceURL(String JavaDoc url)
170     {
171         sourceurl = url;
172     }
173
174     /**
175      * return the source url
176      *
177      * @return source url
178      */

179     public String JavaDoc getSourceURL()
180     {
181         return sourceurl;
182     }
183 }
184
Popular Tags