package it.forclick.localserver.server.ejb;
import it.forclick.localserver.server.entity.*;
import it.forclick.localserver.server.interim.*;
import java.io.Serializable;
import java.rmi.RemoteException;
import org.hibernate.Query;
import it.forclick.localserver.userInfo;
import it.forclick.localserver.LocalSecurity;
import it.forclick.localserver.client.functions.*;
import java.util.*;
import org.hibernate.*;
import org.hibernate.criterion.*;
import it.forclick.localserver.*;
import it.forclick.localserver.server.*;
import it.forclick.localserver.server.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import codetracer.lib.tracerDelegate;
import it.forclick.localserver.client.FileInfoPk;
import it.forclick.localserver.client.ReportParameter;
import net.sf.jasperreports.engine.JasperPrint;
public class MdlMesSession extends BasicSessionBean implements MdlMesRemote
{
protected static final Logger logger = LoggerFactory.getLogger(MdlMesSession.class);
public MdlMesSession()throws RemoteException
{
super();
}
public MdlMesRemote create()throws RemoteException{
return new MdlMesSession();
}
public TMesOutput addMesLogs(userInfo ui,Salvatore em,TMesInput input) throws Exception
{
{
/*START_GEN_CODE:wBYa2c3bpury7124:-638084956*/
return null;
/*STOP_GEN_CODE:wBYa2c3bpury7124*/
}
}
public TMesOutput addMesLogs(userInfo ui,TMesInput input) throws RemoteException
{
{
int serv=0;
boolean err=false;
if(Server.isDebugFine())
serv=tracerDelegate.addCall("addMesLogs", "server", "");
Salvatore em = getSalvatore();
Transaction tr=null;
try
{
tr=em.getTransaction();
TMesOutput out= addMesLogs(ui,em,input);
tr.commit();
if(Server.isAuto_detach())
return TMesOutput.detach(out);
else
return out;
}
catch (Throwable e)
{
err=true;
if(Server.isDebugFine())
tracerDelegate.setEndCallError(serv,e.getMessage(),-1,-1);
logger.warn("addMesLogs", e);
try {
if(tr!=null)
tr.rollback();
} catch (Throwable ex) {
logger.error("addMesLogs_SES", ex);
throw new RemoteException(ex.getMessage());
}
throw new RemoteException(e.getMessage());
}
finally{
em.close();
if(!err)
if(Server.isDebugFine())
tracerDelegate.setEndCall(serv, "");
}
}
}
public TMesComando addMesComando(userInfo ui,Salvatore em,TMesComando input) throws Exception
{
{
/*START_GEN_CODE:wBYa2c4aE7GO7127:-638084956*/
return null;
/*STOP_GEN_CODE:wBYa2c4aE7GO7127*/
}
}
public TMesComando addMesComando(userInfo ui,TMesComando input) throws RemoteException
{
{
int serv=0;
boolean err=false;
if(Server.isDebugFine())
serv=tracerDelegate.addCall("addMesComando", "server", "");
Salvatore em = getSalvatore();
Transaction tr=null;
try
{
tr=em.getTransaction();
TMesComando out= addMesComando(ui,em,input);
tr.commit();
if(Server.isAuto_detach())
return TMesComando.detach(out);
else
return out;
}
catch (Throwable e)
{
err=true;
if(Server.isDebugFine())
tracerDelegate.setEndCallError(serv,e.getMessage(),-1,-1);
logger.warn("addMesComando", e);
try {
if(tr!=null)
tr.rollback();
} catch (Throwable ex) {
logger.error("addMesComando_SES", ex);
throw new RemoteException(ex.getMessage());
}
throw new RemoteException(e.getMessage());
}
finally{
em.close();
if(!err)
if(Server.isDebugFine())
tracerDelegate.setEndCall(serv, "");
}
}
}
public TMesComunicationSystem getComunicationSystem(userInfo ui,Salvatore em,TString input) throws Exception
{
{
/*START_GEN_CODE:wBYa2c56DWVt7128:-638084956*/
return null;
/*STOP_GEN_CODE:wBYa2c56DWVt7128*/
}
}
public TMesComunicationSystem getComunicationSystem(userInfo ui,TString input) throws RemoteException
{
{
int serv=0;
boolean err=false;
if(Server.isDebugFine())
serv=tracerDelegate.addCall("getComunicationSystem", "server", "");
Salvatore em = getSalvatore();
Transaction tr=null;
try
{
tr=em.getTransaction();
TMesComunicationSystem out= getComunicationSystem(ui,em,input);
tr.commit();
if(Server.isAuto_detach())
return TMesComunicationSystem.detach(out);
else
return out;
}
catch (Throwable e)
{
err=true;
if(Server.isDebugFine())
tracerDelegate.setEndCallError(serv,e.getMessage(),-1,-1);
logger.warn("getComunicationSystem", e);
try {
if(tr!=null)
tr.rollback();
} catch (Throwable ex) {
logger.error("getComunicationSystem_SES", ex);
throw new RemoteException(ex.getMessage());
}
throw new RemoteException(e.getMessage());
}
finally{
em.close();
if(!err)
if(Server.isDebugFine())
tracerDelegate.setEndCall(serv, "");
}
}
}
public TMesLavorazione newLavorazione(userInfo ui,Salvatore em,TMesLavorazione input) throws Exception
{
{
/*START_GEN_CODE:wBYa2f34O4wr9549:-638084956*/
if(input.getGeneraDocumento()!=null && input.getGeneraDocumento().booleanValue()){
//Genero il documento
TDocumento doc = input.getDocumento();
MdlAnagDocumentoSession mdlDocumento = new MdlAnagDocumentoSession();
TDocSalva tDocSalva = new TDocSalva();
tDocSalva.setDocumento(doc.getDocumento());
tDocSalva.setForzaSalvataggio(true);
tDocSalva.setToSave(true);
tDocSalva.setUsaPartitaDef(false);
tDocSalva.setRestituisci(new TBoolean(true));
TDocReturn res = mdlDocumento.creaDocumento(ui, em, tDocSalva);
TDocumento tdoc = new TDocumento();
tdoc.setDocumento(res.getDocumento());
tdoc=mdlDocumento.registra(ui,em, tdoc);
input.setDocumento(tdoc);
}
if(input.getGeneraOperazioni()!=null && input.getGeneraOperazioni().booleanValue()){
for(TMesOperazione operazione : input.getOperazioni()){
}
}
return null;
/*STOP_GEN_CODE:wBYa2f34O4wr9549*/
}
}
public TMesLavorazione newLavorazione(userInfo ui,TMesLavorazione input) throws RemoteException
{
{
int serv=0;
boolean err=false;
if(Server.isDebugFine())
serv=tracerDelegate.addCall("newLavorazione", "server", "");
Salvatore em = getSalvatore();
Transaction tr=null;
try
{
tr=em.getTransaction();
TMesLavorazione out= newLavorazione(ui,em,input);
tr.commit();
if(Server.isAuto_detach())
return TMesLavorazione.detach(out);
else
return out;
}
catch (Throwable e)
{
err=true;
if(Server.isDebugFine())
tracerDelegate.setEndCallError(serv,e.getMessage(),-1,-1);
logger.warn("newLavorazione", e);
try {
if(tr!=null)
tr.rollback();
} catch (Throwable ex) {
logger.error("newLavorazione_SES", ex);
throw new RemoteException(ex.getMessage());
}
throw new RemoteException(e.getMessage());
}
finally{
em.close();
if(!err)
if(Server.isDebugFine())
tracerDelegate.setEndCall(serv, "");
}
}
}
public TMesFiltriOperazione cercaOperazioni(userInfo ui,Salvatore em,TMesFiltriOperazione input) throws Exception
{
{
/*START_GEN_CODE:wBYa2f61xwqZ9557:-638084956*/
return null;
/*STOP_GEN_CODE:wBYa2f61xwqZ9557*/
}
}
public TMesFiltriOperazione cercaOperazioni(userInfo ui,TMesFiltriOperazione input) throws RemoteException
{
{
int serv=0;
boolean err=false;
if(Server.isDebugFine())
serv=tracerDelegate.addCall("cercaOperazioni", "server", "");
Salvatore em = getSalvatore();
Transaction tr=null;
try
{
tr=em.getTransaction();
TMesFiltriOperazione out= cercaOperazioni(ui,em,input);
tr.commit();
if(Server.isAuto_detach())
return TMesFiltriOperazione.detach(out);
else
return out;
}
catch (Throwable e)
{
err=true;
if(Server.isDebugFine())
tracerDelegate.setEndCallError(serv,e.getMessage(),-1,-1);
logger.warn("cercaOperazioni", e);
try {
if(tr!=null)
tr.rollback();
} catch (Throwable ex) {
logger.error("cercaOperazioni_SES", ex);
throw new RemoteException(ex.getMessage());
}
throw new RemoteException(e.getMessage());
}
finally{
em.close();
if(!err)
if(Server.isDebugFine())
tracerDelegate.setEndCall(serv, "");
}
}
}
}