001// -------------------------------------------------------------------------------- 002// Copyright 2002-2025 Echo Three, LLC 003// 004// Licensed under the Apache License, Version 2.0 (the "License"); 005// you may not use this file except in compliance with the License. 006// You may obtain a copy of the License at 007// 008// http://www.apache.org/licenses/LICENSE-2.0 009// 010// Unless required by applicable law or agreed to in writing, software 011// distributed under the License is distributed on an "AS IS" BASIS, 012// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013// See the License for the specific language governing permissions and 014// limitations under the License. 015// -------------------------------------------------------------------------------- 016 017package com.echothree.control.user.forum.server; 018 019import com.echothree.control.user.forum.common.ForumRemote; 020import com.echothree.control.user.forum.common.form.*; 021import com.echothree.control.user.forum.server.command.*; 022import com.echothree.model.data.user.common.pk.UserVisitPK; 023import com.echothree.util.common.command.CommandResult; 024import javax.ejb.Stateless; 025import javax.enterprise.inject.spi.CDI; 026 027@Stateless 028public class ForumBean 029 extends ForumFormsImpl 030 implements ForumRemote, ForumLocal { 031 032 // ------------------------------------------------------------------------- 033 // Testing 034 // ------------------------------------------------------------------------- 035 036 @Override 037 public String ping() { 038 return "ForumBean is alive!"; 039 } 040 041 // -------------------------------------------------------------------------------- 042 // Forum Groups 043 // -------------------------------------------------------------------------------- 044 045 @Override 046 public CommandResult createForumGroup(UserVisitPK userVisitPK, CreateForumGroupForm form) { 047 return CDI.current().select(CreateForumGroupCommand.class).get().run(userVisitPK, form); 048 } 049 050 @Override 051 public CommandResult getForumGroup(UserVisitPK userVisitPK, GetForumGroupForm form) { 052 return CDI.current().select(GetForumGroupCommand.class).get().run(userVisitPK, form); 053 } 054 055 @Override 056 public CommandResult getForumGroups(UserVisitPK userVisitPK, GetForumGroupsForm form) { 057 return CDI.current().select(GetForumGroupsCommand.class).get().run(userVisitPK, form); 058 } 059 060 @Override 061 public CommandResult getForumGroupChoices(UserVisitPK userVisitPK, GetForumGroupChoicesForm form) { 062 return CDI.current().select(GetForumGroupChoicesCommand.class).get().run(userVisitPK, form); 063 } 064 065 @Override 066 public CommandResult editForumGroup(UserVisitPK userVisitPK, EditForumGroupForm form) { 067 return CDI.current().select(EditForumGroupCommand.class).get().run(userVisitPK, form); 068 } 069 070 @Override 071 public CommandResult deleteForumGroup(UserVisitPK userVisitPK, DeleteForumGroupForm form) { 072 return CDI.current().select(DeleteForumGroupCommand.class).get().run(userVisitPK, form); 073 } 074 075 // -------------------------------------------------------------------------------- 076 // Forum Group Descriptions 077 // -------------------------------------------------------------------------------- 078 079 @Override 080 public CommandResult createForumGroupDescription(UserVisitPK userVisitPK, CreateForumGroupDescriptionForm form) { 081 return CDI.current().select(CreateForumGroupDescriptionCommand.class).get().run(userVisitPK, form); 082 } 083 084 @Override 085 public CommandResult getForumGroupDescriptions(UserVisitPK userVisitPK, GetForumGroupDescriptionsForm form) { 086 return CDI.current().select(GetForumGroupDescriptionsCommand.class).get().run(userVisitPK, form); 087 } 088 089 @Override 090 public CommandResult editForumGroupDescription(UserVisitPK userVisitPK, EditForumGroupDescriptionForm form) { 091 return CDI.current().select(EditForumGroupDescriptionCommand.class).get().run(userVisitPK, form); 092 } 093 094 @Override 095 public CommandResult deleteForumGroupDescription(UserVisitPK userVisitPK, DeleteForumGroupDescriptionForm form) { 096 return CDI.current().select(DeleteForumGroupDescriptionCommand.class).get().run(userVisitPK, form); 097 } 098 099 // -------------------------------------------------------------------------------- 100 // Forums 101 // -------------------------------------------------------------------------------- 102 103 @Override 104 public CommandResult createForum(UserVisitPK userVisitPK, CreateForumForm form) { 105 return CDI.current().select(CreateForumCommand.class).get().run(userVisitPK, form); 106 } 107 108 @Override 109 public CommandResult getForum(UserVisitPK userVisitPK, GetForumForm form) { 110 return CDI.current().select(GetForumCommand.class).get().run(userVisitPK, form); 111 } 112 113 @Override 114 public CommandResult getForums(UserVisitPK userVisitPK, GetForumsForm form) { 115 return CDI.current().select(GetForumsCommand.class).get().run(userVisitPK, form); 116 } 117 118 @Override 119 public CommandResult getForumChoices(UserVisitPK userVisitPK, GetForumChoicesForm form) { 120 return CDI.current().select(GetForumChoicesCommand.class).get().run(userVisitPK, form); 121 } 122 123 @Override 124 public CommandResult editForum(UserVisitPK userVisitPK, EditForumForm form) { 125 return CDI.current().select(EditForumCommand.class).get().run(userVisitPK, form); 126 } 127 128 @Override 129 public CommandResult deleteForum(UserVisitPK userVisitPK, DeleteForumForm form) { 130 return CDI.current().select(DeleteForumCommand.class).get().run(userVisitPK, form); 131 } 132 133 // -------------------------------------------------------------------------------- 134 // Forum Descriptions 135 // -------------------------------------------------------------------------------- 136 137 @Override 138 public CommandResult createForumDescription(UserVisitPK userVisitPK, CreateForumDescriptionForm form) { 139 return CDI.current().select(CreateForumDescriptionCommand.class).get().run(userVisitPK, form); 140 } 141 142 @Override 143 public CommandResult getForumDescriptions(UserVisitPK userVisitPK, GetForumDescriptionsForm form) { 144 return CDI.current().select(GetForumDescriptionsCommand.class).get().run(userVisitPK, form); 145 } 146 147 @Override 148 public CommandResult editForumDescription(UserVisitPK userVisitPK, EditForumDescriptionForm form) { 149 return CDI.current().select(EditForumDescriptionCommand.class).get().run(userVisitPK, form); 150 } 151 152 @Override 153 public CommandResult deleteForumDescription(UserVisitPK userVisitPK, DeleteForumDescriptionForm form) { 154 return CDI.current().select(DeleteForumDescriptionCommand.class).get().run(userVisitPK, form); 155 } 156 157 // ------------------------------------------------------------------------- 158 // Forum Group Forums 159 // ------------------------------------------------------------------------- 160 161 @Override 162 public CommandResult createForumGroupForum(UserVisitPK userVisitPK, CreateForumGroupForumForm form) { 163 return CDI.current().select(CreateForumGroupForumCommand.class).get().run(userVisitPK, form); 164 } 165 166 @Override 167 public CommandResult getForumGroupForums(UserVisitPK userVisitPK, GetForumGroupForumsForm form) { 168 return CDI.current().select(GetForumGroupForumsCommand.class).get().run(userVisitPK, form); 169 } 170 171 @Override 172 public CommandResult setDefaultForumGroupForum(UserVisitPK userVisitPK, SetDefaultForumGroupForumForm form) { 173 return CDI.current().select(SetDefaultForumGroupForumCommand.class).get().run(userVisitPK, form); 174 } 175 176 @Override 177 public CommandResult editForumGroupForum(UserVisitPK userVisitPK, EditForumGroupForumForm form) { 178 return CDI.current().select(EditForumGroupForumCommand.class).get().run(userVisitPK, form); 179 } 180 181 @Override 182 public CommandResult deleteForumGroupForum(UserVisitPK userVisitPK, DeleteForumGroupForumForm form) { 183 return CDI.current().select(DeleteForumGroupForumCommand.class).get().run(userVisitPK, form); 184 } 185 186 // -------------------------------------------------------------------------------- 187 // Forum Role Types 188 // -------------------------------------------------------------------------------- 189 190 @Override 191 public CommandResult createForumRoleType(UserVisitPK userVisitPK, CreateForumRoleTypeForm form) { 192 return CDI.current().select(CreateForumRoleTypeCommand.class).get().run(userVisitPK, form); 193 } 194 195 @Override 196 public CommandResult getForumRoleTypeChoices(UserVisitPK userVisitPK, GetForumRoleTypeChoicesForm form) { 197 return CDI.current().select(GetForumRoleTypeChoicesCommand.class).get().run(userVisitPK, form); 198 } 199 200 // -------------------------------------------------------------------------------- 201 // Forum Role Type Descriptions 202 // -------------------------------------------------------------------------------- 203 204 @Override 205 public CommandResult createForumRoleTypeDescription(UserVisitPK userVisitPK, CreateForumRoleTypeDescriptionForm form) { 206 return CDI.current().select(CreateForumRoleTypeDescriptionCommand.class).get().run(userVisitPK, form); 207 } 208 209 // -------------------------------------------------------------------------------- 210 // Forum Types 211 // -------------------------------------------------------------------------------- 212 213 @Override 214 public CommandResult createForumType(UserVisitPK userVisitPK, CreateForumTypeForm form) { 215 return CDI.current().select(CreateForumTypeCommand.class).get().run(userVisitPK, form); 216 } 217 218 @Override 219 public CommandResult getForumTypeChoices(UserVisitPK userVisitPK, GetForumTypeChoicesForm form) { 220 return CDI.current().select(GetForumTypeChoicesCommand.class).get().run(userVisitPK, form); 221 } 222 223 // -------------------------------------------------------------------------------- 224 // Forum Type Descriptions 225 // -------------------------------------------------------------------------------- 226 227 @Override 228 public CommandResult createForumTypeDescription(UserVisitPK userVisitPK, CreateForumTypeDescriptionForm form) { 229 return CDI.current().select(CreateForumTypeDescriptionCommand.class).get().run(userVisitPK, form); 230 } 231 232 // -------------------------------------------------------------------------------- 233 // Forum Mime Types 234 // -------------------------------------------------------------------------------- 235 236 @Override 237 public CommandResult createForumMimeType(UserVisitPK userVisitPK, CreateForumMimeTypeForm form) { 238 return CDI.current().select(CreateForumMimeTypeCommand.class).get().run(userVisitPK, form); 239 } 240 241 @Override 242 public CommandResult getForumMimeTypes(UserVisitPK userVisitPK, GetForumMimeTypesForm form) { 243 return CDI.current().select(GetForumMimeTypesCommand.class).get().run(userVisitPK, form); 244 } 245 246 @Override 247 public CommandResult setDefaultForumMimeType(UserVisitPK userVisitPK, SetDefaultForumMimeTypeForm form) { 248 return CDI.current().select(SetDefaultForumMimeTypeCommand.class).get().run(userVisitPK, form); 249 } 250 251 @Override 252 public CommandResult editForumMimeType(UserVisitPK userVisitPK, EditForumMimeTypeForm form) { 253 return CDI.current().select(EditForumMimeTypeCommand.class).get().run(userVisitPK, form); 254 } 255 256 @Override 257 public CommandResult deleteForumMimeType(UserVisitPK userVisitPK, DeleteForumMimeTypeForm form) { 258 return CDI.current().select(DeleteForumMimeTypeCommand.class).get().run(userVisitPK, form); 259 } 260 261 // -------------------------------------------------------------------------------- 262 // Forum Party Roles 263 // -------------------------------------------------------------------------------- 264 265 @Override 266 public CommandResult createForumPartyRole(UserVisitPK userVisitPK, CreateForumPartyRoleForm form) { 267 return CDI.current().select(CreateForumPartyRoleCommand.class).get().run(userVisitPK, form); 268 } 269 270 @Override 271 public CommandResult getForumPartyRoles(UserVisitPK userVisitPK, GetForumPartyRolesForm form) { 272 return CDI.current().select(GetForumPartyRolesCommand.class).get().run(userVisitPK, form); 273 } 274 275 @Override 276 public CommandResult deleteForumPartyRole(UserVisitPK userVisitPK, DeleteForumPartyRoleForm form) { 277 return CDI.current().select(DeleteForumPartyRoleCommand.class).get().run(userVisitPK, form); 278 } 279 280 // -------------------------------------------------------------------------------- 281 // Forum Party Type Roles 282 // -------------------------------------------------------------------------------- 283 284 @Override 285 public CommandResult createForumPartyTypeRole(UserVisitPK userVisitPK, CreateForumPartyTypeRoleForm form) { 286 return CDI.current().select(CreateForumPartyTypeRoleCommand.class).get().run(userVisitPK, form); 287 } 288 289 @Override 290 public CommandResult getForumPartyTypeRoles(UserVisitPK userVisitPK, GetForumPartyTypeRolesForm form) { 291 return CDI.current().select(GetForumPartyTypeRolesCommand.class).get().run(userVisitPK, form); 292 } 293 294 @Override 295 public CommandResult deleteForumPartyTypeRole(UserVisitPK userVisitPK, DeleteForumPartyTypeRoleForm form) { 296 return CDI.current().select(DeleteForumPartyTypeRoleCommand.class).get().run(userVisitPK, form); 297 } 298 299 // -------------------------------------------------------------------------------- 300 // Forum Type Message Types 301 // -------------------------------------------------------------------------------- 302 303 @Override 304 public CommandResult createForumTypeMessageType(UserVisitPK userVisitPK, CreateForumTypeMessageTypeForm form) { 305 return CDI.current().select(CreateForumTypeMessageTypeCommand.class).get().run(userVisitPK, form); 306 } 307 308 // ------------------------------------------------------------------------- 309 // Forum Forum Threads 310 // ------------------------------------------------------------------------- 311 312 @Override 313 public CommandResult createForumForumThread(UserVisitPK userVisitPK, CreateForumForumThreadForm form) { 314 return CDI.current().select(CreateForumForumThreadCommand.class).get().run(userVisitPK, form); 315 } 316 317 @Override 318 public CommandResult getForumForumThreads(UserVisitPK userVisitPK, GetForumForumThreadsForm form) { 319 return CDI.current().select(GetForumForumThreadsCommand.class).get().run(userVisitPK, form); 320 } 321 322 @Override 323 public CommandResult setDefaultForumForumThread(UserVisitPK userVisitPK, SetDefaultForumForumThreadForm form) { 324 return CDI.current().select(SetDefaultForumForumThreadCommand.class).get().run(userVisitPK, form); 325 } 326 327 @Override 328 public CommandResult editForumForumThread(UserVisitPK userVisitPK, EditForumForumThreadForm form) { 329 return CDI.current().select(EditForumForumThreadCommand.class).get().run(userVisitPK, form); 330 } 331 332 @Override 333 public CommandResult deleteForumForumThread(UserVisitPK userVisitPK, DeleteForumForumThreadForm form) { 334 return CDI.current().select(DeleteForumForumThreadCommand.class).get().run(userVisitPK, form); 335 } 336 337 // -------------------------------------------------------------------------------- 338 // Forum Threads 339 // -------------------------------------------------------------------------------- 340 341 @Override 342 public CommandResult getForumThread(UserVisitPK userVisitPK, GetForumThreadForm form) { 343 return CDI.current().select(GetForumThreadCommand.class).get().run(userVisitPK, form); 344 } 345 346 @Override 347 public CommandResult getForumThreads(UserVisitPK userVisitPK, GetForumThreadsForm form) { 348 return CDI.current().select(GetForumThreadsCommand.class).get().run(userVisitPK, form); 349 } 350 351 @Override 352 public CommandResult deleteForumThread(UserVisitPK userVisitPK, DeleteForumThreadForm form) { 353 return CDI.current().select(DeleteForumThreadCommand.class).get().run(userVisitPK, form); 354 } 355 356 // -------------------------------------------------------------------------------- 357 // Forum Messages 358 // -------------------------------------------------------------------------------- 359 360 @Override 361 public CommandResult getForumMessage(UserVisitPK userVisitPK, GetForumMessageForm form) { 362 return CDI.current().select(GetForumMessageCommand.class).get().run(userVisitPK, form); 363 } 364 365 @Override 366 public CommandResult getForumMessages(UserVisitPK userVisitPK, GetForumMessagesForm form) { 367 return CDI.current().select(GetForumMessagesCommand.class).get().run(userVisitPK, form); 368 } 369 370 @Override 371 public CommandResult deleteForumMessage(UserVisitPK userVisitPK, DeleteForumMessageForm form) { 372 return CDI.current().select(DeleteForumMessageCommand.class).get().run(userVisitPK, form); 373 } 374 375 // -------------------------------------------------------------------------------- 376 // Forum Message Attachments 377 // -------------------------------------------------------------------------------- 378 379 @Override 380 public CommandResult createForumMessageAttachment(UserVisitPK userVisitPK, CreateForumMessageAttachmentForm form) { 381 return CDI.current().select(CreateForumMessageAttachmentCommand.class).get().run(userVisitPK, form); 382 } 383 384 @Override 385 public CommandResult getForumMessageAttachment(UserVisitPK userVisitPK, GetForumMessageAttachmentForm form) { 386 return CDI.current().select(GetForumMessageAttachmentCommand.class).get().run(userVisitPK, form); 387 } 388 389 @Override 390 public CommandResult getForumMessageAttachments(UserVisitPK userVisitPK, GetForumMessageAttachmentsForm form) { 391 return CDI.current().select(GetForumMessageAttachmentsCommand.class).get().run(userVisitPK, form); 392 } 393 394 @Override 395 public CommandResult editForumMessageAttachment(UserVisitPK userVisitPK, EditForumMessageAttachmentForm form) { 396 return CDI.current().select(EditForumMessageAttachmentCommand.class).get().run(userVisitPK, form); 397 } 398 399 @Override 400 public CommandResult deleteForumMessageAttachment(UserVisitPK userVisitPK, DeleteForumMessageAttachmentForm form) { 401 return CDI.current().select(DeleteForumMessageAttachmentCommand.class).get().run(userVisitPK, form); 402 } 403 404 // -------------------------------------------------------------------------------- 405 // Forum Message Attachment Descriptions 406 // -------------------------------------------------------------------------------- 407 408 @Override 409 public CommandResult createForumMessageAttachmentDescription(UserVisitPK userVisitPK, CreateForumMessageAttachmentDescriptionForm form) { 410 return CDI.current().select(CreateForumMessageAttachmentDescriptionCommand.class).get().run(userVisitPK, form); 411 } 412 413 @Override 414 public CommandResult getForumMessageAttachmentDescription(UserVisitPK userVisitPK, GetForumMessageAttachmentDescriptionForm form) { 415 return CDI.current().select(GetForumMessageAttachmentDescriptionCommand.class).get().run(userVisitPK, form); 416 } 417 418 @Override 419 public CommandResult getForumMessageAttachmentDescriptions(UserVisitPK userVisitPK, GetForumMessageAttachmentDescriptionsForm form) { 420 return CDI.current().select(GetForumMessageAttachmentDescriptionsCommand.class).get().run(userVisitPK, form); 421 } 422 423 @Override 424 public CommandResult editForumMessageAttachmentDescription(UserVisitPK userVisitPK, EditForumMessageAttachmentDescriptionForm form) { 425 return CDI.current().select(EditForumMessageAttachmentDescriptionCommand.class).get().run(userVisitPK, form); 426 } 427 428 @Override 429 public CommandResult deleteForumMessageAttachmentDescription(UserVisitPK userVisitPK, DeleteForumMessageAttachmentDescriptionForm form) { 430 return CDI.current().select(DeleteForumMessageAttachmentDescriptionCommand.class).get().run(userVisitPK, form); 431 } 432 433 // -------------------------------------------------------------------------------- 434 // Forum Message Part Types 435 // -------------------------------------------------------------------------------- 436 437 @Override 438 public CommandResult createForumMessagePartType(UserVisitPK userVisitPK, CreateForumMessagePartTypeForm form) { 439 return CDI.current().select(CreateForumMessagePartTypeCommand.class).get().run(userVisitPK, form); 440 } 441 442 // -------------------------------------------------------------------------------- 443 // Forum Message Part Type Descriptions 444 // -------------------------------------------------------------------------------- 445 446 @Override 447 public CommandResult createForumMessagePartTypeDescription(UserVisitPK userVisitPK, CreateForumMessagePartTypeDescriptionForm form) { 448 return CDI.current().select(CreateForumMessagePartTypeDescriptionCommand.class).get().run(userVisitPK, form); 449 } 450 451 // -------------------------------------------------------------------------------- 452 // Forum Message Types 453 // -------------------------------------------------------------------------------- 454 455 @Override 456 public CommandResult createForumMessageType(UserVisitPK userVisitPK, CreateForumMessageTypeForm form) { 457 return CDI.current().select(CreateForumMessageTypeCommand.class).get().run(userVisitPK, form); 458 } 459 460 @Override 461 public CommandResult getForumMessageTypeChoices(UserVisitPK userVisitPK, GetForumMessageTypeChoicesForm form) { 462 return CDI.current().select(GetForumMessageTypeChoicesCommand.class).get().run(userVisitPK, form); 463 } 464 465 // -------------------------------------------------------------------------------- 466 // Forum Message Type Descriptions 467 // -------------------------------------------------------------------------------- 468 469 @Override 470 public CommandResult createForumMessageTypeDescription(UserVisitPK userVisitPK, CreateForumMessageTypeDescriptionForm form) { 471 return CDI.current().select(CreateForumMessageTypeDescriptionCommand.class).get().run(userVisitPK, form); 472 } 473 474 // -------------------------------------------------------------------------------- 475 // Forum Message Type Part Types 476 // -------------------------------------------------------------------------------- 477 478 @Override 479 public CommandResult createForumMessageTypePartType(UserVisitPK userVisitPK, CreateForumMessageTypePartTypeForm form) { 480 return CDI.current().select(CreateForumMessageTypePartTypeCommand.class).get().run(userVisitPK, form); 481 } 482 483 // -------------------------------------------------------------------------------- 484 // Blog Entries 485 // -------------------------------------------------------------------------------- 486 487 @Override 488 public CommandResult createBlogEntry(UserVisitPK userVisitPK, CreateBlogEntryForm form) { 489 return CDI.current().select(CreateBlogEntryCommand.class).get().run(userVisitPK, form); 490 } 491 492 @Override 493 public CommandResult editBlogEntry(UserVisitPK userVisitPK, EditBlogEntryForm form) { 494 return CDI.current().select(EditBlogEntryCommand.class).get().run(userVisitPK, form); 495 } 496 497 // -------------------------------------------------------------------------------- 498 // Blog Comments 499 // -------------------------------------------------------------------------------- 500 501 @Override 502 public CommandResult createBlogComment(UserVisitPK userVisitPK, CreateBlogCommentForm form) { 503 return CDI.current().select(CreateBlogCommentCommand.class).get().run(userVisitPK, form); 504 } 505 506 @Override 507 public CommandResult editBlogComment(UserVisitPK userVisitPK, EditBlogCommentForm form) { 508 return CDI.current().select(EditBlogCommentCommand.class).get().run(userVisitPK, form); 509 } 510 511}