create or replace package body efnow101$ is private_ModuleRef WSGOC.MODULE_REF; procedure CreateStartupJavaScript; PROCEDURE get_nomi ( p_nomi_id IN nominations.nomi_id%TYPE ) IS -- get_nomi -- -- BEGIN -- IF NOT caco_security.security_check('efnow101$') THEN -- RETURN; -- END IF; -- FOR nomi_rec IN ( SELECT NULL FROM nominations nomi ,contracts cont WHERE nomi.nomi_id = p_nomi_id AND nomi.cont_id = cont.cont_id AND cont.cust_id = caco_utilities.get_cust_id ) LOOP -- amfr_excel.download(p_nomi_id => p_nomi_id); -- EXIT; -- END LOOP; -- END; PROCEDURE nomi_css IS -- nomi_css -- -- BEGIN -- IF NOT caco_security.security_check('efnow101$') THEN -- RETURN; -- END IF; -- htp.p(' h2 { color : #FF3030; } .nomiTR { height : 20px; } #nomiTextDiv { width : 95%; white-space : pre; overflow-x : scroll; border : 1px solid; margin-left : 5px; margin-right : 5px; padding : 5px; } '); -- END; PROCEDURE view_details(p_nomi_id IN nominations.nomi_id%TYPE) IS -- view_details -- -- -- CURSOR c_nomi IS SELECT cust.name customer_name ,cont.contract_number contract_number ,nomi.identifier nomi_identifier ,conf.CONFIRMATION_SENT AS tsa_timestamp ,nomi.nomi_id FROM nominations nomi, contracts cont, customers cust, confirmations conf WHERE cust.cust_id = cont.cust_id AND cont.cont_id = nomi.cont_id AND nomi.nomi_id = p_nomi_id AND nomi.nomi_id = conf.nomi_id AND conf.confirmation_type = 'NO'; -- l_nomi_rec c_nomi%ROWTYPE; -- l_nomi_text_clob CLOB; l_nomi_text_temp VARCHAR2(4000); l_text_pos NUMBER := 1; l_text_length NUMBER := 0; -- l_success BOOLEAN := TRUE; -- BEGIN -- IF NOT caco_security.security_check('efnow101$') THEN -- RETURN; -- END IF; -- htp.p(' '); -- wsgl.openpagehead(caco_utilities.get_module_text(2405)); --wsgl.metatag; --htp.p(''); caco_system.content_type; htp.p(''); htp.p(' '); -- wsgl.closepagehead; wsgl.openpagebody(FALSE); htp.p(caco_system.menu); -- htp.p('

' || caco_utilities.get_module_text(2405) || '

'); -- View Nominations -- OPEN c_nomi; FETCH c_nomi INTO l_nomi_rec; CLOSE c_nomi; -- htp.p(' '); -- Customer Name htp.p(' '); -- Contract Number htp.p(' '); -- Nomination Identifier htp.p(' '); -- Created On htp.p('
' || caco_utilities.get_module_text(1145) || ':  ' || l_nomi_rec.customer_name || '
' || caco_utilities.get_module_text(2013) || ':  ' || l_nomi_rec.contract_number || '
' || caco_utilities.get_module_text(2060) || ':  ' || l_nomi_rec.nomi_identifier || '
' || caco_utilities.get_module_text(118) || ':  ' || EFNOW101$NOMI.FORMATDATETIME(TO_CHAR(l_nomi_rec.tsa_timestamp,'DD/MM/YYYY HH24:MI')) || '
'); -- -- We want a button to call the spreadsheet download routine -- htp.p('
'); -- htp.p('

' || caco_utilities.get_module_text(2065) || '

'); -- Confirmation Text -- -- Loop through all of the clob and display it in chunks...... -- Create a width limmited dive for putting it in htp.p('
');
    --
    -- Get the CLOB
    BEGIN
      SELECT conf.confirmation_text
      INTO   l_nomi_text_clob
      FROM   confirmations conf
      WHERE  conf.nomi_id = p_nomi_id
      AND    conf.confirmation_type = 'NO';
    EXCEPTION
      WHEN OTHERS THEN
        l_success := FALSE;
    END;
    --
    IF l_success THEN
      -- Get the length of the Confirmation text CLOB
      l_text_length := DBMS_LOB.GETLENGTH(l_nomi_text_clob);
      --
      -- Loop through the clob in chunks of 4000
      WHILE l_text_pos <= l_text_length LOOP
        --
        l_nomi_text_temp := DBMS_LOB.SUBSTR(l_nomi_text_clob,
                                            4000,
                                            l_text_pos);
        --
        htp.p(l_nomi_text_temp);
        --
        l_text_pos := l_text_pos + 4000;
        --
      END LOOP;
      --
    ELSE
      --
      -- Error
      wsgl.displaymessage(p_type => WSGL.MESS_ERROR
                         ,p_mess => caco_utilities.get_module_text(2330)
                         );
      --
    END IF;
    -- Close nomiText
    htp.p('
'); -- -- Close the margin div htp.p('
'); -- -- Close centrecontent div htp.p('
'); -- -- Close outer div htp.p(''); -- wsgl.closepagebody; -- END; -------------------------------------------------------------------------------- -- Name: efnow101$.Startup -- -- Description: This procedure is the entry point for the 'efnow101$' -- module. -- -- Parameters: None -- -------------------------------------------------------------------------------- procedure Startup is begin if not caco_security.security_check('efnow101$') then return; end if; WSGL.RegisterURL('efnow101$.startup'); if WSGL.NotLowerCase then return; end if; WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL)); efnow101$nomi.startup( Z_DIRECT_CALL => TRUE ); exception when others then WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '', '', 'efnow101$.Startup'); end; -------------------------------------------------------------------------------- -- Name: efnow101$.firstpage -- -- Description: This procedure creates the first page for the 'efnow101$' -- module. -- -- Parameters: Z_DIRECT_CALL -- -------------------------------------------------------------------------------- procedure FirstPage(Z_DIRECT_CALL in boolean ) is begin if not caco_security.security_check('efnow101$') then return; end if; WSGL.OpenPageHead(''); WSGL.METATag; WSGL.ClosePageHead; WSGL.OpenPageBody(FALSE, p_attributes=>''); CreateStartupJavaScript; WSGL.DefaultPageCaption('', 1); htp.formOpen(curl => 'ActionItem', cattributes => 'NAME="SP$AIForm"'); WSGL.NavLinks(WSGL.MENU_LONG, WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT), 0, 'efnow101$.showabout', '_top', p_output_line=>FALSE); WSGL.NavLinks; htp.formClose; WSGL.ClosePageBody; exception when others then WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '', '', 'efnow101$.FirstPage'); end; -------------------------------------------------------------------------------- -- Name: efnow101$.showabout -- -- Description: This procedure is used to display an 'About' page for the -- 'efnow101$' module. -- -------------------------------------------------------------------------------- procedure showabout is l_usr varchar2(255) := null; begin if not caco_security.security_check('efnow101$') then return; end if; l_usr := caco_security.get_user; WSGL.RegisterURL('efnow101$.showabout'); if WSGL.NotLowerCase then return; end if; WSGL.OpenPageHead(WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT)||' '); WSGL.METATag; TemplateHeader(TRUE,2); WSGL.ClosePageHead; WSGL.OpenPageBody(FALSE, p_attributes=>''); htp.p(caco_system.menu); WSGL.DefaultPageCaption(WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT)||' '); htp.para; htp.p(' $Revision: 1.5 $'); htp.para; htp.para; htp.p(WSGL.MsgGetText(108,WSGLM.DSP108_GENERATED_BY, 'PL/SQL Web Generator', '10.1.2.6.18')); htp.para; WSGL.Info(FALSE, 'Nominations', 'EFNOW101', l_usr); htp.p(caco_system.footer); WSGL.ClosePageBody; exception when others then WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '', '', 'efnow101$.ShowAbout'); end; -------------------------------------------------------------------------------- -- Name: efnow101$.TemplateHeader -- -- Description: -- -------------------------------------------------------------------------------- procedure TemplateHeader(Z_DIRECT_CALL in boolean, Z_TEMPLATE_ID in number) is begin if not caco_security.security_check('efnow101$') then return; end if; if Z_TEMPLATE_ID = 1 then -- Template defined in \\loordv01\framework\css2\css_content.htm htp.p(' '); elsif Z_TEMPLATE_ID = 2 then -- Template defined in \\loordv01\framework\css2\css_about.htm htp.p(' '); elsif Z_TEMPLATE_ID = 3 then -- Template defined in \\loordv01\framework\css2\css_query.htm htp.p(' '); elsif Z_TEMPLATE_ID = 4 then -- Template defined in \\loordv01\framework\css2\css_view.htm htp.p(' '); elsif Z_TEMPLATE_ID = 5 then -- Template defined in \\loordv01\framework\css2\css_insert.htm htp.p(' '); elsif Z_TEMPLATE_ID = 6 then -- Template defined in \\loordv01\framework\css2\css_recordlist.htm htp.p(' '); elsif Z_TEMPLATE_ID = 7 then -- Template defined in \\loordv01\framework\css2\css_lov.htm htp.p(' '); elsif Z_TEMPLATE_ID = 8 then -- Template defined in \\loordv01\framework\css2\css_text.htm htp.p(' '); end if; exception when others then WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '', '', 'efnow101$.TemplateHeader'); end; -------------------------------------------------------------------------------- -- Name: efnow101$.GetRef -- -- Description: Returns a handle to the display data for the -- 'efnow101$' module. -- If the display object does not exist then it creates it first. -- -- Parameters: -- -------------------------------------------------------------------------------- function GetRef return WSGOC.MODULE_REF is begin if ( WSGOC.Is_Null(private_ModuleRef)) then private_ModuleRef := WSGOC.Module ( pShortName => 'efnow101$' , pFirstTitle => '' ); end if; return private_ModuleRef; exception when others then WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '', '', 'efnow101$.GetRef'); raise; end; -------------------------------------------------------------------------------- -- Name: efnow101$.CreateStartupJavaScript -- -- Description: -- -- Parameters: -- -------------------------------------------------------------------------------- procedure CreateStartupJavaScript is begin htp.p(WSGJSL.OpenScript); htp.p('var FormType = "Startup";'); htp.p(WSGJSL.CloseScript); end; end; /