DBA Data[Home] [Help]

PACKAGE BODY: APPS.WIP_WPS_PREFERENCES_PKG

Source


1 PACKAGE BODY WIP_WPS_PREFERENCES_PKG AS
2 /* $Header: wipzprfb.pls 120.0 2005/05/25 12:52:31 appldev noship $ */
3   /**
4    * This will remove all the saved preferences for the given application/user
5    * combination.
6    */
7   PROCEDURE delete_user_preferences(x_application_id NUMBER, x_organization_id NUMBER,
8 				    x_user_id NUMBER) IS
9 
10      PRAGMA AUTONOMOUS_TRANSACTION;
11   BEGIN
12      delete from wip_preferences
13      where application_id = x_application_id
14        and user_id = x_user_id
15        and organization_id = x_organization_id;
16 
17      COMMIT;
18 
19   END delete_user_preferences;
20 
21 
22   PROCEDURE delete_user_preferences(x_application_id NUMBER, x_organization_id NUMBER,
23 				    x_user_id NUMBER,
24 				    x_module_id NUMBER) IS
25 
26      PRAGMA AUTONOMOUS_TRANSACTION;
27   BEGIN
28 
29      delete from wip_preferences
30      where application_id = x_application_id
31        and user_id = x_user_id
32        and organization_id = x_organization_id
33        and module_id = x_module_id;
34 
35      COMMIT;
36 
37   END delete_user_preferences;
38 
39   PROCEDURE delete_user_preferences(x_application_id NUMBER, x_organization_id NUMBER,
40 				    x_user_id NUMBER,
41 				    x_module_id NUMBER,
42                                     x_preference_type NUMBER) IS
43 
44      PRAGMA AUTONOMOUS_TRANSACTION;
45   BEGIN
46 
47      delete from wip_preferences
48      where application_id = x_application_id
49        and user_id = x_user_id
50        and organization_id = x_organization_id
51        and module_id = x_module_id
52        and preference_type = x_preference_type;
53 
54      COMMIT;
55 
56   END delete_user_preferences;
57 
58   /**
59    * This will insert a record into the preference table.
60      */
61    PROCEDURE insert_preference(x_application_id NUMBER,
62 			       x_organization_id NUMBER,
63 			       x_user_id NUMBER,
64 			       x_preference_type NUMBER,
65 			       x_value VARCHAR2,
66 			       x_value_index NUMBER) IS
67       PRAGMA AUTONOMOUS_TRANSACTION;
68    BEGIN
69 
70       insert into wip_preferences (preference_id,
71 				   application_id,
72 				   organization_id,
73 				   user_id,
74 				   preference_type,
75 				   value,
76 				   value_index,
77 				   last_update_date,
78 				   last_updated_by,
79 				   creation_date,
80 				   created_by)
81       values (wip_preferences_seq.nextval,
82 	      x_application_id,
83 	      x_organization_id,
84 	      x_user_id,
85 	      x_preference_type,
86 	      x_value,
87 	      x_value_index,
88 	      sysdate,
89 	      x_user_id,
90 	      sysdate,
91 	      x_user_id);
92 
93       COMMIT;
94 
95 
96    END insert_preference;
97 
98 
99    PROCEDURE insert_preference(x_application_id NUMBER,
100 			       x_organization_id NUMBER,
101 			       x_user_id NUMBER,
102 			       x_preference_type NUMBER,
103 			       x_value VARCHAR2,
104 			       x_value_index NUMBER,
105 			       x_module_id NUMBER) IS
106       PRAGMA AUTONOMOUS_TRANSACTION;
107    BEGIN
108 
109       insert into wip_preferences (preference_id,
110 				   application_id,
111 				   organization_id,
112 				   user_id,
113 				   preference_type,
114 				   value,
115 				   value_index,
116 				   last_update_date,
117 				   last_updated_by,
118 				   creation_date,
119 				   created_by,
120 				   module_id)
121       values (wip_preferences_seq.nextval,
122 	      x_application_id,
123 	      x_organization_id,
124 	      x_user_id,
125 	      x_preference_type,
126 	      x_value,
127 	      x_value_index,
128 	      sysdate,
129 	      x_user_id,
130 	      sysdate,
131 	      x_user_id,
132 	      x_module_id);
133 
134       COMMIT;
135 
136 
137    END insert_preference;
138 
139 END WIP_WPS_PREFERENCES_PKG;