Index: openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql	6 Feb 2002 21:58:55 -0000	1.6
+++ openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql	17 Aug 2002 03:59:38 -0000	1.7
@@ -76,7 +76,7 @@
        impl_name		acs_sc_impls.impl_name%TYPE
    );
 
-   /* not sure if this should get folded into the impl package or not*/
+   /* Next 2 functions are deprecated but left here for backwards compatability */
 
    function new_alias (
        impl_contract_name	acs_sc_contracts.contract_name%TYPE,
@@ -97,6 +97,26 @@
 /
 show error
 
+create or replace package acs_sc_impl_alias
+as
+   function new (
+       impl_contract_name	acs_sc_contracts.contract_name%TYPE,
+       impl_name		acs_sc_impls.impl_name%TYPE,
+       impl_operation_name	acs_sc_operations.operation_name%TYPE,
+       impl_alias		acs_sc_impl_aliases.impl_alias%TYPE,
+       impl_pl			acs_sc_impl_aliases.impl_pl%TYPE
+   ) return acs_sc_impl_aliases.impl_id%TYPE;
+
+   function delete (
+       impl_contract_name	acs_sc_contracts.contract_name%TYPE,
+       impl_name		acs_sc_impls.impl_name%TYPE,
+       impl_operation_name	acs_sc_operations.operation_name%TYPE
+   ) return acs_sc_impls.impl_id%TYPE;
+
+end acs_sc_impl_alias;
+/
+show error
+
 create or replace package acs_sc_binding
 as
    procedure new (
@@ -381,7 +401,7 @@
    end delete;
 
 
-   /* not sure if this should get folded into the impl package */
+   /* next 2 functions are deprecated. */
 
   function new_alias (
        impl_contract_name	acs_sc_contracts.contract_name%TYPE,
@@ -393,32 +413,87 @@
    is
        v_impl_id		acs_sc_impls.impl_id%TYPE;
    begin
+	-- FUNCTION DEPRECATED. USE acs_sc_impl_alias.new
+	dbms_output.put_line('acs_sc_impl.new_alias DEPRECATED. Use acs_sc_impl_alias.new');
 
+	v_impl_id := acs_sc_impl_alias.new(
+		impl_contract_name,
+		impl_name,
+		impl_operation_name,
+		impl_alias,
+		impl_pl
+	);
+
+	return v_impl_id;
+
+   end new_alias;
+
+   function delete_alias (
+       impl_contract_name	acs_sc_contracts.contract_name%TYPE,
+       impl_name		acs_sc_impls.impl_name%TYPE,
+       impl_operation_name	acs_sc_operations.operation_name%TYPE
+   ) return acs_sc_impls.impl_id%TYPE
+   is
+       v_impl_id		acs_sc_impls.impl_id%TYPE;
+   begin
+	-- FUNCTION DEPRECATED. USE acs_sc_impl_alias.delete
+	dbms_output.put_line('acs_sc_impl.delete_alias DEPRECATED. Use acs_sc_impl_alias.delete');
+
+	v_impl_id := acs_sc_impl_alias.delete(
+		impl_contract_name,
+		impl_name,
+		impl_operation_name
+	);
+
+       return v_impl_id;
+
+   end delete_alias;
+
+end acs_sc_impl;
+/
+show errors
+
+
+
+create or replace package body acs_sc_impl_alias
+as
+
+  function new (
+       impl_contract_name	acs_sc_contracts.contract_name%TYPE,
+       impl_name			acs_sc_impls.impl_name%TYPE,
+       impl_operation_name	acs_sc_operations.operation_name%TYPE,
+       impl_alias			acs_sc_impl_aliases.impl_alias%TYPE,
+       impl_pl				acs_sc_impl_aliases.impl_pl%TYPE
+   ) return acs_sc_impl_aliases.impl_id%TYPE
+   is
+       v_impl_id		acs_sc_impls.impl_id%TYPE;
+   begin
+
        v_impl_id := acs_sc_impl.get_id(impl_contract_name,impl_name);
 
        insert into acs_sc_impl_aliases (
         impl_id,
-	impl_name,
-	impl_contract_name,
-	impl_operation_name,
-	impl_alias,
-	impl_pl
+		impl_name,
+		impl_contract_name,
+		impl_operation_name,
+		impl_alias,
+		impl_pl
        ) values (
         v_impl_id,
-	impl_name,
-	impl_contract_name,
-	impl_operation_name,
-	impl_alias,
-	impl_pl
+		impl_name,
+		impl_contract_name,
+		impl_operation_name,
+		impl_alias,
+		impl_pl
        );
 
        return v_impl_id;
 
-   end new_alias;
+   end new;
 
-   function delete_alias (
+   function delete (
        impl_contract_name	acs_sc_contracts.contract_name%TYPE,
-       impl_name		acs_sc_impls.impl_name%TYPE,
+       impl_name			acs_sc_impls.impl_name%TYPE,
        impl_operation_name	acs_sc_operations.operation_name%TYPE
    ) return acs_sc_impls.impl_id%TYPE
    is
@@ -433,14 +508,12 @@
 
        return v_impl_id;
 
-   end delete_alias;
+   end delete;
 
-end acs_sc_impl;
+end acs_sc_impl_alias;
 /
 show errors
 
-
-
 create or replace package body acs_sc_binding
 as
    -- you can pick a pair of args, either ids or names to pass in.
@@ -535,22 +608,17 @@
    end delete;
 
    function exists_p (
-       contract_name		acs_sc_contracts.contract_name%TYPE,
-       impl_name		acs_sc_impls.impl_name%TYPE
+       contract_name        acs_sc_contracts.contract_name%TYPE,
+       impl_name            acs_sc_impls.impl_name%TYPE
    ) return integer
    is
-       v_contract_id		acs_sc_contracts.contract_id%TYPE;
-       v_impl_id		acs_sc_impls.impl_id%TYPE;
-       v_exists_p		integer;
+       v_exists_p       integer;
    begin
-       v_contract_id := acs_sc_contract.get_id(contract_name);
-       v_impl_id := acs_sc_impl.get_id(contract_name,impl_name);
-
        select decode(count(*),0, 0, 1) into v_exists_p
-          from acs_sc_bindings
-	  where contract_id = v_contract_id
-	  and impl_id = v_impl_id;
-	
+       from acs_sc_bindings
+       where contract_id = acs_sc_contract.get_id(contract_name)
+       and impl_id = acs_sc_impl.get_id(contract_name,impl_name);
+    
        return v_exists_p;
    end exists_p;
 
