DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_PAGE_CONTENTS_PVT

Source


1 PACKAGE BODY PA_PAGE_CONTENTS_PVT AS
2 --$Header: PAPGCTVB.pls 120.0 2005/05/30 19:06:03 appldev noship $
3 
4 procedure ADD_PAGE_CONTENTS (
5 
6          p_api_version          IN      NUMBER   :=  1.0
7         ,p_init_msg_list        IN      VARCHAR2 := fnd_api.g_true
8         ,p_commit               IN      VARCHAR2 := FND_API.g_false
9         ,p_validate_only        IN      VARCHAR2 := FND_API.g_true
10         ,p_max_msg_count        IN      NUMBER   := FND_API.g_miss_num
11 
12         ,P_OBJECT_TYPE          IN      VARCHAR2
13         ,P_PK1_VALUE            IN      VARCHAR2
14         ,P_PK2_VALUE            IN      VARCHAR2
15         ,P_PK3_VALUE            IN      VARCHAR2
16         ,P_PK4_VALUE            IN      VARCHAR2
17         ,P_PK5_VALUE            IN      VARCHAR2
18 
19         ,x_page_content_id      OUT     NOCOPY NUMBER
20         ,x_return_status        OUT     NOCOPY VARCHAR2
21         ,x_msg_count            OUT     NOCOPY NUMBER
22         ,x_msg_data             OUT     NOCOPY VARCHAR2
23 
24 ) is
25 
26    l_content_id NUMBER;
27 
28    --cursor C is select ROWID from PA_PAGE_CONTENTS
29    --  where Page_content_id = l_content_id;
30 
31 BEGIN
32 
33  -- Initialize the Error Stack
34   PA_DEBUG.init_err_stack('PA_PAGE_CONTENTS_PVT.Add_Page_Contents');
35 
36   -- Initialize the return status to success
37   x_return_status := FND_API.G_RET_STS_SUCCESS;
38 
39   --Clear the global PL/SQL message table
40   IF FND_API.TO_BOOLEAN( p_init_msg_list ) THEN
41     FND_MSG_PUB.initialize;
42   END IF;
43 
44   IF P_PK1_VALUE is null  THEN
45            PA_UTILS.Add_Message( p_app_short_name => 'PA'
46                                 ,p_msg_name       => 'PA_OBJECT_ID_INV');
47            x_return_status := 'E';
48 
49   END IF;
50 
51   IF P_OBJECT_TYPE is NULL  THEN
52            PA_UTILS.Add_Message( p_app_short_name => 'PA'
53                                 ,p_msg_name       => 'PA_INVALID_OBJECT_TYPES');
54            x_return_status := 'E';
55   END IF;
56 
57   IF x_return_status = 'S' THEN
58       -- Issue API savepoint if the transaction is to be committed
59       IF p_commit  = FND_API.G_TRUE THEN
60         SAVEPOINT add_page_contents;
61       END IF;
62 
63       --get the unique page content id from the Oracle Sequence
64       /* Commented for bug 3866224 to remove hard coded schema reference and modified as below
65       SELECT pa.pa_page_contents_s.nextval */
66       SELECT pa_page_contents_s.nextval
67       INTO l_content_id
68       FROM DUAL;
69 
70       PA_PAGE_CONTENTS_PKG.INSERT_PAGE_CONTENTS_ROW (
71          l_content_id
72         ,P_OBJECT_TYPE
73         ,P_PK1_VALUE
74         ,P_PK2_VALUE
75         ,P_PK3_VALUE
76         ,P_PK4_VALUE
77         ,P_PK5_VALUE
78         ,x_return_status
79         ,x_msg_count
80         ,x_msg_data
81         );
82       x_page_content_id := l_content_id;
83    END IF;
84 
85      -- Commit if the flag is set and there is no error
86    IF (p_commit = FND_API.G_TRUE AND  x_return_status = FND_API.g_ret_sts_success  )THEN
87       COMMIT;
88    END IF;
89 
90  -- Reset the error stack when returning to the calling program
91   PA_DEBUG.Reset_Err_Stack;
92 
93 EXCEPTION
94     WHEN OTHERS THEN
95       rollback to add_page_contents;
96        -- Set the excetption Message and the stack
97        FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_PAGE_CONTENTS_PVT.ADD_PAGE_CONTENTS'
98                                 ,p_procedure_name => PA_DEBUG.G_Err_Stack );
99 
100 
101         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
102         RAISE;
103 
104 end ADD_PAGE_CONTENTS;
105 
106 
107 procedure DELETE_PAGE_CONTENTS (
108          p_api_version          IN      NUMBER   :=  1.0
109         ,p_init_msg_list        IN      VARCHAR2 := fnd_api.g_true
110         ,p_commit               IN      VARCHAR2 := FND_API.g_false
111         ,p_validate_only        IN      VARCHAR2 := FND_API.g_true
112         ,p_max_msg_count        IN      NUMBER   := FND_API.g_miss_num
113 
114   	,P_PAGE_CONTENT_ID      IN 	NUMBER
115   	,x_return_status        OUT    	NOCOPY VARCHAR2
116   	,x_msg_count            OUT    	NOCOPY NUMBER
117   	,x_msg_data             OUT    	NOCOPY VARCHAR2
118 ) is
119 begin
120   -- Initialize the Error Stack
121   PA_DEBUG.init_err_stack('PA_CONTROL_ITEMS_PVT.Delete_PageContents');
122 
123   x_return_status := FND_API.G_RET_STS_SUCCESS;
124 
125   IF P_PAGE_CONTENT_ID is null  THEN
126            PA_UTILS.Add_Message( p_app_short_name => 'PA'
127                                 ,p_msg_name       => 'PA_OBJECT_ID_INV');
128            x_return_status := 'E';
129   END IF;
130 
131   IF x_return_status = 'S' THEN
132       -- Issue API savepoint if the transaction is to be committed
133       IF p_commit  = FND_API.G_TRUE THEN
134         SAVEPOINT delete_page_contents;
135       END IF;
136       PA_PAGE_CONTENTS_PKG.DELETE_PAGE_CONTENTS_ROW(
137          P_PAGE_CONTENT_ID
138         ,x_return_status
139         ,x_msg_count
140         ,x_msg_data
141         );
142   END IF;
143 
144      -- Commit if the flag is set and there is no error
145   IF (p_commit = FND_API.G_TRUE AND  x_return_status = FND_API.g_ret_sts_success  )THEN
146       COMMIT;
147   END IF;
148 
149  -- Reset the error stack when returning to the calling program
150   PA_DEBUG.Reset_Err_Stack;
151 
152 
153 EXCEPTION
154     WHEN OTHERS THEN
155         IF p_commit = FND_API.G_TRUE THEN
156           ROLLBACK TO delete_page_contents;
157         END IF;
158 
159         -- Set the excetption Message and the stack
160         FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_PAGE_CONTENTS_PVT.delete_page_contents'
161                                  ,p_procedure_name => PA_DEBUG.G_Err_Stack );
162 
163         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
164         RAISE;
165 end DELETE_PAGE_CONTENTS;
166 
167 procedure CLEAR_PAGE_CONTENTS (
168          p_api_version          IN      NUMBER   :=  1.0
169         ,p_init_msg_list        IN      VARCHAR2 := fnd_api.g_true
170         ,p_commit               IN      VARCHAR2 := FND_API.g_false
171         ,p_validate_only        IN      VARCHAR2 := FND_API.g_true
172         ,p_max_msg_count        IN      NUMBER   := FND_API.g_miss_num
173 
174         ,P_PAGE_CONTENT_ID      IN      NUMBER
175         ,x_return_status        OUT     NOCOPY VARCHAR2
176         ,x_msg_count            OUT     NOCOPY NUMBER
177         ,x_msg_data             OUT     NOCOPY VARCHAR2
178 ) is
179 begin
180   -- Initialize the Error Stack
181   PA_DEBUG.init_err_stack('PA_CONTROL_ITEMS_PVT.Clear_Page_Contents');
182 
183   x_return_status := FND_API.G_RET_STS_SUCCESS;
184 
185 
186   IF P_PAGE_CONTENT_ID is null  THEN
187            PA_UTILS.Add_Message( p_app_short_name => 'PA'
188                                 ,p_msg_name       => 'PA_OBJECT_ID_INV');
189            x_return_status := 'E';
190 
191   END IF;
192 
193   IF x_return_status = 'S' THEN
194       -- Issue API savepoint if the transaction is to be committed
195       IF p_commit  = FND_API.G_TRUE THEN
196         SAVEPOINT clear_page_contents;
197       END IF;
198 
199       PA_PAGE_CONTENTS_PKG.CLEAR_CLOB(
200          P_PAGE_CONTENT_ID
201         ,x_return_status
202         ,x_msg_count
203         ,x_msg_data
204         );
205   END IF;
206     -- Commit if the flag is set and there is no error
207   IF (p_commit = FND_API.G_TRUE AND  x_return_status = FND_API.g_ret_sts_success  )THEN
208       COMMIT;
209   END IF;
210 
211  -- Reset the error stack when returning to the calling program
212   PA_DEBUG.Reset_Err_Stack;
213 
214 
215 EXCEPTION
216     WHEN OTHERS THEN
217         IF p_commit = FND_API.G_TRUE THEN
218           ROLLBACK TO clear_page_contents;
219         END IF;
220 
221         -- Set the excetption Message and the stack
222         FND_MSG_PUB.add_exc_msg ( p_pkg_name => 'PA_PAGE_CONTENTS_PVT.clear_page_contents'
223                                  ,p_procedure_name => PA_DEBUG.G_Err_Stack );
224 
225         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
226         RAISE;
227 end CLEAR_PAGE_CONTENTS;
228 
229 
230 END  PA_PAGE_CONTENTS_PVT;