create or replace package cdwp_txt is type cdi_text_lines is table of cdi_text.txt_text%type index by binary_integer; -- Public type declarations type stringarray is table of varchar2(2000) index by binary_integer; -- function to replace references to entities in a text line -- with anchors to the description of the entity -- function add_ent_anchors ( p_text_previous in varchar2 , p_text in varchar2 , p_text_next in varchar2 ,p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_one_file in varchar2 default cdwpbase.get_one_file ,p_static in boolean default cdwpbase.get_static ) return varchar2 ; function mlt_display_name ( p_txt_type in varchar2 ) return varchar2 -- this function returns the NLS display-name of the Multi-Line Text type ; procedure display_full_mlt ( p_session_id in number ,p_el_id in number -- id of the element for which multi-line text should be displayed ,p_ivid in number -- the parent ivid for the MLT ,p_txt_type in varchar2 -- type of multi-line text ,p_mlt_prompt_name in varchar2 default null -- when NULL use Designers own display_name ,p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_one_file in varchar2 default cdwpbase.get_one_file ); procedure prepare_static_mlt_file (p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_one_file in varchar2 default cdwpbase.get_one_file ,p_static in boolean default cdwpbase.get_static ); procedure display_mlt ( p_el_id in number -- id of the element for which multi-line text should be displayed ,p_txt_type in varchar2 -- type of multi-line text ,p_mlt_prompt_name in varchar2 default null -- when NULL use Designers own display_name ,p_replace_entities in boolean default false -- create hyperlinks for Entity names ,p_replace_tables in boolean default false -- create hyperlinks for Table names ,p_max_lines in number default 5 -- maximum number of lines to display (if more then icon + link is displayed) ,p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_one_file in varchar2 default cdwpbase.get_one_file ,p_static in boolean default cdwpbase.get_static ,p_el_type in varchar2 default null -- element type shortname ,p_no_prompt in boolean default false -- when true, this procedure will only write one cell if p_max_lines = 0 or 1 -- when true, no rowopen/rowclose or heading, just datavalue if p_max_lines = 0 ,p_no_row in boolean default false ); procedure display_all_mlt ( p_el_id in number -- id of the element for which multi-line text should be displayed ,p_max_lines in number default 5 -- maximum number of lines to display (if more then icon + link is displayed) ,p_do_not_display1 in varchar2 default 'XXX' ,p_do_not_display2 in varchar2 default 'XXX' ,p_do_not_display3 in varchar2 default 'XXX' ,p_app_name in varchar2 default cdwpbase.get_app_name ,p_app_version in number default cdwpbase.get_app_version ,p_one_file in varchar2 default cdwpbase.get_one_file ,p_static in boolean default cdwpbase.get_static ,p_el_type in varchar2 default null -- element type shortname ); procedure write_lines_to_repository ( p_el_id in number , p_el_type in varchar2 , p_text_type in varchar2 , p_text_lines in cdi_text_lines , p_text_counter in number , p_append_or_replace in varchar2 ) -- Purpose this procedure will write to CDI_TEXT the replacing text -- stored in p_text_lines for element p_el_id and text-type -- p_text_type -- -- Usage p_el_type: the repository short name for the element type -- e.g. 'PLM' for PL/SQL Definition -- p_append_or_replace allowable values: -- 'APPEND' and 'REPLACE' (case insensitive) ; procedure get_lines_from_repository ( p_el_id in number , p_text_type in varchar2 , p_text_lines out cdi_text_lines , p_text_counter out number ) -- Purpose this procedure will read from CDI_TEXT for element p_el_id and text-type -- p_text_type, will split it up into logical lines and return it in the -- variable p_text_lines (the number of lines is returned in p_text_counter) ; function get_mlt_block ( p_el_id in number , p_text_type in varchar2 , p_size in number default 32000 -- how many characters , p_start_pos in number default 1 -- starting at wich position ) return varchar2 -- Purpose this function will read from CDI_TEXT for element p_el_id and text-type -- p_text_type, will add lines together into one string -- The string will be either p_size long or less if the MLT block is shorter than p_size ; function get_html_tagged_text ( p_text_lines in cdi_text_lines , p_text_counter in number , p_tag_code in varchar2 ) return varchar2 -- Purpose Return text between begin-tag and end-tag in HTML style, -- from text block specified by p_text_lines and p_text_counter -- Example: if p_tag_code = 'TY', -- return text between '' and '' -- -- Usage p_tag_code must be of length 2 and in uppercase ; -- Public function and procedure declarations -- Procedure to write the content of a stringarray -- to the htp buffer, after parsing it as PL/SQL code. procedure tidy_up_code( p_txt in cdi_text_lines); end; -- cdwp_txt /