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.document.server; 018 019import com.echothree.control.user.document.common.DocumentRemote; 020import com.echothree.control.user.document.common.form.*; 021import com.echothree.control.user.document.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 DocumentBean 029 extends DocumentFormsImpl 030 implements DocumentRemote, DocumentLocal { 031 032 // ------------------------------------------------------------------------- 033 // Testing 034 // ------------------------------------------------------------------------- 035 036 @Override 037 public String ping() { 038 return "DocumentBean is alive!"; 039 } 040 041 // -------------------------------------------------------------------------------- 042 // Document Types 043 // -------------------------------------------------------------------------------- 044 045 @Override 046 public CommandResult createDocumentType(UserVisitPK userVisitPK, CreateDocumentTypeForm form) { 047 return CDI.current().select(CreateDocumentTypeCommand.class).get().run(userVisitPK, form); 048 } 049 050 @Override 051 public CommandResult getDocumentTypeChoices(UserVisitPK userVisitPK, GetDocumentTypeChoicesForm form) { 052 return CDI.current().select(GetDocumentTypeChoicesCommand.class).get().run(userVisitPK, form); 053 } 054 055 @Override 056 public CommandResult getDocumentType(UserVisitPK userVisitPK, GetDocumentTypeForm form) { 057 return CDI.current().select(GetDocumentTypeCommand.class).get().run(userVisitPK, form); 058 } 059 060 @Override 061 public CommandResult getDocumentTypes(UserVisitPK userVisitPK, GetDocumentTypesForm form) { 062 return CDI.current().select(GetDocumentTypesCommand.class).get().run(userVisitPK, form); 063 } 064 065 @Override 066 public CommandResult setDefaultDocumentType(UserVisitPK userVisitPK, SetDefaultDocumentTypeForm form) { 067 return CDI.current().select(SetDefaultDocumentTypeCommand.class).get().run(userVisitPK, form); 068 } 069 070 @Override 071 public CommandResult editDocumentType(UserVisitPK userVisitPK, EditDocumentTypeForm form) { 072 return CDI.current().select(EditDocumentTypeCommand.class).get().run(userVisitPK, form); 073 } 074 075 @Override 076 public CommandResult deleteDocumentType(UserVisitPK userVisitPK, DeleteDocumentTypeForm form) { 077 return CDI.current().select(DeleteDocumentTypeCommand.class).get().run(userVisitPK, form); 078 } 079 080 // -------------------------------------------------------------------------------- 081 // Document Type Descriptions 082 // -------------------------------------------------------------------------------- 083 084 @Override 085 public CommandResult createDocumentTypeDescription(UserVisitPK userVisitPK, CreateDocumentTypeDescriptionForm form) { 086 return CDI.current().select(CreateDocumentTypeDescriptionCommand.class).get().run(userVisitPK, form); 087 } 088 089 @Override 090 public CommandResult getDocumentTypeDescription(UserVisitPK userVisitPK, GetDocumentTypeDescriptionForm form) { 091 return CDI.current().select(GetDocumentTypeDescriptionCommand.class).get().run(userVisitPK, form); 092 } 093 094 @Override 095 public CommandResult getDocumentTypeDescriptions(UserVisitPK userVisitPK, GetDocumentTypeDescriptionsForm form) { 096 return CDI.current().select(GetDocumentTypeDescriptionsCommand.class).get().run(userVisitPK, form); 097 } 098 099 @Override 100 public CommandResult editDocumentTypeDescription(UserVisitPK userVisitPK, EditDocumentTypeDescriptionForm form) { 101 return CDI.current().select(EditDocumentTypeDescriptionCommand.class).get().run(userVisitPK, form); 102 } 103 104 @Override 105 public CommandResult deleteDocumentTypeDescription(UserVisitPK userVisitPK, DeleteDocumentTypeDescriptionForm form) { 106 return CDI.current().select(DeleteDocumentTypeDescriptionCommand.class).get().run(userVisitPK, form); 107 } 108 109 // -------------------------------------------------------------------------------- 110 // Document Type Usage Types 111 // -------------------------------------------------------------------------------- 112 113 @Override 114 public CommandResult createDocumentTypeUsageType(UserVisitPK userVisitPK, CreateDocumentTypeUsageTypeForm form) { 115 return CDI.current().select(CreateDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 116 } 117 118 @Override 119 public CommandResult getDocumentTypeUsageTypeChoices(UserVisitPK userVisitPK, GetDocumentTypeUsageTypeChoicesForm form) { 120 return CDI.current().select(GetDocumentTypeUsageTypeChoicesCommand.class).get().run(userVisitPK, form); 121 } 122 123 @Override 124 public CommandResult getDocumentTypeUsageType(UserVisitPK userVisitPK, GetDocumentTypeUsageTypeForm form) { 125 return CDI.current().select(GetDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 126 } 127 128 @Override 129 public CommandResult getDocumentTypeUsageTypes(UserVisitPK userVisitPK, GetDocumentTypeUsageTypesForm form) { 130 return CDI.current().select(GetDocumentTypeUsageTypesCommand.class).get().run(userVisitPK, form); 131 } 132 133 @Override 134 public CommandResult setDefaultDocumentTypeUsageType(UserVisitPK userVisitPK, SetDefaultDocumentTypeUsageTypeForm form) { 135 return CDI.current().select(SetDefaultDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 136 } 137 138 @Override 139 public CommandResult editDocumentTypeUsageType(UserVisitPK userVisitPK, EditDocumentTypeUsageTypeForm form) { 140 return CDI.current().select(EditDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 141 } 142 143 @Override 144 public CommandResult deleteDocumentTypeUsageType(UserVisitPK userVisitPK, DeleteDocumentTypeUsageTypeForm form) { 145 return CDI.current().select(DeleteDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 146 } 147 148 // -------------------------------------------------------------------------------- 149 // Document Type Usage Type Descriptions 150 // -------------------------------------------------------------------------------- 151 152 @Override 153 public CommandResult createDocumentTypeUsageTypeDescription(UserVisitPK userVisitPK, CreateDocumentTypeUsageTypeDescriptionForm form) { 154 return CDI.current().select(CreateDocumentTypeUsageTypeDescriptionCommand.class).get().run(userVisitPK, form); 155 } 156 157 @Override 158 public CommandResult getDocumentTypeUsageTypeDescription(UserVisitPK userVisitPK, GetDocumentTypeUsageTypeDescriptionForm form) { 159 return CDI.current().select(GetDocumentTypeUsageTypeDescriptionCommand.class).get().run(userVisitPK, form); 160 } 161 162 @Override 163 public CommandResult getDocumentTypeUsageTypeDescriptions(UserVisitPK userVisitPK, GetDocumentTypeUsageTypeDescriptionsForm form) { 164 return CDI.current().select(GetDocumentTypeUsageTypeDescriptionsCommand.class).get().run(userVisitPK, form); 165 } 166 167 @Override 168 public CommandResult editDocumentTypeUsageTypeDescription(UserVisitPK userVisitPK, EditDocumentTypeUsageTypeDescriptionForm form) { 169 return CDI.current().select(EditDocumentTypeUsageTypeDescriptionCommand.class).get().run(userVisitPK, form); 170 } 171 172 @Override 173 public CommandResult deleteDocumentTypeUsageTypeDescription(UserVisitPK userVisitPK, DeleteDocumentTypeUsageTypeDescriptionForm form) { 174 return CDI.current().select(DeleteDocumentTypeUsageTypeDescriptionCommand.class).get().run(userVisitPK, form); 175 } 176 177 // -------------------------------------------------------------------------------- 178 // Document Type Usages 179 // -------------------------------------------------------------------------------- 180 181 @Override 182 public CommandResult createDocumentTypeUsage(UserVisitPK userVisitPK, CreateDocumentTypeUsageForm form) { 183 return CDI.current().select(CreateDocumentTypeUsageCommand.class).get().run(userVisitPK, form); 184 } 185 186 @Override 187 public CommandResult getDocumentTypeUsage(UserVisitPK userVisitPK, GetDocumentTypeUsageForm form) { 188 return CDI.current().select(GetDocumentTypeUsageCommand.class).get().run(userVisitPK, form); 189 } 190 191 @Override 192 public CommandResult getDocumentTypeUsages(UserVisitPK userVisitPK, GetDocumentTypeUsagesForm form) { 193 return CDI.current().select(GetDocumentTypeUsagesCommand.class).get().run(userVisitPK, form); 194 } 195 196 @Override 197 public CommandResult setDefaultDocumentTypeUsage(UserVisitPK userVisitPK, SetDefaultDocumentTypeUsageForm form) { 198 return CDI.current().select(SetDefaultDocumentTypeUsageCommand.class).get().run(userVisitPK, form); 199 } 200 201 @Override 202 public CommandResult editDocumentTypeUsage(UserVisitPK userVisitPK, EditDocumentTypeUsageForm form) { 203 return CDI.current().select(EditDocumentTypeUsageCommand.class).get().run(userVisitPK, form); 204 } 205 206 @Override 207 public CommandResult deleteDocumentTypeUsage(UserVisitPK userVisitPK, DeleteDocumentTypeUsageForm form) { 208 return CDI.current().select(DeleteDocumentTypeUsageCommand.class).get().run(userVisitPK, form); 209 } 210 211 // -------------------------------------------------------------------------------- 212 // Party Type Document Type Usage Types 213 // -------------------------------------------------------------------------------- 214 215 @Override 216 public CommandResult createPartyTypeDocumentTypeUsageType(UserVisitPK userVisitPK, CreatePartyTypeDocumentTypeUsageTypeForm form) { 217 return CDI.current().select(CreatePartyTypeDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 218 } 219 220 @Override 221 public CommandResult getPartyTypeDocumentTypeUsageType(UserVisitPK userVisitPK, GetPartyTypeDocumentTypeUsageTypeForm form) { 222 return CDI.current().select(GetPartyTypeDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 223 } 224 225 @Override 226 public CommandResult getPartyTypeDocumentTypeUsageTypes(UserVisitPK userVisitPK, GetPartyTypeDocumentTypeUsageTypesForm form) { 227 return CDI.current().select(GetPartyTypeDocumentTypeUsageTypesCommand.class).get().run(userVisitPK, form); 228 } 229 230 @Override 231 public CommandResult setDefaultPartyTypeDocumentTypeUsageType(UserVisitPK userVisitPK, SetDefaultPartyTypeDocumentTypeUsageTypeForm form) { 232 return CDI.current().select(SetDefaultPartyTypeDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 233 } 234 235 @Override 236 public CommandResult editPartyTypeDocumentTypeUsageType(UserVisitPK userVisitPK, EditPartyTypeDocumentTypeUsageTypeForm form) { 237 return CDI.current().select(EditPartyTypeDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 238 } 239 240 @Override 241 public CommandResult deletePartyTypeDocumentTypeUsageType(UserVisitPK userVisitPK, DeletePartyTypeDocumentTypeUsageTypeForm form) { 242 return CDI.current().select(DeletePartyTypeDocumentTypeUsageTypeCommand.class).get().run(userVisitPK, form); 243 } 244 245 // -------------------------------------------------------------------------------- 246 // Party Documents 247 // -------------------------------------------------------------------------------- 248 249 @Override 250 public CommandResult createPartyDocument(UserVisitPK userVisitPK, CreatePartyDocumentForm form) { 251 return CDI.current().select(CreatePartyDocumentCommand.class).get().run(userVisitPK, form); 252 } 253 254 @Override 255 public CommandResult getPartyDocument(UserVisitPK userVisitPK, GetPartyDocumentForm form) { 256 return CDI.current().select(GetPartyDocumentCommand.class).get().run(userVisitPK, form); 257 } 258 259 @Override 260 public CommandResult getPartyDocuments(UserVisitPK userVisitPK, GetPartyDocumentsForm form) { 261 return CDI.current().select(GetPartyDocumentsCommand.class).get().run(userVisitPK, form); 262 } 263 264 @Override 265 public CommandResult setDefaultPartyDocument(UserVisitPK userVisitPK, SetDefaultPartyDocumentForm form) { 266 return CDI.current().select(SetDefaultPartyDocumentCommand.class).get().run(userVisitPK, form); 267 } 268 269 @Override 270 public CommandResult editPartyDocument(UserVisitPK userVisitPK, EditPartyDocumentForm form) { 271 return CDI.current().select(EditPartyDocumentCommand.class).get().run(userVisitPK, form); 272 } 273 274 @Override 275 public CommandResult deletePartyDocument(UserVisitPK userVisitPK, DeletePartyDocumentForm form) { 276 return CDI.current().select(DeletePartyDocumentCommand.class).get().run(userVisitPK, form); 277 } 278 279 // -------------------------------------------------------------------------------- 280 // Document Descriptions 281 // -------------------------------------------------------------------------------- 282 283 @Override 284 public CommandResult createDocumentDescription(UserVisitPK userVisitPK, CreateDocumentDescriptionForm form) { 285 return CDI.current().select(CreateDocumentDescriptionCommand.class).get().run(userVisitPK, form); 286 } 287 288 @Override 289 public CommandResult getDocumentDescription(UserVisitPK userVisitPK, GetDocumentDescriptionForm form) { 290 return CDI.current().select(GetDocumentDescriptionCommand.class).get().run(userVisitPK, form); 291 } 292 293 @Override 294 public CommandResult getDocumentDescriptions(UserVisitPK userVisitPK, GetDocumentDescriptionsForm form) { 295 return CDI.current().select(GetDocumentDescriptionsCommand.class).get().run(userVisitPK, form); 296 } 297 298 @Override 299 public CommandResult editDocumentDescription(UserVisitPK userVisitPK, EditDocumentDescriptionForm form) { 300 return CDI.current().select(EditDocumentDescriptionCommand.class).get().run(userVisitPK, form); 301 } 302 303 @Override 304 public CommandResult deleteDocumentDescription(UserVisitPK userVisitPK, DeleteDocumentDescriptionForm form) { 305 return CDI.current().select(DeleteDocumentDescriptionCommand.class).get().run(userVisitPK, form); 306 } 307 308}