DBA Data[Home] [Help]

PACKAGE BODY: APPS.IEU_UWQ_FORM_ROUTE

Source


1 PACKAGE BODY IEU_UWQ_FORM_ROUTE AS
2 /* $Header: IEUFOOB.pls 120.0 2005/06/02 15:51:20 appldev noship $ */
3 
4 PROCEDURE ieu_uwq_form_obj         (    p_ieu_media_data  IN  SYSTEM.IEU_UWQ_MEDIA_DATA_NST default null,
5                                         p_action_type   OUT NOCOPY number,
6                                         p_action_name   OUT NOCOPY varchar2,
7                                         p_action_param          OUT NOCOPY varchar2 ) IS
8 
9   l_name  varchar2(500);
10   l_value varchar2(1996);
11   l_type  varchar2(500);
12 
13   l_action_param1 varchar2(1996);
14   l_action_param2 varchar2(1996);
15   l_action_param3 varchar2(1996);
16   l_action_param4 varchar2(500);
17 
18   max_length number := 0;
19   P_ieu_media_data1 system.ieu_uwq_media_data_nst;
20 
21   l_block_mode  boolean;
22   l_continuous_mode  boolean;
23 
24   BEGIN
25        p_ieu_media_data1 := SYSTEM.IEU_UWQ_MEDIA_DATA_NST();
26 
27        l_block_mode := FALSE;
28        l_continuous_mode := FALSE;
29 
30        FOR i IN 1..p_ieu_media_data.COUNT
31        LOOP
32 
33          p_ieu_media_data1.EXTEND;
34          p_ieu_media_data1(p_ieu_media_data1.LAST) :=
35 SYSTEM.IEU_UWQ_MEDIA_DATA_OBJ(p_ieu_media_data(i).param_name,
36                                                         p_ieu_media_data(i).param_value,
37                                                         p_ieu_media_data(i).param_type);
38 
39                 l_name  := p_ieu_media_data(i).param_name;
40                 l_value := p_ieu_media_data(i).param_value;
41                 l_type  := p_ieu_media_data(i).param_type;
42 
43 
44                 if l_name = 'UWQ_BLOCK_MODE' and l_value = 'T' then
45                   l_block_mode := TRUE;
46                 end if;
47 
48                 if l_name = 'UWQ_CONTINUOUS_MODE' and l_value = 'T' then
49                   l_continuous_mode := TRUE;
50                 end if;
51 
52                 if l_name = 'workItemID' then
53                   l_action_param1 := 'p_work_item_id="'||l_value||'" ';
54 --                  l_action_param4 := l_action_param4||l_name||'=['||l_value||']';
55                 end if;
56 
57                 if l_name = 'occtMediaItemID' then
58                   l_action_param2 := 'p_media_item_id="'||l_value||'" ';
59 --                  l_action_param4 := l_action_param4||l_name||'=['||l_value||']';
60                 end if;
61 
62                 if l_type is null or l_type <> 'IEU_UPDATE_ENABLED' then
63 
64                    if (length(l_action_param3) is null) then
65                       l_action_param3:= l_action_param3||l_name||'=['||l_value||']';
66 
67                    elsif (length(l_action_param3) is not null) then
68 
69                       /* if it is not null then check total length not exceed 1850
70                          total length = workitemid + occtmediaitemid + action_param3 + name + value
71 + 3 (3 is adding = and squaer brackets [] to the value) */
72 
73                       if ((length(l_action_param3)+nvl(length(l_action_param1),0) +
74 nvl(length(l_action_param2),0)+length(l_name)+length(l_value))+3 < 1850) then
75                         l_action_param3 := l_action_param3||l_name||'=['||l_value||']';
76                       end if;
77 
78                    end if;
79                 end if;
80 
81                 if l_type = 'IEU_UPDATE_ENABLED' then                /* Store all the update enabled
82 types to table of records */
83                    p_ieu_media_data1(i).param_name := l_name;
84                    p_ieu_media_data1(i).param_value := l_value;
85                    p_ieu_media_data1(i).param_type := l_type;
86                 end if;
87 
88        END LOOP;
89 
90 
91            /* maximum length of workitemid, occtmediaitemid and all non-update enbaled types */
92 
93            max_length := length(l_action_param1) + length(l_action_param2) +
94 length(l_action_param3);
95 
96           FOR i IN 1..p_ieu_media_data1.COUNT
97           LOOP
98                 l_name  := p_ieu_media_data1(i).param_name;
99                 l_value := p_ieu_media_data1(i).param_value;
100                 l_type  := p_ieu_media_data1(i).param_type;
101 
102 
103                   if l_type = 'IEU_UPDATE_ENABLED' then
104 
105                       if max_length < 1950 then
106 
107                         if (length(l_action_param4) is null) then
108                            l_action_param4:= l_action_param4||l_name||'=['||l_value||']';
109 
110                         elsif (length(l_action_param4) is not null) then
111 
112                           if (max_length + (length(l_action_param4) +
113 length(l_name)+length(l_value)) +3 < 1950) then
114                             l_action_param4 := l_action_param4||l_name||'=['||l_value||']';
115                           end if;
116 
117                         end if;
118                       end if;
119                   end if; /* IEU_UPDATE_ENABLED */
120 
121           end loop;
122 
123 
124           l_action_param3 := 'p_data="'||l_action_param3||'"';
125           l_action_param4 := 'p_data1="'||l_action_param4||'"';
126 
127           p_action_type     := 1;
128           if l_block_mode = TRUE or l_continuous_mode = FALSE then
129             p_action_type := 2;
130           end if;
131 
132           if l_block_mode = FALSE and l_continuous_mode = FALSE then
133             p_action_type := 1;
134           end if;
135 
136           p_action_name     := 'IEUSCPOP';
137           p_action_param    := l_action_param1||l_action_param2||l_action_param3||l_action_param4;
138 
139   END;
140 END IEU_UWQ_FORM_ROUTE;