src/org/openbravo/erpCommon/ad_process/ApplyModules_data.xsql
author Asier Lostalé <asier.lostale@openbravo.com>
Thu, 11 Jun 2009 15:02:20 +0200
changeset 3995 88e93b5b7c41
parent 3721 395c64aeef09
child 4271 bc808429aa25
permissions -rw-r--r--
fixed bug 9403, fixed bug 9390: Execute compile.complte when applying modules depending on the case.

It is executed when:
-There's at least one module to uninstall
-There's at least one template to install
<?xml version="1.0" encoding="UTF-8" ?>
<!--
 *************************************************************************
 * The contents of this file are subject to the Openbravo  Public  License
 * Version  1.0  (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 SL 
 * All portions are Copyright (C) 2008-2009 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
-->


<SqlClass name="ApplyModulesData" package="org.openbravo.erpCommon.ad_process">
  <SqlMethod name="selectUnappliedModules" type="preparedStatement" return="multiple">
      <SqlMethodComment></SqlMethodComment>
      <Sql><![CDATA[
         SELECT JAVAPACKAGE AS NAME
           FROM AD_MODULE
          WHERE ISACTIVE='Y'
            AND (STATUS='I' OR STATUS='U')  
          UNION
          SELECT JAVAPACKAGE AS NAME
           FROM AD_MODULE_INSTALL         
          ]]>
      </Sql>
  </SqlMethod>
  
  <SqlMethod name="isUpdatingCore" type="preparedStatement" return="boolean">
      <SqlMethodComment></SqlMethodComment>
      <Sql><![CDATA[
         SELECT count(*) as NAME
           FROM AD_MODULE
          WHERE STATUS='I'      
            AND AD_MODULE_ID = '0'
          ]]>
      </Sql>
  </SqlMethod>
  
  <SqlMethod name="compileCompleteNeeded" type="preparedStatement" return="boolean">
      <SqlMethodComment></SqlMethodComment>
      <Sql><![CDATA[
         SELECT count(*) as NAME
           FROM AD_MODULE
          WHERE (STATUS='I'      
                 AND TYPE = 'T')
             OR (STATUS='U')
          ]]>
      </Sql>
  </SqlMethod>
  
  <SqlMethod name="selectUninstalledModules" type="preparedStatement" return="boolean">
      <SqlMethodComment></SqlMethodComment>
      <Sql><![CDATA[
         SELECT count(*) as NAME
           FROM AD_MODULE
          WHERE STATUS='U'           
          ]]>
      </Sql>
  </SqlMethod>
  
  <SqlMethod name="getHelp" type="preparedStatement" return="string">
      <SqlMethodComment></SqlMethodComment>
      <Sql><![CDATA[
         SELECT COALESCE(T.HELP, P.HELP) AS NAME
           FROM AD_PROCESS P LEFT JOIN AD_PROCESS_TRL T 
                                       ON T.AD_PROCESS_ID = P.AD_PROCESS_ID
                                      AND AD_LANGUAGE = ?
          WHERE P.AD_PROCESS_ID = 'BDB3B6FCA0AB453DB4E83503BAB82470'
           
          ]]>
      </Sql>
      <Parameter name="adLanguage"/>
  </SqlMethod>
</SqlClass>