fixes bug#14828
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@95677 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ec600fdb34
commit
65cbb13cb4
|
@ -122,6 +122,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
private Textbox textSMTPPorta;
|
||||
private Textbox textEmailDe;
|
||||
private Textbox textDestinatario;
|
||||
private Textbox textEmailCopiaOculta;
|
||||
private Textbox textAssunto;
|
||||
private Textbox textAssuntoFiscal;
|
||||
private Textbox textEmail;
|
||||
|
@ -135,6 +136,7 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
private List<EmpresaImposto> lsEmpresaImposto;
|
||||
private Button btnApagar;
|
||||
private Button btnAdicionarEstadoImposto;
|
||||
private Button btnTestEmail;
|
||||
private Combobox cmbIndTipo;
|
||||
private Combobox cmbEstado;
|
||||
private Combobox cmbEstadoImposto;
|
||||
|
@ -761,7 +763,23 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
}
|
||||
}
|
||||
|
||||
public void onClick$btnTestEmail(Event ev) throws InterruptedException {
|
||||
|
||||
Map args = new HashMap();
|
||||
args.put("empresa", empresa);
|
||||
args.put("isAutenticacao", chkAutenticacao.isChecked());
|
||||
args.put("emailSMTP", textEmail.getValue());
|
||||
args.put("senhaEmail", textSenhaEmail.getValue());
|
||||
args.put("SMTPHost", textSMTPHost.getValue());
|
||||
args.put("SMTPPorta", textSMTPPorta.getValue());
|
||||
args.put("emailDe", textEmailDe.getValue());
|
||||
args.put("emailCopiaOculta", textEmailCopiaOculta.getValue());
|
||||
args.put("destinatario", textDestinatario.getValue());
|
||||
|
||||
openWindow("/gui/catalogos/viewTestEmail.zul",
|
||||
Labels.getLabel("viewTestEmailController.window.title"), args, MODAL);
|
||||
|
||||
}
|
||||
|
||||
public void onChange$cmbEstado(Event ev) {
|
||||
Comboitem cbiEstado = cmbEstado.getSelectedItem();
|
||||
|
@ -1533,4 +1551,5 @@ public class EditarEmpresaController extends MyGenericForwardComposer {
|
|||
public void setChkHabilitarVendaEstudanteTotem(Checkbox chkHabilitarVendaEstudanteTotem) {
|
||||
this.chkHabilitarVendaEstudanteTotem = chkHabilitarVendaEstudanteTotem;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,462 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.mail.AuthenticationFailedException;
|
||||
import javax.mail.MessagingException;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.zkoss.util.resource.Labels;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Desktop;
|
||||
import org.zkoss.zk.ui.DesktopUnavailableException;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
import org.zkoss.zk.ui.event.Event;
|
||||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Label;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.utilerias.SendMail;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.RJExecutorHolder;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTestEmail;
|
||||
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTestErrorEmail;
|
||||
|
||||
@Controller("viewTestEmailController")
|
||||
@Scope("prototype")
|
||||
public class ViewTestEmailController extends MyGenericForwardComposer {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static Logger log = Logger.getLogger(ViewTestEmailController.class);
|
||||
|
||||
private MyListbox tarefasList;
|
||||
private MyListbox errosList;
|
||||
private Label lblStatusInfo;
|
||||
private Button btnFechar;
|
||||
private Button btnStop;
|
||||
|
||||
private Empresa empresa;
|
||||
|
||||
private EmailConfigurationTestVO voTestConfig = new EmailConfigurationTestVO();
|
||||
private EmailConfigurationTestVO voTestSendEmail = new EmailConfigurationTestVO();
|
||||
|
||||
private boolean success = false;
|
||||
|
||||
private Thread testThread;
|
||||
private Executor executor;
|
||||
|
||||
@Override
|
||||
public void doAfterCompose(Component comp) throws Exception {
|
||||
|
||||
super.doAfterCompose(comp);
|
||||
|
||||
tarefasList.setItemRenderer(new RenderTestEmail());
|
||||
errosList.setItemRenderer(new RenderTestErrorEmail());
|
||||
|
||||
empresa = (Empresa) Executions.getCurrent().getArg().get("empresa");
|
||||
boolean isAutenticacao = (Boolean) Executions.getCurrent().getArg().get("isAutenticacao");
|
||||
String emailSMTP = (String) Executions.getCurrent().getArg().get("emailSMTP");
|
||||
String senhaEmail = (String) Executions.getCurrent().getArg().get("senhaEmail");
|
||||
String SMTPHost = (String) Executions.getCurrent().getArg().get("SMTPHost");
|
||||
String SMTPPorta = (String) Executions.getCurrent().getArg().get("SMTPPorta");
|
||||
String emailDe = (String) Executions.getCurrent().getArg().get("emailDe");
|
||||
String emailCopiaOculta = (String) Executions.getCurrent().getArg().get("emailCopiaOculta");
|
||||
String destinatario = (String) Executions.getCurrent().getArg().get("destinatario");
|
||||
|
||||
List<EmailConfigurationTestVO> data = new ArrayList<EmailConfigurationTestVO>();
|
||||
|
||||
voTestConfig.setTarefa(Labels.getLabel("viewTestEmailController.testEmailMsgTarefa"));
|
||||
voTestConfig.setStatus(Labels.getLabel("viewTestEmailController.msgStatusAndamento"));
|
||||
voTestConfig.setCodStatus("EA");
|
||||
|
||||
voTestSendEmail.setTarefa(Labels.getLabel("viewTestEmailController.sendEmailMsgTarefa"));
|
||||
voTestSendEmail.setStatus(Labels.getLabel("viewTestEmailController.msgStatusAndamento"));
|
||||
voTestSendEmail.setCodStatus("EA");
|
||||
|
||||
data.add(voTestConfig);
|
||||
data.add(voTestSendEmail);
|
||||
|
||||
tarefasList.setData(data);
|
||||
errosList.setData(new ArrayList<String>());
|
||||
|
||||
executor = RJExecutorHolder.getExecutor();
|
||||
|
||||
btnFechar.setDisabled(true);
|
||||
|
||||
desktop.enableServerPush(true);
|
||||
|
||||
testThread = new Thread(new TestConfig(isAutenticacao, emailSMTP, senhaEmail, SMTPHost, SMTPPorta, emailDe, emailCopiaOculta, destinatario, desktop, this));
|
||||
executor.execute(testThread);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onClick$btnStop(Event ev) {
|
||||
try {
|
||||
testThread.interrupt();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
btnFechar.setDisabled(false);
|
||||
btnStop.setDisabled(true);
|
||||
lblStatusInfo.setValue(Labels.getLabel("viewTestEmailController.lblStatusInfo.msgCancelado"));
|
||||
|
||||
voTestConfig.setStatus(Labels.getLabel("viewTestEmailController.msgStatusCancelado"));
|
||||
voTestConfig.setCodStatus("F");
|
||||
|
||||
voTestSendEmail.setStatus(Labels.getLabel("viewTestEmailController.msgStatusCancelado"));
|
||||
voTestSendEmail.setCodStatus("F");
|
||||
|
||||
tarefasList.getListData().set(0, voTestConfig);
|
||||
tarefasList.getListData().set(1, voTestSendEmail);
|
||||
}
|
||||
|
||||
public class EmailConfigurationTestVO {
|
||||
private String tarefa;
|
||||
private String status;
|
||||
private String codStatus;
|
||||
|
||||
public String getTarefa() {
|
||||
return tarefa;
|
||||
}
|
||||
|
||||
public void setTarefa(String tarefa) {
|
||||
this.tarefa = tarefa;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCodStatus() {
|
||||
return codStatus;
|
||||
}
|
||||
|
||||
public void setCodStatus(String codStatus) {
|
||||
this.codStatus = codStatus;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ExceptionTestCodes {
|
||||
UNKNOWN_HOST(new UnknownHostException(), Labels.getLabel("viewTestEmailController.msgExceptionErroServidor") ),
|
||||
AUTHENTICATION_FAILED(new AuthenticationFailedException(), Labels.getLabel("viewTestEmailController.msgExceptionErroUsuarioSenha")),
|
||||
MAIL_ERROR(new MessagingException(), Labels.getLabel("viewTestEmailController.msgExceptionErroGeneric")),
|
||||
GENERIC_ERROR(new Exception(), Labels.getLabel("viewTestEmailController.msgExceptionErroContacteAdm"));
|
||||
|
||||
private final Exception exception;
|
||||
private final String solucao;
|
||||
|
||||
ExceptionTestCodes(Exception exception, String solucao) {
|
||||
this.exception = exception;
|
||||
this.solucao = solucao;
|
||||
}
|
||||
|
||||
public Exception getException() {
|
||||
return exception;
|
||||
}
|
||||
|
||||
public String getSolucao() {
|
||||
return solucao;
|
||||
}
|
||||
|
||||
public static String findException(Exception exception) {
|
||||
for (ExceptionTestCodes ex : ExceptionTestCodes.values()) {
|
||||
if (ex.getException().getClass().equals(exception.getClass())) {
|
||||
return ex.getSolucao();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class TestConfig implements Runnable {
|
||||
|
||||
private final boolean isAutenticacao;
|
||||
private final String emailSMTP;
|
||||
private final String senhaEmail;
|
||||
private final String SMTPHost;
|
||||
private final String SMTPPorta;
|
||||
private final String emailDe;
|
||||
private final String emailCopiaOculta;
|
||||
private final String destinatario;
|
||||
private final Desktop desktop;
|
||||
private final EventListener eventListener;
|
||||
|
||||
public TestConfig(boolean isAutenticacao, String emailSMTP, String senhaEmail, String SMTPHost, String SMTPPorta, String emailDe, String emailCopiaOculta, String destinatario, Desktop desktop, EventListener eventListener) {
|
||||
this.isAutenticacao = isAutenticacao;
|
||||
this.emailSMTP = emailSMTP;
|
||||
this.senhaEmail = senhaEmail;
|
||||
this.SMTPHost = SMTPHost;
|
||||
this.SMTPPorta = SMTPPorta;
|
||||
this.emailDe = emailDe;
|
||||
this.emailCopiaOculta = emailCopiaOculta;
|
||||
this.destinatario = destinatario;
|
||||
this.desktop = desktop;
|
||||
this.eventListener = eventListener;
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
||||
try {
|
||||
|
||||
if (Thread.interrupted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Thread.sleep(3000);
|
||||
Executions.schedule(desktop, eventListener, new TestEmailEvent(isAutenticacao, emailSMTP, senhaEmail, SMTPHost, SMTPPorta, emailDe));
|
||||
|
||||
Thread.sleep(3000);
|
||||
Executions.schedule(desktop, eventListener, new SendEmailTestEvent(isAutenticacao, emailSMTP, senhaEmail, SMTPHost, SMTPPorta, emailDe, emailCopiaOculta, destinatario));
|
||||
} catch (DesktopUnavailableException e) {
|
||||
log.error("Desktop is no longer available: " + desktop, e);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onTestAuthenticationStepCompleted(TestEmailEvent event) {
|
||||
|
||||
if (btnStop.isDisabled()) {
|
||||
btnFechar.setDisabled(false);
|
||||
btnStop.setDisabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Boolean isAuthentincationOK = event.isAuthentincationOK;
|
||||
|
||||
if (isAuthentincationOK != null && isAuthentincationOK) {
|
||||
voTestConfig.setStatus(Labels.getLabel("viewTestEmailController.msgStatusConcluido"));
|
||||
voTestConfig.setCodStatus("C");
|
||||
} else {
|
||||
voTestConfig.setStatus(Labels.getLabel("viewTestEmailController.msgStatusFalha"));
|
||||
voTestConfig.setCodStatus("F");
|
||||
}
|
||||
tarefasList.getListData().set(0, voTestConfig);
|
||||
|
||||
if (voTestConfig.getCodStatus().equals("F")) {
|
||||
String solucao = ExceptionTestCodes.findException(event.exception);
|
||||
String erro = voTestConfig.getTarefa() + " : " + event.msgError + ". " + solucao;
|
||||
errosList.addItemNovo(erro);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void onSendEmailTestStepCompleted(SendEmailTestEvent event) {
|
||||
|
||||
if (btnStop.isDisabled()) {
|
||||
btnFechar.setDisabled(false);
|
||||
btnStop.setDisabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
Boolean isAuthentincationOK = event.isAuthentincationOK;
|
||||
btnFechar.setDisabled(false);
|
||||
btnStop.setDisabled(true);
|
||||
|
||||
if (isAuthentincationOK != null && isAuthentincationOK) {
|
||||
voTestSendEmail.setStatus(Labels.getLabel("viewTestEmailController.msgStatusConcluido"));
|
||||
voTestSendEmail.setCodStatus("C");
|
||||
success = true;
|
||||
} else {
|
||||
voTestSendEmail.setStatus(Labels.getLabel("viewTestEmailController.msgStatusFalha"));
|
||||
voTestSendEmail.setCodStatus("F");
|
||||
}
|
||||
tarefasList.getListData().set(1, voTestSendEmail);
|
||||
|
||||
if (voTestSendEmail.getCodStatus().equals("F")) {
|
||||
String solucao = ExceptionTestCodes.findException(event.exception);
|
||||
String erro = voTestSendEmail.getTarefa() + " : " + event.msgError + ". " + solucao;
|
||||
errosList.addItemNovo(erro);
|
||||
}
|
||||
|
||||
if (success) {
|
||||
lblStatusInfo.setValue(Labels.getLabel("viewTestEmailController.lblStatusInfo.sucesso"));
|
||||
} else {
|
||||
lblStatusInfo.setValue(Labels.getLabel("viewTestEmailController.lblStatusInfo.erro"));
|
||||
}
|
||||
}
|
||||
|
||||
public class TestEmailEvent extends Event {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String msgError;
|
||||
public Exception exception;
|
||||
public boolean isAuthentincationOK;
|
||||
private boolean isAutenticacao;
|
||||
private String emailSMTP;
|
||||
private String senhaEmail;
|
||||
private String SMTPHost;
|
||||
private String SMTPPorta;
|
||||
private String emailDe;
|
||||
|
||||
public TestEmailEvent(boolean isAutenticacao, String emailSMTP, String senhaEmail, String SMTPHost, String SMTPPorta, String emailDe) {
|
||||
super("onTestAuthenticationStepCompleted", null);
|
||||
this.isAutenticacao = isAutenticacao;
|
||||
this.emailSMTP = emailSMTP;
|
||||
this.senhaEmail = senhaEmail;
|
||||
this.SMTPHost = SMTPHost;
|
||||
this.SMTPPorta = SMTPPorta;
|
||||
this.emailDe = emailDe;
|
||||
testEmailAuthentication();
|
||||
}
|
||||
|
||||
private void testEmailAuthentication() {
|
||||
|
||||
try {
|
||||
SendMail mail = new SendMail();
|
||||
mail.setAuth(isAutenticacao);
|
||||
mail.setEmailFrom(emailDe);
|
||||
mail.setSmtpHost(SMTPHost);
|
||||
mail.setSmtpPassword(senhaEmail);
|
||||
mail.setSmtpPort(SMTPPorta);
|
||||
mail.setSmtpUser(emailSMTP);
|
||||
|
||||
this.isAuthentincationOK = mail.testConfiguration();
|
||||
|
||||
} catch (AuthenticationFailedException e) {
|
||||
exception = (e.getNextException() != null) ? e.getNextException() : e;
|
||||
msgError = e.getMessage();
|
||||
} catch (MessagingException e) {
|
||||
exception = (e.getNextException() != null) ? e.getNextException() : e;
|
||||
msgError = e.getMessage();
|
||||
} catch (Exception e) {
|
||||
log.error("", e);
|
||||
exception = e;
|
||||
msgError = e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class SendEmailTestEvent extends Event {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String msgError;
|
||||
public Exception exception;
|
||||
public boolean isAuthentincationOK;
|
||||
private boolean isAutenticacao;
|
||||
private String emailSMTP;
|
||||
private String senhaEmail;
|
||||
private String SMTPHost;
|
||||
private String SMTPPorta;
|
||||
private String emailDe;
|
||||
private String emailCopiaOculta;
|
||||
private String destinatario;
|
||||
|
||||
public SendEmailTestEvent(boolean isAutenticacao, String emailSMTP, String senhaEmail, String SMTPHost, String SMTPPorta, String emailDe, String emailCopiaOculta, String destinatario) {
|
||||
super("onSendEmailTestStepCompleted", null);
|
||||
this.isAutenticacao = isAutenticacao;
|
||||
this.emailSMTP = emailSMTP;
|
||||
this.senhaEmail = senhaEmail;
|
||||
this.SMTPHost = SMTPHost;
|
||||
this.SMTPPorta = SMTPPorta;
|
||||
this.emailDe = emailDe;
|
||||
this.emailCopiaOculta = emailCopiaOculta;
|
||||
this.destinatario = destinatario;
|
||||
testEmailAuthentication();
|
||||
}
|
||||
|
||||
private void testEmailAuthentication() {
|
||||
this.isAuthentincationOK = false;
|
||||
try {
|
||||
SendMail mail = new SendMail();
|
||||
mail.setAuth(isAutenticacao);
|
||||
mail.setEmailFrom(emailDe);
|
||||
mail.setSmtpHost(SMTPHost);
|
||||
mail.setSmtpPassword(senhaEmail);
|
||||
mail.setSmtpPort(SMTPPorta);
|
||||
mail.setSmtpUser(emailSMTP);
|
||||
mail.setSubject(Labels.getLabel("viewTestEmailController.emailSubject", new Object[] { empresa.getNombempresa() }));
|
||||
mail.setText(Labels.getLabel("viewTestEmailController.emailText"));
|
||||
mail.setEmailTo(destinatario);
|
||||
mail.setEmailToCO(emailCopiaOculta);
|
||||
mail.sendEmail(null);
|
||||
|
||||
this.isAuthentincationOK = true;
|
||||
|
||||
} catch (AuthenticationFailedException e) {
|
||||
exception = (e.getNextException() != null) ? e.getNextException() : e;
|
||||
msgError = e.getMessage();
|
||||
} catch (MessagingException e) {
|
||||
exception = (e.getNextException() != null) ? e.getNextException() : e;
|
||||
msgError = e.getMessage();
|
||||
} catch (Exception e) {
|
||||
exception = e;
|
||||
msgError = e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public MyListbox getTarefasList() {
|
||||
return tarefasList;
|
||||
}
|
||||
|
||||
public void setTarefasList(MyListbox tarefasList) {
|
||||
this.tarefasList = tarefasList;
|
||||
}
|
||||
|
||||
public MyListbox getErrosList() {
|
||||
return errosList;
|
||||
}
|
||||
|
||||
public void setErrosList(MyListbox errosList) {
|
||||
this.errosList = errosList;
|
||||
}
|
||||
|
||||
public Empresa getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(Empresa empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
public Label getLblStatusInfo() {
|
||||
return lblStatusInfo;
|
||||
}
|
||||
|
||||
public void setLblStatusInfo(Label lblStatusInfo) {
|
||||
this.lblStatusInfo = lblStatusInfo;
|
||||
}
|
||||
|
||||
public Button getBtnFechar() {
|
||||
return btnFechar;
|
||||
}
|
||||
|
||||
public void setBtnFechar(Button btnFechar) {
|
||||
this.btnFechar = btnFechar;
|
||||
}
|
||||
|
||||
public Button getBtnStop() {
|
||||
return btnStop;
|
||||
}
|
||||
|
||||
public void setBtnStop(Button btnStop) {
|
||||
this.btnStop = btnStop;
|
||||
}
|
||||
|
||||
}
|
|
@ -76,8 +76,8 @@ public class EventListenerOnClickContingenciaBotaoContingencia implements EventL
|
|||
}
|
||||
|
||||
if (destinatarioNuloQuandoEmContingencia()) {
|
||||
MensagensUtils.showMessageExclamation("Favor definir o responsável pelo recebimento do email, em configuração de envio de email.", TITULO_CONTIGENCIA_CONTROLLER);
|
||||
return false;
|
||||
MensagensUtils.showMessageExclamation("Não será possível enviar o e-mail de confirmação de contingência pois as configurações do menu de Catálogo>Empresa>Configuração de Envio de e-mail estão inválidas. Favor definir o responsável pelo envio e recebimento do e-mail no menu Catálogo>Empresa>Configuração de Envio de e-mail no ADM, preenchendo todas as informações.", TITULO_CONTIGENCIA_CONTROLLER);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.zkoss.zk.ui.WebApp;
|
||||
import org.zkoss.zk.ui.util.WebAppCleanup;
|
||||
import org.zkoss.zk.ui.util.WebAppInit;
|
||||
|
||||
public class RJExecutorHolder implements WebAppInit, WebAppCleanup {
|
||||
|
||||
private static volatile ExecutorService executor;
|
||||
|
||||
public static ExecutorService getExecutor() {
|
||||
return executor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup(WebApp wapp) throws Exception {
|
||||
if (executor != null) {
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(WebApp wapp) throws Exception {
|
||||
executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
import com.rjconsultores.ventaboletos.web.gui.controladores.catalogos.ViewTestEmailController.EmailConfigurationTestVO;
|
||||
|
||||
public class RenderTestEmail implements ListitemRenderer {
|
||||
|
||||
@Override
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
EmailConfigurationTestVO testVO = (EmailConfigurationTestVO) o;
|
||||
|
||||
Listcell lc = new Listcell();
|
||||
if (testVO.getCodStatus().equals("EA")) {
|
||||
lc.setImage("/gui/img/play_icon.png");
|
||||
} else if (testVO.getCodStatus().equals("C")) {
|
||||
lc.setImage("/gui/img/check_icon.png");
|
||||
} else if (testVO.getCodStatus().equals("F")) {
|
||||
lc.setImage("/gui/img/close_icon.png");
|
||||
}
|
||||
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(testVO.getTarefa());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lc = new Listcell(testVO.getStatus());
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", testVO);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.rjconsultores.ventaboletos.web.utilerias.render;
|
||||
|
||||
import org.zkoss.zul.Listcell;
|
||||
import org.zkoss.zul.Listitem;
|
||||
import org.zkoss.zul.ListitemRenderer;
|
||||
|
||||
public class RenderTestErrorEmail implements ListitemRenderer {
|
||||
|
||||
@Override
|
||||
public void render(Listitem lstm, Object o) throws Exception {
|
||||
String vo = (String) o;
|
||||
|
||||
Listcell lc = new Listcell(vo);
|
||||
lc.setParent(lstm);
|
||||
|
||||
lstm.setAttribute("data", vo);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -111,6 +111,7 @@ indexController.mnSubSegOpcional.label= Seg. Opcional
|
|||
indexController.mnTarifasOficial.label = Cálculo de precio
|
||||
indexController.mnSendaAmigo.label = Pasajero frecuente
|
||||
indexController.mniMarcas.label = Marcas
|
||||
indexController.mniImagem.label = Imagem
|
||||
indexController.mniMoneda.label = Moneda
|
||||
indexController.mniPlaza.label = Plaza
|
||||
indexController.mniClaseServicio.label = Clase de servicio
|
||||
|
@ -2084,6 +2085,29 @@ editarMarcaController.MSG.borrarOK = Marca se eliminó exitosamente.
|
|||
editarMarcaController.MSG.errorIMG = Archivo no es un imagen:
|
||||
editarMarcaController.fileupload.label = Seleccionar imagen
|
||||
|
||||
# Pantalla Editar Imagem
|
||||
editarImagemController.window.title = Imagem
|
||||
editarImagemController.btnApagar.tooltiptext = Eliminar
|
||||
editarImagemController.btnSalvar.tooltiptext = Salvar
|
||||
editarImagemController.btnFechar.tooltiptext = Fechar
|
||||
editarImagemController.lbNome.value = Imagem
|
||||
editarImagemController.MSG.suscribirOK = Imagem Registrada com Sucesso.
|
||||
editarImagemController.MSG.borrarPergunta = Deseja Eliminar imagem?
|
||||
editarImagemController.MSG.SinImagenPergunta = Deseja salvar a imagem sem adicionar nenhuma?
|
||||
editarImagemController.MSG.borrarOK = Imagem Excluida com Sucesso.
|
||||
editarImagemController.MSG.errorIMG = Arquivo não é uma imagen:
|
||||
editarImagemController.fileupload.label = Selecionar Imagem
|
||||
|
||||
# Mostrar a imagem da Pesquisa
|
||||
busquedaImagemController.window.title = Imagem
|
||||
busquedaImagemController.btnRefresh.tooltiptext = Atualizar
|
||||
busquedaImagemController.btnNovo.tooltiptext = Incluir
|
||||
busquedaImagemaController.btnCerrar.tooltiptext = Fechar
|
||||
busquedaImagemController.btnPesquisa.label = Pesquisa
|
||||
busquedaImagemController.lhDesc.label = Descrição
|
||||
busquedaImagemController.txtNome.label = Imagem
|
||||
busquedaImagemController.lhId.label = ID
|
||||
|
||||
# Muestra a Asociación Marcos Búsqueda clase
|
||||
busquedaAsociacionClaseServicioMarcaController.window.title = Asociación clase de servicio y Marca
|
||||
busquedaAsociacionClaseServicioMarcaController.btnRefresh.tooltiptext = Actualizar
|
||||
|
@ -8196,3 +8220,26 @@ editarEmpresaTrocoSimples.MSG.borrarPergunta = Remover configurações do troco
|
|||
editarEmpresaTrocoSimples.MSG.borrarOK = Configuração removida com Sucesso.
|
||||
editarConvenioController.MSG.erro= Erro ao salvar
|
||||
|
||||
#viewTestEmailController
|
||||
viewTestEmailController.window.title= Testar configurações da conta
|
||||
viewTestEmailController.btnFechar.tooltiptext = Apagar
|
||||
viewTestEmailController.btnStop = Parar
|
||||
viewTestEmailController.lblStatusInfo = Aguarde está sendo testado as configurações da conta fornecida.
|
||||
viewTestEmailController.tabTarefa = Tarefas
|
||||
viewTestEmailController.tabErros = Erros
|
||||
viewTestEmailController.lhStatus = Status
|
||||
viewTestEmailController.testEmailMsgTarefa = Fazer logon no servidor de saida de emails
|
||||
viewTestEmailController.msgStatusAndamento = Em andamento
|
||||
viewTestEmailController.sendEmailMsgTarefa = Enviar email de teste
|
||||
viewTestEmailController.lblStatusInfo.msgCancelado = O teste das configurações da conta foi cancelado. Clique em Sair para continuar.
|
||||
viewTestEmailController.msgStatusCancelado = Cancelado
|
||||
viewTestEmailController.msgStatusConcluido = Concluído
|
||||
viewTestEmailController.msgStatusFalha = Falha
|
||||
viewTestEmailController.msgExceptionErroServidor = Verifique se o endereço do servidor foi digitado corretamente.
|
||||
viewTestEmailController.msgExceptionErroUsuarioSenha = Verifique se o usuário e a senha foram digitados corretamente.
|
||||
viewTestEmailController.msgExceptionErroGeneric = Verifique as configurações do servidor, usuário e senha.
|
||||
viewTestEmailController.msgExceptionErroContacteAdm = Contate o administrador do sistema.
|
||||
viewTestEmailController.lblStatusInfo.sucesso = Parabéns! Todos os testes foram concluídos com êxito.Clique em sair para continuar.
|
||||
viewTestEmailController.lblStatusInfo.erro = Ocorreram alguns erros durante o processamento dos testes. Examine a lista de erros abaixo para obter mais detalhes. Se o problema persistir após a execução das ações sugeridas, contate o provedor de serviços de Internet.
|
||||
viewTestEmailController.emailSubject = Mensagem de Teste do Email da empresa: {0}
|
||||
viewTestEmailController.emailText = Este é um email enviado automaticamente pela ADM TotalBus durante o teste das configurações da sua conta.
|
||||
|
|
|
@ -112,6 +112,7 @@ indexController.mnSubSegOpcional.label= Seg. Opcional
|
|||
indexController.mnTarifasOficial.label = Cálculo de Preço
|
||||
indexController.mnSendaAmigo.label = Passageiro Frequente
|
||||
indexController.mniMarcas.label = Marcas
|
||||
indexController.mniImagem.label = Imagem
|
||||
indexController.mniMoneda.label = Moeda
|
||||
indexController.mniPlaza.label = Praça
|
||||
indexController.mniClaseServicio.label = Tipo de Classe
|
||||
|
@ -2240,6 +2241,29 @@ editarMarcaController.MSG.borrarOK = Marca Excluida com Sucesso.
|
|||
editarMarcaController.MSG.errorIMG = Arquivo não é uma imagen:
|
||||
editarMarcaController.fileupload.label = Selecionar Imagem
|
||||
|
||||
# Pantalla Editar Imagem
|
||||
editarImagemController.window.title = Imagem
|
||||
editarImagemController.btnApagar.tooltiptext = Eliminar
|
||||
editarImagemController.btnSalvar.tooltiptext = Salvar
|
||||
editarImagemController.btnFechar.tooltiptext = Fechar
|
||||
editarImagemController.lbNome.value = Imagem
|
||||
editarImagemController.MSG.suscribirOK = Imagem Registrada com Sucesso.
|
||||
editarImagemController.MSG.borrarPergunta = Deseja Eliminar imagem?
|
||||
editarImagemController.MSG.SinImagenPergunta = Deseja salvar a imagem sem adicionar nenhuma?
|
||||
editarImagemController.MSG.borrarOK = Imagem Excluida com Sucesso.
|
||||
editarImagemController.MSG.errorIMG = Arquivo não é uma imagen:
|
||||
editarImagemController.fileupload.label = Selecionar Imagem
|
||||
|
||||
# Mostrar a imagem da Pesquisa
|
||||
busquedaImagemController.window.title = Imagem
|
||||
busquedaImagemController.btnRefresh.tooltiptext = Atualizar
|
||||
busquedaImagemController.btnNovo.tooltiptext = Incluir
|
||||
busquedaImagemaController.btnCerrar.tooltiptext = Fechar
|
||||
busquedaImagemController.btnPesquisa.label = Pesquisa
|
||||
busquedaImagemController.lhDesc.label = Descrição
|
||||
busquedaImagemController.txtNome.label = Imagem
|
||||
busquedaImagemController.lhId.label = ID
|
||||
|
||||
# Muestra a Associação Marcos Pesquisa Classe
|
||||
busquedaAsociacionClaseServicioMarcaController.window.title = Associação Tipo de Classe e Marca
|
||||
busquedaAsociacionClaseServicioMarcaController.btnRefresh.tooltiptext = Atualizar
|
||||
|
@ -8695,3 +8719,26 @@ editarEmpresaTrocoSimples.MSG.borrarPergunta = Remover configurações do troco
|
|||
editarEmpresaTrocoSimples.MSG.borrarOK = Configuração removida com Sucesso.
|
||||
editarConvenioController.MSG.erro= Erro ao salvar
|
||||
|
||||
#viewTestEmailController
|
||||
viewTestEmailController.window.title= Testar configurações da conta
|
||||
viewTestEmailController.btnFechar.tooltiptext = Apagar
|
||||
viewTestEmailController.btnStop = Parar
|
||||
viewTestEmailController.lblStatusInfo = Aguarde está sendo testado as configurações da conta fornecida.
|
||||
viewTestEmailController.tabTarefa = Tarefas
|
||||
viewTestEmailController.tabErros = Erros
|
||||
viewTestEmailController.lhStatus = Status
|
||||
viewTestEmailController.testEmailMsgTarefa = Fazer logon no servidor de saida de emails
|
||||
viewTestEmailController.msgStatusAndamento = Em andamento
|
||||
viewTestEmailController.sendEmailMsgTarefa = Enviar email de teste
|
||||
viewTestEmailController.lblStatusInfo.msgCancelado = O teste das configurações da conta foi cancelado. Clique em Sair para continuar.
|
||||
viewTestEmailController.msgStatusCancelado = Cancelado
|
||||
viewTestEmailController.msgStatusConcluido = Concluído
|
||||
viewTestEmailController.msgStatusFalha = Falha
|
||||
viewTestEmailController.msgExceptionErroServidor = Verifique se o endereço do servidor foi digitado corretamente.
|
||||
viewTestEmailController.msgExceptionErroUsuarioSenha = Verifique se o usuário e a senha foram digitados corretamente.
|
||||
viewTestEmailController.msgExceptionErroGeneric = Verifique as configurações do servidor, usuário e senha.
|
||||
viewTestEmailController.msgExceptionErroContacteAdm = Contate o administrador do sistema.
|
||||
viewTestEmailController.lblStatusInfo.sucesso = Parabéns! Todos os testes foram concluídos com êxito.Clique em sair para continuar.
|
||||
viewTestEmailController.lblStatusInfo.erro = Ocorreram alguns erros durante o processamento dos testes. Examine a lista de erros abaixo para obter mais detalhes. Se o problema persistir após a execução das ações sugeridas, contate o provedor de serviços de Internet.
|
||||
viewTestEmailController.emailSubject = Mensagem de Teste do Email da empresa: {0}
|
||||
viewTestEmailController.emailText = Este é um email enviado automaticamente pela ADM TotalBus durante o teste das configurações da sua conta.
|
|
@ -52,6 +52,9 @@
|
|||
<listener>
|
||||
<description>My App Init</description>
|
||||
<listener-class>com.rjconsultores.ventaboletos.web.utilerias.MyAppInit</listener-class>
|
||||
</listener>
|
||||
<listener>
|
||||
<listener-class>com.rjconsultores.ventaboletos.web.utilerias.RJExecutorHolder</listener-class>
|
||||
</listener>
|
||||
<desktop-config>
|
||||
<!--disable-theme-uri>~./zul/css/norm*.css.dsp*</disable-theme-uri-->
|
||||
|
|
|
@ -1335,11 +1335,18 @@
|
|||
<label id="lblDestinatario"
|
||||
value="Destinatário de informações gerais" />
|
||||
<textbox id="textDestinatario"
|
||||
width="80%" maxlength="50"
|
||||
width="90%" maxlength="50"
|
||||
value="@{winEditarEmpresa$composer.empresaEmail.destinatario}" />
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<toolbar>
|
||||
<separator bar="true"/>
|
||||
</toolbar>
|
||||
<button id="btnTestEmail" height="20"
|
||||
label="${c:l('viewTestEmailController.window.title')}"
|
||||
/>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?page contentType="text/html;charset=UTF-8"?>
|
||||
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winViewTestEmail"?>
|
||||
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||
|
||||
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||
<window id="winViewTestEmail" border="normal"
|
||||
apply="${viewTestEmailController}" width="520px"
|
||||
contentStyle="overflow:auto" title="${c:l('viewTestEmailController.window.title')}">
|
||||
|
||||
<toolbar>
|
||||
<hbox spacing="5px" style="padding:1px" align="right">
|
||||
<button id="btnFechar" height="20"
|
||||
image="/gui/img/exit.png" width="35px"
|
||||
onClick="winViewTestEmail.detach()"
|
||||
tooltiptext="${c:l('viewTestEmailController.btnFechar.tooltiptext')}" />
|
||||
<button id="btnStop" label="${c:l('viewTestEmailController.btnStop')}" visible="true" />
|
||||
</hbox>
|
||||
|
||||
</toolbar>
|
||||
|
||||
<vlayout height="50px">
|
||||
<label id="lblStatusInfo"
|
||||
value="${c:l('viewTestEmailController.lblStatusInfo')}" />
|
||||
</vlayout>
|
||||
|
||||
<toolbar>
|
||||
<separator bar="true" />
|
||||
</toolbar>
|
||||
|
||||
<tabbox id="tabboxTitle">
|
||||
<tabs>
|
||||
<tab label="${c:l('viewTestEmailController.tabTarefa')}" />
|
||||
<tab label="${c:l('viewTestEmailController.tabErros')}" />
|
||||
</tabs>
|
||||
<tabpanels>
|
||||
<tabpanel style="overflow:auto;">
|
||||
<listbox id="tarefasList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="true">
|
||||
<listhead sizable="true">
|
||||
<listheader id="lhIcon" width="5%" />
|
||||
<listheader id="lhTarefas" width="75%"
|
||||
label="${c:l('viewTestEmailController.tabTarefa')}" />
|
||||
<listheader id="lhStatus" width="20%"
|
||||
label="${c:l('viewTestEmailController.lhStatus')}" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
<tabpanel>
|
||||
<listbox id="errosList"
|
||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||
multiple="true">
|
||||
<listhead sizable="true">
|
||||
<listheader id="lhErrors" width="100%"
|
||||
align="left" />
|
||||
</listhead>
|
||||
</listbox>
|
||||
</tabpanel>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</window>
|
||||
</zk>
|
Binary file not shown.
After Width: | Height: | Size: 595 B |
Binary file not shown.
After Width: | Height: | Size: 679 B |
Binary file not shown.
After Width: | Height: | Size: 673 B |
Loading…
Reference in New Issue