git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@50874 248e525c-4dfb-0310-94bc-949c084e9493

This commit is contained in:
andrew.gilmore
2012-03-19 11:57:19 +00:00
parent 2a0f4900c3
commit 0e9ca75d77
1587 changed files with 500863 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
CREATE OR REPLACE PACKAGE BODY efno_java_xml_interface /* Copyright Advantica 2010 */ IS
--
-- Private Routines
--
--
-- Routine to pass through debug messages
-- uses conditional compilation to determine whether the message should be passed through
--
PROCEDURE d(p_in IN VARCHAR2
,p_line IN NUMBER DEFAULT NULL) IS
BEGIN
$IF $$debug_on $THEN amfr_debug.pl(p_unit => $$PLSQL_UNIT
,p_line => p_line
,p_message => p_in);
$END NULL;
END d;
--
PROCEDURE enable_web_output IS
--
l_name owa.vc_arr;
l_value owa.vc_arr;
--
BEGIN
--
-- initialise the cgi_environment to stop the error you receive on first call
--
l_name(1) := 'WEB_AUTHENT_PREFIX';
l_value(1) := 'WEB$';
--
owa.init_cgi_env( l_name.count, l_name, l_value );
--
END enable_web_output;
--
--
--
PROCEDURE capture_web_buffer_to_clob IS
--
l_web_page htp.htbuf_arr;
l_web_lines INTEGER := 99999999;
--
l_passed_header BOOLEAN := FALSE;
--
BEGIN
--
-- Initialise the CLOB
--
dbms_lob.createtemporary(lob_loc => g_temp_clob
,cache => TRUE);
--
dbms_lob.open(lob_loc => g_temp_clob
,open_mode => dbms_lob.lob_readwrite);
--
-- Get the current web buffer
--
owa.get_page(l_web_page, l_web_lines);
--
-- Start at 3 to remove the content type and size
--
FOR i IN 1..l_web_lines LOOP
--
IF l_passed_header THEN
dbms_lob.writeappend(g_temp_clob, LENGTH(l_web_page(i)), l_web_page(i));
END IF;
--
IF l_web_page(i) = CHR(10) AND NOT l_passed_header THEN
l_passed_header := TRUE;
END IF;
--
END LOOP;
--
END capture_web_buffer_to_clob;
--
-- Public Routines
--
PROCEDURE process_60_xml_message ( p_username IN VARCHAR2 DEFAULT NULL
, p_password IN VARCHAR2 DEFAULT NULL
, p_xml IN CLOB DEFAULT NULL
, p_return IN OUT CLOB
) IS
--
name_array owa.vc_arr;
value_array amfr_message_handler.clob_arr;
--
BEGIN
--
enable_web_output;
--
-- call the XML interface
--
name_array(1) := 'request_id';
value_array(1) := '60';
name_array(2) := 'user';
value_array(2) := p_username;
name_array(3) := 'password';
value_array(3) := p_password;
name_array(4) := 'xmldata';
value_array(4) := p_xml;
--
amfr_message_handler.service_request_clob( name_array => name_array
, value_array => value_array);
--
-- Capture the web page
--
capture_web_buffer_to_clob;
--
-- Need to return the web page
--
p_return := g_temp_clob;
--
-- Rest the temp clob
--
g_temp_clob := null;
--
END process_60_xml_message;
--
FUNCTION about RETURN VARCHAR2 IS
--
--
BEGIN
--
RETURN ( g_id );
--
END about;
--
BEGIN
/**
-- Initialization
*/
NULL;
--
END efno_java_xml_interface;
/