1 11 package org.jboss.portlet.forums.theme; 12 13 import org.jboss.portlet.forums.ForumsConstants; 14 import org.jboss.portlet.forums.properties.XProperties; 15 16 20 public class ForumsTheme 21 { 22 31 public FolderType getFolderType(int type, 32 int status, 33 boolean hot) 34 { 35 switch (type) 36 { 37 case ForumsConstants.POST_ANNOUNCE: 38 return FOLDER_ANNOUNCE; 39 40 case ForumsConstants.POST_STICKY: 41 return FOLDER_STICKY; 42 43 default: 44 if (status == ForumsConstants.TOPIC_LOCKED) 45 { 46 return FOLDER_LOCKED; 47 } 48 else 49 { 50 if (hot) 51 { 52 return FOLDER_HOT; 53 } 54 else 55 { 56 return FOLDER_NORMAL; 57 } 58 } 59 } 60 } 61 62 63 public FolderType FOLDER_ANNOUNCE; 64 65 66 public FolderType FOLDER_STICKY; 67 68 69 public FolderType FOLDER_LOCKED; 70 71 72 public FolderType FOLDER_NORMAL; 73 74 75 public FolderType FOLDER_HOT; 76 77 78 public String resourceForumURL; 79 80 81 public String resourceForumNewURL; 82 83 84 public String resourceForumNewBigURL; 85 86 87 public String resourceForumLockedURL; 88 89 90 public String resourceIconLatestReplyURL; 91 92 93 public String resourceIconNewestReplyURL; 94 95 96 public String resourceIconGotopostURL; 97 98 99 public String resourceFolderURL; 100 101 102 public String resourceFolderNewURL; 103 104 105 public String resourceFolderAnnounceURL; 106 107 108 public String resourceFolderAnnounceNewURL; 109 110 111 public String resourceFolderStickyURL; 112 113 114 public String resourceFolderStickyNewURL; 115 116 117 public String resourceFolderLockedURL; 118 119 120 public String resourceFolderLockedNewURL; 121 122 123 public String resourceFolderHotURL; 124 125 126 public String resourceFolderHotNewURL; 127 128 129 public String resourcePostLockedURL; 130 131 132 public String resourcePostNewURL; 133 134 135 public String resourceTopicModeDeleteURL; 136 137 138 public String resourceTopicModMoveURL; 139 140 141 public String resourceTopicModLockURL; 142 143 144 public String resourceTopicModUnlockURL; 145 146 147 public String resourceTopicModSplitURL; 148 149 150 public String resourceTopicUnWatchURL; 151 152 153 public String resourceTopicWatchURL; 154 155 156 public String resourceReplyNewURL; 157 158 159 public String resourceReplyLockedURL; 160 161 162 public String resourceIconProfileURL; 163 164 165 public String resourceIconPMURL; 166 167 168 public String resourceIconEmailURL; 169 170 171 public String resourceIconWWWURL; 172 173 174 public String resourceIconICQURL; 175 176 177 public String resourceIconAIMURL; 178 179 180 public String resourceIconMSNMURL; 181 182 183 public String resourceIconYIMURL; 184 185 186 public String resourceIconQuoteURL; 187 188 189 public String resourceIconSearchURL; 190 191 192 public String resourceIconEditURL; 193 194 195 public String resourceIconRepostURL; 196 197 198 public String resourceIconIPURL; 199 200 201 public String resourceIconDelpostURL; 202 203 204 public String resourceIconMinipostURL; 205 206 207 public String resourceIconMinipostNewURL; 208 209 210 public String resourceHeadStylesheetURL; 211 private XProperties xprops; 212 213 218 public void setExtendedProperties(XProperties xprops) 219 { 220 this.xprops = xprops; 221 } 222 223 230 public String getProperty(String name) 231 { 232 return xprops.getProperty(name); 233 } 234 235 242 public String getResourceURL(String name) 243 { 244 return xprops.getResourceURL(name); 245 } 246 247 252 public void start() 253 throws Exception 254 { 255 resourceForumURL = xprops.getResourceURL("forum"); 256 resourceForumNewURL = xprops.getResourceURL("forum_new"); 257 resourceForumNewBigURL = xprops.getResourceURL("forum_new_big"); 258 resourceForumLockedURL = xprops.getResourceURL("forum_locked"); 259 resourceIconLatestReplyURL = xprops.getResourceURL("icon_latest_reply"); 260 resourceIconNewestReplyURL = xprops.getResourceURL("icon_newest_reply"); 261 resourceIconGotopostURL = xprops.getResourceURL("icon_gotopost"); 262 resourceFolderURL = xprops.getResourceURL("folder"); 263 resourceFolderNewURL = xprops.getResourceURL("folder_new"); 264 resourceFolderAnnounceURL = xprops.getResourceURL("folder_announce"); 265 resourceFolderAnnounceNewURL = xprops.getResourceURL("folder_announce_new"); 266 resourceFolderStickyURL = xprops.getResourceURL("folder_sticky"); 267 resourceFolderStickyNewURL = xprops.getResourceURL("folder_sticky_new"); 268 resourceFolderLockedURL = xprops.getResourceURL("folder_locked"); 269 resourceFolderLockedNewURL = xprops.getResourceURL("folder_locked_new"); 270 resourceFolderHotURL = xprops.getResourceURL("folder_hot"); 271 resourceFolderHotNewURL = xprops.getResourceURL("folder_hot_new"); 272 resourcePostLockedURL = xprops.getResourceURL("post_locked"); 273 resourcePostNewURL = xprops.getResourceURL("post_new"); 274 resourceTopicModeDeleteURL = xprops.getResourceURL("topic_mod_delete"); 275 resourceTopicModMoveURL = xprops.getResourceURL("topic_mod_move"); 276 resourceTopicModLockURL = xprops.getResourceURL("topic_mod_lock"); 277 resourceTopicModUnlockURL = xprops.getResourceURL("topic_mod_unlock"); 278 resourceTopicModSplitURL = xprops.getResourceURL("topic_mod_split"); 279 resourceTopicUnWatchURL = xprops.getResourceURL("topic_un_watch"); 280 resourceTopicWatchURL = xprops.getResourceURL("topic_watch"); 281 resourceReplyNewURL = xprops.getResourceURL("reply_new"); 282 resourceReplyLockedURL = xprops.getResourceURL("reply_locked"); 283 resourceIconProfileURL = xprops.getResourceURL("icon_profile"); 284 resourceIconPMURL = xprops.getResourceURL("icon_pm"); 285 resourceIconEmailURL = xprops.getResourceURL("icon_email"); 286 resourceIconWWWURL = xprops.getResourceURL("icon_www"); 287 resourceIconICQURL = xprops.getResourceURL("icon_icq"); 288 resourceIconAIMURL = xprops.getResourceURL("icon_aim"); 289 resourceIconMSNMURL = xprops.getResourceURL("icon_msnm"); 290 resourceIconYIMURL = xprops.getResourceURL("icon_yim"); 291 resourceIconQuoteURL = xprops.getResourceURL("icon_quote"); 292 resourceIconSearchURL = xprops.getResourceURL("icon_search"); 293 resourceIconEditURL = xprops.getResourceURL("icon_edit"); 294 resourceIconRepostURL = xprops.getResourceURL("icon_repost"); 295 resourceIconIPURL = xprops.getResourceURL("icon_ip"); 296 resourceIconDelpostURL = xprops.getResourceURL("icon_delpost"); 297 resourceIconMinipostURL = xprops.getResourceURL("icon_minipost"); 298 resourceIconMinipostNewURL = xprops.getResourceURL("icon_minipost_new"); 299 resourceHeadStylesheetURL = xprops.getResourceURL("head_stylesheet"); 300 301 FOLDER_ANNOUNCE = 303 new FolderType(resourceFolderAnnounceURL, resourceFolderAnnounceNewURL, "Topic_Announcement"); 304 FOLDER_STICKY = new FolderType(resourceFolderStickyURL, resourceFolderStickyNewURL, "Topic_Sticky"); 305 FOLDER_LOCKED = new FolderType(resourceFolderLockedURL, resourceFolderLockedNewURL, ""); 306 FOLDER_HOT = new FolderType(resourceFolderHotURL, resourceFolderHotNewURL, ""); 307 FOLDER_NORMAL = new FolderType(resourceFolderURL, resourceForumNewURL, ""); 308 } 309 } | Popular Tags |