Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.todobom.sped.efd.activator;
- import java.net.URL;
- import org.adempiere.exceptions.AdempiereException;
- import org.adempiere.plugin.utils.Incremental2PackActivator;
- import org.apache.commons.io.IOUtils;
- import org.compiere.util.DB;
- public class InstallViewsActivator extends Incremental2PackActivator {
- boolean packedIn = false;
- public InstallViewsActivator() {
- super();
- }
- @Override
- protected void packIn(String trxName, URL packout) {
- super.packIn(trxName, packout);
- packedIn = true;
- }
- @Override
- protected void packIn(String trxName, String installedVersionPart,
- String bundleVersionPart) {
- super.packIn(trxName, installedVersionPart, bundleVersionPart);
- if ( packedIn && DB.isPostgreSQL() ) {
- String iltax;
- try {
- iltax = IOUtils.toString ( getClass().getClassLoader().getResource("sql/postgres/views/lbr_factfiscal_invoicelinetax.sql") );
- DB.executeUpdate( "DROP VIEW IF EXISTS LBR_FactFiscal_InvoiceLineTax;" , false , trxName );
- DB.executeUpdate( iltax , false , trxName );
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- throw new AdempiereException("erro ao executar scripts");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement