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,986 @@
PROMPT Creating API Package Body for Table 'APPLICATION_PARAMETERS'
--------------------------------------------------------------------------------
-- Name: cg$APPLICATION_PARAMETERS
-- Description: APPLICATION_PARAMETERS table API package definitions
--------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY cg$APPLICATION_PARAMETERS IS
PROCEDURE validate_mandatory(cg$val_rec IN cg$row_type,
loc IN VARCHAR2 DEFAULT '');
PROCEDURE up_autogen_columns(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
operation IN VARCHAR2 DEFAULT 'INS',
do_denorm IN BOOLEAN DEFAULT TRUE);
PROCEDURE err_msg(msg IN VARCHAR2,
type IN INTEGER,
loc IN VARCHAR2 DEFAULT '');
--------------------------------------------------------------------------------
-- Name: raise_uk_not_updateable
--
-- Description: Raise appropriate error when unique key updated
--
-- Parameters: none
--------------------------------------------------------------------------------
PROCEDURE raise_uk_not_updateable(uk IN VARCHAR2) IS
BEGIN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_UNIQUE_KEY_UPDATE, cg$errors.ERR_UK_UPDATE, uk),
'E',
'API',
cg$errors.API_UNIQUE_KEY_UPDATE,
'cg$APPLICATION_PARAMETERS.raise_uk_not_updateable');
cg$errors.raise_failure;
END raise_uk_not_updateable;
--------------------------------------------------------------------------------
-- Name: raise_fk_not_transferable
--
-- Description: Raise appropriate error when foreign key updated
--
-- Parameters: none
--------------------------------------------------------------------------------
PROCEDURE raise_fk_not_transferable(fk IN VARCHAR2) IS
BEGIN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_FOREIGN_KEY_TRANS, cg$errors.ERR_FK_TRANS, fk),
'E',
'API',
cg$errors.API_FOREIGN_KEY_TRANS,
'cg$APPLICATION_PARAMETERS.raise_fk_not_transferable');
cg$errors.raise_failure;
END raise_fk_not_transferable;
--------------------------------------------------------------------------------
-- Name: up_autogen_columns
--
-- Description: Specific autogeneration of column values and conversion to
-- uppercase
--
-- Parameters: cg$rec Record of row to be manipulated
-- cg$ind Indicators for row
-- operation Procedure where this procedure was called
--------------------------------------------------------------------------------
PROCEDURE up_autogen_columns(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
operation IN VARCHAR2 DEFAULT 'INS',
do_denorm IN BOOLEAN DEFAULT TRUE) IS
BEGIN
IF (operation = 'INS') THEN
BEGIN
IF (cg$ind.APPA_ID = FALSE
OR cg$rec.APPA_ID is NULL) THEN
SELECT APPA_SEQ.nextval
INTO cg$rec.APPA_ID
FROM DUAL;
cg$ind.APPA_ID := TRUE;
END IF;
EXCEPTION WHEN others THEN
cg$errors.push(SQLERRM, 'E', 'ORA', SQLCODE,
'cg$APPLICATION_PARAMETERS.up_autogen.APPA_ID.OTHERS');
cg$errors.raise_failure;
END;
NULL;
ELSE -- (operation = 'UPD')
NULL;
END IF; -- (operation = 'INS') ELSE (operation = 'UPD')
-- Statements executed for both 'INS' and 'UPD'
EXCEPTION
WHEN no_data_found THEN
NULL;
WHEN others THEN
cg$errors.push( SQLERRM, 'E', 'ORA', SQLCODE,
'cg$APPLICATION_PARAMETERS.up_autogen_columns');
cg$errors.raise_failure;
END up_autogen_columns;
--------------------------------------------------------------------------------
-- Name: validate_mandatory
--
-- Description: Checks all mandatory columns are not null and raises appropriate
-- error if not satisfied
--
-- Parameters: cg$val_rec Record of row to be checked
-- loc Place where this procedure was called for error
-- trapping
--------------------------------------------------------------------------------
PROCEDURE validate_mandatory(cg$val_rec IN cg$row_type,
loc IN VARCHAR2 DEFAULT '') IS
BEGIN
IF (cg$val_rec.APPA_ID IS NULL) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_MAND_COLUMN_ISNULL, cg$errors.VAL_MAND, P10APPA_ID),
'E',
'API',
cg$errors.API_MAND_COLUMN_ISNULL,
loc);
END IF;
IF (cg$val_rec.PARAMETER IS NULL) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_MAND_COLUMN_ISNULL, cg$errors.VAL_MAND, P20PARAMETER),
'E',
'API',
cg$errors.API_MAND_COLUMN_ISNULL,
loc);
END IF;
NULL;
END validate_mandatory;
--------------------------------------------------------------------------------
-- Name: validate_foreign_keys
--
-- Description: Checks all mandatory columns are not null and raises appropriate
-- error if not satisfied
--
-- Parameters: cg$rec Record of row to be checked
--------------------------------------------------------------------------------
PROCEDURE validate_foreign_keys_ins(cg$rec IN cg$row_type) IS
fk_check INTEGER;
BEGIN
NULL;
END;
PROCEDURE validate_foreign_keys_upd( cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type) IS
fk_check INTEGER;
BEGIN
NULL;
END;
PROCEDURE validate_foreign_keys_del(cg$rec IN cg$row_type) IS
fk_check INTEGER;
BEGIN
NULL;
END;
--------------------------------------------------------------------------------
-- Name: slct
--
-- Description: Selects into the given parameter all the attributes for the row
-- given by the primary key
--
-- Parameters: cg$sel_rec Record of row to be selected into using its PK
--------------------------------------------------------------------------------
PROCEDURE slct(cg$sel_rec IN OUT cg$row_type) IS
BEGIN
IF cg$sel_rec.the_rowid is null THEN
SELECT APPA_ID
, PARAMETER
, VALUE
, DESCRIPTION
, rowid
INTO cg$sel_rec.APPA_ID
, cg$sel_rec.PARAMETER
, cg$sel_rec.VALUE
, cg$sel_rec.DESCRIPTION
,cg$sel_rec.the_rowid
FROM APPLICATION_PARAMETERS
WHERE APPA_ID = cg$sel_rec.APPA_ID;
ELSE
SELECT APPA_ID
, PARAMETER
, VALUE
, DESCRIPTION
, rowid
INTO cg$sel_rec.APPA_ID
, cg$sel_rec.PARAMETER
, cg$sel_rec.VALUE
, cg$sel_rec.DESCRIPTION
,cg$sel_rec.the_rowid
FROM APPLICATION_PARAMETERS
WHERE rowid = cg$sel_rec.the_rowid;
END IF;
EXCEPTION WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.slct.others');
cg$errors.raise_failure;
END slct;
--------------------------------------------------------------------------------
-- Name: cascade_update
--
-- Description: Updates all child tables affected by a change to APPLICATION_PARAMETERS
--
-- Parameters: cg$rec Record of APPLICATION_PARAMETERS current values
-- cg$old_rec Record of APPLICATION_PARAMETERS previous values
--------------------------------------------------------------------------------
PROCEDURE cascade_update(cg$new_rec IN OUT cg$row_type,
cg$old_rec IN cg$row_type) IS
BEGIN
NULL;
END cascade_update;
--------------------------------------------------------------------------------
-- Name: validate_domain_cascade_update
--
-- Description: Implement the Domain Key Constraint Cascade Updates Resticts rule
-- of each child table that references this tableAPPLICATION_PARAMETERS
--
-- Parameters: cg$old_rec Record of APPLICATION_PARAMETERS current values
--------------------------------------------------------------------------------
PROCEDURE validate_domain_cascade_update( cg$old_rec IN cg$row_type ) IS
dk_check INTEGER;
BEGIN
NULL;
END validate_domain_cascade_update;
-----------------------------------------------------------------------------------------
-- Name: domain_cascade_update
--
-- Description: Implement the Domain Key Constraint Cascade Updates rules of each
-- child table that references this table APPLICATION_PARAMETERS
--
-- Parameters: cg$new_rec New values for APPLICATION_PARAMETERS's domain key constraint columns
-- cg$new_ind Indicates changed APPLICATION_PARAMETERS's domain key constraint columns
-- cg$old_rec Current values for APPLICATION_PARAMETERS's domain key constraint columns
-----------------------------------------------------------------------------------------
PROCEDURE domain_cascade_update(cg$new_rec IN OUT cg$row_type,
cg$new_ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type) IS
BEGIN
NULL;
END domain_cascade_update;
--------------------------------------------------------------------------------
-- Name: cascade_delete
--
-- Description: Delete all child tables affected by a delete to APPLICATION_PARAMETERS
--
-- Parameters: cg$rec Record of APPLICATION_PARAMETERS current values
--------------------------------------------------------------------------------
PROCEDURE cascade_delete(cg$old_rec IN OUT cg$row_type)
IS
BEGIN
NULL;
END cascade_delete;
--------------------------------------------------------------------------------
-- Name: domain_cascade_delete
--
-- Description: Implement the Domain Key Constraint Cascade Delete rules of each
-- child table that references this tableAPPLICATION_PARAMETERS
--
-- Parameters: cg$old_rec Record of APPLICATION_PARAMETERS current values
--------------------------------------------------------------------------------
PROCEDURE domain_cascade_delete( cg$old_rec IN cg$row_type )
IS
BEGIN
NULL;
END domain_cascade_delete;
--------------------------------------------------------------------------------
-- Name: validate_domain_cascade_delete
--
-- Description: Implement the Domain Key Constraint Cascade Delete Restricts rule
-- of each child table that references this tableAPPLICATION_PARAMETERS
--
-- Parameters: cg$old_rec Record of APPLICATION_PARAMETERS current values
--------------------------------------------------------------------------------
PROCEDURE validate_domain_cascade_delete(cg$old_rec IN cg$row_type)
IS
dk_check INTEGER;
BEGIN
NULL;
END validate_domain_cascade_delete;
--------------------------------------------------------------------------------
-- Name: validate_arc
--
-- Description: Checks for adherence to arc relationship
--
-- Parameters: cg$rec Record of APPLICATION_PARAMETERS current values
--------------------------------------------------------------------------------
PROCEDURE validate_arc(cg$rec IN OUT cg$row_type) IS
i NUMBER;
BEGIN
NULL;
END validate_arc;
--------------------------------------------------------------------------------
-- Name: validate_domain
--
-- Description: Checks against reference table for values lying in a domain
--
-- Parameters: cg$rec Record of APPLICATION_PARAMETERS current values
--------------------------------------------------------------------------------
PROCEDURE validate_domain(cg$rec IN OUT cg$row_type,
cg$ind IN cg$ind_type DEFAULT cg$ind_true)
IS
dummy NUMBER;
found BOOLEAN;
no_tabview EXCEPTION;
PRAGMA EXCEPTION_INIT(no_tabview, -942);
BEGIN
NULL;
EXCEPTION
WHEN cg$errors.cg$error THEN
cg$errors.raise_failure;
WHEN no_tabview THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_RV_TAB_NOT_FOUND,
cg$errors.APIMSG_RV_TAB_NOT_FOUND,
'CG_REF_CODES','APPLICATION_PARAMETERS'),
'E',
'API',
cg$errors.API_RV_TAB_NOT_FOUND,
'cg$APPLICATION_PARAMETERS.v_domain.no_reftable_found');
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.v_domain.others');
cg$errors.raise_failure;
END validate_domain;
--------------------------------------------------------------------------------
-- Name: err_msg
--
-- Description: Pushes onto stack appropriate user defined error message
-- depending on the rule violated
--
-- Parameters: msg Oracle error message
-- type Type of violation e.g. check_constraint: ERR_CHECK_CON
-- loc Place where this procedure was called for error
-- trapping
--------------------------------------------------------------------------------
PROCEDURE err_msg(msg IN VARCHAR2,
type IN INTEGER,
loc IN VARCHAR2 DEFAULT '') IS
con_name VARCHAR2(240);
BEGIN
con_name := cg$errors.parse_constraint(msg, type);
IF (con_name = 'APPA_PK') THEN
cg$errors.push(nvl(APPA_PK
,cg$errors.MsgGetText(cg$errors.API_PK_CON_VIOLATED
,cg$errors.APIMSG_PK_VIOLAT
,'APPA_PK'
,'APPLICATION_PARAMETERS')),
'E',
'API',
cg$errors.API_PK_CON_VIOLATED,
loc);
ELSIF (con_name = 'APPA_UK') THEN
cg$errors.push(nvl(APPA_UK
,cg$errors.MsgGetText(cg$errors.API_UQ_CON_VIOLATED
,cg$errors.APIMSG_UK_VIOLAT
,'APPA_UK'
,'APPLICATION_PARAMETERS')),
'E',
'API',
cg$errors.API_UQ_CON_VIOLATED,
loc);
ELSE
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
loc);
END IF;
END err_msg;
--------------------------------------------------------------------------------
-- Name: doLobs
--
-- Description: This function is updating lob columns
--
-- Parameters: cg$rec Record of row to be inserted
-- cg$ind Record of columns specifically set
--------------------------------------------------------------------------------
PROCEDURE doLobs(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type) IS
BEGIN
NULL;
END doLobs;
--------------------------------------------------------------------------------
-- Name: ins
--
-- Description: API insert procedure
--
-- Parameters: cg$rec Record of row to be inserted
-- cg$ind Record of columns specifically set
-- do_ins Whether we want the actual INSERT to occur
--------------------------------------------------------------------------------
PROCEDURE ins(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_ins IN BOOLEAN DEFAULT TRUE) IS
cg$tmp_rec cg$row_type;
-- Constant default values
BEGIN
-- Application_logic Pre-Insert <<Start>>
-- Application_logic Pre-Insert << End >>
-- Defaulted
-- Auto-generated and uppercased columns
up_autogen_columns(cg$rec, cg$ind, 'INS', do_ins);
called_from_package := TRUE;
IF (do_ins) THEN
validate_foreign_keys_ins(cg$rec);
validate_arc(cg$rec);
validate_domain(cg$rec);
INSERT INTO APPLICATION_PARAMETERS
(APPA_ID
,PARAMETER
,VALUE
,DESCRIPTION)
VALUES
(cg$rec.APPA_ID
,cg$rec.PARAMETER
,cg$rec.VALUE
,cg$rec.DESCRIPTION
);
doLobs(cg$rec, cg$ind);
slct(cg$rec);
upd_oper_denorm2(cg$rec, cg$tmp_rec, cg$ind, 'INS');
END IF;
called_from_package := FALSE;
-- Application logic Post-Insert <<Start>>
-- Application logic Post-Insert << End >>
EXCEPTION
WHEN cg$errors.cg$error THEN
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.mandatory_missing THEN
validate_mandatory(cg$rec, 'cg$APPLICATION_PARAMETERS.ins.mandatory_missing');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.check_violation THEN
err_msg(SQLERRM, cg$errors.ERR_CHECK_CON, 'cg$APPLICATION_PARAMETERS.ins.check_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.fk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_FOREIGN_KEY, 'cg$APPLICATION_PARAMETERS.ins.fk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.uk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_UNIQUE_KEY, 'cg$APPLICATION_PARAMETERS.ins.uk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.ins.others');
called_from_package := FALSE;
cg$errors.raise_failure;
END ins;
--------------------------------------------------------------------------------
-- Name: upd
--
-- Description: API update procedure
--
-- Parameters: cg$rec Record of row to be updated
-- cg$ind Record of columns specifically set
-- do_upd Whether we want the actual UPDATE to occur
--------------------------------------------------------------------------------
PROCEDURE upd(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_upd IN BOOLEAN DEFAULT TRUE,
cg$pk IN cg$row_type DEFAULT NULL )
IS
cg$upd_rec cg$row_type;
cg$old_rec cg$row_type;
RECORD_LOGGED BOOLEAN := FALSE;
BEGIN
-- Application_logic Pre-Update <<Start>>
-- Application_logic Pre-Update << End >>
IF ( cg$pk.APPA_ID IS NULL ) THEN
cg$upd_rec.APPA_ID := cg$rec.APPA_ID;
ELSE
cg$upd_rec.APPA_ID := cg$pk.APPA_ID;
END IF;
cg$old_rec.APPA_ID := cg$upd_rec.APPA_ID;
IF ( cg$pk.the_rowid IS NULL ) THEN
cg$upd_rec.the_rowid := cg$rec.the_rowid;
ELSE
cg$upd_rec.the_rowid := cg$pk.the_rowid;
END IF;
cg$old_rec.the_rowid := cg$upd_rec.the_rowid;
IF ( do_upd ) THEN
slct(cg$upd_rec);
-- Report error if attempt to update non updateable Primary Key APPA_PK
IF (cg$ind.APPA_ID AND cg$rec.APPA_ID != cg$upd_rec.APPA_ID) THEN
raise_uk_not_updateable('APPA_PK');
END IF;
IF NOT (cg$ind.APPA_ID) THEN
cg$rec.APPA_ID := cg$upd_rec.APPA_ID;
END IF;
IF NOT (cg$ind.PARAMETER) THEN
cg$rec.PARAMETER := cg$upd_rec.PARAMETER;
END IF;
IF NOT (cg$ind.VALUE) THEN
cg$rec.VALUE := cg$upd_rec.VALUE;
END IF;
IF NOT (cg$ind.DESCRIPTION) THEN
cg$rec.DESCRIPTION := cg$upd_rec.DESCRIPTION;
END IF;
ELSE
-- Perform checks if called from a trigger
-- Indicators are only set on changed values
null;
-- Report error if attempt to update non updateable Primary Key APPA_PK
IF ( cg$ind.APPA_ID ) THEN
raise_uk_not_updateable('APPA_PK');
END IF;
END IF;
up_autogen_columns(cg$rec, cg$ind, 'UPD', do_upd); -- Auto-generated and uppercased columns
-- Now do update if updateable columns exist
IF (do_upd) THEN
DECLARE
called_from BOOLEAN := called_from_package;
BEGIN
called_from_package := TRUE;
slct(cg$old_rec);
validate_foreign_keys_upd(cg$rec, cg$old_rec, cg$ind);
validate_arc(cg$rec);
validate_domain(cg$rec, cg$ind);
validate_domain_cascade_update(cg$old_rec);
IF cg$rec.the_rowid is null THEN
UPDATE APPLICATION_PARAMETERS
SET
PARAMETER = cg$rec.PARAMETER
,VALUE = cg$rec.VALUE
,DESCRIPTION = cg$rec.DESCRIPTION
WHERE APPA_ID = cg$rec.APPA_ID;
null;
ELSE
UPDATE APPLICATION_PARAMETERS
SET
PARAMETER = cg$rec.PARAMETER
,VALUE = cg$rec.VALUE
,DESCRIPTION = cg$rec.DESCRIPTION
WHERE rowid = cg$rec.the_rowid;
null;
END IF;
slct(cg$rec);
upd_denorm2(cg$rec, cg$ind);
upd_oper_denorm2(cg$rec, cg$old_rec, cg$ind, 'UPD');
cascade_update(cg$rec, cg$old_rec);
domain_cascade_update(cg$rec, cg$ind, cg$old_rec);
called_from_package := called_from;
END;
END IF;
IF NOT (do_upd) THEN
cg$table(idx).APPA_ID := cg$rec.APPA_ID;
cg$tableind(idx).APPA_ID := cg$ind.APPA_ID;
cg$table(idx).PARAMETER := cg$rec.PARAMETER;
cg$tableind(idx).PARAMETER := cg$ind.PARAMETER;
cg$table(idx).VALUE := cg$rec.VALUE;
cg$tableind(idx).VALUE := cg$ind.VALUE;
cg$table(idx).DESCRIPTION := cg$rec.DESCRIPTION;
cg$tableind(idx).DESCRIPTION := cg$ind.DESCRIPTION;
idx := idx + 1;
END IF;
-- Application_logic Post-Update <<Start>>
-- Application_logic Post-Update << End >>
EXCEPTION
WHEN cg$errors.cg$error THEN
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.upd_mandatory_null THEN
validate_mandatory(cg$rec, 'cg$APPLICATION_PARAMETERS.upd.upd_mandatory_null');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.check_violation THEN
err_msg(SQLERRM, cg$errors.ERR_CHECK_CON, 'cg$APPLICATION_PARAMETERS.upd.check_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.fk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_FOREIGN_KEY, 'cg$APPLICATION_PARAMETERS.upd.fk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.uk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_UNIQUE_KEY, 'cg$APPLICATION_PARAMETERS.upd.uk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.upd.others');
called_from_package := FALSE;
cg$errors.raise_failure;
END upd;
----------------------------------------------------------------------------------------
-- Name: domain_cascade_upd
--
-- Description: Update the Domain Constraint Key columns of APPLICATION_PARAMETERS when the
-- Cascade Update rule is Cascades and the domain table has been
-- updated. Called from <Domain Table pkg>.domain_cascade_update().
--
-- Parameters: cg$rec New values for APPLICATION_PARAMETERS's domain key constraint columns
-- cg$ind Indicates changed APPLICATION_PARAMETERS's domain key constraint columns
-- cg$old_rec Current values for APPLICATION_PARAMETERS's domain key constraint columns
----------------------------------------------------------------------------------------
PROCEDURE domain_cascade_upd( cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type )
IS
called_from BOOLEAN := called_from_package;
BEGIN
null;
END domain_cascade_upd;
--------------------------------------------------------------------------------
-- Name: upd_denorm
--
-- Description: API procedure for simple denormalization
--
-- Parameters: cg$rec Record of row to be updated
-- cg$ind Record of columns specifically set
-- do_upd Whether we want the actual UPDATE to occur
--------------------------------------------------------------------------------
PROCEDURE upd_denorm2( cg$rec IN cg$row_type,
cg$ind IN cg$ind_type ) IS
BEGIN
NULL;
END upd_denorm2;
--------------------------------------------------------------------------------
-- Name: upd_oper_denorm
--
-- Description: API procedure for operation denormalization
--
-- Parameters: cg$rec Record of row to be updated
-- cg$ind Record of columns specifically set
-- do_upd Whether we want the actual UPDATE to occur
--------------------------------------------------------------------------------
PROCEDURE upd_oper_denorm2( cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type,
operation IN VARCHAR2 DEFAULT 'UPD'
)
IS
BEGIN
NULL;
END upd_oper_denorm2;
--------------------------------------------------------------------------------
-- Name: del
--
-- Description: API delete procedure
--
-- Parameters: cg$pk Primary key record of row to be deleted
--------------------------------------------------------------------------------
PROCEDURE del(cg$pk IN cg$pk_type,
do_del IN BOOLEAN DEFAULT TRUE) IS
BEGIN
-- Application_logic Pre-Delete <<Start>>
-- Application_logic Pre-Delete << End >>
-- Delete the record
called_from_package := TRUE;
IF (do_del) THEN
DECLARE
cg$rec cg$row_type;
cg$old_rec cg$row_type;
cg$ind cg$ind_type;
BEGIN
cg$rec.APPA_ID := cg$pk.APPA_ID;
slct(cg$rec);
validate_foreign_keys_del(cg$rec);
validate_domain_cascade_delete(cg$rec);
IF cg$pk.the_rowid is null THEN
DELETE APPLICATION_PARAMETERS
WHERE APPA_ID = cg$pk.APPA_ID;
ELSE
DELETE APPLICATION_PARAMETERS
WHERE rowid = cg$pk.the_rowid;
END IF;
upd_oper_denorm2(cg$rec, cg$old_rec, cg$ind, 'DEL');
cascade_delete(cg$rec);
domain_cascade_delete(cg$rec);
END;
END IF;
called_from_package := FALSE;
-- Application_logic Post-Delete <<Start>>
-- Application_logic Post-Delete << End >>
EXCEPTION
WHEN cg$errors.cg$error THEN
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.delete_restrict THEN
err_msg(SQLERRM, cg$errors.ERR_DELETE_RESTRICT, 'cg$APPLICATION_PARAMETERS.del.delete_restrict');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN no_data_found THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_DEL, cg$errors.ROW_DEL),
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.del.no_data_found');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.del.others');
called_from_package := FALSE;
cg$errors.raise_failure;
END del;
--------------------------------------------------------------------------------
-- Name: lck
--
-- Description: API lock procedure
--
-- Parameters: cg$old_rec Calling apps view of record of row to be locked
-- cg$old_ind Record of columns to raise error if modified
-- nowait_flag TRUE lock with NOWAIT, FALSE don't fail if busy
--------------------------------------------------------------------------------
PROCEDURE lck(cg$old_rec IN cg$row_type,
cg$old_ind IN cg$ind_type,
nowait_flag IN BOOLEAN DEFAULT TRUE) IS
cg$tmp_rec cg$row_type;
any_modified BOOLEAN := FALSE;
BEGIN
-- Application_logic Pre-Lock <<Start>>
-- Application_logic Pre-Lock << End >>
-- Do the row lock
BEGIN
IF (nowait_flag) THEN
IF cg$old_rec.the_rowid is null THEN
SELECT APPA_ID
, PARAMETER
, VALUE
, DESCRIPTION
INTO cg$tmp_rec.APPA_ID
, cg$tmp_rec.PARAMETER
, cg$tmp_rec.VALUE
, cg$tmp_rec.DESCRIPTION
FROM APPLICATION_PARAMETERS
WHERE APPA_ID = cg$old_rec.APPA_ID
FOR UPDATE NOWAIT;
ELSE
SELECT APPA_ID
, PARAMETER
, VALUE
, DESCRIPTION
INTO cg$tmp_rec.APPA_ID
, cg$tmp_rec.PARAMETER
, cg$tmp_rec.VALUE
, cg$tmp_rec.DESCRIPTION
FROM APPLICATION_PARAMETERS
WHERE rowid = cg$old_rec.the_rowid
FOR UPDATE NOWAIT;
END IF;
ELSE
IF cg$old_rec.the_rowid is null THEN
SELECT APPA_ID
, PARAMETER
, VALUE
, DESCRIPTION
INTO cg$tmp_rec.APPA_ID
, cg$tmp_rec.PARAMETER
, cg$tmp_rec.VALUE
, cg$tmp_rec.DESCRIPTION
FROM APPLICATION_PARAMETERS
WHERE APPA_ID = cg$old_rec.APPA_ID
FOR UPDATE;
ELSE
SELECT APPA_ID
, PARAMETER
, VALUE
, DESCRIPTION
INTO cg$tmp_rec.APPA_ID
, cg$tmp_rec.PARAMETER
, cg$tmp_rec.VALUE
, cg$tmp_rec.DESCRIPTION
FROM APPLICATION_PARAMETERS
WHERE rowid = cg$old_rec.the_rowid
FOR UPDATE;
END IF;
END IF;
EXCEPTION
WHEN cg$errors.cg$error THEN
cg$errors.raise_failure;
WHEN cg$errors.resource_busy THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_LCK, cg$errors.ROW_LCK),
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.lck.resource_busy');
cg$errors.raise_failure;
WHEN no_data_found THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_DEL, cg$errors.ROW_DEL),
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.lck.no_data_found');
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$APPLICATION_PARAMETERS.lck.others');
cg$errors.raise_failure;
END;
-- Optional Columns
IF (cg$old_ind.VALUE) THEN
IF (cg$tmp_rec.VALUE IS NOT NULL
AND cg$old_rec.VALUE IS NOT NULL) THEN
IF (cg$tmp_rec.VALUE != cg$old_rec.VALUE) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P30VALUE
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$APPLICATION_PARAMETERS.lck');
any_modified := TRUE;
END IF;
ELSIF (cg$tmp_rec.VALUE IS NOT NULL
OR cg$old_rec.VALUE IS NOT NULL) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P30VALUE
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$APPLICATION_PARAMETERS.lck');
any_modified := TRUE;
END IF;
END IF;
IF (cg$old_ind.DESCRIPTION) THEN
IF (cg$tmp_rec.DESCRIPTION IS NOT NULL
AND cg$old_rec.DESCRIPTION IS NOT NULL) THEN
IF (cg$tmp_rec.DESCRIPTION != cg$old_rec.DESCRIPTION) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P40DESCRIPTION
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$APPLICATION_PARAMETERS.lck');
any_modified := TRUE;
END IF;
ELSIF (cg$tmp_rec.DESCRIPTION IS NOT NULL
OR cg$old_rec.DESCRIPTION IS NOT NULL) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P40DESCRIPTION
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$APPLICATION_PARAMETERS.lck');
any_modified := TRUE;
END IF;
END IF;
-- Mandatory Columns
IF (cg$old_ind.APPA_ID) THEN
IF (cg$tmp_rec.APPA_ID != cg$old_rec.APPA_ID) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P10APPA_ID
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$APPLICATION_PARAMETERS.lck');
any_modified := TRUE;
END IF;
END IF;
IF (cg$old_ind.PARAMETER) THEN
IF (cg$tmp_rec.PARAMETER != cg$old_rec.PARAMETER) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P20PARAMETER
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$APPLICATION_PARAMETERS.lck');
any_modified := TRUE;
END IF;
END IF;
IF (any_modified) THEN
cg$errors.raise_failure;
END IF;
-- Application_logic Post-Lock <<Start>>
-- Application_logic Post-Lock << End >>
END lck;
BEGIN
cg$ind_true.APPA_ID := TRUE;
cg$ind_true.PARAMETER := TRUE;
cg$ind_true.VALUE := TRUE;
cg$ind_true.DESCRIPTION := TRUE;
END cg$APPLICATION_PARAMETERS;
/

View File

@@ -0,0 +1,109 @@
PROMPT Creating API Package Specification for Table 'APPLICATION_PARAMETERS'
--------------------------------------------------------------------------------
-- Name: cg$APPLICATION_PARAMETERS
-- Description: APPLICATION_PARAMETERS table API package declarations
--------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE cg$APPLICATION_PARAMETERS IS
called_from_package BOOLEAN := FALSE;
-- Repository User-Defined Error Messages
APPA_PK CONSTANT VARCHAR2(240) := '';
APPA_UK CONSTANT VARCHAR2(240) := '';
-- Column default prompts. Format PSEQNO_COL
P10APPA_ID CONSTANT VARCHAR2(240) := 'Appa Id';
P20PARAMETER CONSTANT VARCHAR2(240) := 'Parameter';
P30VALUE CONSTANT VARCHAR2(240) := 'Value';
P40DESCRIPTION CONSTANT VARCHAR2(240) := 'Description';
cg$row APPLICATION_PARAMETERS%ROWTYPE;
-- APPLICATION_PARAMETERS row type variable
TYPE cg$row_type IS RECORD
(APPA_ID cg$row.APPA_ID%TYPE
,PARAMETER cg$row.PARAMETER%TYPE
,VALUE cg$row.VALUE%TYPE
,DESCRIPTION cg$row.DESCRIPTION%TYPE
,the_rowid ROWID)
;
-- APPLICATION_PARAMETERS indicator type variable
TYPE cg$ind_type IS RECORD
(APPA_ID BOOLEAN DEFAULT FALSE
,PARAMETER BOOLEAN DEFAULT FALSE
,VALUE BOOLEAN DEFAULT FALSE
,DESCRIPTION BOOLEAN DEFAULT FALSE);
cg$ind_true cg$ind_type;
-- APPLICATION_PARAMETERS primary key type variable
TYPE cg$pk_type IS RECORD
(APPA_ID cg$row.APPA_ID%TYPE
,the_rowid ROWID)
;
-- PL/SQL Table Type variable for triggers
TYPE cg$table_type IS TABLE OF APPLICATION_PARAMETERS%ROWTYPE
INDEX BY BINARY_INTEGER;
cg$table cg$table_type;
TYPE cg$tableind_type IS TABLE OF cg$ind_type
INDEX BY BINARY_INTEGER;
cg$tableind cg$tableind_type;
idx BINARY_INTEGER := 1;
PROCEDURE ins(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_ins IN BOOLEAN DEFAULT TRUE
);
PROCEDURE upd(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_upd IN BOOLEAN DEFAULT TRUE,
cg$pk IN cg$row_type DEFAULT NULL
);
PROCEDURE del(cg$pk IN cg$pk_type,
do_del IN BOOLEAN DEFAULT TRUE
);
PROCEDURE lck(cg$old_rec IN cg$row_type,
cg$old_ind IN cg$ind_type,
nowait_flag IN BOOLEAN DEFAULT TRUE
);
PROCEDURE slct(cg$sel_rec IN OUT cg$row_type);
PROCEDURE validate_arc(cg$rec IN OUT cg$row_type);
PROCEDURE validate_domain(cg$rec IN OUT cg$row_type,
cg$ind IN cg$ind_type DEFAULT cg$ind_true);
PROCEDURE validate_foreign_keys_ins(cg$rec IN cg$row_type);
PROCEDURE validate_foreign_keys_upd(cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type);
PROCEDURE validate_foreign_keys_del(cg$rec IN cg$row_type);
PROCEDURE validate_domain_cascade_delete(cg$old_rec IN cg$row_type);
PROCEDURE validate_domain_cascade_update(cg$old_rec IN cg$row_type);
PROCEDURE cascade_update(cg$new_rec IN OUT cg$row_type,
cg$old_rec IN cg$row_type );
PROCEDURE domain_cascade_update(cg$new_rec IN OUT cg$row_type,
cg$new_ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type);
PROCEDURE domain_cascade_upd( cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type);
PROCEDURE cascade_delete(cg$old_rec IN OUT cg$row_type);
PROCEDURE domain_cascade_delete(cg$old_rec IN cg$row_type);
PROCEDURE upd_denorm2( cg$rec IN cg$row_type,
cg$ind IN cg$ind_type );
PROCEDURE upd_oper_denorm2( cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type,
operation IN VARCHAR2 DEFAULT 'UPD' );
END cg$APPLICATION_PARAMETERS;
/

View File

@@ -0,0 +1,372 @@
PROMPT Creating Trigger Logic for Table 'APPLICATION_PARAMETERS'
PROMPT Creating Before Insert Statement Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$BIS_APPLICATION_PARAMETERS
BEFORE INSERT ON APPLICATION_PARAMETERS
BEGIN
-- Application_logic Pre-Before-Insert-statement <<Start>>
-- Application_logic Pre-Before-Insert-statement << End >>
cg$APPLICATION_PARAMETERS.cg$table.DELETE;
cg$APPLICATION_PARAMETERS.cg$tableind.DELETE;
cg$APPLICATION_PARAMETERS.idx := 1;
-- Application_logic Post-Before-Insert-statement <<Start>>
-- Application_logic Post-Before-Insert-statement << End >>
END;
/
PROMPT Creating Before Insert Row Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$BIR_APPLICATION_PARAMETERS
BEFORE INSERT ON APPLICATION_PARAMETERS FOR EACH ROW
DECLARE
cg$rec cg$APPLICATION_PARAMETERS.cg$row_type;
cg$ind cg$APPLICATION_PARAMETERS.cg$ind_type;
BEGIN
-- Application_logic Pre-Before-Insert-row <<Start>>
-- Application_logic Pre-Before-Insert-row << End >>
-- Load cg$rec/cg$ind values from new
cg$rec.APPA_ID := :new.APPA_ID;
cg$ind.APPA_ID := TRUE;
cg$rec.PARAMETER := :new.PARAMETER;
cg$ind.PARAMETER := TRUE;
cg$rec.VALUE := :new.VALUE;
cg$ind.VALUE := TRUE;
cg$rec.DESCRIPTION := :new.DESCRIPTION;
cg$ind.DESCRIPTION := TRUE;
if not (cg$APPLICATION_PARAMETERS.called_from_package) then
cg$APPLICATION_PARAMETERS.validate_arc(cg$rec);
cg$APPLICATION_PARAMETERS.validate_domain(cg$rec);
cg$APPLICATION_PARAMETERS.ins(cg$rec, cg$ind, FALSE);
cg$APPLICATION_PARAMETERS.called_from_package := FALSE;
end if;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).APPA_ID := cg$rec.APPA_ID;
cg$APPLICATION_PARAMETERS.cg$tableind(cg$APPLICATION_PARAMETERS.idx).APPA_ID := cg$ind.APPA_ID;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).PARAMETER := cg$rec.PARAMETER;
cg$APPLICATION_PARAMETERS.cg$tableind(cg$APPLICATION_PARAMETERS.idx).PARAMETER := cg$ind.PARAMETER;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).VALUE := cg$rec.VALUE;
cg$APPLICATION_PARAMETERS.cg$tableind(cg$APPLICATION_PARAMETERS.idx).VALUE := cg$ind.VALUE;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).DESCRIPTION := cg$rec.DESCRIPTION;
cg$APPLICATION_PARAMETERS.cg$tableind(cg$APPLICATION_PARAMETERS.idx).DESCRIPTION := cg$ind.DESCRIPTION;
cg$APPLICATION_PARAMETERS.idx := cg$APPLICATION_PARAMETERS.idx + 1;
:new.APPA_ID := cg$rec.APPA_ID;
:new.PARAMETER := cg$rec.PARAMETER;
:new.VALUE := cg$rec.VALUE;
:new.DESCRIPTION := cg$rec.DESCRIPTION;
-- Application_logic Post-Before-Insert-row <<Start>>
-- Application_logic Post-Before-Insert-row << End >>
END;
/
-- No application logic defined for Trigger cg$AIR_APPLICATION_PARAMETERS, so drop it.
-- To avoid an error if there isn't one, create or replace it, and then drop it
CREATE OR REPLACE TRIGGER cg$AIR_APPLICATION_PARAMETERS
AFTER INSERT ON APPLICATION_PARAMETERS FOR EACH ROW
BEGIN
null;
END;
/
drop trigger cg$AIR_APPLICATION_PARAMETERS
/
PROMPT Creating After Insert Statement Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$AIS_APPLICATION_PARAMETERS
AFTER INSERT ON APPLICATION_PARAMETERS
DECLARE
idx BINARY_INTEGER := cg$APPLICATION_PARAMETERS.cg$table.FIRST;
cg$rec cg$APPLICATION_PARAMETERS.cg$row_type;
cg$old_rec cg$APPLICATION_PARAMETERS.cg$row_type;
fk_check INTEGER;
BEGIN
-- Application_logic Pre-After-Insert-statement <<Start>>
-- Application_logic Pre-After-Insert-statement << End >>
IF NOT (cg$APPLICATION_PARAMETERS.called_from_package) THEN
WHILE idx IS NOT NULL LOOP
cg$rec.APPA_ID := cg$APPLICATION_PARAMETERS.cg$table(idx).APPA_ID;
cg$rec.PARAMETER := cg$APPLICATION_PARAMETERS.cg$table(idx).PARAMETER;
cg$rec.VALUE := cg$APPLICATION_PARAMETERS.cg$table(idx).VALUE;
cg$rec.DESCRIPTION := cg$APPLICATION_PARAMETERS.cg$table(idx).DESCRIPTION;
cg$APPLICATION_PARAMETERS.validate_foreign_keys_ins(cg$rec);
cg$APPLICATION_PARAMETERS.upd_oper_denorm2( cg$rec,
cg$old_rec,
cg$APPLICATION_PARAMETERS.cg$tableind(idx),
'INS'
);
idx := cg$APPLICATION_PARAMETERS.cg$table.NEXT(idx);
END LOOP;
END IF;
-- Application_logic Post-After-Insert-statement <<Start>>
-- Application_logic Post-After-Insert-statement << End >>
END;
/
PROMPT Creating Before Update Statement Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$BUS_APPLICATION_PARAMETERS
BEFORE UPDATE ON APPLICATION_PARAMETERS
BEGIN
-- Application_logic Pre-Before-Update-statement <<Start>>
-- Application_logic Pre-Before-Update-statement << End >>
cg$APPLICATION_PARAMETERS.cg$table.DELETE;
cg$APPLICATION_PARAMETERS.cg$tableind.DELETE;
cg$APPLICATION_PARAMETERS.idx := 1;
-- Application_logic Post-Before-Update-statement <<Start>>
-- Application_logic Post-Before-Update-statement << End >>
END;
/
PROMPT Creating Before Update Row Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$BUR_APPLICATION_PARAMETERS
BEFORE UPDATE ON APPLICATION_PARAMETERS FOR EACH ROW
DECLARE
cg$rec cg$APPLICATION_PARAMETERS.cg$row_type;
cg$ind cg$APPLICATION_PARAMETERS.cg$ind_type;
cg$old_rec cg$APPLICATION_PARAMETERS.cg$row_type;
BEGIN
-- Application_logic Pre-Before-Update-row <<Start>>
-- Application_logic Pre-Before-Update-row << End >>
-- Load cg$rec/cg$ind values from new
cg$rec.APPA_ID := :new.APPA_ID;
cg$ind.APPA_ID := (:new.APPA_ID IS NULL AND :old.APPA_ID IS NOT NULL )
OR (:new.APPA_ID IS NOT NULL AND :old.APPA_ID IS NULL)
OR NOT(:new.APPA_ID = :old.APPA_ID) ;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).APPA_ID := :old.APPA_ID;
cg$rec.PARAMETER := :new.PARAMETER;
cg$ind.PARAMETER := (:new.PARAMETER IS NULL AND :old.PARAMETER IS NOT NULL )
OR (:new.PARAMETER IS NOT NULL AND :old.PARAMETER IS NULL)
OR NOT(:new.PARAMETER = :old.PARAMETER) ;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).PARAMETER := :old.PARAMETER;
cg$rec.VALUE := :new.VALUE;
cg$ind.VALUE := (:new.VALUE IS NULL AND :old.VALUE IS NOT NULL )
OR (:new.VALUE IS NOT NULL AND :old.VALUE IS NULL)
OR NOT(:new.VALUE = :old.VALUE) ;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).VALUE := :old.VALUE;
cg$rec.DESCRIPTION := :new.DESCRIPTION;
cg$ind.DESCRIPTION := (:new.DESCRIPTION IS NULL AND :old.DESCRIPTION IS NOT NULL )
OR (:new.DESCRIPTION IS NOT NULL AND :old.DESCRIPTION IS NULL)
OR NOT(:new.DESCRIPTION = :old.DESCRIPTION) ;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).DESCRIPTION := :old.DESCRIPTION;
cg$APPLICATION_PARAMETERS.idx := cg$APPLICATION_PARAMETERS.idx + 1;
if not (cg$APPLICATION_PARAMETERS.called_from_package) then
cg$APPLICATION_PARAMETERS.validate_arc(cg$rec);
cg$APPLICATION_PARAMETERS.validate_domain(cg$rec, cg$ind);
cg$APPLICATION_PARAMETERS.validate_domain_cascade_update(cg$old_rec);
cg$APPLICATION_PARAMETERS.upd(cg$rec, cg$ind, FALSE);
cg$APPLICATION_PARAMETERS.called_from_package := FALSE;
end if;
:new.PARAMETER := cg$rec.PARAMETER;
:new.VALUE := cg$rec.VALUE;
:new.DESCRIPTION := cg$rec.DESCRIPTION;
-- Application_logic Post-Before-Update-row <<Start>>
-- Application_logic Post-Before-Update-row << End >>
END;
/
-- No application logic defined for Trigger cg$AUR_APPLICATION_PARAMETERS, so drop it.
-- To avoid an error if there isn't one, create or replace it, and then drop it
CREATE OR REPLACE TRIGGER cg$AUR_APPLICATION_PARAMETERS
AFTER UPDATE ON APPLICATION_PARAMETERS FOR EACH ROW
BEGIN
null;
END;
/
drop trigger cg$AUR_APPLICATION_PARAMETERS
/
PROMPT Creating After Update Statement Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$AUS_APPLICATION_PARAMETERS
AFTER UPDATE ON APPLICATION_PARAMETERS
DECLARE
idx BINARY_INTEGER := cg$APPLICATION_PARAMETERS.cg$table.FIRST;
cg$old_rec cg$APPLICATION_PARAMETERS.cg$row_type;
cg$rec cg$APPLICATION_PARAMETERS.cg$row_type;
cg$ind cg$APPLICATION_PARAMETERS.cg$ind_type;
BEGIN
-- Application_logic Pre-After-Update-statement <<Start>>
-- Application_logic Pre-After-Update-statement << End >>
WHILE idx IS NOT NULL LOOP
cg$old_rec.APPA_ID := cg$APPLICATION_PARAMETERS.cg$table(idx).APPA_ID;
cg$old_rec.PARAMETER := cg$APPLICATION_PARAMETERS.cg$table(idx).PARAMETER;
cg$old_rec.VALUE := cg$APPLICATION_PARAMETERS.cg$table(idx).VALUE;
cg$old_rec.DESCRIPTION := cg$APPLICATION_PARAMETERS.cg$table(idx).DESCRIPTION;
IF NOT (cg$APPLICATION_PARAMETERS.called_from_package) THEN
idx := cg$APPLICATION_PARAMETERS.cg$table.NEXT(idx);
cg$rec.APPA_ID := cg$APPLICATION_PARAMETERS.cg$table(idx).APPA_ID;
cg$ind.APPA_ID := updating('APPA_ID');
cg$rec.PARAMETER := cg$APPLICATION_PARAMETERS.cg$table(idx).PARAMETER;
cg$ind.PARAMETER := updating('PARAMETER');
cg$rec.VALUE := cg$APPLICATION_PARAMETERS.cg$table(idx).VALUE;
cg$ind.VALUE := updating('VALUE');
cg$rec.DESCRIPTION := cg$APPLICATION_PARAMETERS.cg$table(idx).DESCRIPTION;
cg$ind.DESCRIPTION := updating('DESCRIPTION');
cg$APPLICATION_PARAMETERS.validate_foreign_keys_upd(cg$rec, cg$old_rec, cg$ind);
cg$APPLICATION_PARAMETERS.upd_denorm2( cg$rec,
cg$APPLICATION_PARAMETERS.cg$tableind(idx)
);
cg$APPLICATION_PARAMETERS.upd_oper_denorm2( cg$rec,
cg$old_rec,
cg$APPLICATION_PARAMETERS.cg$tableind(idx)
);
cg$APPLICATION_PARAMETERS.cascade_update(cg$rec, cg$old_rec);
cg$APPLICATION_PARAMETERS.domain_cascade_update(cg$rec, cg$ind, cg$old_rec);
cg$APPLICATION_PARAMETERS.called_from_package := FALSE;
END IF;
idx := cg$APPLICATION_PARAMETERS.cg$table.NEXT(idx);
END LOOP;
cg$APPLICATION_PARAMETERS.cg$table.DELETE;
-- Application_logic Post-After-Update-statement <<Start>>
-- Application_logic Post-After-Update-statement << End >>
END;
/
PROMPT Creating Before Delete Statement Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$BDS_APPLICATION_PARAMETERS
BEFORE DELETE ON APPLICATION_PARAMETERS
BEGIN
-- Application_logic Pre-Before-Delete-statement <<Start>>
-- Application_logic Pre-Before-Delete-statement << End >>
cg$APPLICATION_PARAMETERS.cg$table.DELETE;
cg$APPLICATION_PARAMETERS.cg$tableind.DELETE;
cg$APPLICATION_PARAMETERS.idx := 1;
-- Application_logic Post-Before-Delete-statement <<Start>>
-- Application_logic Post-Before-Delete-statement << End >>
END;
/
PROMPT Creating Before Delete Row Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$BDR_APPLICATION_PARAMETERS
BEFORE DELETE ON APPLICATION_PARAMETERS FOR EACH ROW
DECLARE
cg$pk cg$APPLICATION_PARAMETERS.cg$pk_type;
cg$rec cg$APPLICATION_PARAMETERS.cg$row_type;
cg$ind cg$APPLICATION_PARAMETERS.cg$ind_type;
BEGIN
-- Application_logic Pre-Before-Delete-row <<Start>>
-- Application_logic Pre-Before-Delete-row << End >>
-- Load cg$rec/cg$ind values from new
cg$pk.APPA_ID := :old.APPA_ID;
cg$rec.APPA_ID := :old.APPA_ID;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).APPA_ID := :old.APPA_ID;
cg$rec.PARAMETER := :old.PARAMETER;
cg$APPLICATION_PARAMETERS.cg$table(cg$APPLICATION_PARAMETERS.idx).PARAMETER := :old.PARAMETER;
cg$APPLICATION_PARAMETERS.idx := cg$APPLICATION_PARAMETERS.idx + 1;
if not (cg$APPLICATION_PARAMETERS.called_from_package) then
cg$APPLICATION_PARAMETERS.validate_domain_cascade_delete(cg$rec);
cg$APPLICATION_PARAMETERS.del(cg$pk, FALSE);
cg$APPLICATION_PARAMETERS.called_from_package := FALSE;
end if;
-- Application_logic Post-Before-Delete-row <<Start>>
-- Application_logic Post-Before-Delete-row << End >>
END;
/
-- No application logic defined for Trigger cg$ADR_APPLICATION_PARAMETERS, so drop it.
-- To avoid an error if there isn't one, create or replace it, and then drop it
CREATE OR REPLACE TRIGGER cg$ADR_APPLICATION_PARAMETERS
AFTER DELETE ON APPLICATION_PARAMETERS FOR EACH ROW
BEGIN
null;
END;
/
drop trigger cg$ADR_APPLICATION_PARAMETERS
/
PROMPT Creating After Delete Statement Trigger on 'APPLICATION_PARAMETERS'
CREATE OR REPLACE TRIGGER cg$ADS_APPLICATION_PARAMETERS
AFTER DELETE ON APPLICATION_PARAMETERS
DECLARE
idx BINARY_INTEGER := cg$APPLICATION_PARAMETERS.cg$table.FIRST;
cg$rec cg$APPLICATION_PARAMETERS.cg$row_type;
cg$old_rec cg$APPLICATION_PARAMETERS.cg$row_type;
BEGIN
-- Application_logic Pre-After-Delete-statement <<Start>>
-- Application_logic Pre-After-Delete-statement << End >>
IF NOT (cg$APPLICATION_PARAMETERS.called_from_package) THEN
WHILE idx IS NOT NULL LOOP
cg$rec.APPA_ID := cg$APPLICATION_PARAMETERS.cg$table(idx).APPA_ID;
cg$APPLICATION_PARAMETERS.cg$tableind(idx).APPA_ID := TRUE;
cg$rec.PARAMETER := cg$APPLICATION_PARAMETERS.cg$table(idx).PARAMETER;
cg$APPLICATION_PARAMETERS.cg$tableind(idx).PARAMETER := TRUE;
cg$rec.VALUE := cg$APPLICATION_PARAMETERS.cg$table(idx).VALUE;
cg$APPLICATION_PARAMETERS.cg$tableind(idx).VALUE := TRUE;
cg$rec.DESCRIPTION := cg$APPLICATION_PARAMETERS.cg$table(idx).DESCRIPTION;
cg$APPLICATION_PARAMETERS.cg$tableind(idx).DESCRIPTION := TRUE;
cg$APPLICATION_PARAMETERS.validate_foreign_keys_del(cg$rec);
cg$APPLICATION_PARAMETERS.upd_oper_denorm2( cg$rec,
cg$old_rec,
cg$APPLICATION_PARAMETERS.cg$tableind(idx),
'DEL'
);
cg$APPLICATION_PARAMETERS.cascade_delete(cg$rec);
cg$APPLICATION_PARAMETERS.domain_cascade_delete(cg$rec);
idx := cg$APPLICATION_PARAMETERS.cg$table.NEXT(idx);
END LOOP;
END IF;
-- Application_logic Post-After-Delete-statement <<Start>>
-- Application_logic Post-After-Delete-statement << End >>
END;
/

View File

@@ -0,0 +1,956 @@
PROMPT Creating API Package Body for Table 'NOM_WINDOW_CONTRACTS'
--------------------------------------------------------------------------------
-- Name: cg$NOM_WINDOW_CONTRACTS
-- Description: NOM_WINDOW_CONTRACTS table API package definitions
--------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY cg$NOM_WINDOW_CONTRACTS IS
PROCEDURE validate_mandatory(cg$val_rec IN cg$row_type,
loc IN VARCHAR2 DEFAULT '');
PROCEDURE up_autogen_columns(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
operation IN VARCHAR2 DEFAULT 'INS',
do_denorm IN BOOLEAN DEFAULT TRUE);
PROCEDURE err_msg(msg IN VARCHAR2,
type IN INTEGER,
loc IN VARCHAR2 DEFAULT '');
--------------------------------------------------------------------------------
-- Name: raise_uk_not_updateable
--
-- Description: Raise appropriate error when unique key updated
--
-- Parameters: none
--------------------------------------------------------------------------------
PROCEDURE raise_uk_not_updateable(uk IN VARCHAR2) IS
BEGIN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_UNIQUE_KEY_UPDATE, cg$errors.ERR_UK_UPDATE, uk),
'E',
'API',
cg$errors.API_UNIQUE_KEY_UPDATE,
'cg$NOM_WINDOW_CONTRACTS.raise_uk_not_updateable');
cg$errors.raise_failure;
END raise_uk_not_updateable;
--------------------------------------------------------------------------------
-- Name: raise_fk_not_transferable
--
-- Description: Raise appropriate error when foreign key updated
--
-- Parameters: none
--------------------------------------------------------------------------------
PROCEDURE raise_fk_not_transferable(fk IN VARCHAR2) IS
BEGIN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_FOREIGN_KEY_TRANS, cg$errors.ERR_FK_TRANS, fk),
'E',
'API',
cg$errors.API_FOREIGN_KEY_TRANS,
'cg$NOM_WINDOW_CONTRACTS.raise_fk_not_transferable');
cg$errors.raise_failure;
END raise_fk_not_transferable;
--------------------------------------------------------------------------------
-- Name: up_autogen_columns
--
-- Description: Specific autogeneration of column values and conversion to
-- uppercase
--
-- Parameters: cg$rec Record of row to be manipulated
-- cg$ind Indicators for row
-- operation Procedure where this procedure was called
--------------------------------------------------------------------------------
PROCEDURE up_autogen_columns(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
operation IN VARCHAR2 DEFAULT 'INS',
do_denorm IN BOOLEAN DEFAULT TRUE) IS
BEGIN
IF (operation = 'INS') THEN
BEGIN
IF (cg$ind.NOWC_ID = FALSE
OR cg$rec.NOWC_ID is NULL) THEN
SELECT NOWC_SEQ.nextval
INTO cg$rec.NOWC_ID
FROM DUAL;
cg$ind.NOWC_ID := TRUE;
END IF;
EXCEPTION WHEN others THEN
cg$errors.push(SQLERRM, 'E', 'ORA', SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.up_autogen.NOWC_ID.OTHERS');
cg$errors.raise_failure;
END;
NULL;
ELSE -- (operation = 'UPD')
NULL;
END IF; -- (operation = 'INS') ELSE (operation = 'UPD')
-- Statements executed for both 'INS' and 'UPD'
EXCEPTION
WHEN no_data_found THEN
NULL;
WHEN others THEN
cg$errors.push( SQLERRM, 'E', 'ORA', SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.up_autogen_columns');
cg$errors.raise_failure;
END up_autogen_columns;
--------------------------------------------------------------------------------
-- Name: validate_mandatory
--
-- Description: Checks all mandatory columns are not null and raises appropriate
-- error if not satisfied
--
-- Parameters: cg$val_rec Record of row to be checked
-- loc Place where this procedure was called for error
-- trapping
--------------------------------------------------------------------------------
PROCEDURE validate_mandatory(cg$val_rec IN cg$row_type,
loc IN VARCHAR2 DEFAULT '') IS
BEGIN
IF (cg$val_rec.CONT_ID IS NULL) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_MAND_COLUMN_ISNULL, cg$errors.VAL_MAND, P1CONT_ID),
'E',
'API',
cg$errors.API_MAND_COLUMN_ISNULL,
loc);
END IF;
IF (cg$val_rec.NOWI_ID IS NULL) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_MAND_COLUMN_ISNULL, cg$errors.VAL_MAND, P2NOWI_ID),
'E',
'API',
cg$errors.API_MAND_COLUMN_ISNULL,
loc);
END IF;
IF (cg$val_rec.NOWC_ID IS NULL) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_MAND_COLUMN_ISNULL, cg$errors.VAL_MAND, P3NOWC_ID),
'E',
'API',
cg$errors.API_MAND_COLUMN_ISNULL,
loc);
END IF;
NULL;
END validate_mandatory;
--------------------------------------------------------------------------------
-- Name: validate_foreign_keys
--
-- Description: Checks all mandatory columns are not null and raises appropriate
-- error if not satisfied
--
-- Parameters: cg$rec Record of row to be checked
--------------------------------------------------------------------------------
PROCEDURE validate_foreign_keys_ins(cg$rec IN cg$row_type) IS
fk_check INTEGER;
BEGIN
NULL;
END;
PROCEDURE validate_foreign_keys_upd( cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type) IS
fk_check INTEGER;
BEGIN
NULL;
END;
PROCEDURE validate_foreign_keys_del(cg$rec IN cg$row_type) IS
fk_check INTEGER;
BEGIN
NULL;
END;
--------------------------------------------------------------------------------
-- Name: slct
--
-- Description: Selects into the given parameter all the attributes for the row
-- given by the primary key
--
-- Parameters: cg$sel_rec Record of row to be selected into using its PK
--------------------------------------------------------------------------------
PROCEDURE slct(cg$sel_rec IN OUT cg$row_type) IS
BEGIN
IF cg$sel_rec.the_rowid is null THEN
SELECT CONT_ID
, NOWI_ID
, NOWC_ID
, rowid
INTO cg$sel_rec.CONT_ID
, cg$sel_rec.NOWI_ID
, cg$sel_rec.NOWC_ID
,cg$sel_rec.the_rowid
FROM NOM_WINDOW_CONTRACTS
WHERE NOWC_ID = cg$sel_rec.NOWC_ID;
ELSE
SELECT CONT_ID
, NOWI_ID
, NOWC_ID
, rowid
INTO cg$sel_rec.CONT_ID
, cg$sel_rec.NOWI_ID
, cg$sel_rec.NOWC_ID
,cg$sel_rec.the_rowid
FROM NOM_WINDOW_CONTRACTS
WHERE rowid = cg$sel_rec.the_rowid;
END IF;
EXCEPTION WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.slct.others');
cg$errors.raise_failure;
END slct;
--------------------------------------------------------------------------------
-- Name: cascade_update
--
-- Description: Updates all child tables affected by a change to NOM_WINDOW_CONTRACTS
--
-- Parameters: cg$rec Record of NOM_WINDOW_CONTRACTS current values
-- cg$old_rec Record of NOM_WINDOW_CONTRACTS previous values
--------------------------------------------------------------------------------
PROCEDURE cascade_update(cg$new_rec IN OUT cg$row_type,
cg$old_rec IN cg$row_type) IS
BEGIN
NULL;
END cascade_update;
--------------------------------------------------------------------------------
-- Name: validate_domain_cascade_update
--
-- Description: Implement the Domain Key Constraint Cascade Updates Resticts rule
-- of each child table that references this tableNOM_WINDOW_CONTRACTS
--
-- Parameters: cg$old_rec Record of NOM_WINDOW_CONTRACTS current values
--------------------------------------------------------------------------------
PROCEDURE validate_domain_cascade_update( cg$old_rec IN cg$row_type ) IS
dk_check INTEGER;
BEGIN
NULL;
END validate_domain_cascade_update;
-----------------------------------------------------------------------------------------
-- Name: domain_cascade_update
--
-- Description: Implement the Domain Key Constraint Cascade Updates rules of each
-- child table that references this table NOM_WINDOW_CONTRACTS
--
-- Parameters: cg$new_rec New values for NOM_WINDOW_CONTRACTS's domain key constraint columns
-- cg$new_ind Indicates changed NOM_WINDOW_CONTRACTS's domain key constraint columns
-- cg$old_rec Current values for NOM_WINDOW_CONTRACTS's domain key constraint columns
-----------------------------------------------------------------------------------------
PROCEDURE domain_cascade_update(cg$new_rec IN OUT cg$row_type,
cg$new_ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type) IS
BEGIN
NULL;
END domain_cascade_update;
--------------------------------------------------------------------------------
-- Name: cascade_delete
--
-- Description: Delete all child tables affected by a delete to NOM_WINDOW_CONTRACTS
--
-- Parameters: cg$rec Record of NOM_WINDOW_CONTRACTS current values
--------------------------------------------------------------------------------
PROCEDURE cascade_delete(cg$old_rec IN OUT cg$row_type)
IS
BEGIN
NULL;
END cascade_delete;
--------------------------------------------------------------------------------
-- Name: domain_cascade_delete
--
-- Description: Implement the Domain Key Constraint Cascade Delete rules of each
-- child table that references this tableNOM_WINDOW_CONTRACTS
--
-- Parameters: cg$old_rec Record of NOM_WINDOW_CONTRACTS current values
--------------------------------------------------------------------------------
PROCEDURE domain_cascade_delete( cg$old_rec IN cg$row_type )
IS
BEGIN
NULL;
END domain_cascade_delete;
--------------------------------------------------------------------------------
-- Name: validate_domain_cascade_delete
--
-- Description: Implement the Domain Key Constraint Cascade Delete Restricts rule
-- of each child table that references this tableNOM_WINDOW_CONTRACTS
--
-- Parameters: cg$old_rec Record of NOM_WINDOW_CONTRACTS current values
--------------------------------------------------------------------------------
PROCEDURE validate_domain_cascade_delete(cg$old_rec IN cg$row_type)
IS
dk_check INTEGER;
BEGIN
NULL;
END validate_domain_cascade_delete;
--------------------------------------------------------------------------------
-- Name: validate_arc
--
-- Description: Checks for adherence to arc relationship
--
-- Parameters: cg$rec Record of NOM_WINDOW_CONTRACTS current values
--------------------------------------------------------------------------------
PROCEDURE validate_arc(cg$rec IN OUT cg$row_type) IS
i NUMBER;
BEGIN
NULL;
END validate_arc;
--------------------------------------------------------------------------------
-- Name: validate_domain
--
-- Description: Checks against reference table for values lying in a domain
--
-- Parameters: cg$rec Record of NOM_WINDOW_CONTRACTS current values
--------------------------------------------------------------------------------
PROCEDURE validate_domain(cg$rec IN OUT cg$row_type,
cg$ind IN cg$ind_type DEFAULT cg$ind_true)
IS
dummy NUMBER;
found BOOLEAN;
no_tabview EXCEPTION;
PRAGMA EXCEPTION_INIT(no_tabview, -942);
BEGIN
NULL;
EXCEPTION
WHEN cg$errors.cg$error THEN
cg$errors.raise_failure;
WHEN no_tabview THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_RV_TAB_NOT_FOUND,
cg$errors.APIMSG_RV_TAB_NOT_FOUND,
'CG_REF_CODES','NOM_WINDOW_CONTRACTS'),
'E',
'API',
cg$errors.API_RV_TAB_NOT_FOUND,
'cg$NOM_WINDOW_CONTRACTS.v_domain.no_reftable_found');
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.v_domain.others');
cg$errors.raise_failure;
END validate_domain;
--------------------------------------------------------------------------------
-- Name: err_msg
--
-- Description: Pushes onto stack appropriate user defined error message
-- depending on the rule violated
--
-- Parameters: msg Oracle error message
-- type Type of violation e.g. check_constraint: ERR_CHECK_CON
-- loc Place where this procedure was called for error
-- trapping
--------------------------------------------------------------------------------
PROCEDURE err_msg(msg IN VARCHAR2,
type IN INTEGER,
loc IN VARCHAR2 DEFAULT '') IS
con_name VARCHAR2(240);
BEGIN
con_name := cg$errors.parse_constraint(msg, type);
IF (con_name = 'NOWC_PK') THEN
cg$errors.push(nvl(NOWC_PK
,cg$errors.MsgGetText(cg$errors.API_PK_CON_VIOLATED
,cg$errors.APIMSG_PK_VIOLAT
,'NOWC_PK'
,'NOM_WINDOW_CONTRACTS')),
'E',
'API',
cg$errors.API_PK_CON_VIOLATED,
loc);
ELSIF (con_name = 'NOWC_CUST_FK') THEN
cg$errors.push(nvl(NOWC_CUST_FK
,cg$errors.MsgGetText(cg$errors.API_FK_CON_VIOLATED
,cg$errors.APIMSG_FK_VIOLAT
,'NOWC_CUST_FK'
,'NOM_WINDOW_CONTRACTS')),
'E',
'API',
cg$errors.API_FK_CON_VIOLATED,
loc);
ELSIF (con_name = 'NOWC_NOWI_FK') THEN
cg$errors.push(nvl(NOWC_NOWI_FK
,cg$errors.MsgGetText(cg$errors.API_FK_CON_VIOLATED
,cg$errors.APIMSG_FK_VIOLAT
,'NOWC_NOWI_FK'
,'NOM_WINDOW_CONTRACTS')),
'E',
'API',
cg$errors.API_FK_CON_VIOLATED,
loc);
ELSE
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
loc);
END IF;
END err_msg;
--------------------------------------------------------------------------------
-- Name: doLobs
--
-- Description: This function is updating lob columns
--
-- Parameters: cg$rec Record of row to be inserted
-- cg$ind Record of columns specifically set
--------------------------------------------------------------------------------
PROCEDURE doLobs(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type) IS
BEGIN
NULL;
END doLobs;
--------------------------------------------------------------------------------
-- Name: ins
--
-- Description: API insert procedure
--
-- Parameters: cg$rec Record of row to be inserted
-- cg$ind Record of columns specifically set
-- do_ins Whether we want the actual INSERT to occur
--------------------------------------------------------------------------------
PROCEDURE ins(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_ins IN BOOLEAN DEFAULT TRUE) IS
cg$tmp_rec cg$row_type;
-- Constant default values
BEGIN
-- Application_logic Pre-Insert <<Start>>
-- Application_logic Pre-Insert << End >>
-- Defaulted
-- Auto-generated and uppercased columns
up_autogen_columns(cg$rec, cg$ind, 'INS', do_ins);
called_from_package := TRUE;
IF (do_ins) THEN
validate_foreign_keys_ins(cg$rec);
validate_arc(cg$rec);
validate_domain(cg$rec);
INSERT INTO NOM_WINDOW_CONTRACTS
(CONT_ID
,NOWI_ID
,NOWC_ID)
VALUES
(cg$rec.CONT_ID
,cg$rec.NOWI_ID
,cg$rec.NOWC_ID
);
doLobs(cg$rec, cg$ind);
slct(cg$rec);
upd_oper_denorm2(cg$rec, cg$tmp_rec, cg$ind, 'INS');
END IF;
called_from_package := FALSE;
-- Application logic Post-Insert <<Start>>
-- Application logic Post-Insert << End >>
EXCEPTION
WHEN cg$errors.cg$error THEN
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.mandatory_missing THEN
validate_mandatory(cg$rec, 'cg$NOM_WINDOW_CONTRACTS.ins.mandatory_missing');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.check_violation THEN
err_msg(SQLERRM, cg$errors.ERR_CHECK_CON, 'cg$NOM_WINDOW_CONTRACTS.ins.check_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.fk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_FOREIGN_KEY, 'cg$NOM_WINDOW_CONTRACTS.ins.fk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.uk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_UNIQUE_KEY, 'cg$NOM_WINDOW_CONTRACTS.ins.uk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.ins.others');
called_from_package := FALSE;
cg$errors.raise_failure;
END ins;
--------------------------------------------------------------------------------
-- Name: upd
--
-- Description: API update procedure
--
-- Parameters: cg$rec Record of row to be updated
-- cg$ind Record of columns specifically set
-- do_upd Whether we want the actual UPDATE to occur
--------------------------------------------------------------------------------
PROCEDURE upd(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_upd IN BOOLEAN DEFAULT TRUE,
cg$pk IN cg$row_type DEFAULT NULL )
IS
cg$upd_rec cg$row_type;
cg$old_rec cg$row_type;
RECORD_LOGGED BOOLEAN := FALSE;
BEGIN
-- Application_logic Pre-Update <<Start>>
-- Application_logic Pre-Update << End >>
IF ( cg$pk.NOWC_ID IS NULL ) THEN
cg$upd_rec.NOWC_ID := cg$rec.NOWC_ID;
ELSE
cg$upd_rec.NOWC_ID := cg$pk.NOWC_ID;
END IF;
cg$old_rec.NOWC_ID := cg$upd_rec.NOWC_ID;
IF ( cg$pk.the_rowid IS NULL ) THEN
cg$upd_rec.the_rowid := cg$rec.the_rowid;
ELSE
cg$upd_rec.the_rowid := cg$pk.the_rowid;
END IF;
cg$old_rec.the_rowid := cg$upd_rec.the_rowid;
IF ( do_upd ) THEN
slct(cg$upd_rec);
-- Report error if attempt to update non updateable Primary Key NOWC_PK
IF (cg$ind.NOWC_ID AND cg$rec.NOWC_ID != cg$upd_rec.NOWC_ID) THEN
raise_uk_not_updateable('NOWC_PK');
END IF;
IF NOT (cg$ind.CONT_ID) THEN
cg$rec.CONT_ID := cg$upd_rec.CONT_ID;
END IF;
IF NOT (cg$ind.NOWI_ID) THEN
cg$rec.NOWI_ID := cg$upd_rec.NOWI_ID;
END IF;
IF NOT (cg$ind.NOWC_ID) THEN
cg$rec.NOWC_ID := cg$upd_rec.NOWC_ID;
END IF;
ELSE
-- Perform checks if called from a trigger
-- Indicators are only set on changed values
null;
-- Report error if attempt to update non updateable Primary Key NOWC_PK
IF ( cg$ind.NOWC_ID ) THEN
raise_uk_not_updateable('NOWC_PK');
END IF;
END IF;
up_autogen_columns(cg$rec, cg$ind, 'UPD', do_upd); -- Auto-generated and uppercased columns
-- Now do update if updateable columns exist
IF (do_upd) THEN
DECLARE
called_from BOOLEAN := called_from_package;
BEGIN
called_from_package := TRUE;
slct(cg$old_rec);
validate_foreign_keys_upd(cg$rec, cg$old_rec, cg$ind);
validate_arc(cg$rec);
validate_domain(cg$rec, cg$ind);
validate_domain_cascade_update(cg$old_rec);
IF cg$rec.the_rowid is null THEN
UPDATE NOM_WINDOW_CONTRACTS
SET
CONT_ID = cg$rec.CONT_ID
,NOWI_ID = cg$rec.NOWI_ID
WHERE NOWC_ID = cg$rec.NOWC_ID;
null;
ELSE
UPDATE NOM_WINDOW_CONTRACTS
SET
CONT_ID = cg$rec.CONT_ID
,NOWI_ID = cg$rec.NOWI_ID
WHERE rowid = cg$rec.the_rowid;
null;
END IF;
slct(cg$rec);
upd_denorm2(cg$rec, cg$ind);
upd_oper_denorm2(cg$rec, cg$old_rec, cg$ind, 'UPD');
cascade_update(cg$rec, cg$old_rec);
domain_cascade_update(cg$rec, cg$ind, cg$old_rec);
called_from_package := called_from;
END;
END IF;
IF NOT (do_upd) THEN
cg$table(idx).CONT_ID := cg$rec.CONT_ID;
cg$tableind(idx).CONT_ID := cg$ind.CONT_ID;
cg$table(idx).NOWI_ID := cg$rec.NOWI_ID;
cg$tableind(idx).NOWI_ID := cg$ind.NOWI_ID;
cg$table(idx).NOWC_ID := cg$rec.NOWC_ID;
cg$tableind(idx).NOWC_ID := cg$ind.NOWC_ID;
idx := idx + 1;
END IF;
-- Application_logic Post-Update <<Start>>
-- Application_logic Post-Update << End >>
EXCEPTION
WHEN cg$errors.cg$error THEN
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.upd_mandatory_null THEN
validate_mandatory(cg$rec, 'cg$NOM_WINDOW_CONTRACTS.upd.upd_mandatory_null');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.check_violation THEN
err_msg(SQLERRM, cg$errors.ERR_CHECK_CON, 'cg$NOM_WINDOW_CONTRACTS.upd.check_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.fk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_FOREIGN_KEY, 'cg$NOM_WINDOW_CONTRACTS.upd.fk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.uk_violation THEN
err_msg(SQLERRM, cg$errors.ERR_UNIQUE_KEY, 'cg$NOM_WINDOW_CONTRACTS.upd.uk_violation');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.upd.others');
called_from_package := FALSE;
cg$errors.raise_failure;
END upd;
----------------------------------------------------------------------------------------
-- Name: domain_cascade_upd
--
-- Description: Update the Domain Constraint Key columns of NOM_WINDOW_CONTRACTS when the
-- Cascade Update rule is Cascades and the domain table has been
-- updated. Called from <Domain Table pkg>.domain_cascade_update().
--
-- Parameters: cg$rec New values for NOM_WINDOW_CONTRACTS's domain key constraint columns
-- cg$ind Indicates changed NOM_WINDOW_CONTRACTS's domain key constraint columns
-- cg$old_rec Current values for NOM_WINDOW_CONTRACTS's domain key constraint columns
----------------------------------------------------------------------------------------
PROCEDURE domain_cascade_upd( cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type )
IS
called_from BOOLEAN := called_from_package;
BEGIN
null;
END domain_cascade_upd;
--------------------------------------------------------------------------------
-- Name: upd_denorm
--
-- Description: API procedure for simple denormalization
--
-- Parameters: cg$rec Record of row to be updated
-- cg$ind Record of columns specifically set
-- do_upd Whether we want the actual UPDATE to occur
--------------------------------------------------------------------------------
PROCEDURE upd_denorm2( cg$rec IN cg$row_type,
cg$ind IN cg$ind_type ) IS
BEGIN
NULL;
END upd_denorm2;
--------------------------------------------------------------------------------
-- Name: upd_oper_denorm
--
-- Description: API procedure for operation denormalization
--
-- Parameters: cg$rec Record of row to be updated
-- cg$ind Record of columns specifically set
-- do_upd Whether we want the actual UPDATE to occur
--------------------------------------------------------------------------------
PROCEDURE upd_oper_denorm2( cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type,
operation IN VARCHAR2 DEFAULT 'UPD'
)
IS
BEGIN
NULL;
END upd_oper_denorm2;
--------------------------------------------------------------------------------
-- Name: del
--
-- Description: API delete procedure
--
-- Parameters: cg$pk Primary key record of row to be deleted
--------------------------------------------------------------------------------
PROCEDURE del(cg$pk IN cg$pk_type,
do_del IN BOOLEAN DEFAULT TRUE) IS
BEGIN
-- Application_logic Pre-Delete <<Start>>
-- Application_logic Pre-Delete << End >>
-- Delete the record
called_from_package := TRUE;
IF (do_del) THEN
DECLARE
cg$rec cg$row_type;
cg$old_rec cg$row_type;
cg$ind cg$ind_type;
BEGIN
cg$rec.NOWC_ID := cg$pk.NOWC_ID;
slct(cg$rec);
validate_foreign_keys_del(cg$rec);
validate_domain_cascade_delete(cg$rec);
IF cg$pk.the_rowid is null THEN
DELETE NOM_WINDOW_CONTRACTS
WHERE NOWC_ID = cg$pk.NOWC_ID;
ELSE
DELETE NOM_WINDOW_CONTRACTS
WHERE rowid = cg$pk.the_rowid;
END IF;
upd_oper_denorm2(cg$rec, cg$old_rec, cg$ind, 'DEL');
cascade_delete(cg$rec);
domain_cascade_delete(cg$rec);
END;
END IF;
called_from_package := FALSE;
-- Application_logic Post-Delete <<Start>>
-- Application_logic Post-Delete << End >>
EXCEPTION
WHEN cg$errors.cg$error THEN
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN cg$errors.delete_restrict THEN
err_msg(SQLERRM, cg$errors.ERR_DELETE_RESTRICT, 'cg$NOM_WINDOW_CONTRACTS.del.delete_restrict');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN no_data_found THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_DEL, cg$errors.ROW_DEL),
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.del.no_data_found');
called_from_package := FALSE;
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.del.others');
called_from_package := FALSE;
cg$errors.raise_failure;
END del;
--------------------------------------------------------------------------------
-- Name: lck
--
-- Description: API lock procedure
--
-- Parameters: cg$old_rec Calling apps view of record of row to be locked
-- cg$old_ind Record of columns to raise error if modified
-- nowait_flag TRUE lock with NOWAIT, FALSE don't fail if busy
--------------------------------------------------------------------------------
PROCEDURE lck(cg$old_rec IN cg$row_type,
cg$old_ind IN cg$ind_type,
nowait_flag IN BOOLEAN DEFAULT TRUE) IS
cg$tmp_rec cg$row_type;
any_modified BOOLEAN := FALSE;
BEGIN
-- Application_logic Pre-Lock <<Start>>
-- Application_logic Pre-Lock << End >>
-- Do the row lock
BEGIN
IF (nowait_flag) THEN
IF cg$old_rec.the_rowid is null THEN
SELECT CONT_ID
, NOWI_ID
, NOWC_ID
INTO cg$tmp_rec.CONT_ID
, cg$tmp_rec.NOWI_ID
, cg$tmp_rec.NOWC_ID
FROM NOM_WINDOW_CONTRACTS
WHERE NOWC_ID = cg$old_rec.NOWC_ID
FOR UPDATE NOWAIT;
ELSE
SELECT CONT_ID
, NOWI_ID
, NOWC_ID
INTO cg$tmp_rec.CONT_ID
, cg$tmp_rec.NOWI_ID
, cg$tmp_rec.NOWC_ID
FROM NOM_WINDOW_CONTRACTS
WHERE rowid = cg$old_rec.the_rowid
FOR UPDATE NOWAIT;
END IF;
ELSE
IF cg$old_rec.the_rowid is null THEN
SELECT CONT_ID
, NOWI_ID
, NOWC_ID
INTO cg$tmp_rec.CONT_ID
, cg$tmp_rec.NOWI_ID
, cg$tmp_rec.NOWC_ID
FROM NOM_WINDOW_CONTRACTS
WHERE NOWC_ID = cg$old_rec.NOWC_ID
FOR UPDATE;
ELSE
SELECT CONT_ID
, NOWI_ID
, NOWC_ID
INTO cg$tmp_rec.CONT_ID
, cg$tmp_rec.NOWI_ID
, cg$tmp_rec.NOWC_ID
FROM NOM_WINDOW_CONTRACTS
WHERE rowid = cg$old_rec.the_rowid
FOR UPDATE;
END IF;
END IF;
EXCEPTION
WHEN cg$errors.cg$error THEN
cg$errors.raise_failure;
WHEN cg$errors.resource_busy THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_LCK, cg$errors.ROW_LCK),
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.lck.resource_busy');
cg$errors.raise_failure;
WHEN no_data_found THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_DEL, cg$errors.ROW_DEL),
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.lck.no_data_found');
cg$errors.raise_failure;
WHEN OTHERS THEN
cg$errors.push(SQLERRM,
'E',
'ORA',
SQLCODE,
'cg$NOM_WINDOW_CONTRACTS.lck.others');
cg$errors.raise_failure;
END;
-- Optional Columns
-- Mandatory Columns
IF (cg$old_ind.CONT_ID) THEN
IF (cg$tmp_rec.CONT_ID != cg$old_rec.CONT_ID) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P1CONT_ID
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$NOM_WINDOW_CONTRACTS.lck');
any_modified := TRUE;
END IF;
END IF;
IF (cg$old_ind.NOWI_ID) THEN
IF (cg$tmp_rec.NOWI_ID != cg$old_rec.NOWI_ID) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P2NOWI_ID
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$NOM_WINDOW_CONTRACTS.lck');
any_modified := TRUE;
END IF;
END IF;
IF (cg$old_ind.NOWC_ID) THEN
IF (cg$tmp_rec.NOWC_ID != cg$old_rec.NOWC_ID) THEN
cg$errors.push(cg$errors.MsgGetText(cg$errors.API_ROW_MOD, cg$errors.ROW_MOD, P3NOWC_ID
),'E', 'API', CG$ERRORS.API_MODIFIED, 'cg$NOM_WINDOW_CONTRACTS.lck');
any_modified := TRUE;
END IF;
END IF;
IF (any_modified) THEN
cg$errors.raise_failure;
END IF;
-- Application_logic Post-Lock <<Start>>
-- Application_logic Post-Lock << End >>
END lck;
BEGIN
cg$ind_true.CONT_ID := TRUE;
cg$ind_true.NOWI_ID := TRUE;
cg$ind_true.NOWC_ID := TRUE;
END cg$NOM_WINDOW_CONTRACTS;
/

View File

@@ -0,0 +1,107 @@
PROMPT Creating API Package Specification for Table 'NOM_WINDOW_CONTRACTS'
--------------------------------------------------------------------------------
-- Name: cg$NOM_WINDOW_CONTRACTS
-- Description: NOM_WINDOW_CONTRACTS table API package declarations
--------------------------------------------------------------------------------
CREATE OR REPLACE PACKAGE cg$NOM_WINDOW_CONTRACTS IS
called_from_package BOOLEAN := FALSE;
-- Repository User-Defined Error Messages
NOWC_PK CONSTANT VARCHAR2(240) := '';
NOWC_CUST_FK CONSTANT VARCHAR2(240) := '';
NOWC_NOWI_FK CONSTANT VARCHAR2(240) := '';
-- Column default prompts. Format PSEQNO_COL
P1CONT_ID CONSTANT VARCHAR2(240) := 'Cust Id';
P2NOWI_ID CONSTANT VARCHAR2(240) := 'Nowi Id';
P3NOWC_ID CONSTANT VARCHAR2(240) := 'Nowc Id';
cg$row NOM_WINDOW_CONTRACTS%ROWTYPE;
-- NOM_WINDOW_CONTRACTS row type variable
TYPE cg$row_type IS RECORD
(CONT_ID cg$row.CONT_ID%TYPE
,NOWI_ID cg$row.NOWI_ID%TYPE
,NOWC_ID cg$row.NOWC_ID%TYPE
,the_rowid ROWID)
;
-- NOM_WINDOW_CONTRACTS indicator type variable
TYPE cg$ind_type IS RECORD
(CONT_ID BOOLEAN DEFAULT FALSE
,NOWI_ID BOOLEAN DEFAULT FALSE
,NOWC_ID BOOLEAN DEFAULT FALSE);
cg$ind_true cg$ind_type;
-- NOM_WINDOW_CONTRACTS primary key type variable
TYPE cg$pk_type IS RECORD
(NOWC_ID cg$row.NOWC_ID%TYPE
,the_rowid ROWID)
;
-- PL/SQL Table Type variable for triggers
TYPE cg$table_type IS TABLE OF NOM_WINDOW_CONTRACTS%ROWTYPE
INDEX BY BINARY_INTEGER;
cg$table cg$table_type;
TYPE cg$tableind_type IS TABLE OF cg$ind_type
INDEX BY BINARY_INTEGER;
cg$tableind cg$tableind_type;
idx BINARY_INTEGER := 1;
PROCEDURE ins(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_ins IN BOOLEAN DEFAULT TRUE
);
PROCEDURE upd(cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
do_upd IN BOOLEAN DEFAULT TRUE,
cg$pk IN cg$row_type DEFAULT NULL
);
PROCEDURE del(cg$pk IN cg$pk_type,
do_del IN BOOLEAN DEFAULT TRUE
);
PROCEDURE lck(cg$old_rec IN cg$row_type,
cg$old_ind IN cg$ind_type,
nowait_flag IN BOOLEAN DEFAULT TRUE
);
PROCEDURE slct(cg$sel_rec IN OUT cg$row_type);
PROCEDURE validate_arc(cg$rec IN OUT cg$row_type);
PROCEDURE validate_domain(cg$rec IN OUT cg$row_type,
cg$ind IN cg$ind_type DEFAULT cg$ind_true);
PROCEDURE validate_foreign_keys_ins(cg$rec IN cg$row_type);
PROCEDURE validate_foreign_keys_upd(cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type);
PROCEDURE validate_foreign_keys_del(cg$rec IN cg$row_type);
PROCEDURE validate_domain_cascade_delete(cg$old_rec IN cg$row_type);
PROCEDURE validate_domain_cascade_update(cg$old_rec IN cg$row_type);
PROCEDURE cascade_update(cg$new_rec IN OUT cg$row_type,
cg$old_rec IN cg$row_type );
PROCEDURE domain_cascade_update(cg$new_rec IN OUT cg$row_type,
cg$new_ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type);
PROCEDURE domain_cascade_upd( cg$rec IN OUT cg$row_type,
cg$ind IN OUT cg$ind_type,
cg$old_rec IN cg$row_type);
PROCEDURE cascade_delete(cg$old_rec IN OUT cg$row_type);
PROCEDURE domain_cascade_delete(cg$old_rec IN cg$row_type);
PROCEDURE upd_denorm2( cg$rec IN cg$row_type,
cg$ind IN cg$ind_type );
PROCEDURE upd_oper_denorm2( cg$rec IN cg$row_type,
cg$old_rec IN cg$row_type,
cg$ind IN cg$ind_type,
operation IN VARCHAR2 DEFAULT 'UPD' );
END cg$NOM_WINDOW_CONTRACTS;
/

View File

@@ -0,0 +1,356 @@
PROMPT Creating Trigger Logic for Table 'NOM_WINDOW_CONTRACTS'
PROMPT Creating Before Insert Statement Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$BIS_NOM_WINDOW_CONTRACTS
BEFORE INSERT ON NOM_WINDOW_CONTRACTS
BEGIN
-- Application_logic Pre-Before-Insert-statement <<Start>>
-- Application_logic Pre-Before-Insert-statement << End >>
cg$NOM_WINDOW_CONTRACTS.cg$table.DELETE;
cg$NOM_WINDOW_CONTRACTS.cg$tableind.DELETE;
cg$NOM_WINDOW_CONTRACTS.idx := 1;
-- Application_logic Post-Before-Insert-statement <<Start>>
-- Application_logic Post-Before-Insert-statement << End >>
END;
/
PROMPT Creating Before Insert Row Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$BIR_NOM_WINDOW_CONTRACTS
BEFORE INSERT ON NOM_WINDOW_CONTRACTS FOR EACH ROW
DECLARE
cg$rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
cg$ind cg$NOM_WINDOW_CONTRACTS.cg$ind_type;
BEGIN
-- Application_logic Pre-Before-Insert-row <<Start>>
-- Application_logic Pre-Before-Insert-row << End >>
-- Load cg$rec/cg$ind values from new
cg$rec.CONT_ID := :new.CONT_ID;
cg$ind.CONT_ID := TRUE;
cg$rec.NOWI_ID := :new.NOWI_ID;
cg$ind.NOWI_ID := TRUE;
cg$rec.NOWC_ID := :new.NOWC_ID;
cg$ind.NOWC_ID := TRUE;
if not (cg$NOM_WINDOW_CONTRACTS.called_from_package) then
cg$NOM_WINDOW_CONTRACTS.validate_arc(cg$rec);
cg$NOM_WINDOW_CONTRACTS.validate_domain(cg$rec);
cg$NOM_WINDOW_CONTRACTS.ins(cg$rec, cg$ind, FALSE);
cg$NOM_WINDOW_CONTRACTS.called_from_package := FALSE;
end if;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).CONT_ID := cg$rec.CONT_ID;
cg$NOM_WINDOW_CONTRACTS.cg$tableind(cg$NOM_WINDOW_CONTRACTS.idx).CONT_ID := cg$ind.CONT_ID;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).NOWI_ID := cg$rec.NOWI_ID;
cg$NOM_WINDOW_CONTRACTS.cg$tableind(cg$NOM_WINDOW_CONTRACTS.idx).NOWI_ID := cg$ind.NOWI_ID;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).NOWC_ID := cg$rec.NOWC_ID;
cg$NOM_WINDOW_CONTRACTS.cg$tableind(cg$NOM_WINDOW_CONTRACTS.idx).NOWC_ID := cg$ind.NOWC_ID;
cg$NOM_WINDOW_CONTRACTS.idx := cg$NOM_WINDOW_CONTRACTS.idx + 1;
:new.CONT_ID := cg$rec.CONT_ID;
:new.NOWI_ID := cg$rec.NOWI_ID;
:new.NOWC_ID := cg$rec.NOWC_ID;
-- Application_logic Post-Before-Insert-row <<Start>>
-- Application_logic Post-Before-Insert-row << End >>
END;
/
-- No application logic defined for Trigger cg$AIR_NOM_WINDOW_CONTRACTS, so drop it.
-- To avoid an error if there isn't one, create or replace it, and then drop it
CREATE OR REPLACE TRIGGER cg$AIR_NOM_WINDOW_CONTRACTS
AFTER INSERT ON NOM_WINDOW_CONTRACTS FOR EACH ROW
BEGIN
null;
END;
/
drop trigger cg$AIR_NOM_WINDOW_CONTRACTS
/
PROMPT Creating After Insert Statement Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$AIS_NOM_WINDOW_CONTRACTS
AFTER INSERT ON NOM_WINDOW_CONTRACTS
DECLARE
idx BINARY_INTEGER := cg$NOM_WINDOW_CONTRACTS.cg$table.FIRST;
cg$rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
cg$old_rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
fk_check INTEGER;
BEGIN
-- Application_logic Pre-After-Insert-statement <<Start>>
-- Application_logic Pre-After-Insert-statement << End >>
IF NOT (cg$NOM_WINDOW_CONTRACTS.called_from_package) THEN
WHILE idx IS NOT NULL LOOP
cg$rec.CONT_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).CONT_ID;
cg$rec.NOWI_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWI_ID;
cg$rec.NOWC_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWC_ID;
cg$NOM_WINDOW_CONTRACTS.validate_foreign_keys_ins(cg$rec);
cg$NOM_WINDOW_CONTRACTS.upd_oper_denorm2( cg$rec,
cg$old_rec,
cg$NOM_WINDOW_CONTRACTS.cg$tableind(idx),
'INS'
);
idx := cg$NOM_WINDOW_CONTRACTS.cg$table.NEXT(idx);
END LOOP;
END IF;
-- Application_logic Post-After-Insert-statement <<Start>>
-- Application_logic Post-After-Insert-statement << End >>
END;
/
PROMPT Creating Before Update Statement Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$BUS_NOM_WINDOW_CONTRACTS
BEFORE UPDATE ON NOM_WINDOW_CONTRACTS
BEGIN
-- Application_logic Pre-Before-Update-statement <<Start>>
-- Application_logic Pre-Before-Update-statement << End >>
cg$NOM_WINDOW_CONTRACTS.cg$table.DELETE;
cg$NOM_WINDOW_CONTRACTS.cg$tableind.DELETE;
cg$NOM_WINDOW_CONTRACTS.idx := 1;
-- Application_logic Post-Before-Update-statement <<Start>>
-- Application_logic Post-Before-Update-statement << End >>
END;
/
PROMPT Creating Before Update Row Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$BUR_NOM_WINDOW_CONTRACTS
BEFORE UPDATE ON NOM_WINDOW_CONTRACTS FOR EACH ROW
DECLARE
cg$rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
cg$ind cg$NOM_WINDOW_CONTRACTS.cg$ind_type;
cg$old_rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
BEGIN
-- Application_logic Pre-Before-Update-row <<Start>>
-- Application_logic Pre-Before-Update-row << End >>
-- Load cg$rec/cg$ind values from new
cg$rec.CONT_ID := :new.CONT_ID;
cg$ind.CONT_ID := (:new.CONT_ID IS NULL AND :old.CONT_ID IS NOT NULL )
OR (:new.CONT_ID IS NOT NULL AND :old.CONT_ID IS NULL)
OR NOT(:new.CONT_ID = :old.CONT_ID) ;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).CONT_ID := :old.CONT_ID;
cg$rec.NOWI_ID := :new.NOWI_ID;
cg$ind.NOWI_ID := (:new.NOWI_ID IS NULL AND :old.NOWI_ID IS NOT NULL )
OR (:new.NOWI_ID IS NOT NULL AND :old.NOWI_ID IS NULL)
OR NOT(:new.NOWI_ID = :old.NOWI_ID) ;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).NOWI_ID := :old.NOWI_ID;
cg$rec.NOWC_ID := :new.NOWC_ID;
cg$ind.NOWC_ID := (:new.NOWC_ID IS NULL AND :old.NOWC_ID IS NOT NULL )
OR (:new.NOWC_ID IS NOT NULL AND :old.NOWC_ID IS NULL)
OR NOT(:new.NOWC_ID = :old.NOWC_ID) ;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).NOWC_ID := :old.NOWC_ID;
cg$NOM_WINDOW_CONTRACTS.idx := cg$NOM_WINDOW_CONTRACTS.idx + 1;
if not (cg$NOM_WINDOW_CONTRACTS.called_from_package) then
cg$NOM_WINDOW_CONTRACTS.validate_arc(cg$rec);
cg$NOM_WINDOW_CONTRACTS.validate_domain(cg$rec, cg$ind);
cg$NOM_WINDOW_CONTRACTS.validate_domain_cascade_update(cg$old_rec);
cg$NOM_WINDOW_CONTRACTS.upd(cg$rec, cg$ind, FALSE);
cg$NOM_WINDOW_CONTRACTS.called_from_package := FALSE;
end if;
:new.CONT_ID := cg$rec.CONT_ID;
:new.NOWI_ID := cg$rec.NOWI_ID;
-- Application_logic Post-Before-Update-row <<Start>>
-- Application_logic Post-Before-Update-row << End >>
END;
/
-- No application logic defined for Trigger cg$AUR_NOM_WINDOW_CONTRACTS, so drop it.
-- To avoid an error if there isn't one, create or replace it, and then drop it
CREATE OR REPLACE TRIGGER cg$AUR_NOM_WINDOW_CONTRACTS
AFTER UPDATE ON NOM_WINDOW_CONTRACTS FOR EACH ROW
BEGIN
null;
END;
/
drop trigger cg$AUR_NOM_WINDOW_CONTRACTS
/
PROMPT Creating After Update Statement Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$AUS_NOM_WINDOW_CONTRACTS
AFTER UPDATE ON NOM_WINDOW_CONTRACTS
DECLARE
idx BINARY_INTEGER := cg$NOM_WINDOW_CONTRACTS.cg$table.FIRST;
cg$old_rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
cg$rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
cg$ind cg$NOM_WINDOW_CONTRACTS.cg$ind_type;
BEGIN
-- Application_logic Pre-After-Update-statement <<Start>>
-- Application_logic Pre-After-Update-statement << End >>
WHILE idx IS NOT NULL LOOP
cg$old_rec.CONT_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).CONT_ID;
cg$old_rec.NOWI_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWI_ID;
cg$old_rec.NOWC_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWC_ID;
IF NOT (cg$NOM_WINDOW_CONTRACTS.called_from_package) THEN
idx := cg$NOM_WINDOW_CONTRACTS.cg$table.NEXT(idx);
cg$rec.CONT_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).CONT_ID;
cg$ind.CONT_ID := updating('CONT_ID');
cg$rec.NOWI_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWI_ID;
cg$ind.NOWI_ID := updating('NOWI_ID');
cg$rec.NOWC_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWC_ID;
cg$ind.NOWC_ID := updating('NOWC_ID');
cg$NOM_WINDOW_CONTRACTS.validate_foreign_keys_upd(cg$rec, cg$old_rec, cg$ind);
cg$NOM_WINDOW_CONTRACTS.upd_denorm2( cg$rec,
cg$NOM_WINDOW_CONTRACTS.cg$tableind(idx)
);
cg$NOM_WINDOW_CONTRACTS.upd_oper_denorm2( cg$rec,
cg$old_rec,
cg$NOM_WINDOW_CONTRACTS.cg$tableind(idx)
);
cg$NOM_WINDOW_CONTRACTS.cascade_update(cg$rec, cg$old_rec);
cg$NOM_WINDOW_CONTRACTS.domain_cascade_update(cg$rec, cg$ind, cg$old_rec);
cg$NOM_WINDOW_CONTRACTS.called_from_package := FALSE;
END IF;
idx := cg$NOM_WINDOW_CONTRACTS.cg$table.NEXT(idx);
END LOOP;
cg$NOM_WINDOW_CONTRACTS.cg$table.DELETE;
-- Application_logic Post-After-Update-statement <<Start>>
-- Application_logic Post-After-Update-statement << End >>
END;
/
PROMPT Creating Before Delete Statement Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$BDS_NOM_WINDOW_CONTRACTS
BEFORE DELETE ON NOM_WINDOW_CONTRACTS
BEGIN
-- Application_logic Pre-Before-Delete-statement <<Start>>
-- Application_logic Pre-Before-Delete-statement << End >>
cg$NOM_WINDOW_CONTRACTS.cg$table.DELETE;
cg$NOM_WINDOW_CONTRACTS.cg$tableind.DELETE;
cg$NOM_WINDOW_CONTRACTS.idx := 1;
-- Application_logic Post-Before-Delete-statement <<Start>>
-- Application_logic Post-Before-Delete-statement << End >>
END;
/
PROMPT Creating Before Delete Row Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$BDR_NOM_WINDOW_CONTRACTS
BEFORE DELETE ON NOM_WINDOW_CONTRACTS FOR EACH ROW
DECLARE
cg$pk cg$NOM_WINDOW_CONTRACTS.cg$pk_type;
cg$rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
cg$ind cg$NOM_WINDOW_CONTRACTS.cg$ind_type;
BEGIN
-- Application_logic Pre-Before-Delete-row <<Start>>
-- Application_logic Pre-Before-Delete-row << End >>
-- Load cg$rec/cg$ind values from new
cg$pk.NOWC_ID := :old.NOWC_ID;
cg$rec.NOWC_ID := :old.NOWC_ID;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).NOWC_ID := :old.NOWC_ID;
cg$rec.CONT_ID := :old.CONT_ID;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).CONT_ID := :old.CONT_ID;
cg$rec.NOWI_ID := :old.NOWI_ID;
cg$NOM_WINDOW_CONTRACTS.cg$table(cg$NOM_WINDOW_CONTRACTS.idx).NOWI_ID := :old.NOWI_ID;
cg$NOM_WINDOW_CONTRACTS.idx := cg$NOM_WINDOW_CONTRACTS.idx + 1;
if not (cg$NOM_WINDOW_CONTRACTS.called_from_package) then
cg$NOM_WINDOW_CONTRACTS.validate_domain_cascade_delete(cg$rec);
cg$NOM_WINDOW_CONTRACTS.del(cg$pk, FALSE);
cg$NOM_WINDOW_CONTRACTS.called_from_package := FALSE;
end if;
-- Application_logic Post-Before-Delete-row <<Start>>
-- Application_logic Post-Before-Delete-row << End >>
END;
/
-- No application logic defined for Trigger cg$ADR_NOM_WINDOW_CONTRACTS, so drop it.
-- To avoid an error if there isn't one, create or replace it, and then drop it
CREATE OR REPLACE TRIGGER cg$ADR_NOM_WINDOW_CONTRACTS
AFTER DELETE ON NOM_WINDOW_CONTRACTS FOR EACH ROW
BEGIN
null;
END;
/
drop trigger cg$ADR_NOM_WINDOW_CONTRACTS
/
PROMPT Creating After Delete Statement Trigger on 'NOM_WINDOW_CONTRACTS'
CREATE OR REPLACE TRIGGER cg$ADS_NOM_WINDOW_CONTRACTS
AFTER DELETE ON NOM_WINDOW_CONTRACTS
DECLARE
idx BINARY_INTEGER := cg$NOM_WINDOW_CONTRACTS.cg$table.FIRST;
cg$rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
cg$old_rec cg$NOM_WINDOW_CONTRACTS.cg$row_type;
BEGIN
-- Application_logic Pre-After-Delete-statement <<Start>>
-- Application_logic Pre-After-Delete-statement << End >>
IF NOT (cg$NOM_WINDOW_CONTRACTS.called_from_package) THEN
WHILE idx IS NOT NULL LOOP
cg$rec.CONT_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).CONT_ID;
cg$NOM_WINDOW_CONTRACTS.cg$tableind(idx).CONT_ID := TRUE;
cg$rec.NOWI_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWI_ID;
cg$NOM_WINDOW_CONTRACTS.cg$tableind(idx).NOWI_ID := TRUE;
cg$rec.NOWC_ID := cg$NOM_WINDOW_CONTRACTS.cg$table(idx).NOWC_ID;
cg$NOM_WINDOW_CONTRACTS.cg$tableind(idx).NOWC_ID := TRUE;
cg$NOM_WINDOW_CONTRACTS.validate_foreign_keys_del(cg$rec);
cg$NOM_WINDOW_CONTRACTS.upd_oper_denorm2( cg$rec,
cg$old_rec,
cg$NOM_WINDOW_CONTRACTS.cg$tableind(idx),
'DEL'
);
cg$NOM_WINDOW_CONTRACTS.cascade_delete(cg$rec);
cg$NOM_WINDOW_CONTRACTS.domain_cascade_delete(cg$rec);
idx := cg$NOM_WINDOW_CONTRACTS.cg$table.NEXT(idx);
END LOOP;
END IF;
-- Application_logic Post-After-Delete-statement <<Start>>
-- Application_logic Post-After-Delete-statement << End >>
END;
/

View File

@@ -0,0 +1,226 @@
create or replace package body amadw025$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
--------------------------------------------------------------------------------
-- Name: amadw025$.Startup
--
-- Description: This procedure is the entry point for the 'amadw025$'
-- module.
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('amadw025$') then
return;
end if;
WSGL.RegisterURL('amadw025$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL));
amadw025$appa.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'amadw025$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: amadw025$.firstpage
--
-- Description: This procedure creates the first page for the 'amadw025$'
-- module.
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('amadw025$') 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, 'amadw025$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'amadw025$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: amadw025$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'amadw025$' module.
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('amadw025$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('amadw025$.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(WSGL.MsgGetText(108,WSGLM.DSP108_GENERATED_BY, 'PL/SQL Web Generator', '10.1.2.6.18'));
htp.para;
WSGL.Info(FALSE, 'Access Manager Framework', 'AMADW025', l_usr);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'amadw025$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: amadw025$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('amadw025$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'amadw025$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: amadw025$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'amadw025$' 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 => 'amadw025$'
, pFirstTitle => ''
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'amadw025$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: amadw025$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/

View File

@@ -0,0 +1,14 @@
create or replace package amadw025$ is
procedure Startup
;
procedure FirstPage(Z_DIRECT_CALL in boolean
);
procedure ShowAbout;
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number);
function GetRef return WSGOC.MODULE_REF;
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
create or replace package amadw025$appa is
CURR_VAL CG$APPLICATION_PARAMETERS.CG$ROW_TYPE;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure QueryView(
K_APPA_ID in varchar2 default null,
Z_EXECUTE_QUERY in varchar2 default null,
Z_POST_DML in boolean default false,
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_START in varchar2 default '1',
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null);
function QueryHits return number;
procedure ActionView(
P_APPA_ID in owa_text.vc_arr,
P_VALUE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_PARAMETER in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_DESCRIPTION in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_VALUE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_APPA_ID in owa_text.vc_arr default WSGL.EmptyVCArrLong,
H_PARAMETER in owa_text.vc_arr default WSGL.EmptyVCArrLong,
z_modified in owa_text.vc_arr,
Z_ACTION in varchar2 default null,
Z_START in varchar2 default '1',
Z_CHK in varchar2 default null );
procedure QueryViewByKey(
P_APPA_ID in varchar2 default null,
Z_POST_DML in boolean default false,
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
PROCEDURE Audit_appa;
end;
/

View File

@@ -0,0 +1,105 @@
create or replace package body amadw025$js$appa is
--------------------------------------------------------------------------------
-- Name: amadw025$js$appa.CreateViewJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateViewJavaScript(
VF_ROWS_UPDATED in integer,
VF_ROWS_DELETED in integer,
VF_ROWS_ERROR in integer,
VF_BODY_ATTRIBUTES in varchar2,
LOV_FRAME in varchar2) is
begin
if not caco_security.security_check('amadw025$appa') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var index = 0;');
htp.p( 'var DataChangeErrors = false;' );
htp.p( 'var DataChange = false;' );
htp.p( 'var P_3 = new Array();' );
htp.p(WSGJSL.RtnCheckModified);
htp.p(WSGJSL.RtnRevertForm);
htp.p('
function ResetRadios( form, num_rows )
{
return;
};
');
htp.p(WSGJSL.OpenEvent('VALUE','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('APPA','Validate'));htp.p('var index = 0;');
htp.p('
for (index = 0; index < ctl.form.P_VALUE.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p('
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('APPA','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFU','OnClick'));
htp.p(' if (!APPA_Validate(ctl)) { return false; }');
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFD','OnClick'));
htp.p(WSGJSL.VerifyDelete(WSGL.MsgGetText(118, WSGLM.DSP118_CONFIRM_DELETE)));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFR','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Application Parameters#3968#',
VF_BODY_ATTRIBUTES, 'amadw025$js$appa.CreateViewJavaScript');
end;
end;
/

View File

@@ -0,0 +1,11 @@
create or replace package amadw025$js$appa is
procedure CreateViewJavaScript(
VF_ROWS_UPDATED in integer,
VF_ROWS_DELETED in integer,
VF_ROWS_ERROR in integer,
VF_BODY_ATTRIBUTES in varchar2,
LOV_FRAME in varchar2);
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,170 @@
CREATE OR REPLACE PACKAGE caco_security IS
--
g_header CONSTANT VARCHAR2(160) := '$Header: /Isle Of Grain/database/PLSQL/caco_security.pck 4 20/10/05 13:33 Gilberta $';
g_revision CONSTANT VARCHAR2(160) := '$Revision: 4 $ Patch 0.2';
--
/*
* $History: caco_security.pck $
*
* ******** EFT - Nominations - Patch 0.2 ********
* Added logging of failed login
*
* ***************** Version 4 *****************
* User: Gilberta Date: 20/10/05 Time: 13:33
* Updated in $/Isle Of Grain/database/PLSQL
* Modified to size the username and password fields on the login screen
* for the benefit of IE6.
*
* ***************** Version 3 *****************
* User: Gilberta Date: 18/07/05 Time: 10:22
* Updated in $/Isle Of Grain/database/PLSQL
* Modified to fix password expiry
*
* ***************** Version 1 *****************
* User: Gilberta Date: 7/01/05 Time: 12:54
* Created in $/Isle Of Grain/database/PLSQL
* Initial Version
*
*/
--
-- Globals
--
g_current_user VARCHAR2(30);
g_current_syus_id NUMBER;
g_current_cust_id NUMBER;
g_current_inte_id NUMBER;
C_password_max_tries CONSTANT NUMBER := NVL(cout_system_configuration.get_configuration_item('G_PASSWORD_FAILED_LOGINS'),3);
--
g_client_id VARCHAR2(240);
--
---------------------------------------------------------------------
-- Security API functions
-- These functions may be called from generated WSG applications.
---------------------------------------------------------------------
--
-- Security_Check: Returns true if the currently logged on user is
-- allowed access to the specified package. If not,
-- will return false. This function will also provide
-- a means for the user to log on.
--
FUNCTION security_check(p_package_name IN VARCHAR2) RETURN BOOLEAN;
--
--
-- Add_Package_Resp: Adds a respondibility to a package, allowing users
-- with that responsibility to access the application.
-- This is called from the generated application
-- installation script if a value is supplied for
-- preference SECRES.
--
PROCEDURE add_package_resp(p_package_name IN VARCHAR2
,p_responsibility IN VARCHAR2);
--
--------------------------------------------------------------------------
-- Implementation specific functions
-- These functions are used only by this implementation of the
-- security package.
--------------------------------------------------------------------------
--
-- Get User
--
FUNCTION get_user RETURN VARCHAR2;
--
-- get session data
--
PROCEDURE get_session_data(p_client_id IN VARCHAR2 DEFAULT NULL);
--
--
-- Show_Logon_Form: Renders logon form
--
PROCEDURE show_logon_form(p_embedded IN BOOLEAN DEFAULT FALSE
,h_href IN VARCHAR2 DEFAULT NULL);
--
--
-- Process_Logon: Accepts submitted logon form and logs user on. If logon
-- fails then notifies user.
--
PROCEDURE process_logon(p_username IN VARCHAR2 DEFAULT NULL
,p_password IN VARCHAR2 DEFAULT NULL
,h_href IN VARCHAR2 DEFAULT NULL
,p_login_button IN VARCHAR2 DEFAULT NULL
);
--
-- Process_Logon: Overloaded version for client certificate
--
PROCEDURE process_certificate_logon;
--
--
-- Show_No_Access: Displays message to inform user that they do not
-- have access to the application. Provides a link
-- to the logon form.
--
PROCEDURE show_no_access;
--
--
-- Call_Logon_Form: Output HTML to call the logon form, which
-- may be in a separate window.
--
PROCEDURE call_logon_form;
--
--
-- Logoff: Removes the current user's session, logging them off. Outputs
-- HTML message when complete.
--
PROCEDURE logoff;
--
-- Logout: Removes the current user's session, logging them off. Redirects to the
-- home page
--
PROCEDURE logout;
--
---
-- Moved from CACO_UTILITIES 26-APR-2003
---
PROCEDURE change_cust_inte(p_inte_id IN intermediaries.inte_id%TYPE DEFAULT NULL
,p_cust_id IN customers.cust_id%TYPE DEFAULT NULL
,p_savebtn IN VARCHAR2 DEFAULT NULL
,p_cancbtn IN VARCHAR2 DEFAULT NULL
,p_message IN VARCHAR2 DEFAULT NULL);
/**
-- Procedure to allow user to change their password.
-- Call without parameters to display the startup screen, other parameters are used internally.
-- @param p_call_type Used internally to determine which screen to display
-- @param p_old_password Existing password for the user
-- @param p_password New password for the user
-- @param p_confirm New password for the user
-- @param p_button Value returned by a button press
--
*/
PROCEDURE change_password(p_call_type IN VARCHAR2 DEFAULT NULL
,p_old_password IN VARCHAR2 DEFAULT NULL
,p_password IN VARCHAR2 DEFAULT NULL
,p_confirm IN VARCHAR2 DEFAULT NULL
,p_button IN VARCHAR2 DEFAULT NULL
,p_embedded IN BOOLEAN DEFAULT FALSE);
/**
-- Procedure to remove expired sessions
-- No parameters required
*/
PROCEDURE remove_expired_sessions;
/**
-- Procedure to produce the register screen
*/
PROCEDURE online_user_registration ( p_register_title IN VARCHAR2 DEFAULT NULL
, p_register_first_name IN VARCHAR2 DEFAULT NULL
, p_register_surname IN VARCHAR2 DEFAULT NULL
, p_register_company IN VARCHAR2 DEFAULT NULL
, p_register_email IN VARCHAR2 DEFAULT NULL
, p_register_phone IN VARCHAR2 DEFAULT NULL
, p_register_submit IN VARCHAR2 DEFAULT NULL
);
/**
-- Procedure to process a logon using an interface
*/
PROCEDURE process_interface_logon ( p_username IN VARCHAR2
, p_password IN VARCHAR2
, p_success OUT BOOLEAN
, p_message OUT VARCHAR2 );
--
END caco_security;
/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,142 @@
CREATE OR REPLACE PACKAGE efno_contracts IS
--
-- Purpose : Nomination Rule engine functions
-- #version $Revision: 1 $
-- #author $Author: Laceyk $
-- Created : 12/02/2007 16:15:16
--
g_package_name CONSTANT VARCHAR2(30) := 'efno_contracts';
g_header CONSTANT VARCHAR2(160) := '$Header: $';
g_revision CONSTANT VARCHAR2(160) := '$Revision: $ Patch 0.3';
--
g_perc_split_en module_text.text%TYPE := caco_utilities.get_module_text(3921,'EN');
g_perc_split_hu module_text.text%TYPE := caco_utilities.get_module_text(3921,'HU');
--
--
g_vc_arr owa_util.vc_arr;
g_num_arr owa_util.num_arr;
--
TYPE network_point_array IS TABLE OF network_points.nepo_id%TYPE INDEX BY BINARY_INTEGER;
--
TYPE category_record IS RECORD ( cate_id categories.cate_id%TYPE
, inherited VARCHAR2(1)
, display_sequence NUMBER );
--
TYPE category_array IS TABLE OF category_record INDEX BY BINARY_INTEGER;
--
TYPE parameter_record IS RECORD ( pars_id parameters.pars_id%TYPE
, inherited VARCHAR2(1) );
--
TYPE parameter_array IS TABLE OF parameter_record INDEX BY BINARY_INTEGER;
--
TYPE contract_rules_rec IS RECORD ( display_sequence contract_rules.display_sequence%TYPE
, rule_name contract_rules.rule_name%TYPE
, rule_type contract_rules.coru_type%TYPE
, coru_id contract_rules.coru_id%TYPE
, rule_id rules.rule_id%TYPE
, inherited contract_rules.inherited%TYPE );
--
TYPE perc_split_record IS RECORD ( conp_id cont_net_point_param_vals.conp_id%TYPE
, value cont_net_point_param_vals.value%TYPE);
--
TYPE perc_split_array IS TABLE OF perc_split_record INDEX BY BINARY_INTEGER;
--
--
CURSOR c_rules( cp_cont_id IN NUMBER )
RETURN contract_rules_rec;
--
/**
-- FUNCTION validate_nomination
-- Fairly Simplistic function that will just return TRUE or FALSE
-- to indicate if the given nomination is valid for the contract as it stands
--
-- %param p_contract_id The Unique identifier of a Contract
-- %param p_nomination_id The Unique identifier of a Nomination
-- %param p_return_error OUT: Message giving brief reason why the rule is invalid if indeed it is
--
-- %return BOOLEAN TRUE indicating that the nomination is valid
*/
FUNCTION validate_nomination( p_contract_id IN contracts.cont_id%TYPE
, p_nomination_id IN nominations.nomi_id%TYPE
, p_return_error OUT VARCHAR2 )
RETURN BOOLEAN;
--
--
PROCEDURE upd_cnppv_records( p_contract_id IN NUMBER
, p_page_no IN NUMBER DEFAULT 1
, p_cnppv_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_value IN owa_util.vc_arr DEFAULT g_vc_arr );
--
PROCEDURE ins_or_upd_cont_opt(p_cont_id IN contract_options.cont_id%TYPE,
p_ind_deadline_for_nom_submit IN contract_options.ind_deadline_for_nom_submit%TYPE,
p_shipper IN contract_options.shipper%TYPE,
p_auto_gen_conf IN contract_options.auto_gen_conf%TYPE,
p_conf_type IN contract_options.conf_type%TYPE,
p_com_conf_subject IN contract_options.com_conf_subject%TYPE,
p_com_conf_content IN contract_options.com_conf_content%TYPE,
p_nom_conf_subject IN contract_options.nom_conf_subject%TYPE,
p_nom_conf_content IN contract_options.nom_conf_content%TYPE,
p_ind_deadline_hr IN contract_options.ind_deadline_for_nom_submit%TYPE,
p_ind_deadline_mi IN contract_options.ind_deadline_for_nom_submit%TYPE,
p_int_subject IN contract_options.int_subject%TYPE,
p_int_content IN contract_options.int_content%TYPE,
p_int_sms_content IN contract_options.int_sms_content%TYPE);
PROCEDURE ins_or_upd_contract_p1( p_ins_or_upd IN VARCHAR2 DEFAULT 'INSERT'
, p_contract_id IN contracts.cont_id%TYPE DEFAULT 0
, p_contract_number IN VARCHAR2 DEFAULT NULL
, p_pre_contract_id IN contracts.prev_cont_id%TYPE DEFAULT 0
, p_customer_id IN customers.cust_id%TYPE DEFAULT 0
, p_template_id IN contract_templates.cote_id%TYPE DEFAULT 0
, p_spte_id IN spreadsheet_templates.spte_id%TYPE DEFAULT 0
, p_ops_contact IN VARCHAR2 DEFAULT NULL
, p_bus_contact IN VARCHAR2 DEFAULT NULL
, p_status IN contracts.status%TYPE DEFAULT NULL
, p_days_before IN VARCHAR2 DEFAULT NULL
, p_date_from IN VARCHAR2 DEFAULT NULL
, p_date_to IN VARCHAR2 DEFAULT NULL
, p_val_window IN VARCHAR2 DEFAULT NULL
, p_val_action IN contracts.validation_action%TYPE DEFAULT NULL
, p_val_exception IN contracts.validation_exception%TYPE DEFAULT NULL
, p_lookback_action IN contracts.lookback_action%TYPE DEFAULT NULL
, p_nepo_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_cate_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_pars_id IN owa_util.vc_arr DEFAULT g_vc_arr );
PROCEDURE ins_or_upd_template_p1( p_ins_or_upd IN VARCHAR2 DEFAULT NULL
, p_template_id IN NUMBER DEFAULT 0
, p_template_name IN VARCHAR2 DEFAULT NULL
, p_template_desc IN VARCHAR2 DEFAULT NULL
, p_emo IN VARCHAR2 DEFAULT NULL
, p_cate_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_pars_id IN owa_util.vc_arr DEFAULT g_vc_arr );
--
-- Procedure to copy an existing contract
--
PROCEDURE copy_contract ( p_cont_id_from contracts.cont_id%TYPE
, p_cont_number_to contracts.contract_number%TYPE
);
--
PROCEDURE efnow050$copy ( p_contract_id IN NUMBER DEFAULT NULL
, p_contract_name IN VARCHAR2 DEFAULT NULL
, p_action IN VARCHAR2 DEFAULT NULL
);
--
-- Function to check if a contract is an Entry Mandatory Offer contract
FUNCTION emo_contract( p_contract_id IN NUMBER )
RETURN VARCHAR2;
-- Function to check if a contract network point is a virtual network point
FUNCTION virtual_nepo( p_conp_id IN NUMBER )
RETURN BOOLEAN;
-- Function to check if a network poinr is being used by a contract
FUNCTION nepo_in_contract ( p_nepo_id IN network_points.nepo_id%TYPE )
RETURN BOOLEAN;
/**
-- FUNCTION about --
-- %return A textual description of the version number and VSS header for this package
*/
FUNCTION about RETURN VARCHAR2;
--
END efno_contracts;
/

View File

@@ -0,0 +1,908 @@
CREATE OR REPLACE PACKAGE BODY efno_interruption IS
--
FUNCTION j_writeworkbook(p_spreadsheet_id IN VARCHAR2
,p_sheet_name IN VARCHAR2) RETURN NUMBER AS
LANGUAGE JAVA NAME 'advantica.oracle.accessmanager.amfr_excel_j.amfr_excel_j.writeWorkBook(java.lang.String, java.lang.String) return long';
--
PROCEDURE replace_text_tags( p_int_id IN interruptions.int_id%TYPE
, p_cust_id IN customers.cust_id%TYPE DEFAULT NULL
, p_text IN OUT VARCHAR2
) IS
--
c_cust_name CONSTANT VARCHAR2(100) := '{CUSTOMER_NAME}';
c_start_date CONSTANT VARCHAR2(100) := '{START_DATE}';
c_end_date CONSTANT VARCHAR2(100) := '{END_DATE}';
--
CURSOR cur_int ( p_int_id IN interruptions.int_id%TYPE ) IS
SELECT int.gas_day_start
,int.gas_day_end
FROM interruptions int
WHERE int.int_id = p_int_id;
--
lr_interruption cur_int%ROWTYPE;
--
BEGIN
--
OPEN cur_int ( p_int_id => p_int_id );
FETCH cur_int
INTO lr_interruption;
CLOSE cur_int;
--
p_text := REPLACE(p_text, c_cust_name, caco_utilities.get_cust_name(p_cust_id));
p_text := REPLACE(p_text, c_start_date, TO_CHAR(lr_interruption.gas_day_start, cout_system_configuration.get_configuration_item('G_DATE_FORMAT')));
p_text := REPLACE(p_text, c_end_date, NVL(TO_CHAR(lr_interruption.gas_day_end, cout_system_configuration.get_configuration_item('G_DATE_FORMAT')),' '));
--
END replace_text_tags;
--
--
--
FUNCTION return_int_ss ( p_int_id IN interruptions.int_id%TYPE
, p_cont_id IN contracts.cont_id%TYPE
) RETURN BLOB IS
--
--
--
c_spte_id CONSTANT spreadsheet_templates.spte_id%TYPE := 90;
--
-- Generated Document
--
l_return BLOB;
--
-- Generic spreadsheet variables
--
l_spreadsheet_id gtt_spreadsheet.spreadsheet_id%TYPE;
l_docu_id documents.docu_id%TYPE;
l_cust_id customers.cust_id%TYPE;
--
-- Generic value for tag replacement
--
l_value VARCHAR2(1000);
l_start_date DATE;
l_num_days NUMBER;
l_offset_reduction NUMBER := 0;
--
-- Known tags
--
c_cust_name CONSTANT VARCHAR2(100) := '{CUSTOMER_NAME}';
c_cont_name CONSTANT VARCHAR2(100) := '{CONTRACT_NAME}';
c_start_date CONSTANT VARCHAR2(100) := '{START_DATE}';
c_end_date CONSTANT VARCHAR2(100) := '{END_DATE}';
c_nepo_code CONSTANT VARCHAR2(100) := '{NETWORK_POINT_CODE}';
c_nepo_name CONSTANT VARCHAR2(100) := '{NETWORK_POINT_NAME}';
c_cate_name CONSTANT VARCHAR2(100) := '{CATE_NAME}';
c_cate_units CONSTANT VARCHAR2(100) := '{CATE_UNITS}';
c_iccv_placeholder CONSTANT VARCHAR2(100) := '{INT_CONT_CAT_VALS}';
--
-- Combination cursor - confirmation template and nomination type, it is correct!
--
CURSOR cur_spte ( p_spte_id IN spreadsheet_templates.spte_id%TYPE ) IS
SELECT l_spreadsheet_id
,sptv.x_axis
,sptv.y_axis
,sptv.cell_value
,sptv.cell_datatype
,sptv.cell_format_mask
,sptv.cell_border
,sptv.cell_background
,sptv.cell_merge
,sptv.cell_font
,sptv.cell_fontsize
,sptv.cell_align
,sptv.col_width
,sptv.row_height
,sptv.cell_wrap
,spte.name
FROM spreadsheet_templates spte
,spreadsheet_template_values sptv
WHERE spte.spte_id = sptv.spte_id
AND sptv.spte_id = c_spte_id;
--
l_r_spte cur_spte%ROWTYPE;
--
CURSOR cur_int (p_int_id IN interruptions.int_id%TYPE) IS
SELECT int.*
FROM interruptions int
WHERE int.int_id = p_int_id;
--
lr_int cur_int%ROWTYPE;
--
CURSOR cur_grid ( p_int_id IN interruptions.int_id%TYPE ) IS
SELECT iccv.iccv_id
, cust.code cust
, iccv.conp_id
, coca.cate_id
, iccv.send_to_customer
, iccv.contracted_value
, iccv.interrupted_value
, iccv.confirmed_value
,nepo.name||':'||cust.name neponame
,ROW_NUMBER() OVER (PARTITION BY cate.name ORDER BY cust.code NULLS LAST) grid_row
FROM int_conp_coca_vals iccv
,contract_categories coca
,categories cate
,cont_network_points conp
,network_points nepo
,contracts cont
,customers cust
WHERE iccv.int_id = p_int_id
AND iccv.coca_id = coca.coca_id
AND coca.cate_id = cate.cate_id
AND iccv.conp_id = conp.conp_id
AND coca.cont_id = cont.cont_id
AND conp.nepo_id = nepo.nepo_id
AND cont.cust_id = cust.cust_id
AND cont.cont_id = p_cont_id
ORDER BY cust.code
,nepo.code
,cate.display_sequence;
--
lr_grid_row cur_grid%ROWTYPE;
--
PROCEDURE insert_cell ( p_r_spte IN cur_spte%ROWTYPE
, p_value_overload IN VARCHAR2 DEFAULT NULL
, p_x_increment IN NUMBER DEFAULT 0
, p_y_increment IN NUMBER DEFAULT 0
, p_span IN NUMBER DEFAULT NULL
) IS
--
l_x_axis VARCHAR2(2) := NULL;
--
BEGIN
--
IF p_x_increment > 0 THEN
--
l_x_axis := CHR(ASCII(p_r_spte.x_axis)+p_x_increment);
--
END IF;
--
INSERT INTO gtt_spreadsheet ( spreadsheet_id
, x_axis
, y_axis
, cell_value
, cell_datatype
, cell_format_mask
, cell_border
, cell_background
, cell_merge
, cell_font
, cell_fontsize
, cell_align
, col_width
, row_height
, cell_wrap
)
VALUES ( p_r_spte.l_spreadsheet_id
, NVL(l_x_axis, p_r_spte.x_axis)
, p_r_spte.y_axis + p_y_increment
, NVL(p_value_overload, p_r_spte.cell_value)
, p_r_spte.cell_datatype
, p_r_spte.cell_format_mask
, p_r_spte.cell_border
, p_r_spte.cell_background
, NVL(p_span, p_r_spte.cell_merge)
, p_r_spte.cell_font
, p_r_spte.cell_fontsize
, p_r_spte.cell_align
, p_r_spte.col_width
, p_r_spte.row_height
, p_r_spte.cell_wrap
);
--
END insert_cell;
--
BEGIN
--
-- Get the details from interruptions
--
OPEN cur_int(p_int_id => p_int_id);
FETCH cur_int
INTO lr_int;
CLOSE cur_int;
--
--
-- Get the next sequence value
--
SELECT spte_seq.NEXTVAL
INTO l_spreadsheet_id
FROM DUAL;
--
-- Get the cust ID
--
SELECT cont.cust_id
INTO l_cust_id
FROM contracts cont
WHERE cont.cont_id = p_cont_id;
--
-- Now loop around the template
--
OPEN cur_spte ( c_spte_id );
--
LOOP
--
FETCH cur_spte
INTO l_r_spte;
--
EXIT WHEN cur_spte%NOTFOUND;
--
IF l_r_spte.cell_value LIKE '{%}' THEN
--
-- Candidate for tag replacement, loop through our known tags
--
-- {CAT_NAME}
-- {CAT_UNITS}
-- {CONTRACT_ID}
-- {CUSTOMER_NAME}
-- {CONTRACT_NAME}
-- {CUSTOMER_EMAIL}
-- {CUSTOMER_FAX}
-- {GAS_DAY}
-- {NETWORK_POINT_CODE}
-- {NETWORK_POINT_NAME}
-- {INT_CONT_CAT_VALS}
--
l_value := NULL;
--
IF INSTR(l_r_spte.cell_value, c_cust_name) > 0 THEN
--
SELECT cust.name
INTO l_value
FROM customers cust
,contracts cont
WHERE cont.cust_id = cust.cust_id
AND cont.cont_id = p_cont_id;
--
l_value := REPLACE(l_r_spte.cell_value, c_cust_name, l_value);
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => l_value
);
--
END IF;
--
IF INSTR(l_r_spte.cell_value, c_cont_name) > 0 THEN
--
SELECT cont.contract_number
INTO l_value
FROM customers cust
,contracts cont
WHERE cont.cust_id = cust.cust_id
AND cont.cont_id = p_cont_id;
--
l_value := REPLACE(l_r_spte.cell_value, c_cont_name, l_value);
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => l_value
);
--
END IF;
--
IF INSTR(l_r_spte.cell_value, c_start_date) > 0 OR INSTR(l_r_spte.cell_value, c_end_date) > 0 THEN
--
l_value := l_r_spte.cell_value;
--
l_value := REPLACE(l_value, c_start_date, NVL(TO_CHAR( lr_int.gas_day_start, cout_system_configuration.get_configuration_item('G_DATE_FORMAT')),''));
l_value := REPLACE(l_value, c_end_date, NVL(TO_CHAR( lr_int.gas_day_end, cout_system_configuration.get_configuration_item('G_DATE_FORMAT')),''));
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => l_value
);
--
--
ELSIF INSTR(l_r_spte.cell_value, c_start_date) > 0 THEN
--
l_value := NVL(TO_CHAR( lr_int.gas_day_start, cout_system_configuration.get_configuration_item('G_DATE_FORMAT')),'');
--
l_value := REPLACE(l_r_spte.cell_value, c_start_date, l_value);
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => l_value
);
--
ELSIF INSTR(l_r_spte.cell_value, c_end_date) > 0 THEN
--
l_value := NVL(TO_CHAR( lr_int.gas_day_end, cout_system_configuration.get_configuration_item('G_DATE_FORMAT')),'');
--
l_value := REPLACE(l_r_spte.cell_value, c_end_date, l_value);
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => l_value
);
--
END IF;
--
IF l_r_spte.cell_value = c_nepo_code THEN
--
FOR site_rec IN ( SELECT site
,rownum FROM (
SELECT nepo.code AS site
FROM int_conp_coca_vals int
,cont_network_points conp
,network_points nepo
WHERE int.int_id = p_int_id
AND int.conp_id = conp.conp_id
AND conp.nepo_id = nepo.nepo_id
AND conp.cont_id = p_cont_id
GROUP BY nepo.code
ORDER BY nepo.code
)
) LOOP
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => site_rec.site
, p_y_increment => (site_rec.rownum - 1)
);
--
END LOOP;
--
END IF;
--
IF l_r_spte.cell_value = c_nepo_name THEN
--
FOR site_rec IN ( SELECT site
,rownum FROM (
SELECT nepo.name AS site
FROM int_conp_coca_vals int
,cont_network_points conp
,network_points nepo
WHERE int.int_id = p_int_id
AND int.conp_id = conp.conp_id
AND conp.nepo_id = nepo.nepo_id
AND conp.cont_id = p_cont_id
GROUP BY nepo.name
,nepo.code
ORDER BY nepo.code
)
) LOOP
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => site_rec.site
, p_y_increment => (site_rec.rownum - 1)
);
--
END LOOP;
--
END IF;
--
IF l_r_spte.cell_value = c_cate_name THEN
--
-- Populate cell with Category Name
--
FOR cat IN ( SELECT rownum, cate_id, name FROM (SELECT coca.cate_id
, cate.name
, cate.display_sequence
FROM int_conp_coca_vals iccv
,contract_categories coca
,categories cate
WHERE iccv.int_id = p_int_id
AND iccv.coca_id = coca.coca_id
AND coca.cate_id = cate.cate_id
GROUP BY coca.cate_id
, cate.name
, cate.display_sequence
ORDER BY cate.display_sequence
)) LOOP
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => cat.name
, p_x_increment => cat.rownum - 1
);
--
END LOOP;
--
END IF;
--
IF l_r_spte.cell_value = c_cate_units THEN
--
-- Populate cell with Category Units
--
FOR cat IN ( SELECT rownum, cate_id, name, units FROM (SELECT coca.cate_id
, cate.name
, cate.units
, cate.display_sequence
FROM int_conp_coca_vals iccv
,contract_categories coca
,categories cate
WHERE iccv.int_id = p_int_id
AND iccv.coca_id = coca.coca_id
AND coca.cate_id = cate.cate_id
GROUP BY coca.cate_id
, cate.name
, cate.units
, cate.display_sequence
ORDER BY cate.display_sequence
)) LOOP
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => cat.units
, p_x_increment => cat.rownum - 1
);
--
END LOOP;
--
END IF;
--
IF l_r_spte.cell_value = c_iccv_placeholder THEN
--
OPEN cur_grid(p_int_id => p_int_id);
FETCH cur_grid
INTO lr_grid_row;
--
FOR custnepo IN ( SELECT rownum-1 AS yincr
,sq.* FROM (
SELECT cust.code cust
, nepo.code nepo
, nepo.name neponame
, iccv.conp_id conp
FROM int_conp_coca_vals iccv
,cont_network_points conp
,network_points nepo
,contracts cont
,customers cust
WHERE iccv.int_id = p_int_id
AND iccv.conp_id = conp.conp_id
AND conp.cont_id = cont.cont_id
AND conp.nepo_id = nepo.nepo_id
AND cont.cust_id = cust.cust_id
AND cont.cont_id = p_cont_id
GROUP BY cust.code
, nepo.code
, nepo.name
, iccv.conp_id
ORDER BY cust.code
,nepo.code ) sq ) LOOP
--
FOR griddetail IN (SELECT rownum-1 AS xincr, cate_id, name, inty_code FROM (
SELECT coca.cate_id
, cate.name
, cate.display_sequence
, inty.code AS inty_code
FROM int_conp_coca_vals iccv
,contract_categories coca
,categories cate
,interruption_types inty
WHERE iccv.int_id = p_int_id
AND iccv.coca_id = coca.coca_id
AND coca.cate_id = cate.cate_id
AND inty.cate_id (+) = cate.cate_id
AND inty.status (+) = 'A'
GROUP BY coca.cate_id
, cate.name
, cate.display_sequence
, inty.code
ORDER BY cate.display_sequence
)) LOOP
--
-- fetch cursor
--
IF lr_grid_row.cate_id = griddetail.cate_id
AND lr_grid_row.conp_id = custnepo.conp THEN
--
IF lr_grid_row.send_to_customer = 'Y' THEN
--
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => caco_utilities.to_thousand_separated(lr_grid_row.interrupted_value)
, p_x_increment => griddetail.xincr
, p_y_increment => custnepo.yincr
);
ELSE
insert_cell ( p_r_spte => l_r_spte
, p_value_overload => caco_utilities.to_thousand_separated(lr_grid_row.contracted_value)
, p_x_increment => griddetail.xincr
, p_y_increment => custnepo.yincr
);
END IF;
--
FETCH cur_grid
INTO lr_grid_row;
--
END IF;
--
END LOOP; --cate
--
END LOOP;--custnepo
--
CLOSE cur_grid;
--
END IF;
--
ELSE
--
insert_cell ( p_r_spte => l_r_spte
);
--
END IF;
--
END LOOP;
--
CLOSE cur_spte;
--
-- dbms_java.set_output(2000);
--
l_docu_id := j_writeworkbook( l_spreadsheet_id
, caco_utilities.get_module_text(p_text_number => 3803)
);
--
-- Get the document into the return variable
--
SELECT docu.blob_content
INTO l_return
FROM documents docu
WHERE docu_id = l_docu_id;
--
-- Now remove the document
--
DELETE
FROM documents d
WHERE d.docu_id = l_docu_id;
--
-- And return
--
RETURN l_return;
--
EXCEPTION
WHEN OTHERS THEN
cout_err.report_and_go(p_exception_number => sqlcode, p_exception_message => sqlerrm);
END return_int_ss;
--
PROCEDURE download ( p_remd_id IN rec_message_details.remd_id%TYPE ) IS
--
l_document_contents documents.blob_content%TYPE;
l_mime_type documents.mime_type%TYPE;
--
l_document_name documents.name%TYPE;
--
BEGIN
--
-- Get the document out of the table ready for direct transmission
--
BEGIN
--
SELECT remd.message_attachment
INTO l_document_contents
FROM rec_message_details remd
WHERE remd.remd_id = p_remd_id;
--
EXCEPTION
WHEN OTHERS THEN
--
NULL;
--
END;
--
l_document_name := caco_utilities.get_module_text(3803)||'.xls';
l_mime_type := 'application/vnd.ms-excel';
--
owa_util.mime_header(l_mime_type, FALSE);
htp.p('Content-Length: '||dbms_lob.getlength(l_document_contents));
htp.p('Content-Disposition: attachment; filename='||l_document_name);
owa_util.http_header_close;
--
IF l_document_contents IS NOT NULL THEN
wpg_docload.download_file(l_document_contents);
END IF;
--
END download;
--
FUNCTION get_global( p_var IN VARCHAR2 ) RETURN VARCHAR2 IS
--
l_return VARCHAR2(30);
--
BEGIN
--
IF p_var = 'g_query_id' THEN
--
l_return := g_query_id;
--
ELSIF p_var = 'g_query_start' THEN
--
l_return := g_query_start;
--
ELSIF p_var = 'g_query_end' THEN
--
l_return := g_query_end;
--
END IF;
--
RETURN l_return;
--
END get_global;
--
PROCEDURE send_messages ( p_int_id IN interruptions.int_id%TYPE DEFAULT NULL
) IS
--
v_substitution_list caco_utilities.g_t_substitution_list;
--
CURSOR cur_cust (p_cust_id IN customers.cust_id%TYPE ) IS
SELECT cust.int_subject
,cust.int_content
,cust.int_sms_content
FROM customers cust
WHERE cust.cust_id = p_cust_id;
--
lr_cust_rec cur_cust%ROWTYPE;
--
l_intr_ss BLOB;
--
BEGIN
--
-- security check - check for access to base package
--
IF NOT caco_security.security_check('efnow210$') THEN
RETURN;
END IF;
--
IF p_int_id IS NOT NULL THEN
--
-- loop around all distinct recipients
--
FOR cust_rec IN ( SELECT cont.cust_id
,cont.cont_id
FROM int_conp_coca_vals iccv
, cont_network_points conp
, contracts cont
WHERE iccv.int_id = p_int_id
AND iccv.conp_id = conp.conp_id
AND conp.cont_id = cont.cont_id
AND iccv.send_to_customer = 'Y'
GROUP BY cont.cust_id
, cont.cont_id
) LOOP
--
-- Get static details
--
OPEN cur_cust ( cust_rec.cust_id );
FETCH cur_cust
INTO lr_cust_rec;
CLOSE cur_cust;
--
-- Sustitute any tags
--
replace_text_tags( p_int_id => p_int_id
, p_cust_id => cust_rec.cust_id
, p_text => lr_cust_rec.int_content
);
--
-- Generate details to be sent
--
l_intr_ss := return_int_ss ( p_int_id => p_int_id
, p_cont_id => cust_rec.cont_id
);
--
-- Now send the details
--
efno_msgsubs.send_recorded_messages( p_cust_id => cust_rec.cust_id
, p_suca_id => efno_msgsubs.get_suca_id( p_suca_group => 'Notification'
, p_suca_name => 'Commercial' )
, p_message_type => 'Interruption'
, p_message_id => p_int_id
, p_email_content_en => lr_cust_rec.int_content
, p_email_subject_en => lr_cust_rec.int_subject
, p_sms_content_en => lr_cust_rec.int_sms_content
, p_file => l_intr_ss
, p_filename => caco_utilities.get_module_text(3803)||'.xls'
, p_file_mime_type => 'application/vnd.ms-excel'
);
--
END LOOP; -- cust_rec
--
ELSE
--
v_substitution_list(1) := 'p_int_id';
--
caco_utilities.raise_exception_error( p_exception_number => -20100
, p_substitution_list => v_substitution_list
);
--
END IF;
--
END send_messages;
--
--
--
FUNCTION get_int_val ( p_val IN NUMBER
, p_conp_id IN NUMBER
, p_copa_id IN NUMBER
, p_gasday IN DATE
) RETURN NUMBER IS
--
l_return NUMBER;
--
BEGIN
--
l_return := p_val;
--
FOR int IN (SELECT int.int_id
FROM interruptions int
WHERE p_gasday BETWEEN int.gas_day_start AND NVL(int.gas_day_end, p_gasday)
) LOOP
--
-- Interruption is in place on this gas day, check if value is reduced
--
FOR iccv IN ( SELECT iccv.interrupted_value AS value
FROM int_conp_coca_vals iccv
,contract_categories coca
,parameters pars
,contract_parameters copa
WHERE iccv.int_id = int.int_id
AND iccv.coca_id = coca.coca_id
AND coca.cate_id = pars.cate_id
AND pars.pars_id = copa.pars_id
AND copa.cont_id = coca.cont_id
AND iccv.conp_id = p_conp_id
AND copa.copa_id = p_copa_id
AND iccv.send_to_customer = 'Y'
AND (pars.code LIKE '%MAX'
OR pars.code LIKE '%CTR')
) LOOP
--
-- Only substitue MAX and contracted, and only if the interrupted value is lower
--
l_return := LEAST(iccv.value, l_return);
--
END LOOP;
--
END LOOP;
--
RETURN l_return;
--
END get_int_val;
--
FUNCTION am_i_interrrupted ( p_conp_id IN cont_network_points.conp_id%TYPE
, p_coca_id IN contract_categories.coca_id%TYPE
, p_gasday IN DATE
) RETURN BOOLEAN IS
--
l_return BOOLEAN := FALSE;
--
BEGIN
--
FOR int IN (SELECT int.int_id
FROM interruptions int
WHERE p_gasday BETWEEN int.gas_day_start AND NVL(int.gas_day_end, p_gasday)
) LOOP
--
-- Interruption is in place on this gas day, check if value is reduced
--
FOR iccv IN ( SELECT iccv.interrupted_value AS int_val
,iccv.contracted_value AS cont_val
FROM int_conp_coca_vals iccv
WHERE iccv.int_id = int.int_id
AND iccv.coca_id = p_coca_id
AND iccv.conp_id = p_conp_id
AND iccv.send_to_customer = 'Y'
) LOOP
--
-- Only substitue MAX and contracted, and only if the interrupted value is lower
--
-- IF iccv.int_val < iccv.cont_val THEN -- quantity check removed in line with interruption comments received on 13/02/2008, AG
--
l_return := TRUE;
--
-- END IF; -- quantity check removed in line with interruption comments received on 13/02/2008, AG
--
END LOOP;
--
END LOOP;
--
RETURN l_return;
--
END am_i_interrrupted;
--
--
--
PROCEDURE daily_message IS
--
l_date DATE;
l_min_days NUMBER;
--
CURSOR cur_inte ( p_inte_id IN interruptions.int_id%TYPE ) IS
SELECT MIN(incp.max_interruption_days)
FROM int_conp_coca_vals iccv
,inty_conp_params incp
,interruption_types inty
,contract_categories coca
WHERE iccv.int_id = p_inte_id
AND inty.cate_id = coca.cate_id
AND incp.inty_id = inty.inty_id
AND iccv.coca_id = coca.coca_id
AND iccv.conp_id = incp.conp_id
AND inty.status = 'A';
--
BEGIN
--
l_date := TRUNC(SYSDATE-cout_system_configuration.get_configuration_item('GAS_DAY_OFFSET')/24);
--
FOR int IN ( SELECT inte.int_id
,l_date - inte.gas_day_start AS days_so_far
FROM interruptions inte
WHERE l_date >= inte.gas_day_start
AND inte.gas_day_end IS NULL
) LOOP
--
OPEN cur_inte (int.int_id);
FETCH cur_inte
INTO l_min_days;
CLOSE cur_inte;
--
IF int.days_so_far = l_min_days THEN
--
FOR user_rec IN (SELECT DISTINCT syus_id
FROM user_profiles
WHERE sypr_id IN (SELECT sypr_id
FROM system_profiles
WHERE role_name LIKE 'EFT Admin'
OR role_name LIKE 'EFT User'
OR role_name LIKE '%KAM%')) LOOP
--
efno_msgsubs.send_messages(p_syus_id => user_rec.syus_id
,p_suca_id => efno_msgsubs.get_suca_id( p_suca_group => 'Notification'
, p_suca_name => 'Service' )
,p_email_content_en => caco_utilities.get_module_text(3849, caco_utilities.get_syus_lang(user_rec.syus_id))
,p_email_subject_en => caco_utilities.get_module_text(3848, caco_utilities.get_syus_lang(user_rec.syus_id))
,p_sms_content_en => caco_utilities.get_module_text(3849, caco_utilities.get_syus_lang(user_rec.syus_id))
);
--
END LOOP;
--
ELSIF int.days_so_far >= l_min_days THEN
--
FOR user_rec IN (SELECT DISTINCT syus_id
FROM user_profiles
WHERE sypr_id IN (SELECT sypr_id
FROM system_profiles
WHERE role_name LIKE 'EFT Admin'
OR role_name LIKE 'EFT User'
OR role_name LIKE '%KAM%')) LOOP
--
efno_msgsubs.send_messages(p_syus_id => user_rec.syus_id
,p_suca_id => efno_msgsubs.get_suca_id( p_suca_group => 'Notification'
, p_suca_name => 'Service' )
,p_email_content_en => caco_utilities.get_module_text(3850, caco_utilities.get_syus_lang(user_rec.syus_id))
,p_email_subject_en => caco_utilities.get_module_text(3848, caco_utilities.get_syus_lang(user_rec.syus_id))
,p_sms_content_en => caco_utilities.get_module_text(3850, caco_utilities.get_syus_lang(user_rec.syus_id))
);
--
END LOOP;
--
END IF;
--
END LOOP;
--
END daily_message;
--
--
--
PROCEDURE submit_job IS
--
i_job binary_integer;
--
BEGIN
--
dbms_job.submit ( i_job
, 'efno_interruption.daily_message;'
, (TRUNC(SYSDATE-cout_system_configuration.get_configuration_item('GAS_DAY_OFFSET')/24) + 10/24)
, '(TRUNC(SYSDATE-cout_system_configuration.get_configuration_item(''GAS_DAY_OFFSET'')/24) + 10/24)+1'
);
--
END submit_job;
--
/**
-- FUNCTION about
--
-- Returns the version number and VSS header for this package
--
-- %return The version number and VSS header for this package
*/
FUNCTION about RETURN VARCHAR2 IS
BEGIN
RETURN(g_revision || CHR(10) || g_header);
END about;
--
--
BEGIN
-- Initialization
NULL;
--
END efno_interruption;
/

View File

@@ -0,0 +1,426 @@
create or replace package body efnow050$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
PROCEDURE contract_options_P( p_contract_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL )
IS
-- contract_options
--
--
BEGIN
-- Check we have permission to be using this module.
IF NOT caco_security.security_check('efnow050$') THEN
RETURN;
END IF;
--
efnow092$.g_package_name := 'efnow050$';
--
efnow092$.contract_options_P( p_contract_id => p_contract_id
, p_success => p_success
, p_error => p_error
, p_err_msg => p_err_msg );
--
END;
PROCEDURE contract_rules( p_contract_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL )
IS
-- contract_rules
--
--
BEGIN
-- Check we have permission to be using this module.
IF NOT caco_security.security_check('efnow050$') THEN
RETURN;
END IF;
--
efnow092$.g_package_name := 'efnow050$';
--
efnow092$.contract_rules( p_contract_id => p_contract_id
, p_success => p_success
, p_error => p_error
, p_err_msg => p_err_msg );
--
END;
PROCEDURE contract_startup( p_screen_type IN VARCHAR2 DEFAULT 'CONTRACT'
, p_ins_or_upd IN VARCHAR2 DEFAULT 'INSERT'
, p_success IN VARCHAR2 DEFAULT NULL
, p_contract_id IN contracts.cont_id%TYPE DEFAULT 0
, p_contract_number IN VARCHAR2 DEFAULT NULL
, p_pre_contract_id IN contracts.prev_cont_id%TYPE DEFAULT 0
, p_template_id IN contract_templates.cote_id%TYPE DEFAULT 0
, p_template_name IN VARCHAR2 DEFAULT NULL
, p_template_desc IN VARCHAR2 DEFAULT NULL
, p_emo IN VARCHAR2 DEFAULT NULL
, p_customer_id IN customers.cust_id%TYPE DEFAULT 0
, p_spte_id IN spreadsheet_templates.spte_id%TYPE DEFAULT 0
, p_ops_contact IN VARCHAR2 DEFAULT NULL
, p_bus_contact IN VARCHAR2 DEFAULT NULL
, p_status IN contracts.status%TYPE DEFAULT NULL
, p_days_before IN VARCHAR2 DEFAULT NULL
, p_date_from IN VARCHAR2 DEFAULT NULL
, p_date_to IN VARCHAR2 DEFAULT NULL
, p_val_window IN VARCHAR2 DEFAULT 0
, p_val_action IN contracts.validation_action%TYPE DEFAULT NULL
, p_val_exception IN contracts.validation_exception%TYPE DEFAULT NULL
, p_lookback_action IN contracts.lookback_action%TYPE DEFAULT NULL
, p_template_changed IN VARCHAR2 DEFAULT NULL
, p_prev_template_id IN NUMBER DEFAULT NULL
, p_error IN VARCHAR2 DEFAULT NULL
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_nepo_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_cate_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_pars_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr )
IS
-- contract_startup
--
--
BEGIN
-- Check we have permission to be using this module.
IF NOT caco_security.security_check('efnow050$') THEN
RETURN;
END IF;
--
-- Set the package name in efnow092$
efnow092$.g_package_name := 'efnow050$';
--
-- Call the contracts startup
efnow092$.startup( p_screen_type => p_screen_type
, p_ins_or_upd => p_ins_or_upd
, p_success => p_success
, p_contract_id => p_contract_id
, p_contract_number => p_contract_number
, p_template_id => p_template_id
, p_template_name => p_template_name
, p_template_desc => p_template_desc
, p_emo => p_emo
, p_customer_id => p_customer_id
, p_spte_id => p_spte_id
, p_ops_contact => p_ops_contact
, p_bus_contact => p_bus_contact
, p_status => p_status
, p_days_before => p_days_before
, p_date_from => p_date_from
, p_date_to => p_date_to
, p_val_window => p_val_window
, p_val_action => p_val_action
, p_val_exception => p_val_exception
, p_lookback_action => p_lookback_action
, p_template_changed => p_template_changed
, p_prev_template_id => p_prev_template_id
, p_error => p_error
, p_err_msg => p_err_msg
, p_nepo_id => p_nepo_id
, p_cate_id => p_cate_id
, p_pars_id => p_pars_id );
--
END contract_startup;
PROCEDURE contract_values_p2( p_contract_id IN NUMBER
, p_page_no IN NUMBER DEFAULT 1
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_cnppv_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_value IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_data_error IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr )
IS
-- contract_values_p2
--
--
BEGIN
-- Check we have permission to be using this module.
IF NOT caco_security.security_check('efnow050$') THEN
RETURN;
END IF;
--
-- Set the package name
efnow092$.g_package_name := 'efnow050$';
--
-- Call efno092$
efnow092$.contract_values_p2( p_contract_id => p_contract_id
, p_page_no => p_page_no
, p_success => p_success
, p_error => p_error
, p_err_msg => p_err_msg
, p_cnppv_id => p_cnppv_id
, p_value => p_value
, p_data_error => p_data_error );
--
END;
PROCEDURE template_rules( p_template_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL )
IS
-- template_rules
--
--
BEGIN
-- Check we have permission to be using this module.
IF NOT caco_security.security_check('efnow050$') THEN
RETURN;
END IF;
--
efnow092$.g_package_name := 'efnow050$';
--
efnow092$.template_rules( p_template_id => p_template_id
, p_success => p_success
, p_error => p_error
, p_err_msg => p_err_msg );
--
END;
--------------------------------------------------------------------------------
-- Name: efnow050$.Startup
--
-- Description: This procedure is the entry point for the 'efnow050$'
-- module.
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('efnow050$') then
return;
end if;
WSGL.RegisterURL('efnow050$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL));
efnow050$cont.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow050$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: efnow050$.firstpage
--
-- Description: This procedure creates the first page for the 'efnow050$'
-- module.
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('efnow050$') 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, 'EFNOW060', 0, 'efnow060$.startup',p_output_line=>FALSE, p_target=>'_top');
WSGL.NavLinks(WSGL.MENU_LONG, 'EFNOW020', 0, 'efnow020$.startup',p_output_line=>FALSE, p_target=>'_top');
WSGL.NavLinks(WSGL.MENU_LONG, 'EFNOW092', 0, 'efnow092$.startup',p_output_line=>FALSE, p_target=>'_top');
WSGL.NavLinks(WSGL.MENU_LONG, WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT), 0, 'efnow050$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow050$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: efnow050$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'efnow050$' module.
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('efnow050$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('efnow050$.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.4 $');
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', 'EFNOW050', l_usr);
htp.p(caco_system.footer);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow050$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: efnow050$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('efnow050$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow050$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: efnow050$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'efnow050$' 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 => 'efnow050$'
, pFirstTitle => ''
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow050$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: efnow050$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/

View File

@@ -0,0 +1,68 @@
create or replace package efnow050$ is
procedure Startup
;
procedure FirstPage(Z_DIRECT_CALL in boolean
);
procedure ShowAbout;
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number);
function GetRef return WSGOC.MODULE_REF;
PROCEDURE contract_options_P( p_contract_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL );
PROCEDURE contract_rules( p_contract_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL );
PROCEDURE contract_startup( p_screen_type IN VARCHAR2 DEFAULT 'CONTRACT'
, p_ins_or_upd IN VARCHAR2 DEFAULT 'INSERT'
, p_success IN VARCHAR2 DEFAULT NULL
, p_contract_id IN contracts.cont_id%TYPE DEFAULT 0
, p_contract_number IN VARCHAR2 DEFAULT NULL
, p_pre_contract_id IN contracts.prev_cont_id%TYPE DEFAULT 0
, p_template_id IN contract_templates.cote_id%TYPE DEFAULT 0
, p_template_name IN VARCHAR2 DEFAULT NULL
, p_template_desc IN VARCHAR2 DEFAULT NULL
, p_emo IN VARCHAR2 DEFAULT NULL
, p_customer_id IN customers.cust_id%TYPE DEFAULT 0
, p_spte_id IN spreadsheet_templates.spte_id%TYPE DEFAULT 0
, p_ops_contact IN VARCHAR2 DEFAULT NULL
, p_bus_contact IN VARCHAR2 DEFAULT NULL
, p_status IN contracts.status%TYPE DEFAULT NULL
, p_days_before IN VARCHAR2 DEFAULT NULL
, p_date_from IN VARCHAR2 DEFAULT NULL
, p_date_to IN VARCHAR2 DEFAULT NULL
, p_val_window IN VARCHAR2 DEFAULT 0
, p_val_action IN contracts.validation_action%TYPE DEFAULT NULL
, p_val_exception IN contracts.validation_exception%TYPE DEFAULT NULL
, p_lookback_action IN contracts.lookback_action%TYPE DEFAULT NULL
, p_template_changed IN VARCHAR2 DEFAULT NULL
, p_prev_template_id IN NUMBER DEFAULT NULL
, p_error IN VARCHAR2 DEFAULT NULL
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_nepo_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_cate_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_pars_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr );
PROCEDURE contract_values_p2( p_contract_id IN NUMBER
, p_page_no IN NUMBER DEFAULT 1
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_cnppv_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_value IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_data_error IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr );
PROCEDURE template_rules( p_template_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL );
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,110 @@
create or replace package efnow050$cont is
type NBT_REC is record
( UI_CUST varchar2(24000)
, UI_CONTRACT varchar2(24000)
, UI_STATUS varchar2(24000)
, UI_CONT_FROM date
, UI_CONT_TO date
, UI_EDIT_URL varchar2(24000)
, UI_COPY_URL varchar2(24000)
, L_CUST_NAME CUSTOMERS.NAME%type
);
NBT_VAL NBT_REC;
CURR_VAL CONTRACTS%rowtype;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure ActionQuery(
P_STATUS in varchar2 default null,
P_CONTRACT_NUMBER in varchar2 default null,
P_L_CUST_NAME in varchar2 default null,
P_VALID_FROM in varchar2 default null,
U_VALID_FROM in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null );
procedure FormQuery(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryList(
P_STATUS in varchar2 default null,
P_CONTRACT_NUMBER in varchar2 default null,
P_L_CUST_NAME in varchar2 default null,
P_VALID_FROM in varchar2 default null,
U_VALID_FROM in varchar2 default null,
Z_START in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null );
function QueryHits(
P_STATUS in varchar2 default null,
P_CONTRACT_NUMBER in varchar2 default null,
P_L_CUST_NAME in varchar2 default null,
P_VALID_FROM in varchar2 default null,
U_VALID_FROM in varchar2 default null) return number;
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure InitialiseDomain(P_ALIAS in varchar2);
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
D_STATUS WSGL.typDVRecord;FUNCTION FormatDate ( p_date IN VARCHAR2 ) RETURN VARCHAR2;
procedure ncalendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure nformat_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
end;
/

View File

@@ -0,0 +1,171 @@
create or replace package body efnow050$js$cont is
--------------------------------------------------------------------------------
-- Name: efnow050$js$cont.CreateQueryJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateQueryJavaScript (
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow050$cont') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Query";');
WSGJSL.Output_Invoke_CAL_JS ('efnow050$cont', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('L_CUST_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow050$cont.l_cust_name_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(
'// CAL
//
//
function CAL(the_fieldname, the_value, the_format, the_prompt) {
var filter = "";
var the_pathname = location.pathname;
var i = the_pathname.indexOf (''/:'');
var j = the_pathname.indexOf (''/'', ++i);
//var frmCAL; //B1777722 Needs to be global to remember state between calls.
if (i != -1)
{
// Syntactically incorrect url so it needs to be corrected
the_pathname = the_pathname.substring (j, the_pathname.length);
}; // (i != -1)
// B1777722 and B1854252 for IE5
if ( navigator.appName == "Microsoft Internet Explorer" && typeof frmCAL == "object" )
{
frmCAL.close();
}
frmCAL = open ("efnow050$cont.ncalendar" +
"?Z_FIELD_NAME=" + escape(the_fieldname) +
"&Z_CALLER_URL=" + escape(location.protocol + ''//'' + location.host + the_pathname + location.search) +
"&Z_FIELD_VALUE=" + escape(the_value) +
"&Z_FIELD_FORMAT=" + escape(the_format) +
"&Z_FIELD_PROMPT=" + escape(the_prompt),
"winCAL", "scrollbars=no,resizable=no,width=320,height=350");
if (frmCAL.opener == null)
{
frmCAL.opener = self;
}
} ');
htp.p(WSGJSL.OpenEvent('CONT','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnQFQ','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
QF_BODY_ATTRIBUTES, 'efnow050$js$cont.CreateQueryJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow050$js$cont.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow050$cont') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
htp.p( 'var P_7 = new Array();' );
htp.p(WSGJSL.OpenEvent('AI_NEW_CONTRACT','OnClick'));
htp.p(
'
// AI_NEW_CONTRACT_OnClick
//
//
location.href = "efnow050$.contract_startup?p_screen_type=CONTRACT";');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Contracts#2080#',
RL_BODY_ATTRIBUTES, 'efnow050$js$cont.CreateListJavaScript');
end;
end;
/

View File

@@ -0,0 +1,11 @@
create or replace package efnow050$js$cont is
procedure CreateQueryJavaScript(
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2);
procedure CreateListJavaScript(
RL_BODY_ATTRIBUTES in varchar2);
end;
/

View File

@@ -0,0 +1,266 @@
create or replace package body efnow055$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
PROCEDURE contract_values_ro( p_contract_id IN NUMBER
, p_page_no IN NUMBER DEFAULT 1
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_cnppv_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_value IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_data_error IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr )
IS
-- contract_values_ro
--
--
BEGIN
-- Check we have permission to be using this module.
IF NOT caco_security.security_check('efnow050$') THEN
RETURN;
END IF;
--
-- Set the package name
efnow092$.g_package_name := 'efnow050$';
--
-- Call efno092$
efnow092$.contract_values_ro( p_contract_id => p_contract_id
, p_page_no => p_page_no
, p_success => p_success
, p_error => p_error
, p_err_msg => p_err_msg
, p_cnppv_id => p_cnppv_id
, p_value => p_value
, p_data_error => p_data_error );
--
END;
--------------------------------------------------------------------------------
-- Name: efnow055$.Startup
--
-- Description: This procedure is the entry point for the 'efnow055$'
-- module.
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('efnow055$') then
return;
end if;
WSGL.RegisterURL('efnow055$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL));
efnow055$cont.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow055$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: efnow055$.firstpage
--
-- Description: This procedure creates the first page for the 'efnow055$'
-- module.
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('efnow055$') 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, 'EFNOW092', 0, 'efnow092$.startup',p_output_line=>FALSE, p_target=>'_top');
WSGL.NavLinks(WSGL.MENU_LONG, WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT), 0, 'efnow055$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow055$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: efnow055$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'efnow055$' module.
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('efnow055$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('efnow055$.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(WSGL.MsgGetText(108,WSGLM.DSP108_GENERATED_BY, 'PL/SQL Web Generator', '10.1.2.6.18'));
htp.para;
WSGL.Info(FALSE, 'Nominations', 'EFNOW055', l_usr);
htp.p(caco_system.footer);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow055$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: efnow055$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('efnow055$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow055$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: efnow055$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'efnow055$' 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 => 'efnow055$'
, pFirstTitle => ''
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow055$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: efnow055$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/

View File

@@ -0,0 +1,23 @@
create or replace package efnow055$ is
procedure Startup
;
procedure FirstPage(Z_DIRECT_CALL in boolean
);
procedure ShowAbout;
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number);
function GetRef return WSGOC.MODULE_REF;
PROCEDURE contract_values_ro( p_contract_id IN NUMBER
, p_page_no IN NUMBER DEFAULT 1
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_cnppv_id IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_value IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr
, p_data_error IN owa_util.vc_arr DEFAULT efnow092$.g_vc_arr );
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,109 @@
create or replace package efnow055$cont is
type NBT_REC is record
( UI_CUST varchar2(24000)
, UI_CONTRACT varchar2(24000)
, UI_STATUS varchar2(24000)
, UI_CONT_FROM date
, UI_CONT_TO date
, UI_VIEW_URL varchar2(24000)
, L_CUST_NAME CUSTOMERS.NAME%type
);
NBT_VAL NBT_REC;
CURR_VAL CONTRACTS%rowtype;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure ActionQuery(
P_STATUS in varchar2 default null,
P_CONTRACT_NUMBER in varchar2 default null,
P_L_CUST_NAME in varchar2 default null,
P_VALID_FROM in varchar2 default null,
U_VALID_FROM in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null );
procedure FormQuery(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryList(
P_STATUS in varchar2 default null,
P_CONTRACT_NUMBER in varchar2 default null,
P_L_CUST_NAME in varchar2 default null,
P_VALID_FROM in varchar2 default null,
U_VALID_FROM in varchar2 default null,
Z_START in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null );
function QueryHits(
P_STATUS in varchar2 default null,
P_CONTRACT_NUMBER in varchar2 default null,
P_L_CUST_NAME in varchar2 default null,
P_VALID_FROM in varchar2 default null,
U_VALID_FROM in varchar2 default null) return number;
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure InitialiseDomain(P_ALIAS in varchar2);
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
D_STATUS WSGL.typDVRecord;FUNCTION FormatDate ( p_date IN VARCHAR2 ) RETURN VARCHAR2;
procedure ncalendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure nformat_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
end;
/

View File

@@ -0,0 +1,122 @@
create or replace package body efnow055$js$cont is
--------------------------------------------------------------------------------
-- Name: efnow055$js$cont.CreateQueryJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateQueryJavaScript (
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow055$cont') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Query";');
WSGJSL.Output_Invoke_CAL_JS ('efnow055$cont', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('L_CUST_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow055$cont.l_cust_name_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('CONT','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnQFQ','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#View Contract Values#3980#',
QF_BODY_ATTRIBUTES, 'efnow055$js$cont.CreateQueryJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow055$js$cont.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow055$cont') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
htp.p( 'var P_4 = new Array();' );
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#View Contract Values#3980#',
RL_BODY_ATTRIBUTES, 'efnow055$js$cont.CreateListJavaScript');
end;
end;
/

View File

@@ -0,0 +1,11 @@
create or replace package efnow055$js$cont is
procedure CreateQueryJavaScript(
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2);
procedure CreateListJavaScript(
RL_BODY_ATTRIBUTES in varchar2);
end;
/

View File

@@ -0,0 +1,232 @@
create or replace package body efnow070$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
--------------------------------------------------------------------------------
-- Name: efnow070$.Startup
--
-- Description: This procedure is the entry point for the 'efnow070$'
-- module.
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('efnow070$') then
return;
end if;
WSGL.RegisterURL('efnow070$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL));
efnow070$gttd.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow070$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: efnow070$.firstpage
--
-- Description: This procedure creates the first page for the 'efnow070$'
-- module.
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('efnow070$') 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, 'efnow070$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow070$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: efnow070$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'efnow070$' module.
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('efnow070$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('efnow070$.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.2 $');
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', 'EFNOW070', l_usr);
htp.p(caco_system.footer);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow070$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: efnow070$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('efnow070$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow070$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: efnow070$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'efnow070$' 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 => 'efnow070$'
, pFirstTitle => ''
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow070$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: efnow070$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/

View File

@@ -0,0 +1,14 @@
create or replace package efnow070$ is
procedure Startup
;
procedure FirstPage(Z_DIRECT_CALL in boolean
);
procedure ShowAbout;
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number);
function GetRef return WSGOC.MODULE_REF;
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
create or replace package efnow070$gttd is
type NBT_REC is record
( UI_VALID_FROM varchar2(24000)
, UI_VALID_UNTIL varchar2(24000)
, UI_HYPERLINK varchar2(24000)
, L_CUST_CODE CUSTOMERS.CODE%type
);
NBT_VAL NBT_REC;
CURR_VAL CONTRACTS%rowtype;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure QueryList(
Z_START in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null );
function QueryHits return number;
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure InitialiseDomain(P_ALIAS in varchar2);
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
D_STATUS WSGL.typDVRecord;FUNCTION FormatDate ( p_date IN VARCHAR2 ) RETURN VARCHAR2;
PROCEDURE get_template ( p_temp_id IN VARCHAR2 );
end;
/

View File

@@ -0,0 +1,33 @@
create or replace package body efnow070$js$gttd is
--------------------------------------------------------------------------------
-- Name: efnow070$js$gttd.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow070$gttd') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
htp.p( 'var P_8 = new Array();' );
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Download Excel Template#2109#',
RL_BODY_ATTRIBUTES, 'efnow070$js$gttd.CreateListJavaScript');
end;
end;
/

View File

@@ -0,0 +1,7 @@
create or replace package efnow070$js$gttd is
procedure CreateListJavaScript(
RL_BODY_ATTRIBUTES in varchar2);
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,135 @@
CREATE OR REPLACE PACKAGE efnow092$ IS
--
g_package_name VARCHAR2(15) := 'efnow092$';
g_title CONSTANT VARCHAR2(50) := caco_utilities.get_module_text(2271); -- Maintain Contract
g_header CONSTANT VARCHAR2(160) := '$Header: $';
g_revision CONSTANT VARCHAR2(160) := '$Revision: $ Patch 0.3';
--
--
g_vc_arr owa_util.vc_arr;
g_num_arr owa_util.num_arr;
--
g_perc_split_en module_text.text%TYPE := caco_utilities.get_module_text(3921,'EN');
g_perc_split_hu module_text.text%TYPE := caco_utilities.get_module_text(3921,'HU');
--
TYPE network_point_record IS RECORD ( nepo_id network_points.nepo_id%TYPE
, name network_points.name%TYPE );
--
TYPE network_point_array IS TABLE OF network_point_record INDEX BY BINARY_INTEGER;
--
TYPE category_record IS RECORD ( cate_id categories.cate_id%TYPE
, name VARCHAR2(200)
, inherited VARCHAR2(1) );
--
TYPE category_array IS TABLE OF category_record INDEX BY BINARY_INTEGER;
--
TYPE parameter_record IS RECORD ( pars_id parameters.pars_id%TYPE
, name parameters.name%TYPE
, inherited VARCHAR2(1) );
--
TYPE parameter_array IS TABLE OF parameter_record INDEX BY BINARY_INTEGER;
--
--
/**
-- Generic procedures for the date LOV, same as designer generated code
*/
PROCEDURE calendar( z_field_name IN VARCHAR2
, z_caller_url IN VARCHAR2
, z_field_value IN VARCHAR2 DEFAULT NULL
, z_field_format IN VARCHAR2 DEFAULT NULL
, z_field_prompt IN VARCHAR2 DEFAULT NULL );
--
PROCEDURE format_cal_date( z_field_name IN VARCHAR2
, z_field_format IN VARCHAR2
, DAY IN VARCHAR2
, MONTH IN VARCHAR2
, YEAR IN VARCHAR2 );
--
--
PROCEDURE optiontransfer_js;
PROCEDURE autocomplete_js;
PROCEDURE selectbox_js;
PROCEDURE contract_js;
PROCEDURE contractP2_js;
PROCEDURE contractRules_js;
PROCEDURE templateRules_js;
--
PROCEDURE contractP1_css;
PROCEDURE contractP2_css;
PROCEDURE contractRules_css;
PROCEDURE templateRules_css;
--
PROCEDURE template_rules( p_template_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL );
--
PROCEDURE contract_options_P( p_contract_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL );
--
PROCEDURE contract_rules( p_contract_id IN NUMBER
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL );
--
PROCEDURE contract_values_ro( p_contract_id IN NUMBER
, p_page_no IN NUMBER DEFAULT 1
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_spreadsheet IN VARCHAR2 DEFAULT NULL
, p_cnppv_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_value IN owa_util.vc_arr DEFAULT g_vc_arr
, p_data_error IN owa_util.vc_arr DEFAULT g_vc_arr );
--
PROCEDURE contract_values_p2( p_contract_id IN NUMBER
, p_page_no IN NUMBER DEFAULT 1
, p_success IN VARCHAR2 DEFAULT 'N'
, p_error IN VARCHAR2 DEFAULT 'N'
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_spreadsheet IN VARCHAR2 DEFAULT NULL
, p_cnppv_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_value IN owa_util.vc_arr DEFAULT g_vc_arr
, p_data_error IN owa_util.vc_arr DEFAULT g_vc_arr );
--
--
PROCEDURE startup( p_screen_type IN VARCHAR2 DEFAULT 'CONTRACT'
, p_ins_or_upd IN VARCHAR2 DEFAULT 'INSERT'
, p_success IN VARCHAR2 DEFAULT NULL
, p_contract_id IN contracts.cont_id%TYPE DEFAULT 0
, p_contract_number IN contracts.contract_number%TYPE DEFAULT NULL
, p_template_id IN contract_templates.cote_id%TYPE DEFAULT 0
, p_template_name IN VARCHAR2 DEFAULT NULL
, p_template_desc IN VARCHAR2 DEFAULT NULL
, p_emo IN VARCHAR2 DEFAULT NULL
, p_customer_id IN customers.cust_id%TYPE DEFAULT 0
, p_spte_id IN spreadsheet_templates.spte_id%TYPE DEFAULT 0
, p_ops_contact IN VARCHAR2 DEFAULT NULL
, p_bus_contact IN VARCHAR2 DEFAULT NULL
, p_status IN contracts.status%TYPE DEFAULT NULL
, p_days_before IN VARCHAR2 DEFAULT NULL
, p_date_from IN VARCHAR2 DEFAULT NULL
, p_date_to IN VARCHAR2 DEFAULT NULL
, p_val_window IN VARCHAR2 DEFAULT 0
, p_val_action IN contracts.validation_action%TYPE DEFAULT NULL
, p_val_exception IN contracts.validation_exception%TYPE DEFAULT NULL
, p_lookback_action IN contracts.lookback_action%TYPE DEFAULT NULL
, p_template_changed IN VARCHAR2 DEFAULT NULL
, p_prev_template_id IN NUMBER DEFAULT NULL
, p_error IN VARCHAR2 DEFAULT NULL
, p_err_msg IN VARCHAR2 DEFAULT NULL
, p_nepo_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_cate_id IN owa_util.vc_arr DEFAULT g_vc_arr
, p_pars_id IN owa_util.vc_arr DEFAULT g_vc_arr );
--
PROCEDURE export_to_excel ( p_contract_id IN NUMBER);
--
PROCEDURE import_from_excel (p_contract_id IN NUMBER
,p_spreadsheet IN VARCHAR2 DEFAULT NULL );
--
FUNCTION about RETURN VARCHAR2;
--
END EFNOW092$;
/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,460 @@
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(' <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">');
--
wsgl.openpagehead(caco_utilities.get_module_text(2405));
--wsgl.metatag;
--htp.p('<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><LINK REL=stylesheet HREF="caco_system.css?p_type=content" >');
caco_system.content_type;
htp.p('<LINK REL=stylesheet HREF="caco_system.css?p_type=content" >');
htp.p(' <link rel="stylesheet" media="all" type="text/css" href="efnow101$.nomi_css" />');
--
wsgl.closepagehead;
wsgl.openpagebody(FALSE);
htp.p(caco_system.menu);
--
htp.p('
<div style="margin:15px;">
<div>
<h2>' || caco_utilities.get_module_text(2405) || '</h2>'); -- View Nominations
--
OPEN c_nomi;
FETCH c_nomi
INTO l_nomi_rec;
CLOSE c_nomi;
--
htp.p('
<table>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(1145) ||
':&nbsp;&nbsp;</b></td>'); -- Customer Name
htp.p(' <td>' || l_nomi_rec.customer_name ||
'</td>
</tr>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(2013) ||
':&nbsp;&nbsp;</b></td>'); -- Contract Number
htp.p(' <td>' || l_nomi_rec.contract_number ||
'</td>
</tr>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(2060) ||
':&nbsp;&nbsp;</b></td>'); -- Nomination Identifier
htp.p(' <td>' || l_nomi_rec.nomi_identifier ||
'</td>
</tr>
<tr class="nomiTR">
<td><b>' || caco_utilities.get_module_text(118) ||
':&nbsp;&nbsp;</b></td>'); -- Created On
htp.p(' <td>' ||
EFNOW101$NOMI.FORMATDATETIME(TO_CHAR(l_nomi_rec.tsa_timestamp,'DD/MM/YYYY HH24:MI')) ||
'</td>
</tr>
</table>');
--
-- We want a button to call the spreadsheet download routine
--
htp.p('<br /><input type="button" value="' ||
caco_utilities.get_module_text(2064) -- Nomination Detail
||
'" onclick="window.location = ''efnow101$.get_nomi?p_nomi_id=' ||
l_nomi_rec.nomi_id || '''" />');
--
htp.p('<p><b>' || caco_utilities.get_module_text(2065) || '</b></p>'); -- Confirmation Text
--
-- Loop through all of the clob and display it in chunks......
-- Create a width limmited dive for putting it in
htp.p('<div id="nomiTextDiv"><pre>');
--
-- 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('</pre></div>');
--
-- Close the margin div
htp.p('</div>');
--
-- Close centrecontent div
htp.p('</div>');
--
-- Close outer div
htp.p('</div>');
--
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('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
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;
/

View File

@@ -0,0 +1,20 @@
create or replace package efnow101$ is
procedure Startup
;
procedure FirstPage(Z_DIRECT_CALL in boolean
);
procedure ShowAbout;
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number);
function GetRef return WSGOC.MODULE_REF;
PROCEDURE get_nomi ( p_nomi_id IN nominations.nomi_id%TYPE );
PROCEDURE nomi_css;
PROCEDURE view_details(p_nomi_id IN nominations.nomi_id%TYPE);
end;
/

View File

@@ -0,0 +1,122 @@
create or replace package body efnow101$js$nomi is
--------------------------------------------------------------------------------
-- Name: efnow101$js$nomi.CreateQueryJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateQueryJavaScript (
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow101$nomi') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Query";');
WSGJSL.Output_Invoke_CAL_JS ('efnow101$nomi', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('L_CONT_CONTRACT_NUMBER','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow101$nomi.l_cont_contract_number_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('NOMI','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnQFQ','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#View Nominations#2405#',
QF_BODY_ATTRIBUTES, 'efnow101$js$nomi.CreateQueryJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow101$js$nomi.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow101$nomi') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
htp.p( 'var P_12 = new Array();' );
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#View Nominations#2405#',
RL_BODY_ATTRIBUTES, 'efnow101$js$nomi.CreateListJavaScript');
end;
end;
/

View File

@@ -0,0 +1,11 @@
create or replace package efnow101$js$nomi is
procedure CreateQueryJavaScript(
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2);
procedure CreateListJavaScript(
RL_BODY_ATTRIBUTES in varchar2);
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,104 @@
create or replace package efnow101$nomi is
type NBT_REC is record
( UI_CONTRACT_STATUS varchar2(32760)
, L_CONT_CONTRACT_NUMBER CONTRACTS.CONTRACT_NUMBER%type
, UI_START_DATE varchar2(24000)
, UI_END_DATE varchar2(24000)
, UI_TIMESTAMP varchar2(24000)
, UI_URL varchar2(24000)
, UI_START_DATE_DATE date
, UI_START_DATE_QRY date
, UI_END_DATE_QRY date
);
NBT_VAL NBT_REC;
CURR_VAL NOMINATIONS%rowtype;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure ActionQuery(
P_UI_CONTRACT_STATUS in varchar2 default null,
P_L_CONT_CONTRACT_NUMBER in varchar2 default null,
P_STATUS in varchar2 default null,
P_UI_START_DATE_QRY in varchar2 default null,
P_UI_END_DATE_QRY in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null );
procedure FormQuery(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryList(
P_UI_CONTRACT_STATUS in varchar2 default null,
P_L_CONT_CONTRACT_NUMBER in varchar2 default null,
P_STATUS in varchar2 default null,
P_UI_START_DATE_QRY in varchar2 default null,
P_UI_END_DATE_QRY in varchar2 default null,
Z_START in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null );
function QueryHits(
P_UI_CONTRACT_STATUS in varchar2 default null,
P_L_CONT_CONTRACT_NUMBER in varchar2 default null,
P_STATUS in varchar2 default null,
P_UI_START_DATE_QRY in varchar2 default null,
P_UI_END_DATE_QRY in varchar2 default null) return number;
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure InitialiseDomain(P_ALIAS in varchar2);
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
D_UI_CONTRACT_STATUS WSGL.typDVRecord;
D_STATUS WSGL.typDVRecord;FUNCTION FormatDate ( p_date IN VARCHAR2 ) RETURN VARCHAR2;
FUNCTION FormatDateTime ( p_date IN VARCHAR2 ) RETURN VARCHAR2;
FUNCTION get_contract_status RETURN VARCHAR2;
FUNCTION get_end_date RETURN DATE;
FUNCTION get_latest_cont RETURN contracts.contract_number%TYPE;
FUNCTION get_start_date RETURN DATE;
end;
/

View File

@@ -0,0 +1,232 @@
create or replace package body efnow110$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
--------------------------------------------------------------------------------
-- Name: efnow110$.Startup
--
-- Description: This procedure is the entry point for the 'efnow110$'
-- module.
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('efnow110$') then
return;
end if;
WSGL.RegisterURL('efnow110$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL));
efnow110$cust.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow110$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$.firstpage
--
-- Description: This procedure creates the first page for the 'efnow110$'
-- module.
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('efnow110$') 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, 'efnow110$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow110$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'efnow110$' module.
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('efnow110$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('efnow110$.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: %');
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', 'EFNOW110', l_usr);
htp.p(caco_system.footer);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow110$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('efnow110$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow110$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'efnow110$' 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 => 'efnow110$'
, pFirstTitle => ''
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow110$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: efnow110$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/

View File

@@ -0,0 +1,14 @@
create or replace package efnow110$ is
procedure Startup
;
procedure FirstPage(Z_DIRECT_CALL in boolean
);
procedure ShowAbout;
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number);
function GetRef return WSGOC.MODULE_REF;
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,133 @@
create or replace package efnow110$cuin is
type NBT_REC is record
( L_INTERMEDIARIES_NAME2 INTERMEDIARIES.NAME%type
);
NBT_VAL NBT_REC;
CURR_VAL CG$CUSTOMER_INTERMEDIARIES.CG$ROW_TYPE;
procedure Startup(
P_CUST_ID in varchar2,
P_2 in varchar2,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure FormInsert(
P_CUST_ID in varchar2 default null,
P_2 in varchar2 default null,
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryView(
K_CUST_ID in varchar2 default null,
K_INTE_ID in varchar2 default null,
P_2 in varchar2 default null,
P_CUST_ID in varchar2 default null,
Z_EXECUTE_QUERY in varchar2 default null,
Z_POST_DML in boolean default false,
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_START in varchar2 default '1',
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null);
procedure QueryList(
P_CUST_ID in varchar2 default null,
P_2 in varchar2 default null,
Z_START in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null );
procedure QueryFirst(
P_CUST_ID in varchar2 default null,
P_2 in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
function QueryHits(
P_CUST_ID in varchar2 default null) return number;
procedure ActionView(
P_CUST_ID in owa_text.vc_arr,
P_INTE_ID in owa_text.vc_arr,
P_2 in varchar2 default null,
O_CUST_ID in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_INTE_ID in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_CREATED_BY in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_CREATED_ON in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_UPDATED_BY in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_UPDATED_ON in owa_text.vc_arr default WSGL.EmptyVCArrLong,
H_L_INTERMEDIARIES_NAME2 in owa_text.vc_arr default WSGL.EmptyVCArrLong,
Q_CUST_ID in varchar2 default null,
z_modified in owa_text.vc_arr,
Z_ACTION in varchar2 default null,
Z_START in varchar2 default '1',
Z_CHK in varchar2 default null );
procedure ActionInsert(
P_L_INTERMEDIARIES_NAME2 in owa_text.vc_arr,
P_CUST_ID in varchar2 default null,
P_2 in varchar2,
z_modified in owa_text.vc_arr,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure ActionDelete(
P_2 in varchar2 default null,
P_CUST_ID in varchar2 default null,
P_INTE_ID in varchar2 default null,
O_CREATED_BY in varchar2 default null,
O_CREATED_ON in varchar2 default null,
O_UPDATED_BY in varchar2 default null,
O_UPDATED_ON in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryViewByKey(
P_CUST_ID in varchar2 default null,
P_INTE_ID in varchar2 default null,
P_2 in varchar2 default null,
Z_POST_DML in boolean default false,
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,180 @@
create or replace package efnow110$cust is
type NBT_REC is record
( UI_CODE varchar2(32760)
, UI_NAME varchar2(32760)
, UI_KAM_MGR_NAME varchar2(32760)
);
NBT_VAL NBT_REC;
CURR_VAL CG$CUSTOMERS.CG$ROW_TYPE;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure ActionQuery(
P_UI_CODE in varchar2 default null,
P_UI_NAME in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null );
procedure FormQuery(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure KAM_SYUS_ID_LOV(
Z_FILTER in varchar2,
Z_MODE in varchar2,
Z_CALLER_URL in varchar2,
Z_FORMROW in number default 0,
Z_LONG_LIST in varchar2 default null,
Z_ISSUE_WAIT in varchar2 default null);
procedure EFLV_CUST_CODE_LOV(
Z_FILTER in varchar2,
Z_MODE in varchar2,
Z_CALLER_URL in varchar2,
Z_FORMROW in number default 0,
Z_LONG_LIST in varchar2 default null,
Z_ISSUE_WAIT in varchar2 default null);
procedure EFLV_CUST_NAME_LOV(
Z_FILTER in varchar2,
Z_MODE in varchar2,
Z_CALLER_URL in varchar2,
Z_FORMROW in number default 0,
Z_LONG_LIST in varchar2 default null,
Z_ISSUE_WAIT in varchar2 default null);
procedure FormInsert(
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryView(
K_CUST_ID in varchar2 default null,
P_UI_CODE in varchar2 default null,
P_UI_NAME in varchar2 default null,
Z_EXECUTE_QUERY in varchar2 default null,
Z_POST_DML in boolean default false,
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_START in varchar2 default '1',
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null);
function QueryHits(
P_UI_CODE in varchar2 default null,
P_UI_NAME in varchar2 default null) return number;
procedure ActionView(
P_CUST_ID in owa_text.vc_arr,
P_CODE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_NAME in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_PRIMARY_CONTACT in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_PRIMARY_CONTACT_TEL in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_CUTY_ID in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_STATUS in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_EMAIL_ADDRESS in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_DESCRIPTION in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_TELEPHONE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_FAX in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_UI_KAM_MGR_NAME in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_KAM_TELEPHONE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_PERIOD_START in owa_text.vc_arr default WSGL.EmptyVCArrLong,
P_PERIOD_END in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_CUST_ID in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_CODE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_NAME in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_PRIMARY_CONTACT in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_PRIMARY_CONTACT_TEL in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_CUTY_ID in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_STATUS in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_EMAIL_ADDRESS in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_DESCRIPTION in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_TELEPHONE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_FAX in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_KAM_MANAGER in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_KAM_TELEPHONE in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_CREATED_BY in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_CREATED_ON in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_UPDATED_BY in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_UPDATED_ON in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_PERIOD_START in owa_text.vc_arr default WSGL.EmptyVCArrLong,
O_PERIOD_END in owa_text.vc_arr default WSGL.EmptyVCArrLong,
Q_UI_CODE in varchar2 default null,
Q_UI_NAME in varchar2 default null,
z_modified in owa_text.vc_arr,
Z_ACTION in varchar2 default null,
Z_START in varchar2 default '1',
Z_CHK in varchar2 default null ,
C_CUIN in owa_text.vc_arr default WSGL.EmptyVCArrLong );
procedure ActionInsert(
P_CODE in owa_text.vc_arr,
P_NAME in owa_text.vc_arr,
P_PRIMARY_CONTACT in owa_text.vc_arr,
P_PRIMARY_CONTACT_TEL in owa_text.vc_arr,
P_CUTY_ID in owa_text.vc_arr,
P_STATUS in owa_text.vc_arr,
P_EMAIL_ADDRESS in owa_text.vc_arr,
P_DESCRIPTION in owa_text.vc_arr,
P_TELEPHONE in owa_text.vc_arr,
P_FAX in owa_text.vc_arr,
P_UI_KAM_MGR_NAME in owa_text.vc_arr,
P_KAM_TELEPHONE in owa_text.vc_arr,
P_PERIOD_START in owa_text.vc_arr,
P_PERIOD_END in owa_text.vc_arr,
z_modified in owa_text.vc_arr,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryViewByKey(
P_CUST_ID in varchar2 default null,
Z_POST_DML in boolean default false,
Z_FORM_STATUS in number default WSGL.FORM_STATUS_OK,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure InitialiseDomain(P_ALIAS in varchar2);
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
D_CUTY_ID WSGL.typDVRecord;
D_STATUS WSGL.typDVRecord;FUNCTION get_cust_code RETURN VARCHAR2;
FUNCTION get_cust_name RETURN VARCHAR2;
end;
/

View File

@@ -0,0 +1,273 @@
create or replace package body efnow110$js$cuin is
--------------------------------------------------------------------------------
-- Name: efnow110$js$cuin.CreateViewJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateViewJavaScript(
VF_ROWS_UPDATED in integer,
VF_ROWS_DELETED in integer,
VF_ROWS_ERROR in integer,
VF_BODY_ATTRIBUTES in varchar2,
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
RL_REQUERY_BUT_ACTION in varchar2,
LOV_FRAME in varchar2) is
begin
if not caco_security.security_check('efnow110$cuin') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var index = 0;');
if IF_ROWS_INSERTED > 0 then
htp.p( 'var DataChange = true;' );
else
htp.p( 'var DataChange = false;' );
end if;
if IF_ROWS_ERROR > 0 then
htp.p( 'var DataChangeErrors = true;' );
else
htp.p( 'var DataChangeErrors = false;' );
end if;
if to_char(efnow110$cust.CURR_VAL.CUST_ID) is not null then
htp.p( 'var P_CUST_ID = new Array();' );
htp.p( 'P_CUST_ID[0] = "' || WSGL.EscapeURLParam(to_char(efnow110$cust.CURR_VAL.CUST_ID)) || '";' );
end if;
htp.p( 'var P_2 = new Array();' );
htp.p( 'P_2[0] = "' || WSGL.EscapeURLParam(nvl(to_char(efnow110$cust.CURR_VAL.CUST_ID), '')) || '";' );
htp.p( 'var CUIN_CHK_VALUE = new Array();' );
htp.p( 'CUIN_CHK_VALUE[0] = ' || to_char(WSGL.Checksum(''|| to_char(efnow110$cust.CURR_VAL.CUST_ID)|| to_char(efnow110$cust.CURR_VAL.CUST_ID))) || ';' );
htp.p( 'var P_23 = new Array();' );
htp.p( 'P_23[0] = "' || WSGL.EscapeURLParam(to_char(efnow110$cuin.CURR_VAL.CUST_ID)) || '";' );
htp.p( 'var P_24 = new Array();' );
htp.p( 'P_24[0] = "' || WSGL.EscapeURLParam(to_char(efnow110$cuin.CURR_VAL.INTE_ID)) || '";' );
htp.p(WSGJSL.RtnCheckModified);
htp.p(WSGJSL.RtnRevertForm);
htp.p(WSGJSL.RtnFlagRow);
htp.p(WSGJSL.OpenEvent('CUIN','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFU','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFD','OnClick'));
htp.p(WSGJSL.VerifyDelete(WSGL.MsgGetText(118, WSGLM.DSP118_CONFIRM_DELETE)));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFR','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFI','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Intermediaries#1059#',
VF_BODY_ATTRIBUTES, 'efnow110$js$cuin.CreateViewJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$js$cuin.CreateInsertJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateInsertJavaScript(
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
IF_BODY_ATTRIBUTES in varchar2,
RL_REQUERY_BUT_ACTION in varchar2,
LOV_FRAME in varchar2) is
begin
if not caco_security.security_check('efnow110$cuin') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Insert";');
htp.p('var index = 0;');
if IF_ROWS_INSERTED > 0 then
htp.p( 'var DataChange = true;' );
else
htp.p( 'var DataChange = false;' );
end if;
if IF_ROWS_ERROR > 0 then
htp.p( 'var DataChangeErrors = true;' );
else
htp.p( 'var DataChangeErrors = false;' );
end if;
if to_char(efnow110$cust.CURR_VAL.CUST_ID) is not null then
htp.p( 'var P_CUST_ID = new Array();' );
htp.p( 'P_CUST_ID[0] = "' || WSGL.EscapeURLParam(to_char(efnow110$cust.CURR_VAL.CUST_ID)) || '";' );
end if;
htp.p( 'var P_2 = new Array();' );
htp.p( 'P_2[0] = "' || WSGL.EscapeURLParam(nvl(to_char(efnow110$cust.CURR_VAL.CUST_ID), '')) || '";' );
if (to_char(efnow110$cust.CURR_VAL.CUST_ID) is not null ) then
htp.p( 'var CUIN_CHK_VALUE = new Array();' );
htp.p( 'CUIN_CHK_VALUE[0] = ' || to_char(WSGL.Checksum(''|| to_char(efnow110$cust.CURR_VAL.CUST_ID)|| to_char(efnow110$cust.CURR_VAL.CUST_ID))) || ';' );
end if;
htp.p(WSGJSL.RtnCheckModified);
htp.p(WSGJSL.RtnRevertForm);
htp.p(WSGJSL.RtnFlagRow);
htp.p(WSGJSL.OpenEvent('L_INTERMEDIARIES_NAME2','LOV')); htp.p('
var depStr = "";
var modeStr = ""
if (index == null)
index = 0;
if (ctl[index].form.name.search(/VForm$/) == -1)
{
modeStr = "INS";
}
else
{
modeStr = "UPD";
}
depStr = depStr + "&P_2=" + escape(ctl[index].form.P_2.value);
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl[index], index, modeStr, "efnow110$cuin.l_intermediaries_name2_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
WSGJSL.Output_Invoke_CAL_JS ('efnow110$cuin', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('CUIN','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnIFI','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnIFR','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Intermediaries#1059#',
IF_BODY_ATTRIBUTES, 'efnow110$js$cuin.CreateInsertJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$js$cuin.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow110$cuin') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
if to_char(efnow110$cust.CURR_VAL.CUST_ID) is not null then
htp.p( 'var P_CUST_ID = new Array();' );
htp.p( 'P_CUST_ID[0] = "' || WSGL.EscapeURLParam(to_char(efnow110$cust.CURR_VAL.CUST_ID)) || '";' );
end if;
htp.p( 'var P_2 = new Array();' );
htp.p( 'P_2[0] = "' || WSGL.EscapeURLParam(nvl(to_char(efnow110$cust.CURR_VAL.CUST_ID), '')) || '";' );
if (to_char(efnow110$cust.CURR_VAL.CUST_ID) is not null ) then
htp.p( 'var CUIN_CHK_VALUE = new Array();' );
htp.p( 'CUIN_CHK_VALUE[0] = ' || to_char(WSGL.Checksum(''|| to_char(efnow110$cust.CURR_VAL.CUST_ID)|| to_char(efnow110$cust.CURR_VAL.CUST_ID))) || ';' );
end if;
htp.p( 'var P_23 = new Array();' );
htp.p( 'var P_24 = new Array();' );
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Intermediaries#1059#',
RL_BODY_ATTRIBUTES, 'efnow110$js$cuin.CreateListJavaScript');
end;
end;
/

View File

@@ -0,0 +1,24 @@
create or replace package efnow110$js$cuin is
procedure CreateListJavaScript(
RL_BODY_ATTRIBUTES in varchar2);
procedure CreateViewJavaScript(
VF_ROWS_UPDATED in integer,
VF_ROWS_DELETED in integer,
VF_ROWS_ERROR in integer,
VF_BODY_ATTRIBUTES in varchar2,
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
RL_REQUERY_BUT_ACTION in varchar2,
LOV_FRAME in varchar2);
procedure CreateInsertJavaScript(
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
IF_BODY_ATTRIBUTES in varchar2,
RL_REQUERY_BUT_ACTION in varchar2,
LOV_FRAME in varchar2);
end;
/

View File

@@ -0,0 +1,978 @@
create or replace package body efnow110$js$cust is
--------------------------------------------------------------------------------
-- Name: efnow110$js$cust.CreateViewJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateViewJavaScript(
VF_ROWS_UPDATED in integer,
VF_ROWS_DELETED in integer,
VF_ROWS_ERROR in integer,
VF_BODY_ATTRIBUTES in varchar2,
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
LOV_FRAME in varchar2) is
begin
if not caco_security.security_check('efnow110$cust') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var index = 0;');
if IF_ROWS_INSERTED > 0 then
htp.p( 'var DataChange = true;' );
else
htp.p( 'var DataChange = false;' );
end if;
if IF_ROWS_ERROR > 0 then
htp.p( 'var DataChangeErrors = true;' );
else
htp.p( 'var DataChangeErrors = false;' );
end if;
htp.p( 'var P_CUST_ID = new Array();' );
htp.p( 'var P_2 = new Array();' );
htp.p( 'var CUIN_CHK_VALUE = new Array();' );
htp.p(WSGJSL.RtnOpenLOV);
htp.p(WSGJSL.RtnNotNull);
htp.p(WSGJSL.RtnChkMaxLength);
htp.p(WSGJSL.RtnCheckModified);
htp.p(WSGJSL.RtnRevertForm);
htp.p(WSGJSL.RtnFlagRow);
htp.p(WSGJSL.RtnFindTargetFrame);
WSGJSL.Output_Invoke_CAL_JS ('efnow110$cust', 'scrollbars=no,resizable=no,width=320,height=350');
efnow110$cust.InitialiseDomain('CUTY_ID');
efnow110$cust.InitialiseDomain('STATUS');
htp.p('
function ResetRadios( form, num_rows )
{
return;
};
');
htp.p(WSGJSL.OpenEvent('CODE','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('NAME','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('PRIMARY_CONTACT','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('PRIMARY_CONTACT_TEL','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('CUTY_ID','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('STATUS','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('EMAIL_ADDRESS','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('DESCRIPTION','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('TELEPHONE','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('FAX','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('UI_KAM_MGR_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
if (index == null)
index = 0;
if (ctl[index].form.name.search(/VForm$/) == -1)
{
modeStr = "INS";
}
else
{
modeStr = "UPD";
}
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl[index], index, modeStr, "efnow110$cust.kam_syus_id_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('UI_KAM_MGR_NAME','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('KAM_TELEPHONE','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('PERIOD_START','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('PERIOD_END','OnChange')); htp.p('
if (ctl != null)
{
ctl.form.z_modified[index].value = "Y";
}');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('CUST','Validate'));
htp.p('var index = 0;');
htp.p('
for (index = 0; index < ctl.form.P_PRIMARY_CONTACT.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p(WSGJSL.CallNotNull('ctl.form.P_PRIMARY_CONTACT[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Primary Contact*#2472#:'), true));
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_PRIMARY_CONTACT_TEL.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p(WSGJSL.CallNotNull('ctl.form.P_PRIMARY_CONTACT_TEL[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Primary Contact Tel.*#2473#:'), true));
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_EMAIL_ADDRESS.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p(WSGJSL.CallNotNull('ctl.form.P_EMAIL_ADDRESS[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Email Address*#2462#:'), true));
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_DESCRIPTION.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p(WSGJSL.CallChkMaxLength('ctl.form.P_DESCRIPTION[index]', 80, WSGL.MsgGetText(230, WSGLM.MSG230_MAXLEN_ERROR, '#Description#20#:', '80')
, true));
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_TELEPHONE.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p(WSGJSL.CallNotNull('ctl.form.P_TELEPHONE[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Telephone*#2463#:'), true));
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_FAX.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p(WSGJSL.CallNotNull('ctl.form.P_FAX[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Fax*#2465#:'), true));
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_UI_KAM_MGR_NAME.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_KAM_TELEPHONE.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_PERIOD_START.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p(WSGJSL.CallNotNull('ctl.form.P_PERIOD_START[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Period Start*#2460#:'), true));
htp.p('
}');
htp.p('
for (index = 0; index < ctl.form.P_PERIOD_END.length; index++)
{');
htp.p(' if (!(ctl.form.z_modified[index].value == "Y")) { continue;};');
htp.p('
}');
htp.p(WSGJSL.CloseEvent);
htp.p(
'// emailCheck
//
//
function emailCheck (emailObj,lang) {
function fieldFocus() {
emailObj.focus();
}
/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD. 1 means check it, 0 means don''''t. */
var checkTLD=1;
var emailStr = emailObj.value;
/* The following is the list of known TLDs that an e-mail address must end with. */
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
/* The following pattern is used to check if the entered e-mail address
fits the user@domain format. It also is used to separate the username
from the domain. */
var emailPat=/^(.+)@(.+)$/;
/* The following string represents the pattern for matching all special
characters. We don''''t want to allow special characters in the address.
These characters include ( ) < > @ , ; : \ " . [ ] */
/*
other chars: +!%/=*-#&{}?$|
*/
var specialChars="\\(\\)\\>\\<\\@\\,\\;\\:\\+\\!\\%\\/\\=\\*\\#\\&\\{\\}\\?\\$|\\\\\\\"\\.\\[\\]";
/* The following string represents the range of characters allowed in a
username or domainname. It really states which chars aren''''t allowed.*/
var validChars="\[^\\s" + specialChars + "\]";
/*var validChars="\[^\\s" + "\]";*/
/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren''''t; anything goes). E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")";
/* The following pattern applies for domains that are IP addresses,
rather than symbolic names. E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
/* The following string represents an atom (basically a series of non-special characters.) */
var atom=validChars + ''''+'''';
/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")";
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
/* Finally, let''''s start trying to figure out if the supplied address is valid. */
/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
/* Too many/few @''''s or something; basically, this address doesn''''t
even fit the general mould of a valid e-mail address. */
setTimeout( fieldFocus , 100 );
if (lang=="HU") {
alert("Helytelen Email c<>m (ellenorizze a @ <20>s . karaktereket)");
}
else {
alert("Email address seems incorrect (check @ and .''''s)");
}
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
// Start by checking that only basic ASCII characters are in the strings (0-127).
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("This username contains invalid characters.");
emailObj.focus();
return false;
}
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("This domain name contains invalid characters.");
emailObj.focus();
return false;
}
}
// See if "user" is valid
if (user.match(userPat)==null) {
// user is not valid
if (lang=="HU") {
alert("A felhaszn<7A>l<EFBFBD>n<EFBFBD>v nem tunik <20>rv<72>nyesnek.");
}
else {
alert("The username doesn''''t seem to be valid.");
}
emailObj.focus();
return false;
}
/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
// this is an IP address
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
emailObj.focus();
return false;
}
}
return true;
}
// Domain is symbolic name. Check if it''''s valid.
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
if (lang=="HU") {
alert("A domain n<>v nem tunik <20>rv<72>nyesnek.");
}
else {
alert("The domain name does not seem to be valid.");
}
emailObj.focus();
return false;
}
}
/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there''''s a hostname preceding
the domain or country. */
if (checkTLD && domArr[domArr.length-1].length!=2 &&
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
emailObj.focus();
return false;
}
// Make sure there''''s a host name preceding the domain.
if (len<2) {
alert("This address is missing a hostname!");
emailObj.focus();
return false;
}
// If we''''ve gotten this far, everything''''s valid!
return true;
}
// End -->');
htp.p(WSGJSL.OpenEvent('CUST','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFU','OnClick'));
htp.p(' if (!CUST_Validate(ctl)) { return false; }');
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFD','OnClick'));
htp.p(WSGJSL.VerifyDelete(WSGL.MsgGetText(118, WSGLM.DSP118_CONFIRM_DELETE)));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFR','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnVFI','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('AI_INTE','OnClick'));
htp.p('
var TargetFrame = JSLFindTargetFrame( "_top");
var Url = "EFNOW110$CUIN.startup?Z_FORM=QUERY&P_CUST_ID=" + P_CUST_ID[index] + "&P_2=" + P_2[index] + "&Z_CHK=" + CUIN_CHK_VALUE[index];
if (TargetFrame)
{
TargetFrame.location = Url;
}
else
{
location = Url;
}
return false;');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Customer#1058#',
VF_BODY_ATTRIBUTES, 'efnow110$js$cust.CreateViewJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$js$cust.CreateInsertJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateInsertJavaScript(
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
IF_BODY_ATTRIBUTES in varchar2,
LOV_FRAME in varchar2) is
begin
if not caco_security.security_check('efnow110$cust') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Insert";');
htp.p('var index = 0;');
if IF_ROWS_INSERTED > 0 then
htp.p( 'var DataChange = true;' );
else
htp.p( 'var DataChange = false;' );
end if;
if IF_ROWS_ERROR > 0 then
htp.p( 'var DataChangeErrors = true;' );
else
htp.p( 'var DataChangeErrors = false;' );
end if;
htp.p(WSGJSL.RtnOpenLOV);
htp.p(WSGJSL.RtnNotNull);
htp.p(WSGJSL.RtnChkMaxLength);
htp.p(WSGJSL.RtnCheckModified);
htp.p(WSGJSL.RtnRevertForm);
htp.p(WSGJSL.RtnFlagRow);
htp.p(WSGJSL.RtnFindTargetFrame);
WSGJSL.Output_Invoke_CAL_JS ('efnow110$cust', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('UI_KAM_MGR_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
if (index == null)
index = 0;
if (ctl[index].form.name.search(/VForm$/) == -1)
{
modeStr = "INS";
}
else
{
modeStr = "UPD";
}
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl[index], index, modeStr, "efnow110$cust.kam_syus_id_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('CUST','Validate'));
htp.p(
'
// CheckEmail
//
//
return emailCheck(ctl.form.P_EMAIL_ADDRESS[0]);');htp.p('var index = 0;');
htp.p(WSGJSL.CallNotNull('ctl.form.P_PRIMARY_CONTACT[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Primary Contact*#2472#:')));
htp.p(WSGJSL.CallNotNull('ctl.form.P_PRIMARY_CONTACT_TEL[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Primary Contact Tel.*#2473#:')));
htp.p(WSGJSL.CallNotNull('ctl.form.P_EMAIL_ADDRESS[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Email Address*#2462#:')));
htp.p(WSGJSL.CallChkMaxLength('ctl.form.P_DESCRIPTION[index]', 80, WSGL.MsgGetText(230, WSGLM.MSG230_MAXLEN_ERROR, '#Description#20#:', '80')
));
htp.p(WSGJSL.CallNotNull('ctl.form.P_TELEPHONE[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Telephone*#2463#:')));
htp.p(WSGJSL.CallNotNull('ctl.form.P_FAX[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Fax*#2465#:')));
htp.p(WSGJSL.CallNotNull('ctl.form.P_PERIOD_START[index]', WSGL.MsgGetText(219, WSGLM.MSG219_MISSING_MANDATORY, '#Period Start*#2460#:')));
htp.p(WSGJSL.CloseEvent);
htp.p(
'// emailCheck
//
//
function emailCheck (emailObj,lang) {
function fieldFocus() {
emailObj.focus();
}
/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD. 1 means check it, 0 means don''''t. */
var checkTLD=1;
var emailStr = emailObj.value;
/* The following is the list of known TLDs that an e-mail address must end with. */
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
/* The following pattern is used to check if the entered e-mail address
fits the user@domain format. It also is used to separate the username
from the domain. */
var emailPat=/^(.+)@(.+)$/;
/* The following string represents the pattern for matching all special
characters. We don''''t want to allow special characters in the address.
These characters include ( ) < > @ , ; : \ " . [ ] */
/*
other chars: +!%/=*-#&{}?$|
*/
var specialChars="\\(\\)\\>\\<\\@\\,\\;\\:\\+\\!\\%\\/\\=\\*\\#\\&\\{\\}\\?\\$|\\\\\\\"\\.\\[\\]";
/* The following string represents the range of characters allowed in a
username or domainname. It really states which chars aren''''t allowed.*/
var validChars="\[^\\s" + specialChars + "\]";
/*var validChars="\[^\\s" + "\]";*/
/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren''''t; anything goes). E.g. "jiminy cricket"@disney.com
is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")";
/* The following pattern applies for domains that are IP addresses,
rather than symbolic names. E.g. joe@[123.124.233.4] is a legal
e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
/* The following string represents an atom (basically a series of non-special characters.) */
var atom=validChars + ''''+'''';
/* The following string represents one word in the typical username.
For example, in john.doe@somewhere.com, john and doe are words.
Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")";
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
/* Finally, let''''s start trying to figure out if the supplied address is valid. */
/* Begin with the coarse pattern to simply break up user@domain into
different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
/* Too many/few @''''s or something; basically, this address doesn''''t
even fit the general mould of a valid e-mail address. */
setTimeout( fieldFocus , 100 );
if (lang=="HU") {
alert("Helytelen Email c<>m (ellenorizze a @ <20>s . karaktereket)");
}
else {
alert("Email address seems incorrect (check @ and .''''s)");
}
return false;
}
var user=matchArray[1];
var domain=matchArray[2];
// Start by checking that only basic ASCII characters are in the strings (0-127).
for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("This username contains invalid characters.");
emailObj.focus();
return false;
}
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("This domain name contains invalid characters.");
emailObj.focus();
return false;
}
}
// See if "user" is valid
if (user.match(userPat)==null) {
// user is not valid
if (lang=="HU") {
alert("A felhaszn<7A>l<EFBFBD>n<EFBFBD>v nem tunik <20>rv<72>nyesnek.");
}
else {
alert("The username doesn''''t seem to be valid.");
}
emailObj.focus();
return false;
}
/* if the e-mail address is at an IP address (as opposed to a symbolic
host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
// this is an IP address
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
emailObj.focus();
return false;
}
}
return true;
}
// Domain is symbolic name. Check if it''''s valid.
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
if (lang=="HU") {
alert("A domain n<>v nem tunik <20>rv<72>nyesnek.");
}
else {
alert("The domain name does not seem to be valid.");
}
emailObj.focus();
return false;
}
}
/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there''''s a hostname preceding
the domain or country. */
if (checkTLD && domArr[domArr.length-1].length!=2 &&
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
emailObj.focus();
return false;
}
// Make sure there''''s a host name preceding the domain.
if (len<2) {
alert("This address is missing a hostname!");
emailObj.focus();
return false;
}
// If we''''ve gotten this far, everything''''s valid!
return true;
}
// End -->');
htp.p(WSGJSL.OpenEvent('CUST','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnIFI','OnClick'));
htp.p(' if (!CUST_Validate(ctl)) { return false; }');
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnIFR','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Customer#1058#',
IF_BODY_ATTRIBUTES, 'efnow110$js$cust.CreateInsertJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow110$js$cust.CreateQueryJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateQueryJavaScript (
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow110$cust') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Query";');
htp.p(WSGJSL.OpenEvent('UI_CODE','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow110$cust.eflv_cust_code1_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
WSGJSL.Output_Invoke_CAL_JS ('efnow110$cust', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('UI_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow110$cust.eflv_cust_name1_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('CUST','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnQFQ','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#Maintain Customer#1058#',
QF_BODY_ATTRIBUTES, 'efnow110$js$cust.CreateQueryJavaScript');
end;
end;
/

View File

@@ -0,0 +1,23 @@
create or replace package efnow110$js$cust is
procedure CreateQueryJavaScript(
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2);
procedure CreateViewJavaScript(
VF_ROWS_UPDATED in integer,
VF_ROWS_DELETED in integer,
VF_ROWS_ERROR in integer,
VF_BODY_ATTRIBUTES in varchar2,
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
LOV_FRAME in varchar2);
procedure CreateInsertJavaScript(
IF_ROWS_INSERTED in integer,
IF_ROWS_ERROR in integer,
IF_BODY_ATTRIBUTES in varchar2,
LOV_FRAME in varchar2);
end;
/

View File

@@ -0,0 +1,232 @@
create or replace package body efnow120$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
--------------------------------------------------------------------------------
-- Name: efnow120$.Startup
--
-- Description: This procedure is the entry point for the 'efnow120$'
-- module (#View Commercial Confirmations#2480#).
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('efnow120$') then
return;
end if;
WSGL.RegisterURL('efnow120$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, '#View Commercial Confirmations#2480#');
efnow120$conf.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '#View Commercial Confirmations#2480#',
'', 'efnow120$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: efnow120$.firstpage
--
-- Description: This procedure creates the first page for the 'efnow120$'
-- module (#View Commercial Confirmations#2480#).
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('efnow120$') then
return;
end if;
WSGL.OpenPageHead('#View Commercial Confirmations#2480#');
WSGL.METATag;
WSGL.ClosePageHead;
WSGL.OpenPageBody(FALSE, p_attributes=>'');
CreateStartupJavaScript;
WSGL.DefaultPageCaption('#View Commercial Confirmations#2480#', 1);
htp.formOpen(curl => 'ActionItem', cattributes => 'NAME="SP$AIForm"');
WSGL.NavLinks(WSGL.MENU_LONG, WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT), 0, 'efnow120$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '#View Commercial Confirmations#2480#',
'', 'efnow120$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: efnow120$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'efnow120$' module (#View Commercial Confirmations#2480#).
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('efnow120$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('efnow120$.showabout');
if WSGL.NotLowerCase then
return;
end if;
WSGL.OpenPageHead(WSGL.MsgGetText(107,WSGLM.DSP107_ABOUT)||' #View Commercial Confirmations#2480#');
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)||' #View Commercial Confirmations#2480#');
htp.para;
htp.p('
$Revision: 1.4 $');
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', 'EFNOW120', l_usr);
htp.p(caco_system.footer);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '#View Commercial Confirmations#2480#',
'', 'efnow120$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: efnow120$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('efnow120$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '#View Commercial Confirmations#2480#',
'', 'efnow120$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: efnow120$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'efnow120$' module (#View Commercial Confirmations#2480#).
-- 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 => 'efnow120$'
, pFirstTitle => '#View Commercial Confirmations#2480#'
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '#View Commercial Confirmations#2480#',
'', 'efnow120$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: efnow120$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/

View File

@@ -0,0 +1,14 @@
create or replace package efnow120$ is
procedure Startup
;
procedure FirstPage(Z_DIRECT_CALL in boolean
);
procedure ShowAbout;
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number);
function GetRef return WSGOC.MODULE_REF;
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,94 @@
create or replace package efnow120$conf is
type NBT_REC is record
( L_CUST2_NAME CUSTOMERS.NAME%type
, L_CONT2_CONTRACT_NUMBER CONTRACTS.CONTRACT_NUMBER%type
, L_NOMI_IDENTIFIER NOMINATIONS.IDENTIFIER%type
, UI_GAS_DAY varchar2(24000)
, UI_CONF_SENT varchar2(24000)
, UI_URL varchar2(24000)
, UI_GAS_DAY_DATE date
);
NBT_VAL NBT_REC;
CURR_VAL CONFIRMATIONS%rowtype;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure ActionQuery(
P_L_CONT2_CONTRACT_NUMBER in varchar2 default null,
P_L_NOMI_IDENTIFIER in varchar2 default null,
P_CONFIRMATION_SENT in varchar2 default null,
U_CONFIRMATION_SENT in varchar2 default null,
P_GAS_DAY in varchar2 default null,
U_GAS_DAY in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null );
procedure FormQuery(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure QueryList(
P_L_CONT2_CONTRACT_NUMBER in varchar2 default null,
P_L_NOMI_IDENTIFIER in varchar2 default null,
P_CONFIRMATION_SENT in varchar2 default null,
U_CONFIRMATION_SENT in varchar2 default null,
P_GAS_DAY in varchar2 default null,
U_GAS_DAY in varchar2 default null,
Z_START in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null );
function QueryHits(
P_L_CONT2_CONTRACT_NUMBER in varchar2 default null,
P_L_NOMI_IDENTIFIER in varchar2 default null,
P_CONFIRMATION_SENT in varchar2 default null,
U_CONFIRMATION_SENT in varchar2 default null,
P_GAS_DAY in varchar2 default null,
U_GAS_DAY in varchar2 default null) return number;
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
FUNCTION FormatDate ( p_date IN VARCHAR2 ) RETURN VARCHAR2;
FUNCTION FormatDateTime ( p_date IN VARCHAR2 ) RETURN VARCHAR2;
end;
/

View File

@@ -0,0 +1,122 @@
create or replace package body efnow120$js$conf is
--------------------------------------------------------------------------------
-- Name: efnow120$js$conf.CreateQueryJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateQueryJavaScript (
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow120$conf') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Query";');
WSGJSL.Output_Invoke_CAL_JS ('efnow120$conf', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('L_CONT2_CONTRACT_NUMBER','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow120$conf.cust_cont_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('CONF','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('btnQFQ','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '#View Commercial Confirmations#2480#'||' : '||'',
QF_BODY_ATTRIBUTES, 'efnow120$js$conf.CreateQueryJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow120$js$conf.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow120$conf') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
htp.p( 'var P_7 = new Array();' );
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '#View Commercial Confirmations#2480#'||' : '||'',
RL_BODY_ATTRIBUTES, 'efnow120$js$conf.CreateListJavaScript');
end;
end;
/

View File

@@ -0,0 +1,11 @@
create or replace package efnow120$js$conf is
procedure CreateQueryJavaScript(
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2);
procedure CreateListJavaScript(
RL_BODY_ATTRIBUTES in varchar2);
end;
/

View File

@@ -0,0 +1,976 @@
CREATE OR REPLACE PACKAGE BODY efnow131$ IS
--
-- Text constants
--
c_heading CONSTANT NUMBER := 1141;
c_gas_day CONSTANT NUMBER := 1142;
c_window_open CONSTANT NUMBER := 1143;
c_window_close CONSTANT NUMBER := 1144;
c_customer_name CONSTANT NUMBER := 1145;
c_contract_name CONSTANT NUMBER := 2082;
c_include_exclude CONSTANT NUMBER := 1146;
c_submit CONSTANT NUMBER := 1147;
c_selectall CONSTANT NUMBER := 1148;
c_message CONSTANT NUMBER := 1150;
c_customers CONSTANT NUMBER := 1045;
c_contracts CONSTANT NUMBER := 2401;
c_timestamp CONSTANT NUMBER := 1152;
c_subject CONSTANT NUMBER := 2148;
--
-- Other Constants
--
c_gas_day_start CONSTANT NUMBER := cout_system_configuration.get_configuration_item(p_parameter => 'GAS_DAY_OFFSET');
c_timecomp_format CONSTANT VARCHAR2(2) := '00';
c_yes CONSTANT VARCHAR2(1) := 'Y';
c_date_format CONSTANT VARCHAR2(255) := g_date_format;
c_datetime_format CONSTANT VARCHAR2(255) := c_date_format ||
' HH24:MI:SS';
c_nom_wdw_format CONSTANT VARCHAR2(255) := c_date_format || ' HH24:MI';
c_renom_window CONSTANT VARCHAR2(1) := 'R';
c_time_format CONSTANT VARCHAR2(255) := 'HH24:MI';
--
-- Global variables
--
g_gas_day_lbl VARCHAR2(255) := caco_utilities.get_module_text(c_gas_day);
g_subject_lbl VARCHAR2(255) := caco_utilities.get_module_text(c_subject);
g_message_lbl VARCHAR2(255) := caco_utilities.get_module_text(c_message);
g_customers VARCHAR2(255) := caco_utilities.get_module_text(c_customers);
g_contracts VARCHAR2(255) := caco_utilities.get_module_text(c_contracts);
g_wdw_open_lbl VARCHAR2(255) := caco_utilities.get_module_text(c_window_open);
g_wdw_close_lbl VARCHAR2(255) := caco_utilities.get_module_text(c_window_close);
g_timestamp_lbl VARCHAR2(255) := caco_utilities.get_module_text(c_timestamp);
--
-- standard web calendar package
--
PROCEDURE calendar(z_field_name IN VARCHAR2
,z_caller_url IN VARCHAR2
,z_field_value IN VARCHAR2 DEFAULT NULL
,z_field_format IN VARCHAR2 DEFAULT NULL
,z_field_prompt IN VARCHAR2 DEFAULT NULL) IS
--
field_caption VARCHAR2(2000);
--
BEGIN
--
IF z_field_prompt IS NULL THEN
--
field_caption := INITCAP(REPLACE(SUBSTR(z_field_name
,3
,LENGTH(z_field_name) - 2)
,'_'
,' '));
--
ELSE
--
field_caption := INITCAP(REPLACE(z_field_prompt
,'_'
,' '));
--
END IF;
--
wsgl.registerurl(g_package_name || '.calendar');
wsgl.addurlparam('Z_FIELD_NAME'
,z_field_name);
wsgl.addurlparam('Z_CALLER_URL'
,z_caller_url);
--
IF wsgl.notlowercase THEN
RETURN;
END IF;
--
wsgl.output_calendar(z_field_name
,z_field_value
,z_field_format
,wsgl.msggettext(123
,wsglm.dsp128_cal_caption
,field_caption)
,NULL
,g_package_name
,'Close'
,TRUE
,g_date_format);
--
wsgl.output_calendar(z_field_name
,z_field_value
,z_field_format
,wsgl.msggettext(123
,wsglm.dsp128_cal_caption
,field_caption)
,NULL
,g_package_name
,'Close'
,FALSE
,g_date_format);
--
EXCEPTION
WHEN OTHERS THEN
wsgl.displaymessage(wsgl.mess_exception
,SQLERRM
,''
,NULL
,g_package_name || '.calendar');
END calendar;
--
-- Standard web formatting package for submitted dates
--
PROCEDURE format_cal_date(z_field_name IN VARCHAR2
,z_field_format IN VARCHAR2
,DAY IN VARCHAR2
,MONTH IN VARCHAR2
,YEAR IN VARCHAR2) IS
--
field_caption VARCHAR2(2000) := INITCAP(REPLACE(SUBSTR(z_field_name
,3
,LENGTH(z_field_name) - 2)
,'_'
,' '));
l_day VARCHAR2(15) := DAY;
--
PROCEDURE output_format_cal_js(page_header IN VARCHAR2
,body_attributes IN VARCHAR2
,chosen_date IN VARCHAR2
,field_format IN VARCHAR2) IS
--
-- Copied from WSGL
--
the_date DATE := TO_DATE(chosen_date
,'DD-MONTH-YYYY');
--
BEGIN
--
wsgl.openpagehead(page_header);
wsgl.closepagehead;
wsgl.openpagebody(FALSE
,p_attributes => body_attributes);
htp.p('<SCRIPT>');
htp.p('opener.dateField.value = "' ||
TO_CHAR(the_date
,field_format) || '";');
htp.p('opener.dateField.focus();');
htp.p('if(opener.dateField.onchange != null) { opener.dateField.onchange(); }');
htp.p('window.close();');
htp.p('</SCRIPT>');
wsgl.closepagebody;
--
END output_format_cal_js;
--
BEGIN
--
IF l_day = '0' THEN
l_day := '01';
END IF;
--
output_format_cal_js(wsgl.msggettext(123
,wsglm.dsp128_cal_caption
,field_caption)
,NULL
,l_day || '-' || MONTH || '-' || YEAR
,z_field_format);
--
END format_cal_date;
--
-- Produce the hour poplist
--
PROCEDURE hour_option_list IS
--
l_hour NUMBER;
--
BEGIN
--
--
-- Start at the gas day begining....
--
l_hour := c_gas_day_start;
--
FOR i IN 1 .. 24 LOOP
--
-- Reset the counter to do hours from midnight to 5
--
IF l_hour > 23 THEN
--
l_hour := 0;
--
END IF;
--
IF TO_NUMBER(TO_CHAR(l_hour
,c_timecomp_format)) =
TO_NUMBER(TO_CHAR((SYSDATE + 1 / 24)
,'HH24')) THEN
--
htp.p('<option value="' ||
TO_CHAR(l_hour
,c_timecomp_format) || '", SELECTED>' ||
TO_CHAR(l_hour
,c_timecomp_format));
--
ELSE
--
htp.p('<option value="' || TO_CHAR(l_hour) || '">' ||
TO_CHAR(l_hour));
--
END IF;
--
l_hour := l_hour + 1;
--
END LOOP;
--
END;
--
-- Produce the minute option list
--
PROCEDURE minute_option_list IS
--
l_minute VARCHAR2(2);
--
BEGIN
--
l_minute := 0;
--
FOR i IN 1 .. 12 LOOP
--
IF l_minute = 0 THEN
--
htp.p('<option value="' ||
TO_CHAR(l_minute
,c_timecomp_format) || '",SELECTED>' ||
TO_CHAR(l_minute
,c_timecomp_format));
--
ELSE
--
htp.p('<option value="' ||
TO_CHAR(l_minute
,c_timecomp_format) || '">' ||
TO_CHAR(l_minute
,c_timecomp_format));
--
END IF;
--
l_minute := l_minute + 5;
--
END LOOP;
--
END;
--
-- Output the HTML page head
--
PROCEDURE page_header IS
--
l_header VARCHAR2(255);
l_gas_day DATE;
--
l_empty_tab_row VARCHAR2(255) := '<tr><td></td><td></td><td></td></tr>';
--
BEGIN
--
l_header := caco_utilities.get_module_text(c_heading);
--
htp.p('<div id="header_div">
<h1>' || l_header || '</h1>');
--
htp.p('<table>');
htp.p('<tr>
<td style="width:120px;"><b>' || g_gas_day_lbl ||
'&nbsp;*&nbsp;</b></td>
<td>
<input id="p_gas_day" name="p_gas_day" type="text" value="' ||
TO_CHAR(l_gas_day
,g_date_format) || '" />
</td>
<td>');
--
htp.p(wsgjsl.calbutton(field_name => 'p_gas_day'
,p_calbut => htf.img(curl => caco_system.images_path ||
'lov.gif'
,calign => 'TOP'
,cattributes => 'ALT="List Values" WIDTH=18 HEIGHT=22 BORDER')
,field_format => g_date_format
,p_field_prompt => g_gas_day_lbl));
--
htp.p(' </td>
</tr>');
--
htp.p('</table>');
--
htp.p('<br>');
--
htp.p('<table>');
htp.p('<tr>
<td style="width:120px;"><b>' || g_wdw_open_lbl ||
'&nbsp;*&nbsp;</b></td>
<td>');
htp.p('<select name="p_wdw_open_hr">');
--
hour_option_list;
--
htp.p('</select>');
--
htp.p(' </td>
<td>');
--
htp.p('<select name="p_wdw_open_min">');
--
minute_option_list;
--
htp.p('</select>');
--
htp.p(' </td>
</tr>');
--
htp.p(l_empty_tab_row);
--
htp.p('<tr>
<td style="width:120px;"><b>' || g_wdw_close_lbl ||
'&nbsp;*&nbsp;</b></td>
<td>');
--
htp.p('<select name="p_wdw_close_hr">');
--
hour_option_list;
--
htp.p('</select>');
--
htp.p(' </td>
<td>');
--
htp.p('<select name="p_wdw_close_min">');
--
minute_option_list;
--
htp.p(' </td>
</tr>');
--
htp.p('</table>');
--
htp.p('<br>');
--
htp.p('<table>');
--
htp.p('<tr valign="top">');
--
htp.p('<td style="width:120px;"><b>' || g_subject_lbl ||
'&nbsp;*&nbsp;</b></td>');
htp.p('<td><input name="p_subject" SIZE="40" MAXLENGTH="100"></input></td>');
--
htp.p('</tr>');
--
htp.p('<tr valign="top">');
--
htp.p('<td style="width:120px;"><b>' || g_message_lbl ||
'&nbsp;*&nbsp;</b></td>');
htp.p('<td><textarea name="p_message" rows=5 cols=30></textarea></td>');
--
htp.p('</tr>');
--
/* htp.p('<tr valign="top">');
--
htp.p('<td style="width:120px;"><b>' || g_notes_lbl ||
'&nbsp;&nbsp;</b></td>');
htp.p('<td><textarea name="p_notes" rows=5 cols=30></textarea></td>');
--
htp.p('</tr>');*/
--
htp.p('</table>');
--
htp.p('<br>');
htp.p('<hr/>');
--
htp.p('</div>');
--
END;
--
-- Output the form elements
--
PROCEDURE page_body IS
--
l_cust_name_lbl VARCHAR2(255);
l_cont_name_lbl VARCHAR2(255);
l_inc_exc_lbl VARCHAR2(255);
l_index NUMBER;
--
BEGIN
--
l_cust_name_lbl := caco_utilities.get_module_text(c_customer_name);
l_cont_name_lbl := caco_utilities.get_module_text(c_contract_name);
l_inc_exc_lbl := caco_utilities.get_module_text(c_include_exclude);
--
htp.p('<div id="page_body_div">');
htp.p('<table>');
htp.p('<thead>');
--
htp.p('<tr>');
--
htp.print('<th align="left">' || l_cust_name_lbl || '</th>');
htp.print('<th align="left">' || l_cont_name_lbl || '</th>');
htp.print('<th align="left">' || l_inc_exc_lbl || '</th>');
--
htp.p('</tr>');
--
htp.p('</thead>');
--
htp.p('<tbody>');
--
l_index := 0;
--
FOR cust_rec IN (SELECT cust.name
,cust.cust_id
,cont.cont_id
,cont.contract_number
FROM customers cust
,contracts cont
WHERE ( cust.cuty_id = caco_utilities.cuty_id_for_user
OR caco_utilities.user_has_system = c_yes )
AND cust.cust_id <> caco_utilities.get_system_customer
AND cont.cust_id = cust.cust_id
AND cont.status = 'O'
AND TRUNC(SYSDATE) BETWEEN cont.valid_from AND cont.valid_until
ORDER BY cust.name
) LOOP
--
l_index := l_index + 1;
--
htp.p('<tr>');
htp.p('<td>' || cust_rec.name || '</td>');
htp.p('<td>' || cust_rec.contract_number || '</td>');
htp.p('<td>' || '<input type="checkbox" name="p_cont_id" VALUE="' ||
cust_rec.cont_id || '">' || '</td>');
htp.p('</tr>');
--
END LOOP;
--
htp.p('</tbody>');
htp.p('</table>');
htp.p('</div>');
--
END;
--
-- javascript routine to check all check boxes
--
PROCEDURE checkall_js IS
--
--
BEGIN
--
htp.p('
<script language="JavaScript">
function checkAll( field )
{
var x=document.getElementsByName(field);
var action=true;
if (x[0].checked == true ) {
action=false;
}
for (i = 0; i < x.length; i++)
{
x[i].checked = action;
}
}
</script>
');
--
END;
--
-- Output the standard html page headers including the document type
--
PROCEDURE standard_html_header IS
BEGIN
--
htp.p(' <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">');
--
wsgl.openpagehead(g_title);
caco_system.content_type;
htp.p('<link rel=stylesheet href="caco_system.css?p_type=content" >');
--
-- Following required to show a calender screen
--
htp.p(wsgjsl.openscript);
wsgjsl.output_invoke_cal_js(g_package_name
,'scrollbars=no,resizable=no,width=320,height=350');
htp.p(wsgjsl.closescript);
--
checkall_js;
--
htp.p(CHR(10) ||
'<link rel="stylesheet" media="all" type="text/css" href="caco_system.css" />');
--
wsgl.closepagehead;
--
wsgl.openpagebody(FALSE);
--
htp.p(caco_system.menu);
--
END;
--
-- Entry procedure
--
PROCEDURE startup IS
--
l_submit_lbl VARCHAR2(255);
l_selectall_lbl VARCHAR2(255);
--
BEGIN
--
IF NOT caco_security.security_check(g_package_name) THEN
RETURN;
END IF;
--
l_submit_lbl := caco_utilities.get_module_text(c_submit);
l_selectall_lbl := caco_utilities.get_module_text(c_selectall);
--
standard_html_header;
--
htp.p('<div id="form_content">');
--
htp.p('<form id="submit_form" name="submit_form" method="get" action="efnow131$.open_renom_window">');
--
-- Draw the page header
--
page_header;
--
page_body;
--
htp.p('<br>');
--
htp.p('<input type=submit value="' || l_submit_lbl || '">');
--
htp.p('<input type=button value="' || l_selectall_lbl ||
'" onClick="checkAll(''p_cont_id'')">');
--
htp.p('<br><br>');
htp.p('<i>''*''' || caco_utilities.get_module_text(2202) || '</i>'); -- '*' Denotes a mandatory field
--
htp.p('<br><br>');
htp.p('<p>'||caco_utilities.get_module_text(3928)||'</p>');
htp.p('<table border="1">
<tr>
<td>{GAS_DAY}</td>
</tr>
<tr>
<td>{START_TIME}</td>
</tr>
<tr>
<td>{END_TIME}</td>
</tr>
<tr>
<td>{CUSTOMER_NAME}</td>
</tr>
<tr>
<td>{CONTRACT_NAME}</td>
</tr>
</table>');
htp.p('</form>'); -- Submit_form
--
htp.p('</div>');
--
wsgl.closepagebody;
--
END;
--
-- Procedure to create the header nomination window record
--
PROCEDURE create_nom_wdw_header(p_gas_day IN DATE
,p_wdw_open IN DATE
,p_wdw_close IN DATE
,p_message IN VARCHAR2
,p_inserted OUT nomination_windows%ROWTYPE) IS
--
l_tsa_timestamp DATE;
l_nowi_id NUMBER;
l_empty_blob BLOB;
l_blob_of_message BLOB;
l_inserted nomination_windows%ROWTYPE;
l_error VARCHAR2(255);
--
BEGIN
--
SELECT nowi_seq.NEXTVAL
INTO l_nowi_id
FROM dual;
--
--
l_blob_of_message := l_empty_blob;
--
l_blob_of_message := utl_raw.cast_to_raw(p_message);
--
l_tsa_timestamp := amfr_timestamp.timestamp_document(p_identifier => l_nowi_id
,p_doctype => c_renom_window
,p_file_for_hash => l_blob_of_message);
--
INSERT INTO nomination_windows
(nowi_id
,gas_day
,window_start
,window_end
,message
,notes
,tsa_timestamp)
VALUES
(l_nowi_id
,p_gas_day
,p_wdw_open
,p_wdw_close
,p_message
,NULL
,SYSDATE)
RETURNING gas_day, window_start, window_end, message, notes, nowi_id, tsa_timestamp INTO l_inserted;
--
p_inserted := l_inserted;
--
EXCEPTION
WHEN OTHERS THEN
--
l_error := 'ERROR in efnow131$.Create_Nom_Wdw_Header: ' || SQLERRM;
--
ROLLBACK;
--
wsgl.displaymessage(p_type => wsgl.mess_error
,p_mess => l_error);
END;
--
-- Procedure to create the child customer records and send messages
--
PROCEDURE create_nom_wdw_contracts(p_nowi_id IN NUMBER
,p_contracts IN owa_util.vc_arr
,p_subject IN VARCHAR2
,p_message IN VARCHAR2
,p_cont_tab OUT t_cont_tab) IS
--
l_idx NUMBER;
l_subject VARCHAR2(255);
l_message VARCHAR2(2000);
--
CURSOR c_cust(cp_cont_id IN contracts.cont_id%TYPE) IS
SELECT cu.name
, co.contract_number
, cu.cust_id
FROM customers cu
, contracts co
WHERE cu.cust_id = co.cust_id
AND co.cont_id = cp_cont_id;
--
l_cust_id customers.cust_id%TYPE;
l_cust_name customers.name%TYPE;
l_contract_number contracts.contract_number%TYPE;
--
l_cont_tab t_cont_tab;
l_cust_tab t_cont_tab;
l_cust_cont_tab t_cont_tab;
l_empty_cont_tab t_cont_tab;
--
BEGIN
--
l_cont_tab := l_empty_cont_tab;
l_cust_tab := l_empty_cont_tab;
l_cust_cont_tab := l_empty_cont_tab;
--
l_idx := p_contracts.FIRST;
--
FOR i IN 1 .. p_contracts.COUNT LOOP
--
OPEN c_cust(p_contracts(l_idx));
FETCH c_cust
INTO l_cust_name
, l_contract_number
, l_cust_id;
CLOSE c_cust;
--
l_cust_cont_tab(i) := l_cust_name||'-'||l_contract_number;
l_cont_tab(i) := l_contract_number;
l_cust_tab(i) := l_cust_name;
--
INSERT INTO nom_window_contracts
(cont_id
,nowi_id)
VALUES
(p_contracts(l_idx)
,p_nowi_id);
--
-- Replace any customer name tokens within the text
--
l_message := REPLACE(p_message, '{CUSTOMER_NAME}', l_cust_tab(i));
l_message := REPLACE(l_message, '{CONTRACT_NAME}', l_cont_tab(i));
l_subject := REPLACE(p_subject, '{CUSTOMER_NAME}', l_cust_tab(i));
l_subject := REPLACE(l_subject, '{CONTRACT_NAME}', l_cont_tab(i));
--
-- Create bulletin message
--
FOR syus IN (SELECT syus.syus_id syus_id
,syus.LANGUAGE
FROM system_users syus
WHERE syus.cust_id = l_cust_id) LOOP
--
amfr_message.create_message(p_subject => l_subject
,p_message => l_message
,p_cust_id => NULL
,p_sypr_id => NULL
,p_syus_id => syus.syus_id
,p_active_from => SYSDATE
,p_active_to => SYSDATE + 3);
--
END LOOP;
--
l_idx := p_contracts.NEXT(l_idx);
--
END LOOP;
--
p_cont_tab := l_cust_cont_tab;
--
END;
--
-- Function to check the date format
--
FUNCTION invalid_date_format(p_gas_day IN VARCHAR2) RETURN BOOLEAN IS
--
l_date DATE;
--
BEGIN
--
l_date := TO_DATE(p_gas_day
,c_date_format);
--
RETURN(FALSE);
--
EXCEPTION
WHEN OTHERS THEN
RETURN(TRUE);
END;
--
-- Submit procedure called by the form
--
PROCEDURE open_renom_window(p_gas_day IN VARCHAR2
,p_wdw_open_hr IN VARCHAR2
,p_wdw_open_min IN VARCHAR2
,p_wdw_close_hr IN VARCHAR2
,p_wdw_close_min IN VARCHAR2
,p_subject IN VARCHAR2
,p_message IN VARCHAR2
,p_cont_id IN owa_util.vc_arr DEFAULT g_empty_vc_array) IS
--
missing_params EXCEPTION;
start_date_in_past EXCEPTION;
dates_overlap EXCEPTION;
l_error_list caco_utilities.g_t_substitution_list;
l_empty_error_list caco_utilities.g_t_substitution_list;
l_gas_day DATE;
l_wdw_open DATE;
l_wdw_close DATE;
l_error VARCHAR2(255);
l_error_type exception_messages.exme_type%TYPE;
l_header_rec nomination_windows%ROWTYPE;
l_inserted_row VARCHAR2(2000);
l_cont_idx NUMBER;
l_cont_tab t_cont_tab;
l_subject VARCHAR2(255);
l_message VARCHAR2(2000);
ex_invalid_date_format EXCEPTION;
--
FUNCTION p_adj_hour (p_hour IN VARCHAR2) RETURN NUMBER IS
--
l_return NUMBER := 0;
--
BEGIN
--
IF p_hour IN ('0','1','2','3','4','5') THEN
--
-- If the hour indicates it is the start of the next calendar day, increment the day
--
l_return := 1;
--
END IF;
--
RETURN l_return;
--
END p_adj_hour;
--
BEGIN
--
standard_html_header;
--
l_error_list := l_empty_error_list;
l_inserted_row := NULL;
--
-- Check mandatory parameters are entered.
--
IF p_gas_day IS NULL THEN
--
l_error_list(1) := g_gas_day_lbl;
RAISE missing_params;
--
ELSIF p_subject IS NULL THEN
--
l_error_list(1) := g_subject_lbl;
RAISE missing_params;
--
ELSIF p_message IS NULL THEN
--
l_error_list(1) := g_message_lbl;
RAISE missing_params;
--
ELSIF p_cont_id.COUNT < 1 THEN
--
l_error_list(1) := g_contracts;
RAISE missing_params;
--
END IF;
--
IF invalid_date_format(p_gas_day) THEN
RAISE ex_invalid_date_format;
END IF;
--
l_gas_day := TO_DATE(p_gas_day
,c_date_format) + (c_gas_day_start / 24);
--
l_wdw_open := TO_DATE(p_gas_day|| ' ' || p_wdw_open_hr || ':' ||
p_wdw_open_min
,c_nom_wdw_format)+p_adj_hour(p_wdw_open_hr);
--
l_wdw_close := TO_DATE(p_gas_day|| ' ' || p_wdw_close_hr || ':' ||
p_wdw_close_min
,c_nom_wdw_format)+p_adj_hour(p_wdw_close_hr);
--
IF l_wdw_open < SYSDATE THEN
--
RAISE start_date_in_past;
--
ELSIF l_wdw_close <= l_wdw_open THEN
--
RAISE dates_overlap;
--
END IF;
--
-- Replace any tokens within the text
l_message := p_message;
l_message := REPLACE(l_message, '{GAS_DAY}', p_gas_day);
l_message := REPLACE(l_message, '{START_TIME}', to_char(l_wdw_open,c_time_format));
l_message := REPLACE(l_message, '{END_TIME}', to_char(l_wdw_close,c_time_format));
l_subject := p_subject;
l_subject := REPLACE(l_subject, '{GAS_DAY}', p_gas_day);
l_subject := REPLACE(l_subject, '{START_TIME}', to_char(l_wdw_open,c_time_format));
l_subject := REPLACE(l_subject, '{END_TIME}', to_char(l_wdw_close,c_time_format));
--
create_nom_wdw_header(p_gas_day => l_gas_day
,p_wdw_open => l_wdw_open
,p_wdw_close => l_wdw_close
,p_message => l_message
,p_inserted => l_header_rec);
--
create_nom_wdw_contracts(p_nowi_id => l_header_rec.nowi_id
,p_contracts => p_cont_id
,p_subject => l_subject
,p_message => l_message
,p_cont_tab => l_cont_tab);
--
l_inserted_row := '<table>' || '<tr><td><b>' || g_gas_day_lbl || ': ' ||
'</b></td><td>' ||
TO_CHAR(l_header_rec.gas_day
,c_datetime_format) || '</td></tr>' ||
'<tr><td><b>' || g_wdw_open_lbl || ': ' ||
'</b></td><td>' ||
TO_CHAR(l_header_rec.window_start
,c_datetime_format) || '</td></tr>' ||
'<tr><td><b>' || g_wdw_close_lbl || ': ' ||
'</b></td><td>' ||
TO_CHAR(l_header_rec.window_end
,c_datetime_format) || '</td></tr>' ||
'<tr><td><b>' || g_message_lbl || ': ' ||
'</b></td><td>' || l_header_rec.message ||
'</td></tr><tr><td><b>' || g_timestamp_lbl || ': ' ||
'</b></td><td>' ||
TO_CHAR(l_header_rec.tsa_timestamp
,c_datetime_format) || '</td></tr>' ||
'</table>';
--
htp.p('<h1>'||caco_utilities.get_module_text(c_heading)||'</h1>');
--
wsgl.displaymessage(p_type => wsgl.mess_success
,p_mess => l_inserted_row);
--
htp.p('<br>');
htp.p('<b>' || g_contracts || '</b>');
htp.p('<br>');
--
l_cont_idx := l_cont_tab.FIRST;
--
FOR i IN 1 .. l_cont_tab.COUNT LOOP
--
htp.p('<p>' || l_cont_tab(l_cont_idx) || '</p>');
--
l_cont_idx := l_cont_tab.NEXT(l_cont_idx);
--
END LOOP;
--
wsgl.closepagebody;
--
COMMIT;
--
EXCEPTION
WHEN ex_invalid_date_format THEN
--
caco_utilities.get_exception_message(p_exception_number => -20538
,p_message => l_error
,p_exme_type => l_error_type
,p_substitution_list => l_error_list
,p_language => caco_utilities.get_syus_lang);
--
wsgl.displaymessage(p_type => wsgl.mess_error
,p_mess => l_error);
--
WHEN missing_params THEN
--
caco_utilities.get_exception_message(p_exception_number => -20506
,p_message => l_error
,p_exme_type => l_error_type
,p_substitution_list => l_error_list
,p_language => caco_utilities.get_syus_lang);
--
wsgl.displaymessage(p_type => wsgl.mess_error
,p_mess => l_error);
--
WHEN start_date_in_past THEN
--
caco_utilities.get_exception_message(p_exception_number => -20507
,p_message => l_error
,p_exme_type => l_error_type
,p_substitution_list => l_error_list
,p_language => caco_utilities.get_syus_lang);
--
wsgl.displaymessage(p_type => wsgl.mess_error
,p_mess => l_error);
--
WHEN dates_overlap THEN
--
caco_utilities.get_exception_message(p_exception_number => -20508
,p_message => l_error
,p_exme_type => l_error_type
,p_substitution_list => l_error_list
,p_language => caco_utilities.get_syus_lang);
--
wsgl.displaymessage(p_type => wsgl.mess_error
,p_mess => l_error);
--
WHEN OTHERS THEN
--
l_error := 'ERROR in efnow131$.open_renom_window: ' || SQLERRM;
--
ROLLBACK;
--
wsgl.displaymessage(p_type => wsgl.mess_error
,p_mess => l_error);
END;
--
-- About procedure
--
FUNCTION about RETURN VARCHAR2 IS
BEGIN
RETURN(g_package_name || chr(10) || g_revision || chr(10) || g_header);
END about;
--
-- Package initialisation
--
BEGIN
-- Initialization
NULL;
END efnow131$;
/

View File

@@ -0,0 +1,57 @@
CREATE OR REPLACE PACKAGE efnow131$ IS
--
g_title CONSTANT VARCHAR2(50) := 'Renomination Window';
g_header CONSTANT VARCHAR2(160) := '$Header: $';
g_revision CONSTANT VARCHAR2(160) := '$Revision: $';
g_package_name CONSTANT VARCHAR2(30) := 'efnow131$';
--
-- Types
--
TYPE t_cont_tab IS TABLE OF VARCHAR2(255) INDEX BY BINARY_INTEGER;
g_empty_vc_array owa_util.vc_arr;
--
-- Global date format
--
g_date_format CONSTANT VARCHAR2(20) := nvl(cout_system_configuration.get_configuration_item('g_date_format')
,'DD/MM/YYYY');
--
/**
-- Generic procedures for the date LOV, same as designer generated code
*/
PROCEDURE calendar(z_field_name IN VARCHAR2
,z_caller_url IN VARCHAR2
,z_field_value IN VARCHAR2 DEFAULT NULL
,z_field_format IN VARCHAR2 DEFAULT NULL
,z_field_prompt IN VARCHAR2 DEFAULT NULL);
--
PROCEDURE format_cal_date(z_field_name IN VARCHAR2
,z_field_format IN VARCHAR2
,DAY IN VARCHAR2
,MONTH IN VARCHAR2
,YEAR IN VARCHAR2);
--
--
PROCEDURE startup;
--
/** Open renom window create records in the nomination_windows and nom_window_contracts tables
to specify timefgrames where customers may renominate within day.
*/
PROCEDURE open_renom_window(p_gas_day IN VARCHAR2
,p_wdw_open_hr IN VARCHAR2
,p_wdw_open_min IN VARCHAR2
,p_wdw_close_hr IN VARCHAR2
,p_wdw_close_min IN VARCHAR2
,p_subject IN VARCHAR2
,p_message IN VARCHAR2
,p_cont_id IN owa_util.vc_arr DEFAULT g_empty_vc_array);
--
/**
-- FUNCTION about
-- Returns the version number and VSS header for this package
--
-- %return The version number and VSS header for this package
*/
FUNCTION about RETURN VARCHAR2;
--
END efnow131$;
/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,228 @@
create or replace package body efnow240$ is
private_ModuleRef WSGOC.MODULE_REF;
procedure CreateStartupJavaScript;
--------------------------------------------------------------------------------
-- Name: efnow240$.Startup
--
-- Description: This procedure is the entry point for the 'efnow240$'
-- module.
--
-- Parameters: None
--
--------------------------------------------------------------------------------
procedure Startup
is
begin
if not caco_security.security_check('efnow240$') then
return;
end if;
WSGL.RegisterURL('efnow240$.startup');
if WSGL.NotLowerCase then
return;
end if;
WSGL.StoreURLLink(0, WSGL.MsgGetText(21,WSGLM.CAP021_TOP_LEVEL));
efnow240$int.startup(
Z_DIRECT_CALL => TRUE
);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow240$.Startup');
end;
--------------------------------------------------------------------------------
-- Name: efnow240$.firstpage
--
-- Description: This procedure creates the first page for the 'efnow240$'
-- module.
--
-- Parameters: Z_DIRECT_CALL
--
--------------------------------------------------------------------------------
procedure FirstPage(Z_DIRECT_CALL in boolean
) is
begin
if not caco_security.security_check('efnow240$') 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, 'efnow240$.showabout', '_top', p_output_line=>FALSE);
WSGL.NavLinks;
htp.formClose;
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow240$.FirstPage');
end;
--------------------------------------------------------------------------------
-- Name: efnow240$.showabout
--
-- Description: This procedure is used to display an 'About' page for the
-- 'efnow240$' module.
--
--------------------------------------------------------------------------------
procedure showabout is
l_usr varchar2(255) := null;
begin
if not caco_security.security_check('efnow240$') then
return;
end if;
l_usr := caco_security.get_user;
WSGL.RegisterURL('efnow240$.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(WSGL.MsgGetText(108,WSGLM.DSP108_GENERATED_BY, 'PL/SQL Web Generator', '10.1.2.6.18'));
htp.para;
WSGL.Info(FALSE, 'Nominations', 'EFNOW240', l_usr);
htp.p(caco_system.footer);
WSGL.ClosePageBody;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow240$.ShowAbout');
end;
--------------------------------------------------------------------------------
-- Name: efnow240$.TemplateHeader
--
-- Description:
--
--------------------------------------------------------------------------------
procedure TemplateHeader(Z_DIRECT_CALL in boolean,
Z_TEMPLATE_ID in number) is
begin
if not caco_security.security_check('efnow240$') then
return;
end if;
if Z_TEMPLATE_ID = 1 then
-- Template defined in \\loordv01\framework\css2\css_content.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=content" >
');
elsif Z_TEMPLATE_ID = 2 then
-- Template defined in \\loordv01\framework\css2\css_about.htm
htp.p('<title></title> <link rel="stylesheet" href="wwv_flow_file_mgr.get_file?p_security_group_id=11019802792885519&p_fname=common.css" type="text/css" /> <script src="/i/javascript/apex_ns_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_get_3_1.js" type="text/javascript"></script> <script src="/i/javascript/apex_builder.js" type="text/javascript"></script> <script type="text/javascript"> <!-- /*Global JS Variables*/ var htmldb_Img_Dir = "/i/"; //--> </script> <link rel="stylesheet" href="/i/css/apex_3_1.css" type="text/css" /> <!--[if IE]><link rel="stylesheet" href="/i/css/apex_ie_3_1.css" type="text/css" /><![endif]--> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />');
elsif Z_TEMPLATE_ID = 3 then
-- Template defined in \\loordv01\framework\css2\css_query.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=query" >
');
elsif Z_TEMPLATE_ID = 4 then
-- Template defined in \\loordv01\framework\css2\css_view.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=view" >
');
elsif Z_TEMPLATE_ID = 5 then
-- Template defined in \\loordv01\framework\css2\css_insert.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=insert" >
');
elsif Z_TEMPLATE_ID = 6 then
-- Template defined in \\loordv01\framework\css2\css_recordlist.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=recordlist" >
');
elsif Z_TEMPLATE_ID = 7 then
-- Template defined in \\loordv01\framework\css2\css_lov.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=lov" >
');
elsif Z_TEMPLATE_ID = 8 then
-- Template defined in \\loordv01\framework\css2\css_text.htm
htp.p('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<link rel=stylesheet href="caco_system.css?p_type=text" >
');
end if;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow240$.TemplateHeader');
end;
--------------------------------------------------------------------------------
-- Name: efnow240$.GetRef
--
-- Description: Returns a handle to the display data for the
-- 'efnow240$' 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 => 'efnow240$'
, pFirstTitle => ''
);
end if;
return private_ModuleRef;
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, '',
'', 'efnow240$.GetRef');
raise;
end;
--------------------------------------------------------------------------------
-- Name: efnow240$.CreateStartupJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateStartupJavaScript is
begin
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Startup";');
htp.p(WSGJSL.CloseScript);
end;
end;
/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,133 @@
create or replace package efnow240$int is
type NBT_REC is record
( UI_STATUS varchar2(32760)
, UI_ORDER_BY varchar2(24000)
, UI_QUERY_DATE date
, UI_CATE_NAME varchar2(32760)
, UI_NEPO_CODE varchar2(32760)
, UI_CUST_NAME varchar2(32760)
, UI_CONTRACT_NUMBER varchar2(32760)
);
NBT_VAL NBT_REC;
CURR_VAL GTT_INTERRUPTIONS%rowtype;
procedure Startup(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null,
Z_FORM in varchar2 default null);
procedure ActionQuery(
P_UI_STATUS in varchar2 default null,
P_UI_QUERY_DATE in varchar2 default null,
U_UI_QUERY_DATE in varchar2 default null,
P_UI_CATE_NAME in varchar2 default null,
P_UI_NEPO_CODE in varchar2 default null,
P_UI_CUST_NAME in varchar2 default null,
P_UI_CONTRACT_NUMBER in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_ACTION in varchar2 default null,
Z_CHK in varchar2 default null );
procedure FormQuery(
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null);
procedure CUST_LOV_LOV(
Z_FILTER in varchar2,
Z_MODE in varchar2,
Z_CALLER_URL in varchar2,
Z_FORMROW in number default 0,
Z_LONG_LIST in varchar2 default null,
Z_ISSUE_WAIT in varchar2 default null);
procedure NEPO_LOV_LOV(
Z_FILTER in varchar2,
Z_MODE in varchar2,
Z_CALLER_URL in varchar2,
Z_FORMROW in number default 0,
Z_LONG_LIST in varchar2 default null,
Z_ISSUE_WAIT in varchar2 default null);
procedure CONT_LOV_LOV(
Z_FILTER in varchar2,
Z_MODE in varchar2,
Z_CALLER_URL in varchar2,
P_UI_STATUS in varchar2 default null,
P_UI_CUST_NAME in varchar2 default null,
Z_FORMROW in number default 0,
Z_LONG_LIST in varchar2 default null,
Z_ISSUE_WAIT in varchar2 default null);
procedure CATE_LOV_LOV(
Z_FILTER in varchar2,
Z_MODE in varchar2,
Z_CALLER_URL in varchar2,
Z_FORMROW in number default 0,
Z_LONG_LIST in varchar2 default null,
Z_ISSUE_WAIT in varchar2 default null);
procedure QueryList(
P_UI_STATUS in varchar2 default null,
P_UI_QUERY_DATE in varchar2 default null,
U_UI_QUERY_DATE in varchar2 default null,
P_UI_CATE_NAME in varchar2 default null,
P_UI_NEPO_CODE in varchar2 default null,
P_UI_CUST_NAME in varchar2 default null,
P_UI_CONTRACT_NUMBER in varchar2 default null,
Z_START in varchar2 default null,
Z_ACTION in varchar2 default null,
Z_DIRECT_CALL in boolean default false,
Z_CHK in varchar2 default null );
function QueryHits(
P_UI_STATUS in varchar2 default null,
P_UI_QUERY_DATE in varchar2 default null,
U_UI_QUERY_DATE in varchar2 default null,
P_UI_CATE_NAME in varchar2 default null,
P_UI_NEPO_CODE in varchar2 default null,
P_UI_CUST_NAME in varchar2 default null,
P_UI_CONTRACT_NUMBER in varchar2 default null) return number;
procedure LoadCache
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_OWN_ROW_VALUES in boolean default false
, Z_CONTEXT_FOR in WSGOC.COMPONENT_REF default null
, Z_BRANCH in WSGOC.BRANCH_REF default null
);
function RestoreState
( Z_CURR_DEPTH in number
, Z_MAX_DEPTH in number
, Z_RESTORE_OWN_ROW in boolean default true
) return boolean;
procedure SaveState;
function GetRef return WSGOC.COMPONENT_REF;
procedure InitialiseDomain(P_ALIAS in varchar2);
procedure calendar
(
Z_FIELD_NAME in varchar2,
Z_CALLER_URL in varchar2,
Z_FIELD_VALUE in varchar2 default null,
Z_FIELD_FORMAT in varchar2 default null,
Z_FIELD_PROMPT in varchar2 default null
);
procedure format_cal_date
(
Z_FIELD_NAME in Varchar2,
Z_FIELD_FORMAT in varchar2,
day in varchar2,
month in varchar2,
year in varchar2
);
D_UI_STATUS WSGL.typDVRecord;PROCEDURE populate_gtt_interruptions (p_gas_day_start IN DATE,
p_gas_day_end IN DATE,
p_cate_id IN NUMBER,
p_nepo_id IN NUMBER,
p_cust_id IN NUMBER,
p_cont_id IN NUMBER,
p_status IN VARCHAR2);
end;
/

View File

@@ -0,0 +1,233 @@
create or replace package body efnow240$js$int is
--------------------------------------------------------------------------------
-- Name: efnow240$js$int.CreateQueryJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateQueryJavaScript (
LOV_FRAME in varchar2,
QF_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow240$int') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "Query";');
htp.p(WSGJSL.RtnOpenLOV);
WSGJSL.Output_Invoke_CAL_JS ('efnow240$int', 'scrollbars=no,resizable=no,width=320,height=350');
htp.p(WSGJSL.OpenEvent('UI_CATE_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow240$int.cate_lov_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('UI_NEPO_CODE','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow240$int.nepo_lov_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('UI_CUST_NAME','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow240$int.cust_lov_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('UI_CONTRACT_NUMBER','LOV')); htp.p('
var depStr = "";
var modeStr = ""
index = -1;
modeStr = "Q";
if (!(LOV_CONT_LOV_CheckDep( ctl )))
return true;
depStr = LOV_CONT_LOV_GetDepStr( ctl );
');
if LOV_FRAME is not null then
htp.p(' var lovFra = "'||LOV_FRAME||'";');
htp.p(' var winpar = "";');
else
htp.p(' var lovFra = "winLOV";');
htp.p(' var winpar = "scrollbars=yes,resizable=yes,width=400,height=400";');
end if;
htp.p(' var filterprompt = "";');
htp.p('
var lovTitle = "'||replace('','"','\"')||'";
window.current_lov_title = lovTitle;
JSLOpenLOV( ctl, index, modeStr, "efnow240$int.cont_lov_lov", depStr, lovFra, winpar, filterprompt );
');
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.OpenEvent('INT','OnLoad'));
htp.p('
if ( FormType != "PostDelete")
{
form_num=0;
do
{
elem_num=0;
len = document.forms[form_num].elements.length;
if (len > 0)
{
while (elem_num < len &&
document.forms[form_num].elements[elem_num].type != "text" &&
document.forms[form_num].elements[elem_num].type != "textarea")
{
elem_num++;
}
if (elem_num < len)
{
document.forms[form_num].elements[elem_num].focus();
break;
}
}
form_num++;
} while ( form_num < document.forms.length );
}
');
htp.p(WSGJSL.CloseEvent);
htp.p('
function LOV_CONT_LOV_CheckDep( ctl )
{
if (ctl.form.P_UI_STATUS.selectedIndex == -1) {
alert("'||WSGL.MsgGetText(232,WSGLM.MSG232_LOV_MISSING_DEPENDANT,'#Status#2114#')||'");
return false;
}
else if (ctl.form.P_UI_STATUS.options[ctl.form.P_UI_STATUS.selectedIndex].text == "") {
alert("'||WSGL.MsgGetText(232,WSGLM.MSG232_LOV_MISSING_DEPENDANT,'#Status#2114#')||'");
return false;
}
return true;
}');
htp.p('
function LOV_CONT_LOV_GetDepStr( ctl )
{
var depStr = "";
depStr = depStr + "&P_UI_STATUS=" + escape(ctl.form.P_UI_STATUS.options[ctl.form.P_UI_STATUS.selectedIndex].value);
depStr = depStr + "&P_UI_CUST_NAME=" + escape(ctl.form.P_UI_CUST_NAME.value);
return depStr;
}');
htp.p(WSGJSL.OpenEvent('btnQFQ','OnClick'));
htp.p(WSGJSL.StandardSubmit(false));
htp.p(WSGJSL.CloseEvent);
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#View Interruptions#2504#',
QF_BODY_ATTRIBUTES, 'efnow240$js$int.CreateQueryJavaScript');
end;
--------------------------------------------------------------------------------
-- Name: efnow240$js$int.CreateListJavaScript
--
-- Description:
--
-- Parameters:
--
--------------------------------------------------------------------------------
procedure CreateListJavaScript (
RL_BODY_ATTRIBUTES in varchar2)
is
begin
if not caco_security.security_check('efnow240$int') then
return;
end if;
htp.p(WSGJSL.OpenScript);
htp.p('var FormType = "List";');
htp.p( 'var P_7 = new Array();' );
htp.p( 'var P_8 = new Array();' );
htp.p( 'var P_9 = new Array();' );
htp.p( 'var P_10 = new Array();' );
htp.p( 'var P_11 = new Array();' );
htp.p(WSGJSL.CloseScript);
exception
when others then
WSGL.DisplayMessage(WSGL.MESS_EXCEPTION, SQLERRM, ''||' : '||'#View Interruptions#2504#',
RL_BODY_ATTRIBUTES, 'efnow240$js$int.CreateListJavaScript');
end;
end;
/

View File

@@ -0,0 +1,122 @@
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.NOM_CONF_SUBJECT',
'Nomination {GAS_DAY_START}',
'Nom Confirmation Subject');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.NOM_CONF_CONTENT',
'Nomination id: {NOMINATION_IDENTIFIER} Start: {GAS_DAY_START} End: {GAS_DAY_END} Timestamp: {TIMESTAMP}',
'Nom Confirmation Content');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.COM_CONF_SUBJECT',
'Confirmation',
'Com Confirmation Subject');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.COM_CONF_CONTENT',
'Confirmation id: {CONFIRMATION_IDENTIFIER}',
'Com Confirmation Content');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.AUTO_GEN_CONF',
'N',
'Auto Generate Confirm');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.CONF_TYPE',
'N',
'Confirmation Format');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.IND_DEADLINE_FOR_NOM_SUBMIT',
'00:00',
'Ind Sub Deadline (HH:MI)');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.SHIPPER',
'',
'Shipper');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.INT_SUBJECT',
'Automated message from EFT Nominations: There is an interruption in place',
'Interruption Subject');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.INT_CONTENT',
'There is an interruption in place for you, {CUSTOMER_NAME}. This is in place from {START_DATE} to {END_DATE}.',
'Interruption Content');
INSERT INTO application_parameters
(appa_id,
parameter,
VALUE,
description)
VALUES
(appa_seq.nextval,
'COOP.INT_SMS_CONTENT',
'Automated SMS Message from the EFT nominations system. There is an interruption in place for you, {CUSTOMER_NAME}. This is in place from {START_DATE} to {END_DATE}.',
'Interruption SMS Content');
COMMIT;

View File

@@ -0,0 +1,37 @@
-- M:\Projects\EFT\Change_Requests_August_2010\Designer\application_parameters_table.sql
--
-- Generated for Oracle 10g on Fri Oct 22 15:10:20 2010 by Server Generator 10.1.2.6.18
SPOOL application_parameters_table.lst
PROMPT Creating Table 'APPLICATION_PARAMETERS'
CREATE TABLE APPLICATION_PARAMETERS
(APPA_ID NUMBER NOT NULL
,PARAMETER VARCHAR2(240) NOT NULL
,VALUE VARCHAR2(240)
,DESCRIPTION VARCHAR2(240)
)
/
PROMPT Creating Primary Key on 'APPLICATION_PARAMETERS'
ALTER TABLE APPLICATION_PARAMETERS
ADD (CONSTRAINT APPA_PK PRIMARY KEY
(APPA_ID))
/
PROMPT Creating Unique Key on 'APPLICATION_PARAMETERS'
ALTER TABLE APPLICATION_PARAMETERS
ADD (CONSTRAINT APPA_UK UNIQUE
(PARAMETER))
/
PROMPT Creating Sequence 'APPA_SEQ'
CREATE SEQUENCE APPA_SEQ
NOMAXVALUE
NOMINVALUE
NOCYCLE
/
SPOOL OFF

View File

@@ -0,0 +1,33 @@
INSERT INTO contract_options
(cont_id,
nom_conf_subject,
nom_conf_content,
com_conf_subject,
com_conf_content,
auto_gen_conf,
conf_type,
ind_deadline_for_nom_submit,
shipper,
int_subject,
int_content,
int_sms_content)
SELECT co.cont_id,
cu.nom_conf_subject,
cu.nom_conf_content,
cu.com_conf_subject,
cu.com_conf_content,
cu.auto_gen_conf,
cu.conf_type,
cu.ind_deadline_for_nom_submit,
cu.shipper,
cu.int_subject,
cu.int_content,
cu.int_sms_content
FROM customers cu,
contracts co
WHERE cu.cust_id = co.cust_id
ORDER BY co.cont_id;
COMMIT;

View File

@@ -0,0 +1,58 @@
-- M:\Projects\EFT\Change_Requests_August_2010\Designer\contract_options_table.sql
--
-- Generated for Oracle 10g on Thu Oct 21 14:41:01 2010 by Server Generator 10.1.2.6.18
SPOOL contract_options_table.lst
PROMPT Creating Table 'CONTRACT_OPTIONS'
CREATE TABLE CONTRACT_OPTIONS
(CONT_ID NUMBER NOT NULL
,NOM_CONF_SUBJECT VARCHAR2(255)
,NOM_CONF_CONTENT VARCHAR2(4000)
,COM_CONF_SUBJECT VARCHAR2(255)
,COM_CONF_CONTENT VARCHAR2(4000)
,AUTO_GEN_CONF VARCHAR2(1) DEFAULT 'N'
,CONF_TYPE VARCHAR2(1) DEFAULT 'N'
,IND_DEADLINE_FOR_NOM_SUBMIT VARCHAR(5)
,SHIPPER VARCHAR2(100)
,INT_SUBJECT VARCHAR2(255)
,INT_CONTENT VARCHAR2(4000)
,INT_SMS_CONTENT VARCHAR2(255)
)
/
PROMPT Creating Check Constraint on 'CONTRACT_OPTIONS'
ALTER TABLE CONTRACT_OPTIONS
ADD (CONSTRAINT AVCON_1287668460_AUTO__000 CHECK (AUTO_GEN_CONF IN ('Y', 'N')))
/
PROMPT Creating Foreign Key on 'CONTRACT_OPTIONS'
ALTER TABLE CONTRACT_OPTIONS ADD (CONSTRAINT
COOP_CONT_FK FOREIGN KEY
(CONT_ID) REFERENCES CONTRACTS
(CONT_ID))
/
PROMPT Creating Unique Key on 'CONTRACT_OPTIONS'
ALTER TABLE CONTRACT_OPTIONS
ADD (CONSTRAINT COOP_UK UNIQUE
(CONT_ID))
/
DELETE FROM CG_REF_CODES
WHERE RV_DOMAIN = 'CONTRACT_OPTIONS.CONF_TYPE'
/
INSERT INTO CG_REF_CODES (RV_DOMAIN, RV_LOW_VALUE, RV_HIGH_VALUE, RV_ABBREVIATION, RV_MEANING)
VALUES ('CONTRACT_OPTIONS.CONF_TYPE', 'E', NULL, 'Excel', 'Excel')
/
INSERT INTO CG_REF_CODES (RV_DOMAIN, RV_LOW_VALUE, RV_HIGH_VALUE, RV_ABBREVIATION, RV_MEANING)
VALUES ('CONTRACT_OPTIONS.CONF_TYPE', 'X', NULL, 'XML', 'XML')
/
COMMIT
/
SPOOL OFF

View File

@@ -0,0 +1,253 @@
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3961,
'Previous Contract Number',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3961,
'Previous Contract Number',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3962,
'Previous contract ends after the contract begins',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3962,
'Previous contract ends after the contract begins',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3963,
'Maintain Application Parameters',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3963,
'Maintain Application Parameters',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3964,
'Options',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3964,
'Options',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3967,
'Maintain Contract Options',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3967,
'Maintain Contract Options',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3968,
'Maintain Application Parameters',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3968,
'Maintain Application Parameters',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3969,
'Data is not linked to a valid contract number. Please contact support',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3969,
'Data is not linked to a valid contract number. Please contact support',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3970,
'Auto Generate Confirm is a mandatory field',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3970,
'Auto Generate Confirm is a mandatory field',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3971,
'Confirmation Format is a mandatory field',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3971,
'Confirmation Format is a mandatory field',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3972,
'Com Confirmation Subject is a mandatory field',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3972,
'Com Confirmation Subject is a mandatory field',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3973,
'Com Confirmation Content is a mandatory field',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3973,
'Com Confirmation Content is a mandatory field',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3974,
'Nom Confirmation Subject is a mandatory field',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3974,
'Nom Confirmation Subject is a mandatory field',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3975,
'Nom Confirmation Content is a mandatory field',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3975,
'Nom Confirmation Content is a mandatory field',
'HU');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3976,
'An unexpected error has occurred while updating contract options. Please contact support',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3976,
'An unexpected error has occurred while updating contract options. Please contact support',
'HU');
COMMIT;

View File

@@ -0,0 +1,35 @@
CREATE OR REPLACE PROCEDURE populate_previous_contract IS
/*
* POPULATE_PREVIOUS_CONTRACT is a one-off update of all contracts
* that do not have a previous contract assigned to them.
* The order of selection is:
* 1) The most recently completed.
* 2) The longest running.
* 3) The most recently created.
*/
CURSOR contract_match IS
SELECT t.cont_id,
t2.cont_id prev_cont_id
FROM contracts t,
contracts t2
WHERE t.cust_id = t2.cust_id
AND t.valid_from > t2.valid_until
AND t.prev_cont_id IS NULL
ORDER BY t.cust_id,
t.cont_id,
t2.valid_until DESC,
t2.valid_from,
t2.cont_id DESC;
current_contract NUMBER := 0;
BEGIN
FOR r IN contract_match LOOP
IF r.cont_id <> current_contract THEN
UPDATE contracts
SET prev_cont_id = r.prev_cont_id
WHERE cont_id = r.cont_id;
current_contract := r.cont_id;
COMMIT;
END IF;
END LOOP;
END populate_previous_contract;
/

View File

@@ -0,0 +1,12 @@
-- M:\Projects\EFT\Change_Requests_August_2010\Designer\prev_contract_.tab
--
-- Generated for Oracle 10g on Tue Oct 12 16:50:03 2010 by Server Generator 10.1.2.6.18
PROMPT Altering Table 'CONTRACTS'
ALTER TABLE CONTRACTS
ADD (PREV_CONT_ID NUMBER
)
/

View File

@@ -0,0 +1,11 @@
alter table GTT_INTERRUPTIONS add contract_number varchar2(30) not null;
alter table GTT_INTERRUPTIONS
drop constraint GTIN_PK cascade;
alter table GTT_INTERRUPTIONS
add constraint GTIN_PK primary key (GAS_YEAR, CUSTOMER_NAME, CONTRACT_NUMBER, CATEGORY_NAME, NETWORK_POINT);
insert into SPREADSHEET_TEMPLATE_VALUES (sptv_id, name, spte_id, x_axis, y_axis, cell_value, x_range, y_range, cell_datatype, cell_format_mask, cell_border, cell_background, cell_merge, cell_font, cell_fontsize, cell_align, created_by, created_on, col_width, row_height, cell_wrap)
values (764, 'cell?', 90, 'B', 5, 'Szerzod<EFBFBD>s', 1, 1, null, null, null, null, null, null, null, 'RIGHT', 'SYSTEM', to_date('28-10-2010 10:31:40', 'dd-mm-yyyy hh24:mi:ss'), 6363, 255, null);
insert into SPREADSHEET_TEMPLATE_VALUES (sptv_id, name, spte_id, x_axis, y_axis, cell_value, x_range, y_range, cell_datatype, cell_format_mask, cell_border, cell_background, cell_merge, cell_font, cell_fontsize, cell_align, created_by, created_on, col_width, row_height, cell_wrap)
values (765, 'cell?', 90, 'C', 5, '{CONTRACT_NAME}', 1, 1, null, null, null, null, null, null, null, null, 'SYSTEM', to_date('28-10-2010 10:31:40', 'dd-mm-yyyy hh24:mi:ss'), 5741, 255, null);

View File

@@ -0,0 +1,24 @@
-- Add/modify columns
alter table SYSTEM_USERS add failed_login_attempts number(2);
insert into SYSTEM_CONFIGURATION (syco_id, parameter, value, description)
values (179, 'G_PASSWORD_FAILED_LOGINS', '3', 'The number of failed logins allowed due to an invalid password');
insert into MODULE_TEXT (mtxt_id, text_number, text, language)
values (21735, 3965, 'Invalid password. <p1> attempts remaining.', 'EN');
insert into MODULE_TEXT (mtxt_id, text_number, text, language)
values (21736, 3966, 'Invalid Password. 0 attempts remaining. Account locked.', 'EN');
CREATE OR REPLACE TRIGGER SYSTEM_USERS_BU_TRIG
BEFORE UPDATE OF user_locked ON system_users
FOR EACH ROW
DECLARE
BEGIN
IF :OLD.user_locked = 'Y'
AND :NEW.user_locked = 'N'
THEN
:NEW.failed_login_attempts := 0;
END IF;
END;
/
ALTER TRIGGER SYSTEM_USERS_BU_TRIG ENABLE;

View File

@@ -0,0 +1,19 @@
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3979,
'Application Parameters',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3979,
'Application Parameters',
'HU');
COMMIT;

View File

@@ -0,0 +1,19 @@
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3980,
'View Contract Values',
'EN');
INSERT INTO module_text
(text_number,
text,
LANGUAGE)
VALUES
(3980,
'View Contract Values',
'HU');
COMMIT;

View File

@@ -0,0 +1,13 @@
prompt PL/SQL Developer import file
prompt Created on 11 November 2010 by nichollskg
set feedback off
set define off
prompt Loading MODULE_TEXT...
insert into MODULE_TEXT (text_number, text, language)
values (3977, 'Contract Status', 'EN');
insert into MODULE_TEXT (text_number, text, language)
values (3978, 'Nomination Status', 'EN');
prompt 2 records loaded
set feedback on
set define on
prompt Done.

View File

@@ -0,0 +1,13 @@
CREATE TABLE NOM_WINDOW_CUSTOMERS_COPY
AS SELECT * FROM NOM_WINDOW_CUSTOMERS;
DROP TABLE NOM_WINDOW_CUSTOMERS;
DROP PACKAGE cg$NOM_WINDOW_CUSTOMERS;
CREATE TABLE NOM_WINDOW_CONTRACTS
( CONT_ID NUMBER NOT NULL ENABLE,
NOWI_ID NUMBER NOT NULL ENABLE,
NOWC_ID NUMBER NOT NULL ENABLE,
CONSTRAINT NOWC_PK PRIMARY KEY (NOWC_ID),
CONSTRAINT NOWC_CONT_FK FOREIGN KEY (CONT_ID)
REFERENCES CONTRaCTS (CONT_ID)) ;
CREATE INDEX NOWC_CUST_FK_I ON NOM_WINDOW_CONTRACTS (CONT_ID) ;
CREATE INDEX NOWC_NOWI_FK_I ON NOM_WINDOW_CONTRACTS (NOWI_ID);

View File

@@ -0,0 +1,57 @@
DECLARE
l_cont_id contracts.cont_id%TYPE;
FUNCTION get_cont_id (p_cust_id IN customers.cust_id%TYPE
,p_effective_date IN DATE) RETURN contracts.cont_id%TYPE IS
l_ret contracts.cont_id%TYPE;
--
CURSOR cur_cont IS
SELECT cont_id
FROM contracts
WHERE cust_id = p_cust_id
AND p_effective_date BETWEEN valid_from AND valid_until
ORDER BY valid_until DESC;
--
BEGIN
--
OPEN cur_cont;
FETCH cur_cont INTO l_ret;
CLOSE cur_cont;
--
RETURN l_ret;
--
END get_cont_id;
BEGIN
FOR rec_nwc IN (SELECT nwc.nowi_id
, nwc.nowc_id
, nwc.cust_id
, nw.window_end
FROM nom_window_customers_copy nwc
, nomination_windows nw
WHERE nw.nowi_id= nwc.nowi_id
ORDER BY nwc.cust_id)
LOOP
--
l_cont_id := get_cont_id(rec_nwc.cust_id
,rec_nwc.window_end);
--
DBMS_OUTPUT.PUT_LINE ('Start:');
DBMS_OUTPUT.PUT_LINE ('rec_nwc.nowi_id = '||rec_nwc.nowi_id);
DBMS_OUTPUT.PUT_LINE ('rec_nwc.nowc_id = '||rec_nwc.nowc_id);
DBMS_OUTPUT.PUT_LINE ('rec_nwc.cust_id = '||rec_nwc.cust_id);
IF l_cont_id IS NOT NULL
THEN
DBMS_OUTPUT.PUT_LINE ('l_cont_id = '||l_cont_id);
INSERT INTO nom_window_contracts(cont_id
,nowi_id
,nowc_id) VALUES
(l_cont_id
,rec_nwc.nowi_id
,rec_nwc.nowc_id);
ELSE
DBMS_OUTPUT.PUT_LINE ('* NO CONT ID *');
END IF;
DBMS_OUTPUT.PUT_LINE ('End:');
END LOOP;
END;
commit;

View File

@@ -0,0 +1,20 @@
INSERT INTO system_options
(syop_id_the_parent_of,
syop_id,
option_type,
NAME,
description,
module_name,
mtxt_text_number,
display_seq)
VALUES
(61,
765,
'S',
'Application Parameters',
'Generated ' || to_date(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'),
'amadw025$.startup',
3979,
NULL);
COMMIT;

View File

@@ -0,0 +1,20 @@
INSERT INTO system_options
(syop_id_the_parent_of,
syop_id,
option_type,
NAME,
description,
module_name,
mtxt_text_number,
display_seq)
VALUES
(734,
766,
'S',
'View Contract Values',
'Generated ' || to_date(SYSDATE, 'DD-MON-YYYY HH24:MI:SS'),
'efnow055$.startup',
3980,
NULL);
COMMIT;

View File

@@ -0,0 +1,4 @@
UPDATE module_text
SET text = RTRIM(text,'.')||
', contracted value will be replaced.'
WHERE text_number = 3558;

View File

@@ -0,0 +1,13 @@
prompt PL/SQL Developer import file
prompt Created on 07 February 2011 by NICHOLLSKG
set feedback off
set define off
prompt Loading MODULE_TEXT...
insert into MODULE_TEXT (mtxt_id, text_number, text, language)
values (21765, 3981, 'The contract selected for the nomination (<P1>) and the contract contained in the spreadsheet (<P2>) do not match.', 'EN');
insert into MODULE_TEXT (mtxt_id, text_number, text, language)
values (21766, 3981, 'The contract selected for the nomination (<P1>) and the contract contained in the spreadsheet (<P2>) do not match.', 'HU');
prompt 2 records loaded
set feedback on
set define on
prompt Done.

View File

@@ -0,0 +1,33 @@
SELECT XMLelement("nomination",
XMLelement("contract", cont.contract_number)
, XMLElement("timestamp", TO_CHAR(nom.created_on, 'DD/MM/YYYY-HH24:MI:SS'))
, XMLelement("gas_day_start", TO_CHAR(MIN(nnpcv.gas_day), 'DD/MM/YYYY'))
, XMLElement("gas_day_end", TO_CHAR(MAX(nnpcv.gas_day), 'DD/MM/YYYY'))
, XMLElement("status", 'valid')
, XMLElement("reason", '')
, XMLElement("nomination_body",XMLAgg(XMLELEMENT( "nomination_line"
, XMLELEMENT("gas_day", nnpcv.gas_day)
, xmlelement("network_point_code", np.code)
, xmlelement("category_code", cate.code)
, xmlelement("value", nnpcv.value)
, XMLElement("status", 'valid')
, XMLElement("reason", '')
))
)
)
FROM nominations nom
, contracts cont
, nom_net_point_cat_vals nnpcv
, cont_network_points conp
, network_points np
, contract_categories cc
, categories cate
WHERE nom.nomi_id = 2971
and nom.cont_id = cont.cont_id
AND nom.nomi_id = nnpcv.nomi_id
AND nnpcv.conp_id = conp.conp_id
AND nnpcv.coca_id = cc.coca_id
AND conp.nepo_id = np.nepo_id
AND cc.cate_id = cate.cate_id
group by cont.contract_number, nom.created_on--, nnpcv.gas_day, np.code

View File

@@ -0,0 +1 @@
<nomination><contract>Gas Contract 12345.678</contract><timestamp>20/11/2009-16:29:22</timestamp><gas_day_start>21/11/2009</gas_day_start><gas_day_end>21/11/2009</gas_day_end><nomination_body><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00001</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>1</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00001</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>1</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00002</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>1</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00003</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>2</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00004</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>3</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00005</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>4</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00005</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>4</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00004</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>3</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00003</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>2</value></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00002</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>1</value></nomination_line></nomination_body></nomination>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="nomination">
<xs:complexType>
<xs:sequence>
<xs:element ref="contract"/>
<xs:element ref="timestamp"/>
<xs:element ref="gas_day_start"/>
<xs:element ref="gas_day_end"/>
<xs:element ref="nomination_body"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="contract" type="xs:string"/>
<xs:element name="timestamp" type="xs:string"/>
<xs:element name="gas_day_start" type="xs:string"/>
<xs:element name="gas_day_end" type="xs:string"/>
<xs:element name="nomination_body">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="nomination_line"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="nomination_line">
<xs:complexType>
<xs:sequence>
<xs:element ref="gas_day"/>
<xs:element ref="network_point_code"/>
<xs:element ref="category_code"/>
<xs:element ref="value"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="gas_day" type="xs:NMTOKEN"/>
<xs:element name="network_point_code" type="xs:NCName"/>
<xs:element name="category_code" type="xs:NCName"/>
<xs:element name="value" type="xs:integer"/>
</xs:schema>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="error" type="xs:string"/>
</xs:schema>

View File

@@ -0,0 +1 @@
<error>Invalid Username/Password</error>

View File

@@ -0,0 +1 @@
<error>Unknown Request</error>

View File

@@ -0,0 +1 @@
<nomination><contract>Gas Contract 12345.678</contract><timestamp>20/11/2009-16:29:22</timestamp><gas_day_start>21/11/2009</gas_day_start><gas_day_end>21/11/2009</gas_day_end><status>valid</status><reason></reason><nomination_body><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00001</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>1</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00001</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>1</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00002</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>1</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00003</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>2</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00004</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>3</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00005</network_point_code><category_code>cat_IntrType1_m3day</category_code><value>4</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00005</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>4</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00004</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>3</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00003</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>2</value><status>valid</status><reason></reason></nomination_line><nomination_line><gas_day>2009-11-21</gas_day><network_point_code>ADNP00002</network_point_code><category_code>cat_IntrType2_m3h</category_code><value>1</value><status>valid</status><reason></reason></nomination_line></nomination_body></nomination>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="nomination">
<xs:complexType>
<xs:sequence>
<xs:element ref="contract"/>
<xs:element ref="timestamp"/>
<xs:element ref="gas_day_start"/>
<xs:element ref="gas_day_end"/>
<xs:element ref="status"/>
<xs:element ref="reason"/>
<xs:element ref="nomination_body"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="contract" type="xs:string"/>
<xs:element name="timestamp" type="xs:string"/>
<xs:element name="gas_day_start" type="xs:string"/>
<xs:element name="gas_day_end" type="xs:string"/>
<xs:element name="nomination_body">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="nomination_line"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="nomination_line">
<xs:complexType>
<xs:sequence>
<xs:element ref="gas_day"/>
<xs:element ref="network_point_code"/>
<xs:element ref="category_code"/>
<xs:element ref="value"/>
<xs:element ref="status"/>
<xs:element ref="reason"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="gas_day" type="xs:NMTOKEN"/>
<xs:element name="network_point_code" type="xs:NCName"/>
<xs:element name="category_code" type="xs:NCName"/>
<xs:element name="value" type="xs:integer"/>
<xs:element name="status" type="xs:NCName"/>
<xs:element name="reason">
<xs:complexType/>
</xs:element>
</xs:schema>

Some files were not shown because too many files have changed in this diff Show More