001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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.comment.server; 018 019import com.echothree.control.user.comment.common.CommentRemote; 020import com.echothree.control.user.comment.common.form.*; 021import com.echothree.control.user.comment.server.command.*; 022import com.echothree.model.data.user.common.pk.UserVisitPK; 023import com.echothree.util.common.command.CommandResult; 024import javax.ejb.Stateless; 025 026@Stateless 027public class CommentBean 028 extends CommentFormsImpl 029 implements CommentRemote, CommentLocal { 030 031 // ------------------------------------------------------------------------- 032 // Testing 033 // ------------------------------------------------------------------------- 034 035 @Override 036 public String ping() { 037 return "CommentBean is alive!"; 038 } 039 040 // ------------------------------------------------------------------------- 041 // Comment Types 042 // ------------------------------------------------------------------------- 043 044 @Override 045 public CommandResult createCommentType(UserVisitPK userVisitPK, CreateCommentTypeForm form) { 046 return new CreateCommentTypeCommand(userVisitPK, form).run(); 047 } 048 049 @Override 050 public CommandResult getCommentType(UserVisitPK userVisitPK, GetCommentTypeForm form) { 051 return new GetCommentTypeCommand(userVisitPK, form).run(); 052 } 053 054 @Override 055 public CommandResult getCommentTypes(UserVisitPK userVisitPK, GetCommentTypesForm form) { 056 return new GetCommentTypesCommand(userVisitPK, form).run(); 057 } 058 059 @Override 060 public CommandResult editCommentType(UserVisitPK userVisitPK, EditCommentTypeForm form) { 061 return new EditCommentTypeCommand(userVisitPK, form).run(); 062 } 063 064 @Override 065 public CommandResult deleteCommentType(UserVisitPK userVisitPK, DeleteCommentTypeForm form) { 066 return new DeleteCommentTypeCommand(userVisitPK, form).run(); 067 } 068 069 // ------------------------------------------------------------------------- 070 // Comment Type Descriptions 071 // ------------------------------------------------------------------------- 072 073 @Override 074 public CommandResult createCommentTypeDescription(UserVisitPK userVisitPK, CreateCommentTypeDescriptionForm form) { 075 return new CreateCommentTypeDescriptionCommand(userVisitPK, form).run(); 076 } 077 078 @Override 079 public CommandResult getCommentTypeDescriptions(UserVisitPK userVisitPK, GetCommentTypeDescriptionsForm form) { 080 return new GetCommentTypeDescriptionsCommand(userVisitPK, form).run(); 081 } 082 083 @Override 084 public CommandResult editCommentTypeDescription(UserVisitPK userVisitPK, EditCommentTypeDescriptionForm form) { 085 return new EditCommentTypeDescriptionCommand(userVisitPK, form).run(); 086 } 087 088 @Override 089 public CommandResult deleteCommentTypeDescription(UserVisitPK userVisitPK, DeleteCommentTypeDescriptionForm form) { 090 return new DeleteCommentTypeDescriptionCommand(userVisitPK, form).run(); 091 } 092 093 // ------------------------------------------------------------------------- 094 // Comment Usage Types 095 // ------------------------------------------------------------------------- 096 097 @Override 098 public CommandResult createCommentUsageType(UserVisitPK userVisitPK, CreateCommentUsageTypeForm form) { 099 return new CreateCommentUsageTypeCommand(userVisitPK, form).run(); 100 } 101 102 @Override 103 public CommandResult getCommentUsageType(UserVisitPK userVisitPK, GetCommentUsageTypeForm form) { 104 return new GetCommentUsageTypeCommand(userVisitPK, form).run(); 105 } 106 107 @Override 108 public CommandResult getCommentUsageTypes(UserVisitPK userVisitPK, GetCommentUsageTypesForm form) { 109 return new GetCommentUsageTypesCommand(userVisitPK, form).run(); 110 } 111 112 @Override 113 public CommandResult editCommentUsageType(UserVisitPK userVisitPK, EditCommentUsageTypeForm form) { 114 return new EditCommentUsageTypeCommand(userVisitPK, form).run(); 115 } 116 117 @Override 118 public CommandResult deleteCommentUsageType(UserVisitPK userVisitPK, DeleteCommentUsageTypeForm form) { 119 return new DeleteCommentUsageTypeCommand(userVisitPK, form).run(); 120 } 121 122 // ------------------------------------------------------------------------- 123 // Comment Usage Type Descriptions 124 // ------------------------------------------------------------------------- 125 126 @Override 127 public CommandResult createCommentUsageTypeDescription(UserVisitPK userVisitPK, CreateCommentUsageTypeDescriptionForm form) { 128 return new CreateCommentUsageTypeDescriptionCommand(userVisitPK, form).run(); 129 } 130 131 @Override 132 public CommandResult getCommentUsageTypeDescriptions(UserVisitPK userVisitPK, GetCommentUsageTypeDescriptionsForm form) { 133 return new GetCommentUsageTypeDescriptionsCommand(userVisitPK, form).run(); 134 } 135 136 @Override 137 public CommandResult editCommentUsageTypeDescription(UserVisitPK userVisitPK, EditCommentUsageTypeDescriptionForm form) { 138 return new EditCommentUsageTypeDescriptionCommand(userVisitPK, form).run(); 139 } 140 141 @Override 142 public CommandResult deleteCommentUsageTypeDescription(UserVisitPK userVisitPK, DeleteCommentUsageTypeDescriptionForm form) { 143 return new DeleteCommentUsageTypeDescriptionCommand(userVisitPK, form).run(); 144 } 145 146 // ------------------------------------------------------------------------- 147 // Comments 148 // ------------------------------------------------------------------------- 149 150 @Override 151 public CommandResult createComment(UserVisitPK userVisitPK, CreateCommentForm form) { 152 return new CreateCommentCommand(userVisitPK, form).run(); 153 } 154 155 @Override 156 public CommandResult editComment(UserVisitPK userVisitPK, EditCommentForm form) { 157 return new EditCommentCommand(userVisitPK, form).run(); 158 } 159 160 @Override 161 public CommandResult getCommentStatusChoices(UserVisitPK userVisitPK, GetCommentStatusChoicesForm form) { 162 return new GetCommentStatusChoicesCommand(userVisitPK, form).run(); 163 } 164 165 @Override 166 public CommandResult setCommentStatus(UserVisitPK userVisitPK, SetCommentStatusForm form) { 167 return new SetCommentStatusCommand(userVisitPK, form).run(); 168 } 169 170 @Override 171 public CommandResult getComment(UserVisitPK userVisitPK, GetCommentForm form) { 172 return new GetCommentCommand(userVisitPK, form).run(); 173 } 174 175 @Override 176 public CommandResult deleteComment(UserVisitPK userVisitPK, DeleteCommentForm form) { 177 return new DeleteCommentCommand(userVisitPK, form).run(); 178 } 179 180 // ------------------------------------------------------------------------- 181 // Comment Usages 182 // ------------------------------------------------------------------------- 183 184 @Override 185 public CommandResult createCommentUsage(UserVisitPK userVisitPK, CreateCommentUsageForm form) { 186 return new CreateCommentUsageCommand(userVisitPK, form).run(); 187 } 188 189 @Override 190 public CommandResult deleteCommentUsage(UserVisitPK userVisitPK, DeleteCommentUsageForm form) { 191 return new DeleteCommentUsageCommand(userVisitPK, form).run(); 192 } 193 194}