-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallation & Usage Steps For Oracle APEX
More file actions
226 lines (179 loc) · 6.92 KB
/
Copy pathInstallation & Usage Steps For Oracle APEX
File metadata and controls
226 lines (179 loc) · 6.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
################## Get OS Details
Step # 01 :
Use JavaScript => File URLs => #APP_FILES#os_info.js
Step # 02 : Create Page Items where get and store
=> eg : P18_OS_NAME, P18_BROWSER_NAME, P18_BROWSER_VERSION
Step # 03 : Use below code on Execute when Page Loads / Create a Dynamic Action on Page Load
=> Code :
let os = platform.os;
let browser = platform.name;
let browserVersion = platform.version;
apex.item("P18_OS_NAME").setValue(os);
apex.item("P18_BROWSER_NAME").setValue(browser);
apex.item("P18_BROWSER_VERSION").setValue(browserVersion);
################## Get HTTP User Agent
Step # 01 : Create Page Items where get and store
=> eg : P18_USER_AGENT
Step # 02 : Use below code on Execute when Page Loads / Create a Dynamic Action on Page Load
=> Code :
function getuserAgent() {
return [
navigator.userAgent,
navigator.language,
screen.width + "x" + screen.height,
screen.colorDepth,
Intl.DateTimeFormat().resolvedOptions().timeZone,
navigator.platform
].join("||");
}
var userAgent = getuserAgent();
apex.item("P18_USER_AGENT").setValue(userAgent);
################## Get SYS Guid / Device ID
Step # 01 : Create Page Items where get and store
=> eg : P18_DEVICE_ID
Step # 02 : Use below code on Execute when Page Loads / Create a Dynamic Action on Page Load
=> Code :
function getDeviceId() {
let id = localStorage.getItem("DEVICE_ID");
if (!id) {
id = crypto.randomUUID();
localStorage.setItem("DEVICE_ID", id);
}
return id;
}
apex.item("P18_DEVICE_ID").setValue(getDeviceId());
################## Get User Agent, Screen Size & Timezone
Step # 01 : Create Page Items where get and store
=> eg : P18_USER_AGENT, P18_SCREEN, P18_TIMEZONE
Step # 02 : Use below code on Execute when Page Loads / Create a Dynamic Action on Page Load
=> Code :
let ua = navigator.userAgent;
apex.item("P18_USER_AGENT").setValue(ua);
apex.item("P18_SCREEN").setValue(screen.width + "x" + screen.height);
apex.item("P18_TIMEZONE").setValue(Intl.DateTimeFormat().resolvedOptions().timeZone);
################## Get Location (User Permission Required) Latitude & Longitude
Step # 01 : Create Page Items where get and store
=> eg : P18_LATITUDE, P18_LONGITUDE
Step # 02 : Use below code on Execute when Page Loads / Create a Dynamic Action on Page Load
=> Code :
navigator.geolocation.getCurrentPosition(function(pos){
apex.item("P18_LATITUDE").setValue(pos.coords.latitude);
apex.item("P18_LONGITUDE").setValue(pos.coords.longitude);
});
################## JavaScript Library For Get All Client Informations at a Time
Step # 01 : Create Page Items where get and store
=> eg : P18_DEVICE_TYPE, P18_OS_NAME, P18_OS_VERSION, P18_BROWSER, P18_BROWSER_VERSION, P18_SCREEN, P18_TIMEZONE, P18_LANGUAGE, P18_DEVICE_HASH, P18_LAT, P18_LON
Step # 02 : Use JavaScript => Function and Global Variable Declaration
(function (window) {
"use strict";
function ua() { return navigator.userAgent || ""; }
function deviceType() {
var u = ua().toLowerCase();
if (u.indexOf("ipad") > -1 || u.indexOf("tablet") > -1) return "TABLET";
if (u.indexOf("mobi") > -1 || u.indexOf("android") > -1) return "MOBILE";
return "DESKTOP";
}
function osName() {
var u = ua();
if (u.indexOf("Windows NT") > -1) return "Windows";
if (u.indexOf("Android") > -1) return "Android";
if (/iPhone|iPad/.test(u)) return "iOS";
if (u.indexOf("Mac OS X") > -1) return "MacOS";
if (u.indexOf("Linux") > -1) return "Linux";
return "Unknown";
}
function osVersion() {
var u = ua(), m;
if ((m = u.match(/Windows NT ([0-9.]+)/))) return m[1];
if ((m = u.match(/Android ([0-9.]+)/))) return m[1];
if ((m = u.match(/OS ([0-9_]+)/))) return m[1].replace(/_/g, ".");
if ((m = u.match(/Mac OS X ([0-9_]+)/))) return m[1].replace(/_/g, ".");
return "Unknown";
}
function browserName() {
var u = ua();
if (u.indexOf("Edg") > -1) return "Edge";
if (u.indexOf("Chrome") > -1) return "Chrome";
if (u.indexOf("Firefox") > -1) return "Firefox";
if (u.indexOf("Safari") > -1) return "Safari";
return "Unknown";
}
function browserVersion() {
var u = ua(), m;
if ((m = u.match(/Edg\/([0-9.]+)/))) return m[1];
if ((m = u.match(/Chrome\/([0-9.]+)/))) return m[1];
if ((m = u.match(/Firefox\/([0-9.]+)/))) return m[1];
if ((m = u.match(/Version\/([0-9.]+)/))) return m[1];
return "Unknown";
}
function screenInfo() {
var w = window.innerWidth ||
document.documentElement.clientWidth ||
document.body.clientWidth;
var h = window.innerHeight ||
document.documentElement.clientHeight ||
document.body.clientHeight;
return (w && h) ? (w + "x" + h) : "Unknown";
}
function timezone() {
try {
return Intl.DateTimeFormat().resolvedOptions().timeZone;
} catch (e) {
return "Unknown";
}
}
function language() {
return navigator.language || "Unknown";
}
function simpleHash(str) {
var hash = 0, i;
for (i = 0; i < str.length; i++) {
hash = ((hash << 5) - hash) + str.charCodeAt(i);
hash |= 0;
}
return "D" + Math.abs(hash);
}
function fingerprint() {
return simpleHash(
ua() + screenInfo() + timezone() + language()
);
}
function captureLocation(cb) {
if (!navigator.geolocation) {
cb(null, null);
return;
}
navigator.geolocation.getCurrentPosition(
function (p) { cb(p.coords.latitude, p.coords.longitude); },
function () { cb(null, null); },
{ timeout: 5000 }
);
}
window.ApexDevice = {
deviceType: deviceType,
osName: osName,
osVersion: osVersion,
browserName: browserName,
browserVersion: browserVersion,
screenInfo: screenInfo,
timezone: timezone,
language: language,
fingerprint: fingerprint,
captureLocation: captureLocation
};
})(window);
Step # 03 : Use below code on Execute when Page Loads / Create a Dynamic Action on Page Load
=> Code :
apex.item("P18_DEVICE_TYPE").setValue(ApexDevice.deviceType());
apex.item("P18_OS_NAME").setValue(ApexDevice.osName());
apex.item("P18_OS_VERSION").setValue(ApexDevice.osVersion());
apex.item("P18_BROWSER").setValue(ApexDevice.browserName());
apex.item("P18_BROWSER_VERSION").setValue(ApexDevice.browserVersion());
apex.item("P18_SCREEN").setValue(ApexDevice.screenInfo());
apex.item("P18_TIMEZONE").setValue(ApexDevice.timezone());
apex.item("P18_LANGUAGE").setValue(ApexDevice.language());
apex.item("P18_DEVICE_HASH").setValue(ApexDevice.fingerprint());
ApexDevice.captureLocation(function (lat, lon) {
apex.item("P18_LAT").setValue(lat);
apex.item("P18_LON").setValue(lon);
});