KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > raptus > owxv3 > modules > base > PubBaseEntry


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

5
6 package com.raptus.owxv3.modules.base;
7
8 import java.util.*;
9
10 import com.raptus.owxv3.api.*;
11
12 /**
13  * represents ONE news entry in ONE language
14  *
15  * <hr>
16  * <table width="100%" border="0">
17  * <tr>
18  * <td width="24%"><b>Filename</b></td><td width="76%">PubBaseEntry.java</td>
19  * </tr>
20  * <tr>
21  * <td width="24%"><b>Author</b></td><td width="76%">Guy Zürcher (gzuercher@raptus.com)</td>
22  * </tr>
23  * <tr>
24  * <td width="24%"><b>Date</b></td><td width="76%">22th of April 2001</td>
25  * </tr>
26  * </table>
27  * <hr>
28  * <table width="100%" border="0">
29  * <tr>
30  * <td width="24%"><b>Date / Author</b></td><td width="76%"><b>Changes</b></td>
31  * </tr>
32  * </table>
33  * <hr>
34  */

35 public class PubBaseEntry implements ComparableItemIFace,FieldContainerIFace
36 {
37     /**
38      * if == null field is omitted in display
39      */

40     protected String JavaDoc entryDate = null;
41
42     /**
43      * Contains a list of GResTitledUrl objects
44      *
45      * if == null field(s) is omitted in display
46      */

47     protected Vector links = null;
48
49     /**
50      * Contains a list of GResTitledFiles that represents a file with title
51      *
52      * if == null field(s) is omitted in display
53      */

54     protected Vector files = null;
55
56     /**
57      * Contains a list of GResTitledFiles that represents a picture with title
58      *
59      * if == null field(s) is omitted in display
60      */

61     protected Vector pics = null;
62
63     /**
64      *Contains Hastable of (fieldname,GResField) objects
65      */

66     protected Hashtable fields=null;
67     
68     /**
69      *Contains Hastable of (fieldname,GResLocalizedField) objects
70      */

71     protected Hashtable localizedFields=null;
72     /**
73      * Accessor methods
74      */

75     public String JavaDoc getEntryDate() { return entryDate; }
76     public void setEntryDate(String JavaDoc date) { this.entryDate = date; }
77
78     /*public String getTitle() { return title; }
79     public void setTitle(String title) { this.title = title; }
80
81     public String getText() { return text;}
82     public void setText(String text) { this.text = text; }
83      */

84
85     
86     public Vector getLinkList() { return links; }
87     public void setLinkList(Vector list) { this.links = list; }
88
89    /* public Vector getFilesList() { return pics; }
90     public void setFilesList(Vector list) { this.pics = list; }
91     */

92
93     public Hashtable getFieldList() { return fields; }
94     public void setFieldList(Hashtable list) { fields=list; }
95     
96     public Hashtable getLocalizedFieldList() { return localizedFields; }
97     public void setLocalizedFieldList(Hashtable list){ localizedFields=list; }
98     
99     public Vector getFilesList() { return files; }
100     public void setFilesList(Vector list) { this.files = list; }
101
102     public Vector getPicList() { return pics; }
103     public void setPicList(Vector list) { this.pics = list; }
104     
105     public String JavaDoc getField(String JavaDoc fieldname)
106     {
107         return getField(fieldname,null);
108     }
109     
110     
111     /**
112      *
113      *Method from FieldContanierIFace interface
114      */

115     public String JavaDoc getField(String JavaDoc fieldname,Locale l)
116     {
117         
118         GResField gf=(GResField)fields.get(fieldname);
119         if(gf!=null)
120         {
121             return gf.getValue();
122         }
123         else
124         {
125             //searching in locale sensitive fields
126

127             GResLocalizedField glf=(GResLocalizedField)localizedFields.get(fieldname);
128             if(glf!=null)
129             {
130                 return glf.getValue(l);
131             }
132             else return "";
133         }
134     }//end getField
135

136     /**
137      * return true if this item has the specified item
138      */

139     public boolean equals(int id)
140     {
141         if(this.id == id)
142         {
143             return true;
144         }
145         else
146         {
147             return false;
148         }
149     }
150
151     int id;
152     public void setBaseID(int id)
153     {
154         this.id = id;
155     }
156
157     public int getBaseID()
158     {
159         return id;
160     }
161
162 }
163
164 // eof
165
Popular Tags