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.icon.server;
018
019import com.echothree.control.user.icon.common.IconRemote;
020import com.echothree.control.user.icon.common.form.*;
021import com.echothree.control.user.icon.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 IconBean
029        extends IconFormsImpl
030        implements IconRemote, IconLocal {
031    
032    // -------------------------------------------------------------------------
033    //   Testing
034    // -------------------------------------------------------------------------
035    
036    @Override
037    public String ping() {
038        return "IconBean is alive!";
039    }
040    
041    // --------------------------------------------------------------------------------
042    //   Icon Usage Types
043    // --------------------------------------------------------------------------------
044    
045    @Override
046    public CommandResult createIconUsageType(UserVisitPK userVisitPK, CreateIconUsageTypeForm form) {
047        return CDI.current().select(CreateIconUsageTypeCommand.class).get().run(userVisitPK, form);
048    }
049    
050    // --------------------------------------------------------------------------------
051    //   Icon Usage Type Descriptions
052    // --------------------------------------------------------------------------------
053    
054    @Override
055    public CommandResult createIconUsageTypeDescription(UserVisitPK userVisitPK, CreateIconUsageTypeDescriptionForm form) {
056        return CDI.current().select(CreateIconUsageTypeDescriptionCommand.class).get().run(userVisitPK, form);
057    }
058    
059    // --------------------------------------------------------------------------------
060    //   Icons
061    // --------------------------------------------------------------------------------
062    
063    @Override
064    public CommandResult getIconChoices(UserVisitPK userVisitPK, GetIconChoicesForm form) {
065        return CDI.current().select(GetIconChoicesCommand.class).get().run(userVisitPK, form);
066    }
067    
068}