1    package com.instantbank.lettertemplate.control.event;
2    
3    import java.io.Serializable;
4    import java.util.ArrayList;
5    
6    /**
7     *  Preview/Print Letter usecase: This event is sent from the web tier to the
8     *  EJB Controller to notify the EJB Controller that an action needs to be made
9     *  in the letter Preview Print model data.
10    *
11    * @author Instant-bank (Jorge Cardenas)
12    * @created August 2002
13    */
14   public class PreviewPrintEvent extends LetterTemplateEventSupport {
15   
16     // possible actions on PreviewPrint model data:
17     /**
18      *  action constant of getting the templates list of the current company
19      */
20     public static final int LIST_TEMPLATES_PREVIEW = 0;
21   
22     // attributes: necesary data for executing the operations
23     /**
24      *  action requested by the user
25      */
26     private int actionType;
27     /**
28      *  current company
29      */
30     private String companyId;
31     /**
32      *  current user
33      */
34     private Long userId;
35   
36   
37     /**
38      *  constructor: initializes attributes
39      *
40      * @param actionType action requested by the user
41      * @param companyId current company
42      * @param userId current user
43      */
44     public PreviewPrintEvent(int actionType, String companyId, Long userId) {
45   
46       this.actionType = actionType;
47       this.companyId = companyId;
48       this.userId = userId;
49     }
50   
51   
52     /**
53      *  get method for actionType
54      *
55      * @return The actionType value
56      */
57     public int getActionType() {
58       return actionType;
59     }
60   
61   
62     /**
63      *  get method for companyId
64      *
65      * @return The companyId value
66      */
67     public String getCompanyId() {
68       return companyId;
69     }
70   
71   
72     /**
73      *  get method for userId
74      *
75      * @return The userId value
76      */
77     public Long getUserId() {
78       return userId;
79     }
80   
81   
82     /**
83      *  String representation of the event
84      *
85      * @return text of event
86      */
87     public String toString() {
88       return "PreviewPrintEvent("
89         + String.valueOf(actionType) + ", "
90         + companyId + ", "
91         + userId.toString() +
92         ")";
93     }
94   
95   
96     /**
97      *  JNDI name for the event: LetterTemplateController EJB registers this env variable
98      *
99      * @return The eventName value
100     */
101    public String getEventName() {
102      return "java:comp/env/previewPrintEvent";
103    }
104  }
105  
106