1   /*
2    * Copyright 2003 - 2013 The eFaps Team
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   * Revision:        $Rev$
17   * Last Changed:    $Date$
18   * Last Changed By: $Author$
19   */
20  
21  package org.efaps.admin.event;
22  
23  
24  /**
25   * This enumeration provides the key-value Relation for the TriggerEvent.<br>
26   * Therefore using a trigger can be made by using the key. An example for the
27   * use of this enumeration is the definition of a Trigger inside the XML
28   * definition.
29   *
30   * @author The eFaps Team
31   * @version $Id$
32   */
33  public enum EventType
34  {
35      /** EventType for checking the access to a type. */
36      ACCESSCHECK          ("Admin_DataModel_TypeAccessCheckEvent"),
37      /** EventType executed instead the checkin of a type. */
38      CHECKIN_OVERRIDE     ("Admin_DataModel_Type_Trigger_CheckinOverride"),
39      /** EventType executed after the checkin of a type. */
40      CHECKIN_POST         ("Admin_DataModel_Type_Trigger_CheckinPost"),
41      /** EventType executed before the checkin of a type. */
42      CHECKIN_PRE          ("Admin_DataModel_Type_Trigger_CheckinPre"),
43      /** EventType executed instead the checkout of a type. */
44      CHECKOUT_OVERRIDE    ("Admin_DataModel_Type_Trigger_CheckoutOverride"),
45      /** EventType executed after the checkout of a type. */
46      CHECKOUT_POST        ("Admin_DataModel_Type_Trigger_CheckoutPost"),
47      /** EventType executed before the checkout of a type. */
48      CHECKOUT_PRE         ("Admin_DataModel_Type_Trigger_CheckoutPre"),
49      /** EventType executed instead the deletion of a type. */
50      DELETE_OVERRIDE      ("Admin_DataModel_Type_Trigger_DeleteOverride"),
51      /** EventType executed after the deletion of a type. */
52      DELETE_POST          ("Admin_DataModel_Type_Trigger_DeletePost"),
53      /** EventType executed before the deletion of a type. */
54      DELETE_PRE           ("Admin_DataModel_Type_Trigger_DeletePre"),
55      /** EventType executed instead the insert of a type. */
56      INSERT_OVERRIDE      ("Admin_DataModel_Type_Trigger_InsertOverride"),
57      /** EventType executed after the insert of a type. */
58      INSERT_POST          ("Admin_DataModel_Type_Trigger_InsertPost"),
59      /** EventType executed before the insert of a type. */
60      INSERT_PRE           ("Admin_DataModel_Type_Trigger_InsertPre"),
61      /** EventType executed instead the update of a type. */
62      UPDATE_OVERRIDE      ("Admin_DataModel_Type_Trigger_UpdateOverride"),
63      /** EventType executed after the update of a type. */
64      UPDATE_POST          ("Admin_DataModel_Type_Trigger_UpdatePost"),
65      /** EventType executed before the update of a type. */
66      UPDATE_PRE           ("Admin_DataModel_Type_Trigger_UpdatePre"),
67      /**
68       * EventType executed immediately after reading the value from
69       * the database to be possible to alter the value.
70       */
71      READ_VALUE           ("Admin_DataModel_AttributeReadEvent"),
72      /**
73       *  EventType executed just before the prepare update the value
74       *  into the database to be possible to alter the value.
75       */
76      UPDATE_VALUE         ("Admin_DataModel_AttributeUpdateEvent"),
77      /**
78       *  EventType executed just before prepare insert of the value
79       *  into the database to be possible to alter the value.
80       */
81      INSERT_VALUE         ("Admin_DataModel_AttributeInsertEvent"),
82      /**
83       * EventType to get the BigDecimal value for a rate.
84       */
85      RATE_VALUE           ("Admin_DataModel_AttributeRateEvent"),
86      /**
87       * Event Ttpe to get the values as a map for a range link.
88       */
89      RANGE_VALUE          ("Admin_DataModel_AttributeRangeEvent"),
90      /**
91       * EventType to get a formated Value for a Field. It is executed after
92       * retrieving the value. The value is passed to the ESJP for formatting it.
93       */
94      UI_FIELD_FORMAT      ("Admin_UI_FieldFormatEvent"),
95      /**
96       * EventType for a field that updates other fields. The event will be
97       * executed, if the value for the field is changed.
98       */
99      UI_FIELD_UPDATE      ("Admin_UI_FieldUpdateEvent"),
100     /**
101      * EventType for generating the value for a field instead of retrieving it
102      * directly from the database.
103      */
104     UI_FIELD_VALUE        ("Admin_UI_FieldValueEvent"),
105     /**
106      * EventType for getting the instance behind a field.
107      */
108     UI_FIELD_ALTINST      ("Admin_UI_FieldAlternateInstanceEvent"),
109     /** EventType for a FieldCommand. */
110     UI_FIELD_CMD          ("Admin_UI_FieldCommandEvent"),
111     /** EventType for the search ESJP of a auto complete field. */
112     UI_FIELD_AUTOCOMPLETE ("Admin_UI_FieldAutoCompleteEvent"),
113     /** EventType for the picker event of a field. */
114     UI_PICKER             ("Admin_UI_PickerEvent"),
115     /**
116      * EventType for checking the access to a field (depending on mode: create
117      * edit etc.
118      */
119     UI_ACCESSCHECK        ("Admin_UI_AbstractAccessCheckEvent"),
120     /**
121      * EventType executed from an command.
122      */
123     UI_COMMAND_EXECUTE    ("Admin_UI_CommandExecuteEvent"),
124     /**
125      * EventType executed to validate a form.
126      */
127     UI_VALIDATE           ("Admin_UI_ValidateEvent"),
128     /**
129      * EventType for checking the access to a field (depending on mode: create
130      * edit etc.
131      */
132     UI_INSTANCEMANAGER    ("Admin_UI_InstanceManagerEvent"),
133     /** EventType for evaluating the values for a table. */
134     UI_TABLE_EVALUATE     ("Admin_UI_TableEvaluateEvent"),
135     /**
136      * EventType used to validate the values for an attribute.
137      */
138     VALIDATE              ("Admin_DataModel_AttributeValidateEvent");
139 
140     /**
141      * Name of the Event.
142      */
143     private final String name;
144 
145     /**
146      * @param _name name for the event
147      */
148     private EventType(final String _name)
149     {
150         this.name = _name;
151     }
152 
153     /**
154      * Getter method for the instance variable {@link #name}.
155      *
156      * @return value of instance variable {@link #name}
157      */
158     public String getName()
159     {
160         return this.name;
161     }
162 }