DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_PAGE_TYPE_REGION_PKG

Source


1 PACKAGE BODY PA_PAGE_TYPE_REGION_PKG AS
2 --$Header: PAPLPTHB.pls 115.3 2003/06/16 21:33:58 shanif noship $
3 
4 
5 procedure INSERT_PAGE_TYPE_REGION_ROW (
6   P_PAGE_TYPE_CODE in VARCHAR2,
7   P_REGION_SOURCE_TYPE in VARCHAR2,
8   P_REGION_SOURCE_CODE in VARCHAR2,
9 
10   P_VIEW_REGION_CODE in VARCHAR2,
11   P_EDIT_REGION_CODE in VARCHAR2,
12   P_REGION_STYLE in VARCHAR2,
13   P_DISPLAY_ORDER in NUMBER,
14   P_MANDATORY_FLAG in VARCHAR2,
15 
16   P_DEFAULT_REGION_POSITION in VARCHAR2,
17   P_PLACEHOLDER_REGION_FLAG in VARCHAR2,
18   P_START_DATE_ACTIVE in DATE,
19   P_END_DATE_ACTIVE in DATE,
20   P_DOCUMENT_SOURCE in VARCHAR2,
21   P_PAGE_FUNCTION_NAME in VARCHAR2,
22   P_SECURITY_FUNCTION_NAME in VARCHAR2
23 )
24   IS
25 
26    l_row_id ROWID;
27 
28    CURSOR  c1 IS
29       SELECT rowid
30 	FROM   pa_page_type_regions
31 	WHERE  page_type_code = p_page_type_code
32 	AND region_source_type = p_region_source_type
33 	AND region_source_code = p_region_source_code;
34 
35 begin
36 
37   insert into PA_PAGE_TYPE_REGIONS (
38 				    PAGE_TYPE_CODE,
39 				    VIEW_REGION_CODE,
40 				    EDIT_REGION_CODE,
41 				    DISPLAY_ORDER,
42 				    MANDATORY_FLAG,
43 				    LAST_UPDATED_BY,
44 				    CREATED_BY ,
45 				    CREATION_DATE ,
46 				    LAST_UPDATE_DATE ,
47 				    LAST_UPDATE_LOGIN ,
48 				    DEFAULT_REGION_POSITION ,
49 				    PLACEHOLDER_REGION_FLAG ,
50   				    REGION_SOURCE_TYPE,
51 				    REGION_SOURCE_CODE,
52 				    region_style,
53 				    START_DATE_ACTIVE ,
54 				    end_date_active,
55 				    DOCUMENT_SOURCE,
56                                     page_function_name,
57                                     security_function_name)
58 				    VALUES
59 				    (
60 				     P_PAGE_TYPE_CODE,
61 				     P_VIEW_REGION_CODE,
62 				     P_EDIT_REGION_CODE,
63 				     P_DISPLAY_ORDER,
64 				     P_MANDATORY_FLAG,
65 
66 				     fnd_global.user_id,
67 				     fnd_global.user_id,
68 				     sysdate,
69 				     sysdate,
70 				     fnd_global.user_id,
71 
72 				     P_DEFAULT_REGION_POSITION ,
73 				     P_PLACEHOLDER_REGION_FLAG ,
74 				     P_REGION_SOURCE_TYPE,
75 				     P_REGION_SOURCE_CODE,
76 				     P_region_style,
77 				     Nvl(p_start_date_active, Sysdate) ,
78 				     p_end_date_active,
79 				     P_DOCUMENT_SOURCE,
80                                      p_page_function_name,
81                                      p_security_function_name);
82 
83 
84 				    OPEN c1;
85 				    FETCH c1 INTO l_row_id;
86 				    IF (c1%NOTFOUND) THEN
87 				       CLOSE c1;
88 				       RAISE NO_DATA_FOUND;
89 				    END IF;
90 				    CLOSE c1;
91 
92 EXCEPTION
93     WHEN OTHERS THEN -- catch the exceptions here
94         -- Set the current program unit name in the error stack
95 --      PA_Error_Utils.Set_Error_Stack('PA_PROJECT_SUBTEAMS_PKG.Insert_Row');
96 --        x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
97         RAISE;
98 end INSERT_PAGE_TYPE_REGION_ROW;
99 
100 
101 procedure UPDATE_PAGE_TYPE_REGION_ROW (
102   P_PAGE_TYPE_CODE in VARCHAR2,
103   P_REGION_SOURCE_TYPE in VARCHAR2,
104   P_REGION_SOURCE_CODE in VARCHAR2,
105 
106   P_VIEW_REGION_CODE in VARCHAR2,
107   P_EDIT_REGION_CODE in VARCHAR2,
108   P_REGION_STYLE in VARCHAR2,
109   P_DISPLAY_ORDER in NUMBER,
110   P_MANDATORY_FLAG in VARCHAR2,
111 
112   P_DEFAULT_REGION_POSITION in VARCHAR2,
113   P_PLACEHOLDER_REGION_FLAG in VARCHAR2,
114   P_START_DATE_ACTIVE in DATE,
115   P_END_DATE_ACTIVE in DATE,
116   p_document_source IN varchar2,
117   p_page_function_name IN varchar2,
118   p_security_function_name IN varchar2)
119   IS
120 
121    l_row_id ROWID;
122 
123    CURSOR  c1 IS
124       SELECT rowid
125 	FROM   pa_page_type_regions
126 	WHERE  page_type_code = p_page_type_code
127 	AND region_source_type = p_region_source_type
128 	AND region_source_code = p_region_source_code;
129 
130 BEGIN
131 
132   UPDATE PA_PAGE_TYPE_REGIONS SET
133     view_region_code = P_VIEW_REGION_CODE,
134     edit_region_code = P_EDIT_REGION_CODE,
135     display_order = Decode(p_display_order, 1.7e20, display_order, p_display_order),
136     mandatory_flag = Decode(p_mandatory_flag, '^', mandatory_flag,p_mandatory_flag ),
137     default_region_position = Decode(p_default_region_position,'^', default_region_position, p_default_region_position ) ,
138     placeholder_region_flag = Decode(p_placeholder_region_flag,'^', placeholder_region_flag, p_placeholder_region_flag ) ,
139     region_style = Decode(P_region_style, '^', region_style, p_region_style),
140     start_date_active = P_START_DATE_ACTIVE ,
141     end_date_active = p_end_date_active,
142     LAST_UPDATED_BY =  fnd_global.user_id,
143     LAST_UPDATE_DATE = sysdate,
144     LAST_UPDATE_LOGIN = fnd_global.login_id,
145     document_source = p_document_source,
146     page_function_name = p_page_function_name,
147     security_function_name = p_security_function_name
148     WHERE
149     page_type_code = p_page_type_code
150     AND region_source_type = p_region_source_type
151     AND region_source_code = p_region_source_code;
152 
153   if (sql%notfound) THEN
154       raise no_data_found;
155 --     PA_UTILS.Add_Message ( p_app_short_name => 'PA',p_msg_name => 'PA_XC_RECORD_CHANGED');
156  --    x_return_status := FND_API.G_RET_STS_ERROR;
157    --  RETURN;
158   end if;
159 
160 EXCEPTION
161     WHEN OTHERS THEN -- catch the exceptins here
162         -- Set the current program unit name in the error stack
163 --      PA_Error_Utils.Set_Error_Stack('PA_PROJECT_SUBTEAMS_PKG.Update_Row');
164        -- x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
165         RAISE;
166 
167 end UPDATE_PAGE_TYPE_REGION_ROW;
168 
169 
170 procedure delete_page_type_REGION_ROW (
171 				       p_rowid IN VARCHAR2 := NULL,
172 				       P_PAGE_TYPE_CODE in VARCHAR2 := NULL ,
173 				       P_REGION_SOURCE_TYPE in VARCHAR2 := NULL ,
174 				       P_REGION_SOURCE_CODE in VARCHAR2  := NULL
175 ) is
176 BEGIN
177 
178    IF p_rowid IS NOT NULL THEN
179  delete from PA_PAGE_TYPE_REGIONS
180     where rowid = p_rowid;
181     ELSE
182 
183   delete from PA_PAGE_TYPE_REGIONS
184     where PAGE_TYPE_CODE = p_page_type_code
185     AND region_source_type = p_region_source_type
186     AND region_source_code = p_region_source_code;
187    END IF;
188 
189 EXCEPTION
190     WHEN OTHERS THEN
191         -- Set the current program unit name in the error stack
192 
193 --        x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
194         RAISE;
195 
196 end DELETE_PAGE_TYPE_REGION_ROW;
197 
198 
199 END  PA_PAGE_TYPE_REGION_PKG;