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.printer.server; 018 019import com.echothree.control.user.printer.common.PrinterRemote; 020import com.echothree.control.user.printer.common.form.*; 021import com.echothree.control.user.printer.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 PrinterBean 029 extends PrinterFormsImpl 030 implements PrinterRemote, PrinterLocal { 031 032 // ------------------------------------------------------------------------- 033 // Testing 034 // ------------------------------------------------------------------------- 035 036 @Override 037 public String ping() { 038 return "PrinterBean is alive!"; 039 } 040 041 // ------------------------------------------------------------------------- 042 // Printer Groups 043 // ------------------------------------------------------------------------- 044 045 @Override 046 public CommandResult createPrinterGroup(UserVisitPK userVisitPK, CreatePrinterGroupForm form) { 047 return CDI.current().select(CreatePrinterGroupCommand.class).get().run(userVisitPK, form); 048 } 049 050 @Override 051 public CommandResult getPrinterGroupChoices(UserVisitPK userVisitPK, GetPrinterGroupChoicesForm form) { 052 return CDI.current().select(GetPrinterGroupChoicesCommand.class).get().run(userVisitPK, form); 053 } 054 055 @Override 056 public CommandResult getPrinterGroup(UserVisitPK userVisitPK, GetPrinterGroupForm form) { 057 return CDI.current().select(GetPrinterGroupCommand.class).get().run(userVisitPK, form); 058 } 059 060 @Override 061 public CommandResult getPrinterGroups(UserVisitPK userVisitPK, GetPrinterGroupsForm form) { 062 return CDI.current().select(GetPrinterGroupsCommand.class).get().run(userVisitPK, form); 063 } 064 065 @Override 066 public CommandResult setDefaultPrinterGroup(UserVisitPK userVisitPK, SetDefaultPrinterGroupForm form) { 067 return CDI.current().select(SetDefaultPrinterGroupCommand.class).get().run(userVisitPK, form); 068 } 069 070 @Override 071 public CommandResult editPrinterGroup(UserVisitPK userVisitPK, EditPrinterGroupForm form) { 072 return CDI.current().select(EditPrinterGroupCommand.class).get().run(userVisitPK, form); 073 } 074 075 @Override 076 public CommandResult getPrinterGroupStatusChoices(UserVisitPK userVisitPK, GetPrinterGroupStatusChoicesForm form) { 077 return CDI.current().select(GetPrinterGroupStatusChoicesCommand.class).get().run(userVisitPK, form); 078 } 079 080 @Override 081 public CommandResult setPrinterGroupStatus(UserVisitPK userVisitPK, SetPrinterGroupStatusForm form) { 082 return CDI.current().select(SetPrinterGroupStatusCommand.class).get().run(userVisitPK, form); 083 } 084 085 @Override 086 public CommandResult deletePrinterGroup(UserVisitPK userVisitPK, DeletePrinterGroupForm form) { 087 return CDI.current().select(DeletePrinterGroupCommand.class).get().run(userVisitPK, form); 088 } 089 090 // ------------------------------------------------------------------------- 091 // Printer Group Descriptions 092 // ------------------------------------------------------------------------- 093 094 @Override 095 public CommandResult createPrinterGroupDescription(UserVisitPK userVisitPK, CreatePrinterGroupDescriptionForm form) { 096 return CDI.current().select(CreatePrinterGroupDescriptionCommand.class).get().run(userVisitPK, form); 097 } 098 099 @Override 100 public CommandResult getPrinterGroupDescription(UserVisitPK userVisitPK, GetPrinterGroupDescriptionForm form) { 101 return CDI.current().select(GetPrinterGroupDescriptionCommand.class).get().run(userVisitPK, form); 102 } 103 104 @Override 105 public CommandResult getPrinterGroupDescriptions(UserVisitPK userVisitPK, GetPrinterGroupDescriptionsForm form) { 106 return CDI.current().select(GetPrinterGroupDescriptionsCommand.class).get().run(userVisitPK, form); 107 } 108 109 @Override 110 public CommandResult editPrinterGroupDescription(UserVisitPK userVisitPK, EditPrinterGroupDescriptionForm form) { 111 return CDI.current().select(EditPrinterGroupDescriptionCommand.class).get().run(userVisitPK, form); 112 } 113 114 @Override 115 public CommandResult deletePrinterGroupDescription(UserVisitPK userVisitPK, DeletePrinterGroupDescriptionForm form) { 116 return CDI.current().select(DeletePrinterGroupDescriptionCommand.class).get().run(userVisitPK, form); 117 } 118 119 // ------------------------------------------------------------------------- 120 // Printers 121 // ------------------------------------------------------------------------- 122 123 @Override 124 public CommandResult createPrinter(UserVisitPK userVisitPK, CreatePrinterForm form) { 125 return CDI.current().select(CreatePrinterCommand.class).get().run(userVisitPK, form); 126 } 127 128 @Override 129 public CommandResult getPrinter(UserVisitPK userVisitPK, GetPrinterForm form) { 130 return CDI.current().select(GetPrinterCommand.class).get().run(userVisitPK, form); 131 } 132 133 @Override 134 public CommandResult getPrinters(UserVisitPK userVisitPK, GetPrintersForm form) { 135 return CDI.current().select(GetPrintersCommand.class).get().run(userVisitPK, form); 136 } 137 138 @Override 139 public CommandResult editPrinter(UserVisitPK userVisitPK, EditPrinterForm form) { 140 return CDI.current().select(EditPrinterCommand.class).get().run(userVisitPK, form); 141 } 142 143 @Override 144 public CommandResult getPrinterStatusChoices(UserVisitPK userVisitPK, GetPrinterStatusChoicesForm form) { 145 return CDI.current().select(GetPrinterStatusChoicesCommand.class).get().run(userVisitPK, form); 146 } 147 148 @Override 149 public CommandResult setPrinterStatus(UserVisitPK userVisitPK, SetPrinterStatusForm form) { 150 return CDI.current().select(SetPrinterStatusCommand.class).get().run(userVisitPK, form); 151 } 152 153 @Override 154 public CommandResult deletePrinter(UserVisitPK userVisitPK, DeletePrinterForm form) { 155 return CDI.current().select(DeletePrinterCommand.class).get().run(userVisitPK, form); 156 } 157 158 // ------------------------------------------------------------------------- 159 // Printer Descriptions 160 // ------------------------------------------------------------------------- 161 162 @Override 163 public CommandResult createPrinterDescription(UserVisitPK userVisitPK, CreatePrinterDescriptionForm form) { 164 return CDI.current().select(CreatePrinterDescriptionCommand.class).get().run(userVisitPK, form); 165 } 166 167 @Override 168 public CommandResult getPrinterDescription(UserVisitPK userVisitPK, GetPrinterDescriptionForm form) { 169 return CDI.current().select(GetPrinterDescriptionCommand.class).get().run(userVisitPK, form); 170 } 171 172 @Override 173 public CommandResult getPrinterDescriptions(UserVisitPK userVisitPK, GetPrinterDescriptionsForm form) { 174 return CDI.current().select(GetPrinterDescriptionsCommand.class).get().run(userVisitPK, form); 175 } 176 177 @Override 178 public CommandResult editPrinterDescription(UserVisitPK userVisitPK, EditPrinterDescriptionForm form) { 179 return CDI.current().select(EditPrinterDescriptionCommand.class).get().run(userVisitPK, form); 180 } 181 182 @Override 183 public CommandResult deletePrinterDescription(UserVisitPK userVisitPK, DeletePrinterDescriptionForm form) { 184 return CDI.current().select(DeletePrinterDescriptionCommand.class).get().run(userVisitPK, form); 185 } 186 187 // ------------------------------------------------------------------------- 188 // Printer Group Jobs 189 // ------------------------------------------------------------------------- 190 191 @Override 192 public CommandResult createPrinterGroupJob(UserVisitPK userVisitPK, CreatePrinterGroupJobForm form) { 193 return CDI.current().select(CreatePrinterGroupJobCommand.class).get().run(userVisitPK, form); 194 } 195 196 @Override 197 public CommandResult getPrinterGroupJob(UserVisitPK userVisitPK, GetPrinterGroupJobForm form) { 198 return CDI.current().select(GetPrinterGroupJobCommand.class).get().run(userVisitPK, form); 199 } 200 201 @Override 202 public CommandResult getPrinterGroupJobs(UserVisitPK userVisitPK, GetPrinterGroupJobsForm form) { 203 return CDI.current().select(GetPrinterGroupJobsCommand.class).get().run(userVisitPK, form); 204 } 205 206 @Override 207 public CommandResult getPrinterGroupJobStatusChoices(UserVisitPK userVisitPK, GetPrinterGroupJobStatusChoicesForm form) { 208 return CDI.current().select(GetPrinterGroupJobStatusChoicesCommand.class).get().run(userVisitPK, form); 209 } 210 211 @Override 212 public CommandResult setPrinterGroupJobStatus(UserVisitPK userVisitPK, SetPrinterGroupJobStatusForm form) { 213 return CDI.current().select(SetPrinterGroupJobStatusCommand.class).get().run(userVisitPK, form); 214 } 215 216 @Override 217 public CommandResult deletePrinterGroupJob(UserVisitPK userVisitPK, DeletePrinterGroupJobForm form) { 218 return CDI.current().select(DeletePrinterGroupJobCommand.class).get().run(userVisitPK, form); 219 } 220 221 // ------------------------------------------------------------------------- 222 // Printer Group Use Types 223 // ------------------------------------------------------------------------- 224 225 @Override 226 public CommandResult createPrinterGroupUseType(UserVisitPK userVisitPK, CreatePrinterGroupUseTypeForm form) { 227 return CDI.current().select(CreatePrinterGroupUseTypeCommand.class).get().run(userVisitPK, form); 228 } 229 230 @Override 231 public CommandResult getPrinterGroupUseTypeChoices(UserVisitPK userVisitPK, GetPrinterGroupUseTypeChoicesForm form) { 232 return CDI.current().select(GetPrinterGroupUseTypeChoicesCommand.class).get().run(userVisitPK, form); 233 } 234 235 @Override 236 public CommandResult getPrinterGroupUseType(UserVisitPK userVisitPK, GetPrinterGroupUseTypeForm form) { 237 return CDI.current().select(GetPrinterGroupUseTypeCommand.class).get().run(userVisitPK, form); 238 } 239 240 @Override 241 public CommandResult getPrinterGroupUseTypes(UserVisitPK userVisitPK, GetPrinterGroupUseTypesForm form) { 242 return CDI.current().select(GetPrinterGroupUseTypesCommand.class).get().run(userVisitPK, form); 243 } 244 245 @Override 246 public CommandResult setDefaultPrinterGroupUseType(UserVisitPK userVisitPK, SetDefaultPrinterGroupUseTypeForm form) { 247 return CDI.current().select(SetDefaultPrinterGroupUseTypeCommand.class).get().run(userVisitPK, form); 248 } 249 250 @Override 251 public CommandResult editPrinterGroupUseType(UserVisitPK userVisitPK, EditPrinterGroupUseTypeForm form) { 252 return CDI.current().select(EditPrinterGroupUseTypeCommand.class).get().run(userVisitPK, form); 253 } 254 255 @Override 256 public CommandResult deletePrinterGroupUseType(UserVisitPK userVisitPK, DeletePrinterGroupUseTypeForm form) { 257 return CDI.current().select(DeletePrinterGroupUseTypeCommand.class).get().run(userVisitPK, form); 258 } 259 260 // ------------------------------------------------------------------------- 261 // Printer Group Use Type Descriptions 262 // ------------------------------------------------------------------------- 263 264 @Override 265 public CommandResult createPrinterGroupUseTypeDescription(UserVisitPK userVisitPK, CreatePrinterGroupUseTypeDescriptionForm form) { 266 return CDI.current().select(CreatePrinterGroupUseTypeDescriptionCommand.class).get().run(userVisitPK, form); 267 } 268 269 @Override 270 public CommandResult getPrinterGroupUseTypeDescription(UserVisitPK userVisitPK, GetPrinterGroupUseTypeDescriptionForm form) { 271 return CDI.current().select(GetPrinterGroupUseTypeDescriptionCommand.class).get().run(userVisitPK, form); 272 } 273 274 @Override 275 public CommandResult getPrinterGroupUseTypeDescriptions(UserVisitPK userVisitPK, GetPrinterGroupUseTypeDescriptionsForm form) { 276 return CDI.current().select(GetPrinterGroupUseTypeDescriptionsCommand.class).get().run(userVisitPK, form); 277 } 278 279 @Override 280 public CommandResult editPrinterGroupUseTypeDescription(UserVisitPK userVisitPK, EditPrinterGroupUseTypeDescriptionForm form) { 281 return CDI.current().select(EditPrinterGroupUseTypeDescriptionCommand.class).get().run(userVisitPK, form); 282 } 283 284 @Override 285 public CommandResult deletePrinterGroupUseTypeDescription(UserVisitPK userVisitPK, DeletePrinterGroupUseTypeDescriptionForm form) { 286 return CDI.current().select(DeletePrinterGroupUseTypeDescriptionCommand.class).get().run(userVisitPK, form); 287 } 288 289 // ------------------------------------------------------------------------- 290 // Party Printer Group Uses 291 // ------------------------------------------------------------------------- 292 293 @Override 294 public CommandResult createPartyPrinterGroupUse(UserVisitPK userVisitPK, CreatePartyPrinterGroupUseForm form) { 295 return CDI.current().select(CreatePartyPrinterGroupUseCommand.class).get().run(userVisitPK, form); 296 } 297 298 @Override 299 public CommandResult getPartyPrinterGroupUse(UserVisitPK userVisitPK, GetPartyPrinterGroupUseForm form) { 300 return CDI.current().select(GetPartyPrinterGroupUseCommand.class).get().run(userVisitPK, form); 301 } 302 303 @Override 304 public CommandResult getPartyPrinterGroupUses(UserVisitPK userVisitPK, GetPartyPrinterGroupUsesForm form) { 305 return CDI.current().select(GetPartyPrinterGroupUsesCommand.class).get().run(userVisitPK, form); 306 } 307 308 @Override 309 public CommandResult editPartyPrinterGroupUse(UserVisitPK userVisitPK, EditPartyPrinterGroupUseForm form) { 310 return CDI.current().select(EditPartyPrinterGroupUseCommand.class).get().run(userVisitPK, form); 311 } 312 313 @Override 314 public CommandResult deletePartyPrinterGroupUse(UserVisitPK userVisitPK, DeletePartyPrinterGroupUseForm form) { 315 return CDI.current().select(DeletePartyPrinterGroupUseCommand.class).get().run(userVisitPK, form); 316 } 317 318}