Updated LeadTimes.csv and modules in line with Gareths email of 20/2/2008
git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@3648 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
@@ -31,6 +31,22 @@ PROCEDURE export_table_to_csv(p_table IN VARCHAR2,
|
||||
end MIP_FILES;
|
||||
/
|
||||
create or replace package body MIP_FILES as
|
||||
|
||||
PROCEDURE pl(p_in VARCHAR2) IS
|
||||
l_fh utl_file.file_type;
|
||||
BEGIN
|
||||
dbms_application_info.set_module('MIP_FILES'
|
||||
,p_in);
|
||||
l_fh := utl_file.fopen(location => 'WEBMIP_BULK_LOAD'
|
||||
,filename => 'MIP_FILES.txt'
|
||||
,open_mode => 'A');
|
||||
utl_file.put_line(l_fh
|
||||
,to_char(SYSDATE
|
||||
,'DD/MM/YYYY HH24:MI:SS') || ',' || p_in);
|
||||
utl_file.fclose(l_fh);
|
||||
END pl;
|
||||
|
||||
|
||||
/*
|
||||
FUNCTION is_file_over_size_limit
|
||||
- takes the uri of the file to test for size and returns true if the file
|
||||
@@ -42,11 +58,12 @@ create or replace package body MIP_FILES as
|
||||
|
||||
BEGIN
|
||||
|
||||
pl('is_file_over_size_limit:'||p_uri);
|
||||
SELECT doc_size
|
||||
INTO l_file_size
|
||||
FROM wwv_flow_files
|
||||
WHERE NAME = p_uri;
|
||||
|
||||
pl('l_file_size:'||l_file_size);
|
||||
RETURN(l_file_size > 3 * 1024 * 1024);
|
||||
|
||||
end is_file_over_size_limit;
|
||||
@@ -60,7 +77,7 @@ create or replace package body MIP_FILES as
|
||||
function are_files_over_size_limit(p_enqu_id NUMBER) return boolean is
|
||||
l_total_size number;
|
||||
BEGIN
|
||||
|
||||
pl('are_files_over_size_limit:'||p_enqu_id);
|
||||
SELECT SUM(doc_size)
|
||||
INTO l_total_size
|
||||
FROM documents d
|
||||
@@ -70,6 +87,7 @@ create or replace package body MIP_FILES as
|
||||
AND d.id = dr.docu_id
|
||||
AND d.uri = f.NAME;
|
||||
|
||||
pl('l_total_size:'||l_total_size);
|
||||
RETURN (nvl(l_total_size,0) > 10 * 1024 * 1024);
|
||||
|
||||
end are_files_over_size_limit;
|
||||
@@ -223,7 +241,8 @@ create or replace package body MIP_FILES as
|
||||
p_doro_type in varchar2) return BOOLEAN is
|
||||
l_doc_id number;
|
||||
l_success boolean;
|
||||
begin
|
||||
BEGIN
|
||||
pl('set_file_association, p_uri='||p_uri||', p_drwg_code='||p_drwg_code);
|
||||
--reference it in the documents table
|
||||
insert into documents( uri, description, id, docu_type )
|
||||
values (p_uri,
|
||||
@@ -249,11 +268,15 @@ create or replace package body MIP_FILES as
|
||||
sysdate,
|
||||
p_description,
|
||||
doev_seq.NEXTVAL);
|
||||
|
||||
pl('check_file_sizes');
|
||||
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');
|
||||
pl('returning false');
|
||||
return false;
|
||||
else
|
||||
--if it works then return true
|
||||
pl('returning true');
|
||||
return true;
|
||||
end if;
|
||||
end set_file_association;
|
||||
|
||||
Reference in New Issue
Block a user