KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > api > components > CmpFilesBean


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

5
6 package com.raptus.owxv3.api.components;
7
8 import java.util.Vector JavaDoc;
9
10 import javax.servlet.http.HttpServletRequest JavaDoc;
11
12 import org.apache.struts.action.ActionMapping;
13
14 import com.raptus.owxv3.LoggingManager;
15 import com.raptus.owxv3.api.FilesSelector;
16
17 /**
18  *
19  * <hr>
20  * <table width="100%" border="0">
21  * <tr>
22  * <td width="24%"><b>Filename</b></td><td width="76%">CmpPicsBean.java</td>
23  * </tr>
24  * <tr>
25  * <td width="24%"><b>Author</b></td><td width="76%">Guy Zürcher (gzuercher@raptus.com)</td>
26  * </tr>
27  * <tr>
28  * <td width="24%"><b>Date</b></td><td width="76%">28th of June 2001</td>
29  * </tr>
30  * </table>
31  * <hr>
32  * <table width="100%" border="0">
33  * <tr>
34  * <td width="24%"><b>Date / Author</b></td><td width="76%"><b>Changes</b></td>
35  * </tr>
36  * </table>
37  * <hr>
38  */

39 public class CmpFilesBean extends ComponentBean
40 {
41     /**
42      *
43      */

44     protected String JavaDoc selCategory = null;
45
46     /**
47      *
48      */

49     protected int fileToLink = -1;
50
51     /**
52      *
53      */

54     protected FilesSelector fileSelector = null;
55
56     /**
57      *
58      */

59     //protected MessagesSelector msgsSelector = null;
60

61
62     /**
63      *
64      */

65     protected String JavaDoc[] title = null;
66
67     /**
68      *
69      */

70     public String JavaDoc getSelCategory() { return selCategory; }
71     public void setSelCategory(String JavaDoc category) { this.selCategory = category; }
72
73     /**
74      *
75      */

76     public int getFileToLink() { return fileToLink; }
77     public void setFileToLink(int fileId) { this.fileToLink = fileId; }
78
79     /**
80      *
81      */

82     public FilesSelector getFilesSelector() { return fileSelector; }
83     public void setFilesSelector(FilesSelector fs) { this.fileSelector = fs; }
84
85
86     /**
87      *
88
89     public MessagesSelector getMsgsSelector() { return msgsSelector; }
90     public void setMsgsSelector(MessagesSelector ms) { this.msgsSelector = ms; }
91      */

92
93     /**
94      *
95      */

96     public String JavaDoc[] getTitle() { return title; }
97     public void setTitle(String JavaDoc[] t) { this.title = t; }
98
99
100     /**
101      *
102      */

103     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request)
104     {
105         super.reset(mapping, request);
106
107         selCategory = null;
108         fileToLink = -1;
109         title=null;
110     }
111
112     /**
113      *return true if the populate succeded false otherwise
114      */

115     public boolean populateViewFields()
116     {
117         if(selCategory != null){
118
119             fileSelector.switchToCategory(selCategory);
120             return true;
121         }
122         else if(fileToLink != -1 && title!=null)
123         {
124             boolean ret=fileSelector.linkFile(fileToLink,title);
125             //if(ret) setComponentChanged(true);
126
selCategory = null;
127             fileToLink = -1;
128             title=null;
129             return ret;
130         }
131         else
132             LoggingManager.log("Missing data for populating view fields!", this);
133
134         return true;
135     }
136
137     /**
138      *
139      */

140
141     public Vector JavaDoc getLinkedFiles(){
142         if(fileSelector==null) return null;
143         return fileSelector.getLinkedFiles( getCurrLocale() );
144
145     }
146
147 }
148
149 // eof
150
Popular Tags