IDEMPIERE-5107 Can't 2pack zip for Window Role - improve showing error messages (#1066)
This commit is contained in:
parent
a05a81154e
commit
c4c3e348b6
|
@ -2,6 +2,7 @@ package org.adempiere.pipo2.handler;
|
|||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Level;
|
||||
|
@ -129,7 +130,7 @@ public class CommonTranslationHandler extends AbstractElementHandler implements
|
|||
if(pstm.executeUpdate()<0){
|
||||
throw new SAXException();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
throw new DBException(e);
|
||||
} finally {
|
||||
DB.close(pstm);
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.adempiere.pipo2.handler;
|
|||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
@ -120,7 +121,7 @@ public class ImpFormatElementHandler extends AbstractElementHandler {
|
|||
createImpFormatRow(ctx, document, rs
|
||||
.getInt("AD_ImpFormat_Row_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "ImpFormat", e);
|
||||
throw new DatabaseAccessException("Failed to export Import Format.", e);
|
||||
} finally {
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.adempiere.pipo2.handler;
|
|||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
@ -157,7 +158,7 @@ public class MenuElementHandler extends AbstractElementHandler {
|
|||
oldseqNo = seqNo;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
throw new DBException(e);
|
||||
} finally {
|
||||
DB.close(rs, pstmt);
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.adempiere.pipo2.handler;
|
|||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
@ -160,7 +161,7 @@ public class PrintFormatElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createItem(ctx, document, rs.getInt("AD_PrintFormatItem_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
throw new DBException(e);
|
||||
} finally {
|
||||
DB.close(rs, pstmt);
|
||||
|
|
|
@ -18,11 +18,13 @@ package org.adempiere.pipo2.handler;
|
|||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.transform.sax.TransformerHandler;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.adempiere.exceptions.DBException;
|
||||
import org.adempiere.pipo2.AbstractElementHandler;
|
||||
import org.adempiere.pipo2.Element;
|
||||
import org.adempiere.pipo2.ElementHandler;
|
||||
|
@ -129,8 +131,8 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createReportViewCol(ctx, document, rs.getInt("AD_ReportView_Col_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new AdempiereException(e);
|
||||
} catch (SQLException e) {
|
||||
throw new DBException(e);
|
||||
} finally {
|
||||
DB.close(rs, pstmt);
|
||||
}
|
||||
|
@ -145,8 +147,8 @@ public class ReportViewElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createReportViewColumn(ctx, document, AD_ReportView_ID, rs.getInt("AD_Column_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new AdempiereException(e);
|
||||
} catch (SQLException e) {
|
||||
throw new DBException(e);
|
||||
} finally {
|
||||
DB.close(rs, pstmt);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.adempiere.pipo2.handler;
|
|||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
@ -131,7 +132,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createOrgAccess(ctx, document, rs.getInt("AD_Org_ID"), rs.getInt("AD_Role_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_Role_OrgAccess", e);
|
||||
throw new DatabaseAccessException("Failed to export organization role access.");
|
||||
} finally {
|
||||
|
@ -150,7 +151,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createUserRole(ctx, document, rs.getInt("AD_User_ID"), rs.getInt("AD_Role_ID"), rs.getInt("AD_Org_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_User_Roles", e);
|
||||
throw new DatabaseAccessException("Failed to export user role assignment.");
|
||||
} finally {
|
||||
|
@ -168,7 +169,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createWindowAccess(ctx, document, rs.getInt("AD_Window_ID"), rs.getInt("AD_Role_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_Window_Access", e);
|
||||
throw new DatabaseAccessException("Failed to export window access.");
|
||||
} finally {
|
||||
|
@ -185,7 +186,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createProcessAccess(ctx, document, rs.getInt("AD_Process_ID"), rs.getInt("AD_Role_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_Process_Access", e);
|
||||
throw new DatabaseAccessException("Failed to export process access.");
|
||||
} finally {
|
||||
|
@ -202,7 +203,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createFormAccess(ctx, document, rs.getInt("AD_Form_ID"), rs.getInt("AD_Role_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_Form_Access", e);
|
||||
throw new DatabaseAccessException("Failed to export form access.");
|
||||
} finally {
|
||||
|
@ -219,7 +220,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createWorkflowAccess(ctx, document, rs.getInt("AD_Workflow_ID"), rs.getInt("AD_Role_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_Workflow_Access", e);
|
||||
throw new DatabaseAccessException("Failed to export workflow access.");
|
||||
} finally {
|
||||
|
@ -236,7 +237,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createTaskAccess(ctx, document, rs.getInt("AD_Task_ID"), rs.getInt("AD_Role_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_Task_Access", e);
|
||||
throw new DatabaseAccessException("Failed to export task access.");
|
||||
} finally {
|
||||
|
@ -253,7 +254,7 @@ public class RoleElementHandler extends AbstractElementHandler {
|
|||
while (rs.next()) {
|
||||
createInfoWindowAccess(ctx, document, rs.getInt("AD_InfoWindow_ID"), rs.getInt("AD_Role_ID"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (SQLException e) {
|
||||
log.log(Level.SEVERE, "AD_InfoWindow_Access", e);
|
||||
throw new DatabaseAccessException("Failed to export InfoWindow access.");
|
||||
} finally {
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.adempiere.pipo2.handler;
|
|||
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
|
@ -138,7 +139,7 @@ public class TabElementHandler extends AbstractElementHandler {
|
|||
createField(ctx, document, rs.getInt("AD_Field_ID"));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (SQLException e)
|
||||
{
|
||||
log.log(Level.SEVERE,e.getLocalizedMessage(), e);
|
||||
throw new DatabaseAccessException("Failed to export window tab", e);
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.Set;
|
|||
|
||||
import org.adempiere.base.IGridTabExporter;
|
||||
import org.adempiere.base.equinox.EquinoxExtensionLocator;
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.adempiere.webui.AdempiereWebUI;
|
||||
import org.adempiere.webui.LayoutUtils;
|
||||
import org.adempiere.webui.adwindow.AbstractADWindowContent;
|
||||
|
@ -342,7 +341,7 @@ public class ExportAction implements EventListener<Event>
|
|||
media = new AMedia(exporter.getSuggestedFileName(panel.getActiveGridTab()), null, exporter.getContentType(), file, true);
|
||||
Filedownload.save(media);
|
||||
} catch (Exception e) {
|
||||
throw new AdempiereException(e);
|
||||
FDialog.error(0, winExportFile, e.getLocalizedMessage());
|
||||
} finally {
|
||||
if (winExportFile != null)
|
||||
winExportFile.onClose();
|
||||
|
|
Loading…
Reference in New Issue