DBA Data[Home] [Help]

PACKAGE: APPS.UMX_USERNAME_POLICY_PVT

Source


1 PACKAGE UMX_USERNAME_POLICY_PVT AS
2 /* $Header: UMXVUNPS.pls 120.5 2005/09/16 23:00:10 kching noship $ */
3 
4   --
5   -- Procedure        :  get_suggested_username
6   -- Type             :  Public
7   -- Pre_reqs         :  None
8   -- Description      :  This API will return the suggested user name for a person.
9   --                     The user name will be generated via the
10   --                     oracle.apps.fnd.umx.username.generate Business Event
11   --                     which will be raised by this API.  The event could
12   --                     return a null value as the user name if the user name
13   --                     could not be generated.
14   -- Input Parameters :
15   -- @param     p_person_party_id
16   --    Description:  Person Party ID of the person who to generate
17   --                  a username for.
18   --    Required   :  N
19   -- Output Parameters :
20   --   x_suggested_username: Username generated by the Username Policy. May return null.
21   --
22   --
23   procedure get_suggested_username (p_person_party_id    in HZ_PARTIES.PARTY_ID%TYPE default null,
24                                     x_suggested_username out nocopy FND_USER.USER_NAME%TYPE);
25 
26   --
27   -- Procedure        :  get_username_policy_desc
28   -- Type             :  Public
29   -- Pre_reqs         :  None
30   -- Description      :  This API will return the description of the user name
31   --                     policy.  The return parameters / user name policy is
32   --                     based on the UMX: User Name Policy (UMX_USERNAME_POLICY)
33   --                     profile option, which points to a LOOKUP TYPE that
34   --                     should include the following:
35   --
36   --                       LOOKUP CODES: DESCRIPTION, PROMPT, HINT
37   --
38   --                     with the appropriate LOOKUP MEANING defined. Example:
39   --
40   --                       LOOKUP TYPE: UMX_USERNAME_POLICY:EMAIL
41   --
42   --  LOOKUP CODE    MEANING                     DESCRIPTION
43   --  -----------    --------------------------  -------------------------------
44   --  PROMPT         User Name                   Prompt of the user name text
45   --                                             input field.
46   --
47   --  DESCRIPTION    User Names must be based    Description of the policy
48   --                 on Email Address
49   --
50   --  HINT           example: [email protected]  Example of what the username should
51   --                                             look like.
52   --
53   -- Input Parameters :
54   -- Output Parameters :
55   -- x_policy_code:      User Name Policy code. Preseeded policies are:
56   --
57   --                     Code: UMX_USERNAME_POLICY:EMAIL
58   --                     Meaning: User name should be defined as Email Address.
59   --                              Product teams may choose to hide the email
60   --                              field in any account creation / registration
61   --                              UI's as long as the entered username (email)
62   --                              is copied into the fnd_user.email_address field
63   --                              as well.
64   --
65   --                     Code: UMX_USERNAME_POLICY:NONE
66   --                     Meaning: No username policy / format defined, freetext
67   --
68   --                     Code: Anything else, this would be a custom policy defined
69   --                           at a client site.
70   --
71   -- x_description:      User Name Policy description. May be null. For example:
72   --
73   --                       "User Names must be based on <b>Email Address</b>".
74   --                       The description can be displayed as a quick tip in
75   --                       the user account creation/registration page.
76   --
77   -- x_prompt:           Prompt of the User Name field. Defaults to "User Name" if
78   --                     none is defined in the policy.
79   --
80   -- x_hint:             An example of the user name format. May be null. For
81   --                     example:
82   --
83   --                       "(example: [email protected])"
84   --
85   --                     The hint can be displayed as an inline hint below the
86   --                     User Name field in any user account creation/registration
87   --                     page.
88   --
89   --
90   procedure get_username_policy_desc
91                 (x_policy_code out nocopy FND_LOOKUP_TYPES.LOOKUP_TYPE%TYPE,
92                  x_description out nocopy FND_LOOKUP_VALUES.MEANING%TYPE,
93                  x_prompt      out nocopy FND_LOOKUP_VALUES.MEANING%TYPE,
94                  x_hint        out nocopy FND_LOOKUP_VALUES.MEANING%TYPE);
95 
96   --
97   -- Procedure        :  policy_subscription
98   -- Type             :  Private
99   -- Pre_reqs         :  None
100   -- Description      :  The is the subscription API which registers to the
101   --                     oracle.apps.fnd.umx.username.generate Workflow Business
102   --                     Event.  This subscription will generate the suggested
103   --                     user name by querying the email address stored in TCA.
104   --                     This API is intented to be called as a Business Subscription
105   --                     Rule Function.
106   -- Input Parameters :
107   -- @param     p_subscription_guid
108   --    Description:  Workflow Business Subscription GUID
109   --    Required   :  Y
110   -- @param     p_event
111   --    Description:  The event message.
112   --    Required   :  Y
113   -- Output Parameters :
114   --
115   function policy_subscription (p_subscription_guid in raw,
116                                 p_event             in out nocopy WF_EVENT_T) return varchar2;
117 
118 /* =========================START OBSOLETE IMPLEMENTATION======================*/
119   -- The WF itemtype for the Username Policy
120   g_itemtype varchar2 (23) := 'UMXUNPL';
121 
122   --
123   -- Procedure        :  run_policy
124   -- Type             :  Private
125   -- Pre_reqs         :  None
126   -- Description      :  This API will invoke the Username Policy
127   --                     workflow process and return the generated
128   --                     username and status "SUCCESS".  It will
129   --                     return error message and status "FAIL"
130   --                     if error occurs.
131   -- Input Parameters :
132   -- @param     p_reg_serv_code
133   --    Description:  Registration Service Code
134   --    Required   :  Y
135   -- @param     p_person_party_id
136   --    Description:  Person Party ID of the person who generate
137   --                  a username for.
138   --    Required   :  Y
139   -- Output Parameters :
140   -- x_generated_username: Username generated by the Username Policy
141   -- x_policy_override: The Username Policy determine if this policy
142   --                    can be overridden by the caller.
143   --                    Y - caller can override the policy
144   --                    N - caller cannot override the policy
145   -- x_result_code: Result code from running the Username Policy
146   --                (SUCCESS/FAIL)
147   -- x_policy_code: Policy Type (Example: EMAIL)
148   -- x_policy_name: Policy Name (Example: Email Address)
149   -- x_policy_desc: A brief description of the format used to generate
150   --                the username. (Example: "(exameple: [email protected])")
151   -- x_error_msg: Description why the Username Policy failed
152   --
153   --*/
154   Procedure run_policy (
155     p_reg_serv_code      in  UMX_REG_SERVICES_B.REG_SERVICE_CODE%TYPE,
156     p_person_party_id    in  HZ_PARTIES.PARTY_ID%TYPE,
157     x_generated_username out NOCOPY FND_USER.USER_NAME%TYPE,
158     x_policy_override    out NOCOPY varchar2,
159     x_policy_code        out NOCOPY varchar2,
160     x_policy_name        out NOCOPY varchar2,
161     x_policy_desc        out NOCOPY varchar2,
162     x_result_code        out NOCOPY varchar2,
163     x_error_msg          out NOCOPY varchar2
164   );
165 
166   --
167   -- Procedure        :  run_policy
168   -- Type             :  Private
169   -- Pre_reqs         :  None
170   -- Description      :  This API will invoke the Username Policy
171   --                     workflow process and return the generated
172   --                     username and status "SUCCESS".  It will
173   --                     return error message and status "FAIL"
174   --                     if error occurs.
175   -- Input Parameters :
176   -- @param     p_reg_serv_code
177   --    Description:  Registration Service Code
178   --    Required   :  Y
179   -- @param     p_person_party_id
180   --    Description:  Person Party ID of the person who generate
181   --                  a username for.
182   --    Required   :  Y
183   -- Output Parameters :
184   -- x_generated_username: Username generated by the Username Policy
185   -- x_policy_override: The Username Policy determine if this policy
186   --                    can be overridden by the caller.
187   --                    Y - caller can override the policy
188   --                    N - caller cannot override the policy
189   -- x_result_code: Result code from running the Username Policy
190   --                (SUCCESS/FAIL)
191   -- x_policy_code: Policy Type (Example: EMAIL)
192   -- x_policy_name: Policy Name (Example: Email Address)
193   -- x_policy_desc: A brief description of the format used to generate
194   --                the username. (Example: "(exameple: [email protected])")
195   -- x_error_msg: Description why the Username Policy failed
196   -- x_exist_user_id: User ID of the existing person.
197   -- x_exist_per_party_id: Person party id of the existing person.
198   --
199   --*/
200   Procedure run_policy (
201     p_reg_serv_code       in  UMX_REG_SERVICES_B.REG_SERVICE_CODE%TYPE,
202     p_person_party_id     in  HZ_PARTIES.PARTY_ID%TYPE,
203     x_generated_username  out NOCOPY FND_USER.USER_NAME%TYPE,
204     x_policy_override     out NOCOPY varchar2,
205     x_policy_code         out NOCOPY varchar2,
206     x_policy_name         out NOCOPY varchar2,
207     x_policy_desc         out NOCOPY varchar2,
208     x_result_code         out NOCOPY varchar2,
209     x_error_msg           out NOCOPY varchar2,
210     x_exist_user_id       out NOCOPY FND_USER.USER_ID%TYPE,
211     x_exist_per_party_id  out NOCOPY FND_USER.PERSON_PARTY_ID%TYPE
212   );
213 
214   --
215   -- Procedure
216   --      Selector
217   --
218   -- Description
219   --      Determine which process to run
220   -- IN
221   --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
222   --   itemkey   - A string generated from the application object's primary key.
223   --   actid     - The function activity(instance id).
224   --   funcmode  - Run/Cancel/Timeout
225   -- OUT
226   --   resultout - Name of workflow process to run
227   --
228   procedure Selector (item_type    in  varchar2,
229                       item_key     in  varchar2,
230                       activity_id  in  number,
231                       command      in  varchar2,
232                       resultout    out NOCOPY varchar2);
233   --
234   -- Procedure
235   --      gen_username
236   --
237   -- Description
238   --      Generate the username
239   -- IN
240   --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
241   --   itemkey   - A string generated from the application object's primary key.
242   --   actid     - The function activity(instance id).
243   --   funcmode  - Run/Cancel/Timeout
244   -- OUT
245   --   resultout - Name of workflow process to run
246   --
247   procedure gen_username (item_type    in  varchar2,
248                           item_key     in  varchar2,
249                           activity_id  in  number,
250                           command      in  varchar2,
251                           resultout    out NOCOPY varchar2);
252 
253   --
254   -- Procedure
255   --      chk_username_avail
256   --
257   -- Description
258   --      Check if the username is available in FND_USER table
259   -- IN
260   --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
261   --   itemkey   - A string generated from the application object's primary key.
262   --   actid     - The function activity(instance id).
263   --   funcmode  - Run/Cancel/Timeout
264   -- OUT
265   --   resultout - Name of workflow process to run
266   --
267   procedure chk_username_avail (item_type    in  varchar2,
268                                 item_key     in  varchar2,
269                                 activity_id  in  number,
270                                 command      in  varchar2,
271                                 resultout    out NOCOPY varchar2);
272 
273   --
274   -- Procedure
275   --      collision_resolution
276   --
277   -- Description
278   --      Template to resolve collision of username
279   -- IN
280   --   itemtype  - A valid item type from (WF_ITEM_TYPES table).
281   --   itemkey   - A string generated from the application object's primary key.
285   --   resultout - Name of workflow process to run
282   --   actid     - The function activity(instance id).
283   --   funcmode  - Run/Cancel/Timeout
284   -- OUT
286   --
287   procedure collision_resolution (item_type    in  varchar2,
288                                   item_key     in  varchar2,
289                                   activity_id  in  number,
290                                   command      in  varchar2,
291                                   resultout    out NOCOPY varchar2);
292 /* =========================END OBSOLETE IMPLEMENTATION======================*/
293 
294 END UMX_USERNAME_POLICY_PVT;