fixes bug#14878
dev:lucas qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@96035 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
9d24d63db4
commit
4b3b6ffea6
|
@ -0,0 +1,31 @@
|
||||||
|
################################################################################
|
||||||
|
#CONFIGURACAO DATASOURCE
|
||||||
|
database.jndi.name=java:/sco
|
||||||
|
database.jndi.resourceRef=false
|
||||||
|
|
||||||
|
#Banco de backup - Utilizado em relatórios
|
||||||
|
#!!!!!!!!!!!!!!!!!!!!!!Nunca mudar o datasource de leitura abaixo!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
database.read.jndi.name=java:/sco_read
|
||||||
|
database.read.jndi.resourceRef=false
|
||||||
|
|
||||||
|
database.rds=true
|
||||||
|
#CONEXION PRUEBAS
|
||||||
|
database.url=jdbc:oracle:thin:@10.17.55.116:1521:XE
|
||||||
|
#database.url=jdbc:oracle:thin:@sistema.grupoguanabara.net.br:1521/ORCL
|
||||||
|
#database.username=vtabol
|
||||||
|
#database.password=vtax05
|
||||||
|
#database.url=jdbc:oracle:thin:@producao.grupoguanabara.net.br:1521/ORCL
|
||||||
|
#database.username=vtabol
|
||||||
|
#database.password=prodx05
|
||||||
|
database.username=vtabol_sco
|
||||||
|
database.password=vtax05
|
||||||
|
################################################################################
|
||||||
|
#CONFIGURACAO HIBERNATE
|
||||||
|
database.showSql=false
|
||||||
|
database.generateDdl=false
|
||||||
|
database.dialect=org.hibernate.dialect.Oracle10gDialect
|
||||||
|
database.driver=oracle.jdbc.OracleDriver
|
||||||
|
database.batch_size=50
|
||||||
|
database.order_inserts=true
|
||||||
|
database.order_updates=true
|
||||||
|
database.jdbc.batch_versioned_data=true
|
|
@ -0,0 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||||
|
|
||||||
|
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
||||||
|
|
||||||
|
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
||||||
|
<layout class="org.apache.log4j.PatternLayout">
|
||||||
|
<param name="ConversionPattern" value="%p [%t] %c.%M(%L) | %m%n" />
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
|
||||||
|
<param name="DatePattern" value="'.'yyyy-MM-dd"/><!--Rollover at midnight each day.-->
|
||||||
|
<param name="File" value="${user.home}/applicationAdm.log"/>
|
||||||
|
<layout class="org.apache.log4j.PatternLayout">
|
||||||
|
<param name="ConversionPattern" value="[%d] %p [%t] %c.%M(%L) | %m%n"/>
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<logger name="org.apache">
|
||||||
|
<level value="ERROR" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- logger name="com.rjconsultores">
|
||||||
|
<level value="DEBUG" />
|
||||||
|
</logger-->
|
||||||
|
|
||||||
|
<logger name="org.hibernate">
|
||||||
|
<level value="ERROR" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- <logger name="org.hibernate.SQL"> -->
|
||||||
|
<!-- <level value="TRACE" /> -->
|
||||||
|
<!-- <appender-ref ref="FILE" /> -->
|
||||||
|
<!-- </logger> -->
|
||||||
|
|
||||||
|
|
||||||
|
<logger name="WS.MESSAGE">
|
||||||
|
<level value="DEBUG" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="org.springframework.security">
|
||||||
|
<level value="ERROR" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="com.trg">
|
||||||
|
<level value="ERROR" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="com.bci">
|
||||||
|
<level value="ERROR" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<root>
|
||||||
|
<level value="ERROR"/>
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
<appender-ref ref="FILE" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</log4j:configuration>
|
|
@ -0,0 +1,137 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Scope;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
import org.zkoss.zhtml.Messagebox;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.EventListener;
|
||||||
|
import org.zkoss.zul.Paging;
|
||||||
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Imagem;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderImagem;
|
||||||
|
|
||||||
|
@Controller("busquedaImagemController")
|
||||||
|
@Scope("prototype")
|
||||||
|
public class BusquedaImagemController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private transient PagedListWrapper<Imagem> plwImagem;
|
||||||
|
private MyListbox imagemList;
|
||||||
|
private Paging pagingImagem;
|
||||||
|
private Textbox txtNome;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
imagemList.setItemRenderer(new RenderImagem());
|
||||||
|
imagemList.addEventListener("onDoubleClick", new EventListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(Event event) throws Exception {
|
||||||
|
Imagem c = (Imagem) imagemList.getSelected();
|
||||||
|
verImagem(c);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
refreshLista();
|
||||||
|
|
||||||
|
txtNome.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void verImagem(Imagem imagem) {
|
||||||
|
if (imagem == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map args = new HashMap();
|
||||||
|
args.put("busquedaImagemController", this);
|
||||||
|
args.put("imagem", imagem);
|
||||||
|
args.put("imagemList", imagemList);
|
||||||
|
|
||||||
|
openWindow("/gui/catalogos/editarImagem.zul",
|
||||||
|
Labels.getLabel("editarImagemController.window.title"), args, MODAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refreshLista() {
|
||||||
|
HibernateSearchObject<Imagem> imagemBusqueda = new HibernateSearchObject<Imagem>(Imagem.class,
|
||||||
|
pagingImagem.getPageSize());
|
||||||
|
|
||||||
|
imagemBusqueda.addFilterLike("nombImagem",
|
||||||
|
"%" + txtNome.getText().trim().concat("%"));
|
||||||
|
|
||||||
|
imagemBusqueda.addSortAsc("nombImagem");
|
||||||
|
imagemBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
|
||||||
|
plwImagem.init(imagemBusqueda, imagemList, pagingImagem);
|
||||||
|
|
||||||
|
if (imagemList.getData().length == 0) {
|
||||||
|
try {
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||||
|
Labels.getLabel("busquedaMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnPesquisa(Event ev) {
|
||||||
|
refreshLista();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnRefresh(Event ev) {
|
||||||
|
refreshLista();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnNovo(Event ev) {
|
||||||
|
verImagem(new Imagem());
|
||||||
|
}
|
||||||
|
|
||||||
|
public Textbox getTxtNome() {
|
||||||
|
return txtNome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTxtNome(Textbox txtNome) {
|
||||||
|
this.txtNome = txtNome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagedListWrapper<Imagem> getPlwImagem() {
|
||||||
|
return plwImagem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlwImagem(PagedListWrapper<Imagem> plwImagem) {
|
||||||
|
this.plwImagem = plwImagem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getImagemList() {
|
||||||
|
return imagemList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImagemList(MyListbox imagemList) {
|
||||||
|
this.imagemList = imagemList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Paging getPagingImagem() {
|
||||||
|
return pagingImagem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPagingImagem(Paging pagingImagem) {
|
||||||
|
this.pagingImagem = pagingImagem;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,322 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.servlet.RequestDispatcher;
|
||||||
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.servlet.ServletRequest;
|
||||||
|
import javax.servlet.ServletResponse;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Scope;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
import org.zkoss.zhtml.Messagebox;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.Executions;
|
||||||
|
import org.zkoss.zk.ui.UiException;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zk.ui.event.UploadEvent;
|
||||||
|
import org.zkoss.zul.Button;
|
||||||
|
import org.zkoss.zul.Combobox;
|
||||||
|
import org.zkoss.zul.Image;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Imagem;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ImagemService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.Application;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.servlet.ImageServlet;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext;
|
||||||
|
|
||||||
|
@Controller("editarImagemController")
|
||||||
|
@Scope("prototype")
|
||||||
|
public class EditarImagemController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Autowired
|
||||||
|
private ImagemService imagemService;
|
||||||
|
@Autowired
|
||||||
|
private EmpresaService empresaService;
|
||||||
|
private Imagem imagem;
|
||||||
|
private List<Empresa> lsEmpresa;
|
||||||
|
private MyListbox imagemList;
|
||||||
|
private BusquedaImagemController busquedaImagemController;
|
||||||
|
private Image img;
|
||||||
|
private MyTextbox txtNome;
|
||||||
|
private Button btnApagar;
|
||||||
|
private static Logger log = Logger.getLogger(EditarImagemController.class);
|
||||||
|
private Combobox cmbEmpresa;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
|
||||||
|
lsEmpresa = empresaService.obtenerTodos();
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
|
||||||
|
imagem = (Imagem) Executions.getCurrent().getArg().get("imagem");
|
||||||
|
busquedaImagemController = (BusquedaImagemController) Executions.getCurrent().getArg().get("busquedaImagemController");
|
||||||
|
if (imagem.getNombImagem() != null) {
|
||||||
|
img.setContent(new org.zkoss.image.AImage(imagem.getNombImagem(),
|
||||||
|
imagem.getImagem()));
|
||||||
|
}
|
||||||
|
imagemList = (MyListbox) Executions.getCurrent().getArg().get("imagemList");
|
||||||
|
|
||||||
|
if (imagem.getImagemId() == null) {
|
||||||
|
btnApagar.setVisible(Boolean.FALSE);
|
||||||
|
}else{
|
||||||
|
txtNome.setDisabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
txtNome.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void uploadPhoto(UploadEvent event) {
|
||||||
|
org.zkoss.util.media.Media media = event.getMedia();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (media instanceof org.zkoss.image.Image) {
|
||||||
|
img.setContent(new org.zkoss.image.AImage(media.getName(),
|
||||||
|
media.getStreamData()));
|
||||||
|
} else {
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarMarcaController.MSG.errorIMG") + " " + media,
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
} catch (IOException ex) {
|
||||||
|
log.error(ex);
|
||||||
|
throw UiException.Aide.wrap(ex);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
log.error(ex);
|
||||||
|
throw UiException.Aide.wrap(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnSalvar(Event ev) throws InterruptedException {
|
||||||
|
txtNome.getText();
|
||||||
|
try {
|
||||||
|
String nomeImagem = imagem.getNombImagem();
|
||||||
|
List<Imagem> lsImagens = imagemService.buscar(nomeImagem);
|
||||||
|
boolean podeSalvar = false;
|
||||||
|
if (lsImagens.isEmpty()) {
|
||||||
|
podeSalvar = true;
|
||||||
|
} else {
|
||||||
|
for (Imagem m : lsImagens) {
|
||||||
|
if (m.getImagemId().equals(imagem.getImagemId())) {
|
||||||
|
podeSalvar = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (podeSalvar) {
|
||||||
|
imagem.setActivo(Boolean.TRUE);
|
||||||
|
imagem.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
imagem.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
|
||||||
|
if (img.getContent() != null) {
|
||||||
|
imagem.setImagem(img.getContent().getByteData());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imagem.getImagem() == null) {
|
||||||
|
int resp = Messagebox.show(
|
||||||
|
Labels.getLabel("editarMarcaController.MSG.SinImagenPergunta"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||||
|
|
||||||
|
if (resp == Messagebox.YES) {
|
||||||
|
if (imagem.getImagemId() == null) {
|
||||||
|
imagemService.suscribir(imagem);
|
||||||
|
imagemList.addItem(imagem);
|
||||||
|
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarMarcaController.MSG.suscribirOK"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
closeWindow();
|
||||||
|
Executions.getCurrent().sendRedirect("");
|
||||||
|
} else {
|
||||||
|
imagemService.actualizacion(imagem);
|
||||||
|
imagemList.updateItem(imagem);
|
||||||
|
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarMarcaController.MSG.suscribirOK"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
closeWindow();
|
||||||
|
Executions.getCurrent().sendRedirect("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (imagem.getImagemId() == null) {
|
||||||
|
imagemService.suscribir(imagem);
|
||||||
|
imagemList.addItem(imagem);
|
||||||
|
} else {
|
||||||
|
imagemService.actualizacion(imagem);
|
||||||
|
imagemList.updateItem(imagem);
|
||||||
|
}
|
||||||
|
|
||||||
|
sendUpdateImage();
|
||||||
|
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarMarcaController.MSG.suscribirOK"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
busquedaImagemController.refreshLista();
|
||||||
|
closeWindow();
|
||||||
|
Executions.getCurrent().sendRedirect("");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("MSG.Registro.Existe"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.EXCLAMATION);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error("editarMarcaController: " + ex);
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("MSG.Error"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnApagar(Event ev) {
|
||||||
|
try {
|
||||||
|
int resp = Messagebox.show(
|
||||||
|
Labels.getLabel("editarMarcaController.MSG.borrarPergunta"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.YES | Messagebox.NO, Messagebox.QUESTION);
|
||||||
|
|
||||||
|
if (resp == Messagebox.YES) {
|
||||||
|
imagemService.borrar(imagem);
|
||||||
|
|
||||||
|
Messagebox.show(
|
||||||
|
Labels.getLabel("editarMarcaController.MSG.borrarOK"),
|
||||||
|
Labels.getLabel("editarMarcaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
|
||||||
|
imagemList.removeItem(imagem);
|
||||||
|
|
||||||
|
closeWindow();
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
log.error(ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendUpdateImage() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
Set<String> images = new HashSet<String>();
|
||||||
|
images.add(Constantes.IMAGEM_EMPRESA);
|
||||||
|
images.add(Constantes.IMAGEM_EMPRESA_GENERICA);
|
||||||
|
|
||||||
|
if (imagem != null && images.contains(imagem.getNombImagem())) {
|
||||||
|
Application application = (Application) AppContext.getApplicationContext().getBean("app");
|
||||||
|
application.setImage(imagem);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImagemService getImagemService() {
|
||||||
|
return imagemService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImagemService(ImagemService imagemService) {
|
||||||
|
this.imagemService = imagemService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EmpresaService getEmpresaService() {
|
||||||
|
return empresaService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresaService(EmpresaService empresaService) {
|
||||||
|
this.empresaService = empresaService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Imagem getImagem() {
|
||||||
|
return imagem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImagem(Imagem imagem) {
|
||||||
|
this.imagem = imagem;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Empresa> getLsEmpresa() {
|
||||||
|
return lsEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsEmpresa(List<Empresa> lsEmpresa) {
|
||||||
|
this.lsEmpresa = lsEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyListbox getImagemList() {
|
||||||
|
return imagemList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImagemList(MyListbox imagemList) {
|
||||||
|
this.imagemList = imagemList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BusquedaImagemController getBusquedaImagemController() {
|
||||||
|
return busquedaImagemController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusquedaImagemController(BusquedaImagemController busquedaImagemController) {
|
||||||
|
this.busquedaImagemController = busquedaImagemController;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Image getImg() {
|
||||||
|
return img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImg(Image img) {
|
||||||
|
this.img = img;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MyTextbox getTxtNome() {
|
||||||
|
return txtNome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTxtNome(MyTextbox txtNome) {
|
||||||
|
this.txtNome = txtNome;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Button getBtnApagar() {
|
||||||
|
return btnApagar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBtnApagar(Button btnApagar) {
|
||||||
|
this.btnApagar = btnApagar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Combobox getCmbEmpresa() {
|
||||||
|
return cmbEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCmbEmpresa(Combobox cmbEmpresa) {
|
||||||
|
this.cmbEmpresa = cmbEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.web.utilerias;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.flywaydb.core.Flyway;
|
import org.flywaydb.core.Flyway;
|
||||||
import org.quartz.JobDetail;
|
import org.quartz.JobDetail;
|
||||||
|
@ -24,6 +25,7 @@ import org.zkoss.zk.ui.WebApp;
|
||||||
import com.rjconsultores.ventaboletos.FlyWay;
|
import com.rjconsultores.ventaboletos.FlyWay;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.Application;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties;
|
||||||
import com.rjconsultores.ventaboletos.web.gui.controladores.job.GeneracionConferenciaMovimentoJob;
|
import com.rjconsultores.ventaboletos.web.gui.controladores.job.GeneracionConferenciaMovimentoJob;
|
||||||
import com.rjconsultores.ventaboletos.web.gui.controladores.job.GeneracionCorridaJob;
|
import com.rjconsultores.ventaboletos.web.gui.controladores.job.GeneracionCorridaJob;
|
||||||
|
@ -86,6 +88,7 @@ public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit {
|
||||||
|
|
||||||
executeFlyway();
|
executeFlyway();
|
||||||
customToDatabase();
|
customToDatabase();
|
||||||
|
imageToDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -119,7 +122,14 @@ public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit {
|
||||||
|
|
||||||
log.info("Executando customToDatabase...");
|
log.info("Executando customToDatabase...");
|
||||||
ApplicationProperties.getInstance().readConfigurationToDatabase();
|
ApplicationProperties.getInstance().readConfigurationToDatabase();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void imageToDatabase() {
|
||||||
|
|
||||||
|
log.info("Executando loadImageToDatabase...");
|
||||||
|
ApplicationProperties.getInstance().loadImageToDatabase("empresa.png", false);
|
||||||
|
ApplicationProperties.getInstance().loadImageToDatabase("empresa_generica.png", true);
|
||||||
|
ApplicationProperties.getInstance().singletonImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean ipBloqueadoGeracaoServico() {
|
private boolean ipBloqueadoGeracaoServico() {
|
||||||
|
@ -320,6 +330,7 @@ public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit {
|
||||||
DataSource ds = (DataSource) factory.getBean("dataSource");
|
DataSource ds = (DataSource) factory.getBean("dataSource");
|
||||||
return ds;
|
return ds;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ConstanteService getConstanteService() {
|
private ConstanteService getConstanteService() {
|
||||||
ApplicationContext appContext = AppContext.getApplicationContext();
|
ApplicationContext appContext = AppContext.getApplicationContext();
|
||||||
BeanFactory factory = (BeanFactory) appContext;
|
BeanFactory factory = (BeanFactory) appContext;
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos;
|
||||||
|
|
||||||
|
import org.zkoss.util.resource.Labels;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
|
||||||
|
|
||||||
|
public class ItemMenuImagem extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public ItemMenuImagem() {
|
||||||
|
super("indexController.mniImagem.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.IMAGEM";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ejecutar() {
|
||||||
|
PantallaUtileria.openWindow("/gui/catalogos/busquedaImagem.zul",
|
||||||
|
Labels.getLabel("busquedaImagemController.window.title"),
|
||||||
|
getArgs() ,desktop);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -13,6 +13,7 @@ catalogos.empresa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalog
|
||||||
catalogos.formaPago=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuFormaPago
|
catalogos.formaPago=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuFormaPago
|
||||||
catalogos.grupoRuta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuGrupoRuta
|
catalogos.grupoRuta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuGrupoRuta
|
||||||
catalogos.marcas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMarcas
|
catalogos.marcas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMarcas
|
||||||
|
catalogos.imagem=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuImagem
|
||||||
catalogos.monedas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMoneda
|
catalogos.monedas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMoneda
|
||||||
catalogos.pais=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPais
|
catalogos.pais=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPais
|
||||||
catalogos.plaza=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPlaza
|
catalogos.plaza=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPlaza
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
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.entidad.Imagem;
|
||||||
|
|
||||||
|
public class RenderImagem implements ListitemRenderer {
|
||||||
|
|
||||||
|
public void render(Listitem lstm, Object o) throws Exception {
|
||||||
|
Imagem imagem = (Imagem) o;
|
||||||
|
|
||||||
|
Listcell lc = new Listcell(imagem.getImagemId().toString());
|
||||||
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
lc = new Listcell(imagem.getNombImagem());
|
||||||
|
lc.setParent(lstm);
|
||||||
|
|
||||||
|
lstm.setAttribute("data", imagem);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.rjconsultores.ventaboletos.web.utilerias.servlet;
|
package com.rjconsultores.ventaboletos.web.utilerias.servlet;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -13,10 +14,12 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.BeanFactory;
|
import org.springframework.beans.factory.BeanFactory;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.constantes.Constantes;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Constante;
|
import com.rjconsultores.ventaboletos.entidad.Constante;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Imagem;
|
||||||
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
import com.rjconsultores.ventaboletos.service.ConstanteService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.Application;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext;
|
import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,9 +28,10 @@ import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext;
|
||||||
public class ImageServlet extends HttpServlet {
|
public class ImageServlet extends HttpServlet {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private static final String PATH_IMAGENES = "/com/rjconsultores/ventaboletos/web/cliente/imagenes/";
|
private static final String PATH_IMAGENES = "/com/rjconsultores/ventaboletos/web/cliente/imagenes/";
|
||||||
private static final String IMAGENE_EMPRESA = "empresa.png";
|
// private static final String IMAGENE_EMPRESA = "empresa.png";
|
||||||
private static final String IMAGENE_EMPRESA_GENERICA = "empresa_generica.png";
|
// private static final String IMAGENE_EMPRESA_GENERICA = "empresa_generica.png";
|
||||||
private static Boolean IMAGENE_EMPRESA_GENERICA_CHECKED = null;
|
private static Boolean IMAGENE_EMPRESA_GENERICA_CHECKED = null;
|
||||||
|
// private static Imagem IMAGEM_EMPRESA_CARREGADA = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
|
||||||
|
@ -41,7 +45,8 @@ public class ImageServlet extends HttpServlet {
|
||||||
// Open the file and output streams
|
// Open the file and output streams
|
||||||
imagene = getNombreImagene(imagene);
|
imagene = getNombreImagene(imagene);
|
||||||
|
|
||||||
InputStream in = getImagene(imagene);
|
InputStream in = getImagem(imagene);
|
||||||
|
if (in != null) {
|
||||||
OutputStream out = resp.getOutputStream();
|
OutputStream out = resp.getOutputStream();
|
||||||
|
|
||||||
// Copy the contents of the file to the output stream
|
// Copy the contents of the file to the output stream
|
||||||
|
@ -53,6 +58,9 @@ public class ImageServlet extends HttpServlet {
|
||||||
in.close();
|
in.close();
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
} catch (FileNotFoundException fnfe) {
|
} catch (FileNotFoundException fnfe) {
|
||||||
log("Arquivo da Imagem nao localizado");
|
log("Arquivo da Imagem nao localizado");
|
||||||
}
|
}
|
||||||
|
@ -67,7 +75,7 @@ public class ImageServlet extends HttpServlet {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String getNombreImagene(String imagene){
|
private String getNombreImagene(String imagene){
|
||||||
if (!imagene.equalsIgnoreCase(IMAGENE_EMPRESA)){
|
if (!imagene.equalsIgnoreCase(Constantes.IMAGEM_EMPRESA)){
|
||||||
return imagene;
|
return imagene;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +87,7 @@ public class ImageServlet extends HttpServlet {
|
||||||
|
|
||||||
ConstanteService constanteService = getConstanteService();
|
ConstanteService constanteService = getConstanteService();
|
||||||
Constante constante = constanteService.buscarPorNomeConstante("IMAGENE_EMPRESA_GENERICA");
|
Constante constante = constanteService.buscarPorNomeConstante("IMAGENE_EMPRESA_GENERICA");
|
||||||
|
|
||||||
if ( (constante != null) && StringUtils.isNotBlank(constante.getValorconstante())){
|
if ( (constante != null) && StringUtils.isNotBlank(constante.getValorconstante())){
|
||||||
imageneGenericaEmpresaActivo= Boolean.parseBoolean(constante.getValorconstante());
|
imageneGenericaEmpresaActivo= Boolean.parseBoolean(constante.getValorconstante());
|
||||||
|
|
||||||
|
@ -87,9 +96,8 @@ public class ImageServlet extends HttpServlet {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( (IMAGENE_EMPRESA_GENERICA_CHECKED != null) && (IMAGENE_EMPRESA_GENERICA_CHECKED) ){
|
if ( (IMAGENE_EMPRESA_GENERICA_CHECKED != null) && (IMAGENE_EMPRESA_GENERICA_CHECKED) ){
|
||||||
imagene = IMAGENE_EMPRESA_GENERICA;
|
imagene = Constantes.IMAGEM_EMPRESA_GENERICA;
|
||||||
}
|
}
|
||||||
|
|
||||||
return imagene;
|
return imagene;
|
||||||
|
@ -97,13 +105,33 @@ public class ImageServlet extends HttpServlet {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputStream getImagene(String imagene) throws FileNotFoundException, IOException {
|
private InputStream getImagem(String imagene) {
|
||||||
InputStream inputStream = null;
|
InputStream inputStream = null;
|
||||||
try {
|
try {
|
||||||
inputStream = new ClassPathResource(PATH_IMAGENES + imagene).getInputStream();
|
Application application = (Application) AppContext.getApplicationContext().getBean("app");
|
||||||
} catch (FileNotFoundException fnfe) {
|
Imagem imagem = application.getImage();
|
||||||
throw fnfe;
|
if ((imagem != null) && imagem.getImagem() != null) {
|
||||||
} catch (IOException e) {
|
inputStream = getImagemLoaded(imagem.getImagem());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log("Erro ao carregar imagem do banco de dados.");
|
||||||
|
} finally {
|
||||||
|
if (inputStream != null) {
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return inputStream;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private InputStream getImagemLoaded(byte[] imagene) throws Exception {
|
||||||
|
InputStream inputStream = null;
|
||||||
|
try {
|
||||||
|
inputStream = new ByteArrayInputStream(imagene);
|
||||||
|
} catch (Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
return inputStream;
|
return inputStream;
|
||||||
|
@ -116,4 +144,6 @@ public class ImageServlet extends HttpServlet {
|
||||||
ConstanteService cs = (ConstanteService) factory.getBean("constanteService");
|
ConstanteService cs = (ConstanteService) factory.getBean("constanteService");
|
||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,6 +485,7 @@
|
||||||
<value>com.rjconsultores.ventaboletos.entidad.OperadorEmbarcadaServico</value>
|
<value>com.rjconsultores.ventaboletos.entidad.OperadorEmbarcadaServico</value>
|
||||||
<value>com.rjconsultores.ventaboletos.entidad.LogHistoricoContingencia</value>
|
<value>com.rjconsultores.ventaboletos.entidad.LogHistoricoContingencia</value>
|
||||||
<value>com.rjconsultores.ventaboletos.entidad.EmpresaTrocoSimples</value>
|
<value>com.rjconsultores.ventaboletos.entidad.EmpresaTrocoSimples</value>
|
||||||
|
<value>com.rjconsultores.ventaboletos.entidad.Imagem</value>
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
|
|
||||||
|
@ -522,6 +523,8 @@
|
||||||
<property name="jndiName" value="${database.read.jndi.name}" />
|
<property name="jndiName" value="${database.read.jndi.name}" />
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="app" class="com.rjconsultores.ventaboletos.utilerias.Application" />
|
||||||
|
|
||||||
<!-- <bean id="dataSource" -->
|
<!-- <bean id="dataSource" -->
|
||||||
<!-- class="org.springframework.jdbc.datasource.DriverManagerDataSource"> -->
|
<!-- class="org.springframework.jdbc.datasource.DriverManagerDataSource"> -->
|
||||||
<!-- <property name="driverClassName" value="${database.driver}" /> -->
|
<!-- <property name="driverClassName" value="${database.driver}" /> -->
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
<?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="winBusquedaImagem"?>
|
||||||
|
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||||
|
|
||||||
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
|
<window id="winBusquedaImagem" title="${c:l('busquedaImagemController.window.title')}"
|
||||||
|
apply="${busquedaImagemController}" contentStyle="overflow:auto"
|
||||||
|
height="350px" width="600px" border="normal" >
|
||||||
|
<toolbar>
|
||||||
|
<button id="btnRefresh" image="/gui/img/refresh.png" width="35px"
|
||||||
|
tooltiptext="${c:l('busquedaImagemController.btnRefresh.tooltiptext')}" />
|
||||||
|
<separator orient="vertical" />
|
||||||
|
<button id="btnNovo" image="/gui/img/add.png" width="35px"
|
||||||
|
tooltiptext="${c:l('busquedaImagemController.btnNovo.tooltiptext')}" />
|
||||||
|
<separator orient="vertical" />
|
||||||
|
<button id="btnCerrar" onClick="winBusquedaImagem.detach()" image="/gui/img/exit.png" width="35px"
|
||||||
|
tooltiptext="${c:l('busquedaImagemController.btnCerrar.tooltiptext')}"/>
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="20%" />
|
||||||
|
<column width="80%" />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<label value="${c:l('busquedaImagemController.txtNome.label')}"/>
|
||||||
|
<textbox id="txtNome" width="300px" use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
|
||||||
|
<toolbar>
|
||||||
|
|
||||||
|
<button id="btnPesquisa" image="/gui/img/find.png"
|
||||||
|
label="${c:l('busquedaImagemController.btnPesquisa.label')}"/>
|
||||||
|
</toolbar>
|
||||||
|
<paging id="pagingImagem" pageSize="15" />
|
||||||
|
<listbox id="imagemList" use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" multiple="false">
|
||||||
|
<listhead sizable="true">
|
||||||
|
<listheader image="/gui/img/create_doc.gif"
|
||||||
|
label="${c:l('busquedaImagemController.lhId.label')}" width="70px"
|
||||||
|
sort="auto(imagemId)"/>
|
||||||
|
<listheader id="lhDesc" image="/gui/img/create_doc.gif"
|
||||||
|
label="${c:l('busquedaImagemController.lhDesc.label')}"
|
||||||
|
sort="auto(nombImagem)"/>
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
</window>
|
||||||
|
</zk>
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?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="winEditarImagem"?>
|
||||||
|
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||||
|
|
||||||
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
|
<window id="winEditarImagem" border="normal"
|
||||||
|
apply="${editarImagemController}"
|
||||||
|
width="800px" height="500px" contentStyle="overflow:auto"
|
||||||
|
title="${c:l('editarImagemController.window.title')}">
|
||||||
|
<toolbar>
|
||||||
|
<hbox spacing="5px" style="padding:1px" align="right">
|
||||||
|
<button id="btnApagar" height="20"
|
||||||
|
image="/gui/img/remove.png" width="35px"
|
||||||
|
tooltiptext="${c:l('editarImagemController.btnApagar.tooltiptext')}"/>
|
||||||
|
<button id="btnSalvar" height="20"
|
||||||
|
image="/gui/img/save.png" width="35px"
|
||||||
|
tooltiptext="${c:l('editarImagemController.btnSalvar.tooltiptext')}"/>
|
||||||
|
<button id="btnFechar" height="20"
|
||||||
|
image="/gui/img/exit.png" width="35px"
|
||||||
|
onClick="winEditarImagem.detach()"
|
||||||
|
tooltiptext="${c:l('editarImagemController.btnFechar.tooltiptext')}"/>
|
||||||
|
</hbox>
|
||||||
|
</toolbar>
|
||||||
|
|
||||||
|
<grid>
|
||||||
|
<columns>
|
||||||
|
<column width="40%" />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row>
|
||||||
|
<label id="lbNome" value="${c:l('editarImagemController.lbNome.value')}"/>
|
||||||
|
<textbox id="txtNome" constraint="no empty" width="100%" maxlength="30"
|
||||||
|
value="@{winEditarImagem$composer.imagem.nombImagem}"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"/>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
<row >
|
||||||
|
<fileupload width="60%" label="${c:l('editarImagemController.fileupload.label')}"
|
||||||
|
onUpload="winEditarImagem$composer.uploadPhoto(event)"/>
|
||||||
|
</row>
|
||||||
|
|
||||||
|
</rows>
|
||||||
|
|
||||||
|
</grid>
|
||||||
|
<image id="img" droppable="true" style="overflow:auto" />
|
||||||
|
</window>
|
||||||
|
</zk>
|
Loading…
Reference in New Issue