DBA Data[Home] [Help]

PACKAGE BODY: APPS.CSL_SETUP_PROFILE

Source


1 PACKAGE BODY CSL_SETUP_PROFILE AS
2 /* $Header: cslstprb.pls 120.0 2005/05/24 17:45:58 appldev noship $ */
3 
4 ------------------------------------------------------------
5 -- procedure to initialize test datastructures
6 -- executeds prior to test run (not currently being called)
7 ------------------------------------------------------------
8 PROCEDURE init
9 IS
10 BEGIN
11  NULL;
12 END init;
13 
14 ------------------------------------------------------------
15 -- procedure to cleanup any  test datastructures that were setup in the init
16 --  procedure call executes after test run (not currently being called)
17 ------------------------------------------------------------
18 PROCEDURE cleanup
19 IS
20 BEGIN
21  NULL;
22 END cleanup ;
23 
24 ------------------------------------------------------------
25 -- procedure to execute the PLSQL test
26 -- the inputs needed for the test are passed in and a report object and CLOB are -- returned.
27 ------------------------------------------------------------
28 PROCEDURE runtest(inputs IN  JTF_DIAG_INPUTTBL,
29                   report OUT NOCOPY JTF_DIAG_REPORT,
30                   reportClob OUT NOCOPY CLOB)
31 IS
32   reportStr          LONG;
33   statusStr          VARCHAR2(50);  -- SUCCESS or FAILURE
34   errStr             VARCHAR2(4000);
35   fixInfo            VARCHAR2(4000);
36   isFatal            VARCHAR2(50);  -- TRUE or FALSE
37   jtmProfileValue    VARCHAR2(255) ;
38   cslProfileValue    VARCHAR2(255) ;
39   profileValue       VARCHAR2(255) ;
40   TYPE profileTab IS TABLE OF VARCHAR2(80) INDEX BY BINARY_INTEGER;
41   profileTable profileTab ;
42 
43 BEGIN
44      JTF_DIAGNOSTIC_ADAPTUTIL.setUpVars(reportClob);
45 
46      /*First level specific profiles*/
47      jtmProfileValue := fnd_profile.VALUE_SPECIFIC(
48           Name => 'JTM_MOB_APPS_ENABLED', APPLICATION_ID => 874); -- JTM
49 
50      cslProfileValue := fnd_profile.VALUE_SPECIFIC(
51           Name => 'JTM_MOB_APPS_ENABLED', APPLICATION_ID => 868, RESPONSIBILITY_ID => 22916 ); --CSL
52 
53      IF (jtmProfileValue = 'Y') AND (cslProfileValue = 'Y') THEN
54         reportStr := '-Profile option values for JTM: Mobile Applications Enabled are set up correct'||
55 	             ' for JTM and CSL-';
56         JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportClob,reportStr);
57         statusStr := 'SUCCESS';
58      ELSE
59         statusStr := 'FAILURE';
60 	IF jtmProfileValue = 'N' THEN
61 	   errStr := 'JTM: Mobile Applications Enabled profile is not set to Y for application'||
62 	             ' Oracle CRM Mobile Foundation ';
63 	   fixInfo :='Set the application specific JTM: Mobile Applications Enabled profile value to Y.';
64 	ELSIF cslProfileValue = 'N' THEN
65 	   IF errStr IS NULL THEN
66               errStr := 'JTM: Mobile Applications Enabled profile is not set to Y for Oracle Field Service'||
67 	                ' / Laptop responsibility';
68 	   ELSE
69               errStr := errStr||', JTM: Mobile Applications Enabled profile is not set to Y for '||
70 	                        'Oracle Field Service / Laptop responsibility';
71 	   END IF;
72 	   IF fixInfo IS NULL THEN
73               fixInfo := 'Set the responsibility specific JTM: Mobile Applications Enabled profile '||
74 	                 'value to Y.' ;
75 	   ELSE
76 	      fixInfo :=fixInfo||', Set the responsibility specific JTM: Mobile Applications Enabled'||
77 	                         ' profile value to Y.' ;
78 	   END IF;
79 	END IF;
80 	isFatal := 'FALSE';
81      END IF;
82 
83      jtmProfileValue := fnd_profile.VALUE_SPECIFIC(
84           Name => 'JTM_DEFAULT_LOGON_RESPONSIBILITY', APPLICATION_ID => 868); -- CSL
85      IF jtmProfileValue = 'CSL_IMOBILE' THEN
86          reportStr := '-Profile JTM: Default Logon Responsibility for CRM Mobile Application '||
87 	              'is correct set to Oracle Field Service/Laptop-';
88        JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportClob,reportStr);
89      ELSE
90        IF errStr IS NULL THEN
91          errStr := 'Profile JTM: Default Logon Responsibility for CRM Mobile Application '||
92 	           'is not set to Oracle Field Service/Laptop on application level';
93        ELSE
94          errStr := errStr|| ', Profile JTM: Default Logon Responsibility for CRM Mobile Application '||
95 	                    'is not set to Oracle Field Service/Laptop on application level';
96        END IF;
97        IF fixInfo IS NULL THEN
98          fixInfo := 'Set the profile at application level to Oracle Field Service/Laptop';
99        ELSE
100          fixInfo := fixInfo||', Set the profile at application level to Oracle Field Service/Laptop';
101        END IF;
102      END IF;
103 
104      /*Site level profiles, can add more if needed*/
105      --Bug 3724123
106      profileTable(1) := 'CS_INV_VALIDATION_ORG' ;
107      reportStr := NULL;
108      FOR i IN 1..profileTable.COUNT LOOP
109        profileValue := null ;
110        fnd_profile.get(profileTable(i),profileValue) ;
111        IF profileValue IS NOT NULL THEN
112           reportStr := '-Profile option value set for profile '|| profileTable(i)||' to: '||profileValue||'-';
113           JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(reportClob,reportStr);
114           IF statusStr IS NULL OR statusStr = 'SUCCESS' THEN
115              statusStr := 'SUCCESS';
116           END IF;
117         ELSE
118            statusStr := 'FAILURE';
119            IF errStr IS NULL THEN
120               errStr := errStr || 'Profile option value not set for ' || profileTable(i);
121            ELSE
122               errStr := errStr || ', ' || profileTable(i) ;
123            END IF;
124            IF fixInfo IS NULL THEN
125               fixInfo := fixInfo || 'Set up Profile option values for ' || profileTable(i);
126            ELSE
127               fixInfo := fixInfo || ', ' || profileTable(i) ;
128            END IF;
129            isFatal := 'FALSE';
130         END IF;
131      END LOOP ;
132      report := JTF_DIAGNOSTIC_ADAPTUTIL.constructReport(statusStr,errStr,fixInfo,isFatal);
133      reportClob := JTF_DIAGNOSTIC_ADAPTUTIL.getReportClob;
134 END runtest;
135 
136 ------------------------------------------------------------
137 -- procedure to report name back to framework
138 ------------------------------------------------------------
139 PROCEDURE getComponentName(str OUT NOCOPY  VARCHAR2)
140 IS
141 BEGIN
142  str := 'Profile setup';
143 END getComponentName;
144 
145 ------------------------------------------------------------
146 -- procedure to report test name back to framework
147 ------------------------------------------------------------
148 PROCEDURE getTestName(str OUT NOCOPY  VARCHAR2)
149 IS
150 BEGIN
151  str := 'Check Profiles';
152 END getTestName;
153 
154 ------------------------------------------------------------
155 -- procedure to report test description back to framework
156 ------------------------------------------------------------
157 PROCEDURE getTestDesc(str OUT NOCOPY VARCHAR2)
158 IS
159 BEGIN
160  str := 'Check profiles for their values';
161 END getTestDesc;
162 
163 END CSL_SETUP_PROFILE;