prompt Package Header: jr_names create or replace package jr_name is --Nested table type to hold irid/ivid of object versions type objver_rec is record (irid number ,ivid number ); type objver_list is table of objver_rec; --Global list of irids an ivids, used to store --result sets for later retrieval one at a time --as a workaround to the fact that JDBC cannot deal --with nested tables. global_obj_set objver_list; -- Nested table type to hold irid/ivid/type/fol_irid of elements -- Bug 2552095 type dpnd_objver_rec is record (irid number ,ivid number ,type_id number ,fol_irid number ); type dpnd_objver_list is table of dpnd_objver_rec; ----------------------------------------------------- -- Case_Sensitive() -- Returns TRUE if naming service is in case -- sensitive mode, otherwise returns FALSE. ----------------------------------------------------- function case_sensitive return boolean; ----------------------------------------------------- -- Enable_Case_Sensitivity() -- Puts the naming service into case -- sensitive mode. ----------------------------------------------------- procedure enable_case_sensitivity; ----------------------------------------------------- -- Disable_Case_Sensitivity() -- Puts the naming service into case -- insensitive mode. ----------------------------------------------------- procedure disable_case_sensitivity; ----------------------------------------------------- -- Get_Case_Sensitive_Flag() -- Returns value of case_sensitive_flag -- 'Y' - case sensitive -- 'N' - case insensitive ----------------------------------------------------- function get_case_sensitive_flag return varchar2; ----------------------------------------------------- -- Initialize() -- Sets up non-default values for special characters -- used in naming service... ----------------------------------------------------- procedure initialize(i_escape_char in char ,i_file_seperator1 in char ,i_file_seperator2 in char ,i_SAC_seperator in char ,i_branch_seperator in char ,i_version_start in char ,i_version_end in char ,i_type_seperator in char ,i_wildcard_char in char ,i_single_wildcard_char in char); ----------------------------------------------------- -- Special_Chars() -- Returns the values for the special characters -- used in naming service... ----------------------------------------------------- procedure Special_Chars(o_escape_char out char ,o_file_seperator1 out char ,o_file_seperator2 out char ,o_SAC_seperator out char ,o_branch_seperator out char ,o_version_start out char ,o_version_end out char ,o_type_seperator out char ,o_wildcard_char out char ,o_single_wildcard_char out char); ----------------------------------------------------------------------------- -- get_IVID() -- Convert CRN Path into an IVID -- No errors raised, and exceptions not handled - allows function to be called -- directly from SQL. ----------------------------------------------------------------------------- function get_IVID(CRPath in varchar2,seperator in char := NULL) return number; ------------------------------------------------ -- Get ivid of object from supplied path. -- Wrapper for get_IVID(), exceptions handled -- and errors raised... ------------------------------------------------ function get_VID(CRPath in varchar2,seperator in char := NULL) return number; ----------------------------------------------------------------------------- -- Get objects matching last member (wildcards allowed) in supplied path. ----------------------------------------------------------------------------- function get_objects(CRPath in varchar2,seperator in char := NULL) return objver_list; ------------------------------------------------- -- Get irid and ivid of object form supplied path ------------------------------------------------- procedure get_RID_VID(CRPath in varchar2, o_irid out number, o_ivid out number, seperator in char := NULL); ----------------------------------------------------------------------------- -- Convert Path into an IVID in the context of a configuration. -- Use just the object names to specify path members. ----------------------------------------------------------------------------- function get_VID_in_config(CRPath in varchar2, config_ivid in number, seperator in char := NULL) return number; ----------------------------------------------------------------------------- -- Convert Path into an IVID and IRID in the context of a configuration. -- Use just the object names to specify path members. ----------------------------------------------------------------------------- procedure get_RID_VID_in_config(CRPath in varchar2 ,config_ivid in number ,irid out number ,ivid out number ,seperator in char := NULL); -------------------------------------------------------------------------- -- Convert CRN Path into a list of IRIDs + IVIDs (wildcards allowed) -------------------------------------------------------------------------- function path_members(CRPath in varchar2,seperator in char := NULL) return objver_list; --------------------------------------------------- -- Get CRN from supplied ivid or ivid and irid, in -- required format: -- NAME - just the name of object/folder -- VLABEL - name;vlabel -- BRANCH - name;branch;version_seq ---------------------------------------------------- function get_CRN(i_ivid in number ,format varchar2 ,add_escapes in number := 0) return varchar2 ; function get_CRN(i_irid in number ,i_ivid in number ,format varchar2 ,add_escapes in number := 0) return varchar2 ; --This function posts no errors onto stack, and can be called from SQL statment. function get_CRN_from_IVID(i_ivid in number ,format in varchar2 ,add_escapes number := 0) return varchar2; --This function posts no errors onto stack, and can be called from SQL statment. function get_CRN_from_IRID(i_irid in number ,format in varchar2 ,add_escapes number := 0) return varchar2; --------------------------------------------------- -- Get version info (no name) -- for specified object version. Formats: -- VLABEL - vlabel -- BRANCH - branch;version_seq --------------------------------------------------- function get_version_info(i_ivid in number ,format varchar2 ,add_escapes in number := 0) return varchar2; -------------------------------------------------- -- Get descriptor (as defined in logical model) -- for an element. -- Accepts IRID or IVID, and works with or without -- workarea context. EL_TYPE is the logical type -- id of the element. ---------------------------------------------------- function get_descriptor(el_id in number ,el_type in number ,format in varchar2 ,add_escapes in number := 0) return varchar2; -------------------------------------------------- -- Get descriptor (as defined in logical model) -- for an element. -- Accepts IRID or IVID, and works with or without -- workarea context. ELEM_TYPE is the short name -- for the element type, and PRODUCT is the product -- code for the element type (as defined in logical -- model). ---------------------------------------------------- function get_descriptor(el_id in number ,elem_type in varchar2 ,product in varchar2 ,format in varchar2 ,add_escapes in number := 0) return varchar2; ---------------------------------------------------------------- -- Convert IRID/IVID into path of CRNs -- Posts no errors to stack, so can be called from SQL statement ---------------------------------------------------------------- --Works in context of workarea, takes IRID or IVID... function get_Path(id in number ,format varchar2 ,seperator varchar2 := NULL ,add_escapes in number := 0) return varchar2; PRAGMA RESTRICT_REFERENCES (get_Path, WNDS, WNPS); --Works in context of a workarea, takes IRID or IVID and returns IRID and IVID --of the root container. FUNCTION get_Path(id IN number ,root_irid OUT number ,root_ivid OUT number ,format IN varchar2 ,seperator IN varchar2 := NULL ,add_escapes IN number := 0) RETURN varchar2; PRAGMA RESTRICT_REFERENCES (get_Path, WNDS, WNPS); --Works in context of a configuration... function get_Path_in_config(ivid in number ,config_id in number ,format varchar2 ,seperator varchar2 := NULL ,add_escapes in number := 0) return varchar2; PRAGMA RESTRICT_REFERENCES (get_Path_in_config, WNDS, WNPS); --Works with no context - gets latest versions from specified branch... function get_Path_no_context(el_id in number ,branch in varchar2 ,format in varchar2 ,seperator varchar2 := NULL ,add_escapes in number := 0) return varchar2; --Works for SACs, but cannot be called directly from SQL statement... function get_path(el_id in number ,elem_type in varchar2 ,product in varchar2 ,format in varchar2 ,seperator varchar2 := NULL ,add_escapes in number := 0) return varchar2; function get_path(el_id in number ,el_type in number ,format in varchar2 ,seperator varchar2 := NULL ,add_escapes in number := 0) return varchar2; ------------------------------------------------------------------ --Gets the contents of a folder (irid+ivid), specified by fol_ivid ----------------------------------------------------------------- function folder_contents(fol_ivid in number ,recurse in boolean ,filter in varchar2 default NULL) return objver_list; ------------------------------------------------------------------ --Gets the contents of a folder (irid+ivid+type), specified by fol_ivid -- Called only from package jr_dependancy ----------------------------------------------------------------- function dpnd_folder_contents(fol_ivid in number ,recurse in boolean ,filter in varchar2 default NULL) return dpnd_objver_list; ---------------------------------------------------------------------------------------- --Gets the latest versions (irid+ivid) of the contents of a folder, specified by fol_ivid ----------------------------------------------------------------------------------------- function folder_latest_contents(fol_ivid in number ,branch_id number ,recurse in boolean ,filter in varchar2 default NULL) return objver_list; ---------------------------------------------------------------------------------------- --Gets the latest versions (irid+ivid) of the contents of a diagram, specified by diagram_ivid -- Added to Fix US BUGS 1969465 -- 1969487 ----------------------------------------------------------------------------------------- function latest_diagram_contents(diagram_ivid IN number ,branch_id number ) RETURN objver_list ; ------------------------------------------------------------------------- --Gets the contents of a folder (irid+ivid). Folder specified by path. --If latest is true, get latest versions on same branch as folder. --otherwise, get versions according to workarea context. ------------------------------------------------------------------------- function folder_contents(path in varchar2 ,latest in boolean DEFAULT TRUE ,recurse in boolean DEFAULT TRUE ,filter in varchar2 DEFAULT NULL ,seperator in char DEFAULT NULL) return objver_list; ----------------------------------------------------------------------------- --Gets the latest versions before specified date and on specified branch, --of the contents of a folder, specified by fol_ivid ----------------------------------------------------------------------------- function folder_contents_before(fol_ivid in number ,branch_id number ,before_date in date ,recurse in boolean ,filter in varchar2 default NULL) return objver_list; ----------------------------------------------------------------------------- --Gets the latest versions between specified dates and on specified branch, --of the contents of a folder, specified by fol_ivid ----------------------------------------------------------------------------- function folder_contents_between(fol_ivid in number ,branch_id number ,start_date in date ,end_date in date ,recurse in boolean ,filter in varchar2 default NULL) return objver_list; ------------------------------------------------------------------------- --Checks the name uniqueness of the given element in the context --of the given folder and current application system. --If the element does not have a unique name, the irid and type id --of the conflicting element are passed back, and the function returns --FALSE. For Oracle Designer elements, the appropriate CDAPI checks are --called. -------------------------------------------------------------------------- function is_el_name_unique(con_irid in number ,pac_irid in number ,clash_irid out number ,clash_type_id out number) return boolean; ----------------------------------------------------------------------------- -- Wrappers to return jr_num_list rather than objver_list, -- as OCI can only handle collections of primitive types. -- Eventually, will replace interfaces for original methods -- with ones that look like these wrappers, but need to modify exsisting -- server code that calls naming service first... ----------------------------------------------------------------------------- procedure get_objects(CRPath in varchar2,irids out jr_num_list,ivids out jr_num_list,seperator in char := NULL); procedure path_members(CRPath in varchar2,irids out jr_num_list,ivids out jr_num_list,seperator in char := NULL); procedure folder_contents(fol_ivid in number, recurse in boolean,irids out jr_num_list,ivids out jr_num_list,filter in varchar2 default NULL); procedure folder_latest_contents(fol_ivid in number, branch_id number, recurse in boolean,irids out jr_num_list,ivids out jr_num_list,filter in varchar2 default NULL); procedure folder_contents(path in varchar2, latest in boolean, recurse in boolean,irids out jr_num_list,ivids out jr_num_list,filter in varchar2 default NULL,seperator in char := NULL) ; ----------------------------------------------------------------------------- -- Wrappers for functions that return objver_lists. Needed because JDBC cannot -- deal with arrays. Procedures pass back number of objects found for given -- path and populate global_obj_set. ----------------------------------------------------------------------------- procedure get_objects(CRPath in varchar2, found out number,seperator in char := NULL); procedure path_members(CRPath in varchar2, found out number,seperator in char := NULL); procedure folder_contents(fol_ivid in number, recurse in boolean,filter in varchar2 default NULL,found out number); procedure folder_latest_contents(fol_ivid in number, branch_id number, recurse in boolean,filter in varchar2 default NULL,found out number); procedure folder_contents(path in varchar2, latest in boolean, recurse in boolean,found out number,filter in varchar2 default NULL,seperator in char := NULL) ; -------------------------------------------------------------- --Gets the first element in the global_obj_set. --Returns irid, ivid and index. -------------------------------------------------------------- procedure get_first(irid out number ,ivid out number ,el_index out number); ------------------------------------------------------------------- --Gets the next element in global_obj_set, after the specified index --If the specified index is null, then it gets the first in the --list. -------------------------------------------------------------------- procedure get_next(irid out number ,ivid out number ,el_index in out number); INVALID_CRN exception; INVALID_WILDCARD exception; INCORRECTLY_PARSED_PATH exception; NULL_CONTEXT exception; INVALID_BRANCH_NAME exception; INVALID_TYPE exception; TOO_MANY_ELEMENTS exception; --------------------------------------------------- --DEPRECATED METHODS - Should no longer be called --------------------------------------------------- function get_config_IVID(config_name in varchar2) return number; procedure get_config_IRID_IVID(config_name in varchar2 ,config_irid out number ,config_ivid out number); ------------------------------------------------- --- Allow calls from SQL ------------------------------------------------- PRAGMA RESTRICT_REFERENCES (get_IVID, WNDS); PRAGMA RESTRICT_REFERENCES (get_CRN_from_IVID, WNDS, WNPS); PRAGMA RESTRICT_REFERENCES (get_CRN_from_IRID, WNDS, WNPS); PRAGMA RESTRICT_REFERENCES (get_version_info, WNDS, WNPS); PRAGMA RESTRICT_REFERENCES (get_Path_no_context, WNDS, WNPS); PRAGMA RESTRICT_REFERENCES (case_sensitive, WNDS, WNPS); PRAGMA RESTRICT_REFERENCES (get_case_sensitive_flag, WNDS, WNPS); end; /