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