remove publicly exposed function

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3640 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
PriestJ
2008-02-20 12:49:30 +00:00
parent 6dd271eb4c
commit f68701d4f1

View File

@@ -22,13 +22,11 @@ function set_file_association(p_uri in varchar2,
p_enqu_id in number, p_enqu_id in number,
p_drwg_code in varchar2, p_drwg_code in varchar2,
p_doro_type in varchar2) return boolean; p_doro_type in varchar2) return boolean;
PROCEDURE export_table_to_csv(p_table IN VARCHAR2, PROCEDURE export_table_to_csv(p_table IN VARCHAR2,
p_column_headers IN VARCHAR2, p_column_headers IN VARCHAR2,
p_delimiter IN VARCHAR2 DEFAULT ','); p_delimiter IN VARCHAR2 DEFAULT ',');
function are_files_over_size_limit(p_enqu_id number,p_uri varchar2) return BOOLEAN;
end MIP_FILES; end MIP_FILES;
/ /
@@ -41,16 +39,16 @@ create or replace package body MIP_FILES as
*/ */
function is_file_over_size_limit(p_uri varchar2) return boolean is function is_file_over_size_limit(p_uri varchar2) return boolean is
l_file_size wwv_flow_files.doc_size%type; l_file_size wwv_flow_files.doc_size%type;
BEGIN BEGIN
SELECT doc_size SELECT doc_size
INTO l_file_size INTO l_file_size
FROM wwv_flow_files FROM wwv_flow_files
WHERE NAME = p_uri; WHERE NAME = p_uri;
RETURN(l_file_size > 3 * 1024 * 1024); RETURN(l_file_size > 3 * 1024 * 1024);
end is_file_over_size_limit; end is_file_over_size_limit;
/* /*
FUNCTION are_files_over_size_limit FUNCTION are_files_over_size_limit
@@ -62,7 +60,7 @@ create or replace package body MIP_FILES as
function are_files_over_size_limit(p_enqu_id NUMBER) return boolean is function are_files_over_size_limit(p_enqu_id NUMBER) return boolean is
l_total_size number; l_total_size number;
BEGIN BEGIN
SELECT SUM(doc_size) SELECT SUM(doc_size)
INTO l_total_size INTO l_total_size
FROM documents d FROM documents d
@@ -71,9 +69,9 @@ create or replace package body MIP_FILES as
WHERE dr.enqu_id = p_enqu_id WHERE dr.enqu_id = p_enqu_id
AND d.id = dr.docu_id AND d.id = dr.docu_id
AND d.uri = f.NAME; AND d.uri = f.NAME;
RETURN (nvl(l_total_size,0) > 10 * 1024 * 1024); RETURN (nvl(l_total_size,0) > 10 * 1024 * 1024);
end are_files_over_size_limit; end are_files_over_size_limit;
/* /*
FUNCTION delete_file FUNCTION delete_file
@@ -97,13 +95,13 @@ create or replace package body MIP_FILES as
INTO l_uri; INTO l_uri;
CLOSE c_get_uri; CLOSE c_get_uri;
--set up a deletion event for the document --set up a deletion event for the document
insert into document_events(docu_id, dost_code,event_date,description,id) insert into document_events(docu_id, dost_code,event_date,description,id)
values (p_id, values (p_id,
p_doc_status, p_doc_status,
sysdate, sysdate,
p_reason, p_reason,
doev_seq.NEXTVAL); doev_seq.NEXTVAL);
--delete the actual file from the database --delete the actual file from the database
delete wwv_flow_files where wwv_flow_files.name = l_uri; delete wwv_flow_files where wwv_flow_files.name = l_uri;
return true; return true;
end delete_file; end delete_file;
@@ -116,11 +114,11 @@ create or replace package body MIP_FILES as
function quote_file_exists(p_qute_id number) return boolean is function quote_file_exists(p_qute_id number) return boolean is
l_file_exists number; l_file_exists number;
CURSOR c_file_exists(cp_qute_id number) IS CURSOR c_file_exists(cp_qute_id number) IS
select 1 select 1
from wwv_flow_files from wwv_flow_files
where name=(select d.uri where name=(select d.uri
from documents d, document_roles dr from documents d, document_roles dr
where dr.qute_id = cp_qute_id and d.id = dr.docu_id); where dr.qute_id = cp_qute_id and d.id = dr.docu_id);
begin begin
IF NOT c_file_exists%ISOPEN THEN IF NOT c_file_exists%ISOPEN THEN
OPEN c_file_exists(p_qute_id); OPEN c_file_exists(p_qute_id);
@@ -131,7 +129,7 @@ create or replace package body MIP_FILES as
if l_file_exists is not null and l_file_exists>0 then if l_file_exists is not null and l_file_exists>0 then
return true; return true;
else else
return false; return false;
end if; end if;
end quote_file_exists; end quote_file_exists;
/* /*
@@ -143,11 +141,11 @@ create or replace package body MIP_FILES as
function drawing_file_exists(p_drwg_code varchar2) return boolean is function drawing_file_exists(p_drwg_code varchar2) return boolean is
l_file_exists number; l_file_exists number;
CURSOR c_file_exists(cp_drwg_code varchar2) IS CURSOR c_file_exists(cp_drwg_code varchar2) IS
select 1 select 1
from wwv_flow_files from wwv_flow_files
where name=(select d.uri where name=(select d.uri
from documents d, document_roles dr from documents d, document_roles dr
where dr.drwg_code = cp_drwg_code and d.id = dr.docu_id); where dr.drwg_code = cp_drwg_code and d.id = dr.docu_id);
begin begin
IF NOT c_file_exists%ISOPEN THEN IF NOT c_file_exists%ISOPEN THEN
OPEN c_file_exists(p_drwg_code); OPEN c_file_exists(p_drwg_code);
@@ -158,7 +156,7 @@ create or replace package body MIP_FILES as
if l_file_exists is not null and l_file_exists>0 then if l_file_exists is not null and l_file_exists>0 then
return true; return true;
else else
return false; return false;
end if; end if;
end drawing_file_exists; end drawing_file_exists;
/* /*
@@ -180,28 +178,28 @@ create or replace package body MIP_FILES as
p_enqu_id in number, p_enqu_id in number,
p_drwg_code in varchar2) return boolean is p_drwg_code in varchar2) return boolean is
l_doc_id number; l_doc_id number;
begin begin
--reference it in the documents table --reference it in the documents table
insert into documents( uri, description, id, docu_type ) insert into documents( uri, description, id, docu_type )
values (p_uri, values (p_uri,
p_description, p_description,
docu_seq.NEXTVAL, docu_seq.NEXTVAL,
p_docu_type) p_docu_type)
returning id into l_doc_id; returning id into l_doc_id;
--set up a role for the document --set up a role for the document
update document_roles set docu_id = l_doc_id update document_roles set docu_id = l_doc_id
where drwg_code = nvl(p_drwg_code,'') or qute_id = nvl(p_qute_id,0) or enqu_id = nvl(p_enqu_id,0); where drwg_code = nvl(p_drwg_code,'') or qute_id = nvl(p_qute_id,0) or enqu_id = nvl(p_enqu_id,0);
--set up an event for the document --set up an event for the document
insert into document_events(docu_id, dost_code,event_date,description,id) insert into document_events(docu_id, dost_code,event_date,description,id)
values (l_doc_id, values (l_doc_id,
'AWAIT SCAN', 'AWAIT SCAN',
sysdate, sysdate,
p_description, p_description,
doev_seq.NEXTVAL); doev_seq.NEXTVAL);
--if it works then return true --if it works then return true
return true; return true;
end update_file_association; end update_file_association;
/* /*
FUNCTION set_file_association FUNCTION set_file_association
- sets the association between a object within webmip to a file held in the - sets the association between a object within webmip to a file held in the
@@ -231,10 +229,10 @@ create or replace package body MIP_FILES as
values (p_uri, values (p_uri,
p_description, p_description,
docu_seq.NEXTVAL, docu_seq.NEXTVAL,
p_docu_type) p_docu_type)
returning id into l_doc_id; returning id into l_doc_id;
--set up a role for the document --set up a role for the document
insert into document_roles(rt_code, start_date,description,qute_id,enqu_id,drwg_code,id,doro_type,docu_id) insert into document_roles(rt_code, start_date,description,qute_id,enqu_id,drwg_code,id,doro_type,docu_id)
values (p_rt_code, values (p_rt_code,
sysdate, sysdate,
p_description, p_description,
@@ -243,18 +241,18 @@ create or replace package body MIP_FILES as
p_drwg_code, p_drwg_code,
doro_seq.NEXTVAL, doro_seq.NEXTVAL,
p_doro_type, p_doro_type,
l_doc_id); l_doc_id);
--set up an event for the document --set up an event for the document
insert into document_events(docu_id, dost_code,event_date,description,id) insert into document_events(docu_id, dost_code,event_date,description,id)
values (l_doc_id, values (l_doc_id,
'AWAIT SCAN', 'AWAIT SCAN',
sysdate, sysdate,
p_description, p_description,
doev_seq.NEXTVAL); doev_seq.NEXTVAL);
if (are_files_over_size_limit(p_enqu_id) or is_file_over_size_limit(p_uri)) and p_rt_code = 'ENQUIRY SUPPORTING DOC' and not p_enqu_id is null then if (are_files_over_size_limit(p_enqu_id) or is_file_over_size_limit(p_uri)) and p_rt_code = 'ENQUIRY SUPPORTING DOC' and not p_enqu_id is null then
l_success := delete_file(l_doc_id,'REMOVED SIZE','webMIP determined the file or files to be too big'); l_success := delete_file(l_doc_id,'REMOVED SIZE','webMIP determined the file or files to be too big');
return false; return false;
else else
--if it works then return true --if it works then return true
return true; return true;
end if; end if;