details:   https://code.openbravo.com/erp/devel/pi/rev/bad8c6d3677a
changeset: 13841:bad8c6d3677a
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Tue Sep 27 11:04:18 2011 +0200
summary:   Related to issue 17641. Removed old delete client objects.

diffstat:

 src-db/database/model/excludeFilter.xml                       |    4 -
 src-db/database/model/functions/AD_DELETE_CLIENT.xml          |  218 ----------
 src-db/database/model/functions/AD_DELETE_CLIENT0.xml         |   33 -
 src-db/database/model/postscript-Oracle.sql                   |  163 -------
 src-db/database/model/postscript-PostgreSql.sql               |  161 -------
 src/org/openbravo/erpCommon/ad_process/DeleteClient_data.xsql |   37 -
 6 files changed, 0 insertions(+), 616 deletions(-)

diffs (truncated from 660 to 300 lines):

diff -r 7d3eaa3a17c4 -r bad8c6d3677a src-db/database/model/excludeFilter.xml
--- a/src-db/database/model/excludeFilter.xml   Tue Sep 27 09:55:42 2011 +0200
+++ b/src-db/database/model/excludeFilter.xml   Tue Sep 27 11:04:18 2011 +0200
@@ -38,10 +38,6 @@
     <excludedFunction name="IS_TRIGGER_ENABLED"/>
     <excludedFunction name="DROP_VIEW"/>
     <excludedFunction name="MONTHS_BETWEEN"/>
-    <excludedFunction name="AD_SCRIPT_DISABLE_TRIGGERS"/>
-    <excludedFunction name="AD_SCRIPT_DISABLE_CONSTRAINTS"/>
-    <excludedFunction name="AD_SCRIPT_ENABLE_TRIGGERS"/>
-    <excludedFunction name="AD_SCRIPT_ENABLE_CONSTRAINTS"/>
     <excludedFunction name="AD_SCRIPT_DROP_RECREATE_INDEXES"/>
     <excludedFunction name="AD_SCRIPT_DROP_RECREATE_INDEX"/>
     <excludedFunction name="AD_SCRIPT_EXECUTE"/>
diff -r 7d3eaa3a17c4 -r bad8c6d3677a 
src-db/database/model/functions/AD_DELETE_CLIENT.xml
--- a/src-db/database/model/functions/AD_DELETE_CLIENT.xml      Tue Sep 27 
09:55:42 2011 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-<?xml version="1.0"?>
-  <database name="FUNCTION AD_DELETE_CLIENT">
-    <function name="AD_DELETE_CLIENT" type="NULL">
-      <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
-        <default/>
-      </parameter>
-      <parameter name="p_ad_client_id" type="VARCHAR" mode="in">
-        <default/>
-      </parameter>
-      
<body><![CDATA[/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
-* Version 1.1  with a permitted attribution clause; you may not  use this
-* file except in compliance with the License. You  may  obtain  a copy of
-* the License at http://www.openbravo.com/legal/license.html
-* Software distributed under the License  is  distributed  on  an "AS IS"
-* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-* License for the specific  language  governing  rights  and  limitations
-* under the License.
-* The Original Code is Openbravo ERP.
-* The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2001-2008 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.
-************************************************************************/
-  /*************************************************************************
-  * Title: Delete client
-  * Description:
-  *   Delete data (for every table in TAD schema) from the client selected
-  ************************************************************************/
-  -- Logistice
-  v_ResultStr VARCHAR2(4000):='';
-  v_Message VARCHAR2(4000):='';
-  v_Result NUMBER:=1; -- 0=failure
-  -- Parameter
-  TYPE RECORD IS REF CURSOR;
-    Cur_Parameter RECORD;
-    -- Parameter Variables
-    v_AD_Client_ID VARCHAR2(32) ;
-    p_NewClientValue VARCHAR2(80) ;
-    --
-    Cur_Triggers RECORD;
-    Cur_Constraints RECORD;
-    Cur_ConstraintsEnable RECORD;
-    Cur_Tables RECORD;
-    Cur_Script RECORD;
-    --
-    v_seqNo NUMBER:=0;
-    v_NextNo VARCHAR2(32):='1000000';
-    v_prev_const NUMBER:=0;
-    v_prev_trig NUMBER:=0;
-    v_post_const NUMBER:=0;
-    v_post_trig NUMBER:=0;
-    v_count NUMBER:=0;
-    v_ID_Column VARCHAR2(30) ;
-    v_minID varchar2(32) ;
-    v_maxID varchar2(32) ;
-    v_nextID varchar2(32) ;
-    v_strTemp VARCHAR2(4000):='';
-    v_strSql VARCHAR2(4000):='';
-    v_tableActual VARCHAR2(30) ;
-  BEGIN
-    IF(p_PInstance_ID IS NOT NULL) THEN
-      --  Update AD_PInstance
-      DBMS_OUTPUT.PUT_LINE('Updating PInstance - Processing ' || 
p_PInstance_ID) ;
-      v_ResultStr:='PInstanceNotFound';
-      AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'Y', NULL, NULL) ;
-      -- Get Parameters
-      v_ResultStr:='ReadingParameters';
-
-      FOR Cur_Parameter IN
-        (SELECT p.ParameterName, p.P_String, p.P_Number
-        FROM AD_PInstance i
-        LEFT JOIN AD_PInstance_Para p
-          ON i.AD_PInstance_ID=p.AD_PInstance_ID
-        WHERE i.AD_PInstance_ID=p_PInstance_ID
-        ORDER BY p.SeqNo
-        )
-      LOOP
-        IF(Cur_Parameter.ParameterName='AD_Client_ID') THEN
-          v_AD_Client_ID:=Cur_Parameter.P_String;
-          DBMS_OUTPUT.PUT_LINE('  AD_Client_ID=' || v_AD_Client_ID) ;
-        ELSE
-          DBMS_OUTPUT.PUT_LINE('*** Unknown Parameter=' || 
Cur_Parameter.ParameterName) ;
-        END IF;
-      END LOOP; -- Get Parameter
-    ELSE
-      v_AD_Client_ID:=p_AD_Client_ID;
-      --v_Message := '@ADPinstanceIsNull@';
-      --GOTO END_PROCESS;
-    END IF;
-  BEGIN --BODY
-    IF (v_AD_Client_ID = '0') THEN
-      RAISE_APPLICATION_ERROR(-20000, '@DeletingSystemClient@') ;
-    END IF;
-
-    --Count ENABLED constraints and triggers before the process
-    select count(*)
-    into v_prev_const
-    from user_constraints
-    where status='ENABLED';
-  
-    select count(*)
-    into v_prev_trig
-    from user_triggers
-    where status='ENABLED';
-       
-    DELETE FROM AD_SCRIPT_SQL;
-    v_ResultStr := 'Disabling  triggers';
-    v_seqNo := ad_script_disable_triggers(v_seqNo);
-    v_ResultStr:='Disabling constraints';
-    v_seqNo := ad_script_disable_constraints(v_seqNo);
-    AD_Sequence_Next('AD_Client', '1000000', v_NextNo) ;
-    FOR Cur_Tables IN
-      (SELECT AD_Table_ID, UPPER(TableName) AS NAME
-    FROM AD_Table
-    WHERE IsView='N'  AND UPPER(TableName)<>'AD_CLIENT'  AND EXISTS
-      (SELECT 1
-      FROM AD_Column
-      WHERE AD_Table_ID=AD_Table.AD_Table_ID  AND 
UPPER(ColumnName)='AD_CLIENT_ID'
-      )
-    ORDER BY TableName)
-    LOOP
-      v_seqNo:=v_seqNo + 1;
-      INSERT
-      INTO AD_SCRIPT_SQL VALUES
-        (v_seqNo, 'DELETE FROM '||Cur_Tables.NAME||' WHERE AD_Client_ID = 
'''||v_AD_Client_ID||'''');
-    END LOOP;
-    v_seqNo:=v_seqNo + 1;
-    INSERT
-    INTO AD_SCRIPT_SQL VALUES
-      (v_seqNo, 'DELETE FROM AD_Client WHERE AD_Client_ID = 
'''||v_AD_Client_ID||'''') ;
--- Deal with users that have defaults set to the deleted client
- v_seqNo := v_seqNo + 1;
- INSERT INTO AD_SCRIPT_SQL VALUES (v_seqNo, 'UPDATE AD_USER SET 
DEFAULT_AD_CLIENT_ID=null where DEFAULT_AD_CLIENT_ID NOT IN (SELECT 
AD_Client_ID from AD_Client)');
- v_seqNo := v_seqNo + 1;
- INSERT INTO AD_SCRIPT_SQL VALUES (v_seqNo, 'UPDATE AD_USER SET 
DEFAULT_AD_ORG_ID=null where DEFAULT_AD_ORG_ID NOT IN (SELECT AD_Org_ID from 
AD_Org)');
- v_seqNo := v_seqNo + 1;
- INSERT INTO AD_SCRIPT_SQL VALUES (v_seqNo, 'UPDATE AD_USER SET 
DEFAULT_AD_ROLE_ID=null where DEFAULT_AD_ROLE_ID NOT IN (SELECT AD_Role_ID from 
AD_Role)');
- v_seqNo := v_seqNo + 1;
- INSERT INTO AD_SCRIPT_SQL VALUES (v_seqNo, 'UPDATE AD_USER SET 
DEFAULT_M_WAREHOUSE_ID=null where DEFAULT_M_WAREHOUSE_ID NOT IN (SELECT 
M_Warehouse_ID from M_Warehouse)');
- -- make sure Openbravo user can logon
- v_seqNo := v_seqNo + 1;
- INSERT INTO AD_SCRIPT_SQL VALUES (v_seqNo, 'UPDATE AD_USER SET 
DEFAULT_AD_CLIENT_ID=''0'', DEFAULT_AD_ORG_ID=''0'', DEFAULT_AD_ROLE_ID=''0'' 
where AD_USER_ID=''100'' AND DEFAULT_AD_CLIENT_ID is null and DEFAULT_AD_ORG_ID 
is null and DEFAULT_AD_ROLE_ID is null');
-
-
-    v_ResultStr:='Enabling  constraints';
-    v_seqNo := ad_script_enable_constraints(v_seqNo);
-    v_ResultStr := 'Enabling  triggers';
-    v_seqNo := ad_script_enable_triggers(v_seqNo);
-    -- Update sequence values
-    v_ResultStr:='Updating sequences';
-    v_ResultStr:='Executing';
-    v_ResultStr := ad_script_execute(v_ResultStr);
-
-  select count(*)
-   into v_count
-    from user_constraints
-   where status!='ENABLED';
-  if v_count>0 then
-    v_Result:=0;
-    v_Message:=substr(v_Message||'<br><br>@ProcessLeft@ '||v_count||' 
@DisabledConstraints@',1,2000);
-  else
-    select count(*)
-     into v_post_const
-      from user_constraints
-     where status='ENABLED';
-    if (v_prev_const-v_post_const)>0 then
-    
-         v_Result:=0;
-      v_Message:=substr(v_Message||'<br><br>@ProcessLeft@ 
'||(v_prev_const-v_post_const)||' @DisabledConstraints@',1,2000);
-    end if;
-  end if;
-
-  select count(*)
-  into v_count
-    from user_triggers
-    where status!='ENABLED';
-  if v_count>0 then
-    v_Result:=0;
-    v_Message:=substr(v_Message||'<br><br>@ProcessLeft@ '||v_count||' 
@DisabledTriggers@',1,2000);
-  else
-    select count(*)
-    into v_post_trig
-      from user_triggers
-      where status='ENABLED';
-    if (v_prev_trig-v_post_trig)>0 then
-      v_Result:=0;
-      v_Message:=substr(v_Message||'<br><br>@ProcessLeft@ 
'||(v_prev_trig-v_post_trig)||' @DisabledTriggers@',1,2000);
-    end if;
-  end if;
-
-   --<<END_PROCESS>>
-  IF(p_PInstance_ID IS NOT NULL) THEN
-    --  Update AD_PInstance
-    if (coalesce(length(v_Message),0)>=1997) then
-        v_Message:=substr(v_Message,1,1997)||'...';
-      end if;
-    DBMS_OUTPUT.PUT_LINE('Updating PInstance - Finished ' || v_Message) ;
-    AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', v_Result, v_Message) ;
-  ELSE
-    DBMS_OUTPUT.PUT_LINE('Finished ' || v_Message) ;
-  END IF;
-  -- Commented by cromero 19102006 COMMIT;
-  RETURN;
-END; --BODY
- 
-EXCEPTION
-WHEN OTHERS THEN
-  v_ResultStr:= '@ERROR=' || SQLERRM;
-  DBMS_OUTPUT.PUT_LINE(v_ResultStr) ;
-  ROLLBACK;
-  IF(p_PInstance_ID IS NOT NULL) THEN
-    AD_UPDATE_PINSTANCE(p_PInstance_ID, NULL, 'N', 0, v_ResultStr) ;
-  END IF;
---  RETURN;
-END AD_DELETE_CLIENT
-]]></body>
-    </function>
-  </database>
diff -r 7d3eaa3a17c4 -r bad8c6d3677a 
src-db/database/model/functions/AD_DELETE_CLIENT0.xml
--- a/src-db/database/model/functions/AD_DELETE_CLIENT0.xml     Tue Sep 27 
09:55:42 2011 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-  <database name="FUNCTION AD_DELETE_CLIENT0">
-    <function name="AD_DELETE_CLIENT0" type="NULL">
-      <parameter name="p_pinstance_id" type="VARCHAR" mode="in">
-        <default/>
-      </parameter>
-      
<body><![CDATA[/*************************************************************************
- * The contents of this file are subject to the Openbravo  Public  License
- * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
- * Version 1.1  with a permitted attribution clause; you may not  use this
- * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html
- * Software distributed under the License  is  distributed  on  an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- * License for the specific  language  governing  rights  and  limitations
- * under the License.
- * The Original Code is Openbravo ERP.
- * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2010 Openbravo SLU
- * All Rights Reserved.
- * Contributor(s):  ______________________________________.
- ************************************************************************/
-/*************************************************************************
- * Title: Delete client0
- * Description:
- *   Delete data (for every table in TAD schema) from the instance selected
- ************************************************************************/
-BEGIN
- AD_DELETE_CLIENT(p_PInstance_ID, NULL);
-END AD_DELETE_CLIENT0
-]]></body>
-    </function>
-  </database>
diff -r 7d3eaa3a17c4 -r bad8c6d3677a src-db/database/model/postscript-Oracle.sql
--- a/src-db/database/model/postscript-Oracle.sql       Tue Sep 27 09:55:42 
2011 +0200
+++ b/src-db/database/model/postscript-Oracle.sql       Tue Sep 27 11:04:18 
2011 +0200
@@ -46,169 +46,6 @@
 END hex_to_int;
 /-- END hex_to_int
 
-CREATE OR REPLACE FUNCTION ad_script_disable_triggers (p_seqNoStart NUMBER)
-  RETURN NUMBER
-AS
-/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
-* Version 1.1  with a permitted attribution clause; you may not  use this
-* file except in compliance with the License. You  may  obtain  a copy of
-* the License at http://www.openbravo.com/legal/license.html
-* Software distributed under the License  is  distributed  on  an "AS IS"
-* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-* License for the specific  language  governing  rights  and  limitations
-* under the License.
-* The Original Code is Openbravo ERP.
-* The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2001-2008 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to