Help with remoting
fkj Jun 14, 2010 1:06 PMI was successfully using remoting in a page. Recently I had to use the same page in a another project, so I packed it in a JAR to use it as template. (link)
After doing that the remoting stub is being generated wrong.
Right code:
Seam.Remoting.type.atendimentoBean = function() { this.__callback = new Object(); Seam.Remoting.type.atendimentoBean.prototype.cancelar = function(p0, callback, exceptionHandler) { return Seam.Remoting.execute(this, "cancelar", [p0], callback, exceptionHandler); } } Seam.Remoting.type.atendimentoBean.__name = "atendimentoBean"; Seam.Component.register(Seam.Remoting.type.atendimentoBean);
Wrong code:
Seam.Remoting.type.br$com$spdata$persistence$mysql$entity$chat$StAtendente.__name = "br.com.spdata.persistence.mysql.entity.chat.StAtendente"; Seam.Remoting.type.br$com$spdata$persistence$mysql$entity$chat$StAtendente.__metadata = [ {field: "id", type: "number"}, {field: "tipoAtendimento", type: "bean"}, {field: "produtos", type: "bag"}, {field: "supervisor", type: "bool"}, {field: "setorAtendimento", type: "bean"}, {field: "nome", type: "str"}, {field: "tecnico", type: "bean"}, {field: "sistemas", type: "bag"}]; Seam.Remoting.registerType(Seam.Remoting.type.br$com$spdata$persistence$mysql$entity$chat$StAtendente); Seam.Remoting.type.br$com$spdata$persistence$mysql$entity$chat$StMensagemAtendimentoCliente.__name = "br.com.spdata.persistence.mysql.entity.chat.StMensagemAtendimentoCliente"; Seam.Remoting.type.br$com$spdata$persistence$mysql$entity$chat$StMensagemAtendimentoCliente.__metadata = [ {field: "id", type: "number"}, {field: "atendimento", type: "bean"}, {field: "texto", type: "str"}, {field: "data", type: "date"}]; Seam.Remoting.registerType(Seam.Remoting.type.br$com$spdata$persistence$mysql$entity$chat$StMensagemAtendimentoCliente); ... LOTS MORE OF ENTITY CLASS CODE ... Seam.Remoting.type.atendimentoBean = function() { this.finalizado = undefined; this.posicaoFila = undefined; this.estadoChat = undefined; this.atendimento = undefined; this.aceitaTermos = undefined; this.mensagem = undefined; Seam.Remoting.type.atendimentoBean.prototype.isFinalizado = function() { return this.finalizado; } Seam.Remoting.type.atendimentoBean.prototype.getPosicaoFila = function() { return this.posicaoFila; } Seam.Remoting.type.atendimentoBean.prototype.getEstadoChat = function() { return this.estadoChat; } Seam.Remoting.type.atendimentoBean.prototype.getAtendimento = function() { return this.atendimento; } Seam.Remoting.type.atendimentoBean.prototype.isAceitaTermos = function() { return this.aceitaTermos; } Seam.Remoting.type.atendimentoBean.prototype.getMensagem = function() { return this.mensagem; } Seam.Remoting.type.atendimentoBean.prototype.setFinalizado = function(finalizado) { this.finalizado = finalizado; } Seam.Remoting.type.atendimentoBean.prototype.setPosicaoFila = function(posicaoFila) { this.posicaoFila = posicaoFila; } Seam.Remoting.type.atendimentoBean.prototype.setEstadoChat = function(estadoChat) { this.estadoChat = estadoChat; } Seam.Remoting.type.atendimentoBean.prototype.setAtendimento = function(atendimento) { this.atendimento = atendimento; } Seam.Remoting.type.atendimentoBean.prototype.setAceitaTermos = function(aceitaTermos) { this.aceitaTermos = aceitaTermos; } Seam.Remoting.type.atendimentoBean.prototype.setMensagem = function(mensagem) { this.mensagem = mensagem; } } Seam.Remoting.type.atendimentoBean.__name = "atendimentoBean"; Seam.Remoting.type.atendimentoBean.__metadata = [ {field: "posicaoFila", type: "number"}, {field: "finalizado", type: "bool"}, {field: "estadoChat", type: "str"}, {field: "atendimento", type: "bean"}, {field: "aceitaTermos", type: "bool"}, {field: "mensagem", type: "bean"}]; Seam.Component.register(Seam.Remoting.type.atendimentoBean);
Any ideas?
Thanks,
Felipe