Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2019 Consiglio Nazionale delle Ricerche
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
/*
* Created on Sep 20, 2005
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package it.cnr.contab.config00.bp;
import java.rmi.RemoteException;
import it.cnr.contab.config00.bulk.Parametri_cnrBulk;
import it.cnr.contab.config00.ejb.Parametri_livelli_epComponentSession;
import it.cnr.contab.config00.pdcep.bulk.Voce_epHome;
import it.cnr.contab.config00.pdcep.cla.bulk.Parametri_livelli_epBulk;
import it.cnr.contab.utenze00.bp.CNRUserContext;
import it.cnr.jada.DetailedRuntimeException;
import it.cnr.jada.UserContext;
import it.cnr.jada.action.ActionContext;
import it.cnr.jada.action.BusinessProcessException;
import it.cnr.jada.bulk.OggettoBulk;
import it.cnr.jada.comp.ComponentException;
import it.cnr.jada.persistency.IntrospectionException;
import it.cnr.jada.persistency.PersistencyException;
public class CRUDConfigParametriLivelliEPBP extends it.cnr.jada.util.action.SimpleCRUDBP {
private boolean isEcoDisabled=false;
private boolean isPatDisabled=false;
/**
* Primo costruttore della classe CRUDConfigParametriCnrBP.
*/
public CRUDConfigParametriLivelliEPBP() {
super();
}
/**
* Secondo costruttore della classe CRUDConfigParametriCnrBP.
* @param String function
*/
public CRUDConfigParametriLivelliEPBP(String function) {
super(function);
}
public OggettoBulk initializeModelForInsert(ActionContext actioncontext, OggettoBulk oggettobulk) throws BusinessProcessException {
((Parametri_livelli_epBulk)oggettobulk).setEsercizio(CNRUserContext.getEsercizio(actioncontext.getUserContext()));
return super.initializeModelForInsert(actioncontext, oggettobulk);
}
protected void initialize(ActionContext actioncontext) throws BusinessProcessException {
super.initialize(actioncontext);
Parametri_livelli_epComponentSession sessione = (Parametri_livelli_epComponentSession) createComponentSession();
try {
Parametri_livelli_epBulk parLivBulk = sessione.getParametriLivelli(actioncontext.getUserContext(), CNRUserContext.getEsercizio(actioncontext.getUserContext()));
if (parLivBulk != null) {
isEcoDisabled = !this.isParametriLivelliEcoEnabled(actioncontext.getUserContext(), parLivBulk);
isPatDisabled = !this.isParametriLivelliPatEnabled(actioncontext.getUserContext(), parLivBulk);
this.setModel(actioncontext, parLivBulk);
this.setStatus(it.cnr.jada.util.action.FormController.EDIT);
}
} catch (DetailedRuntimeException e) {
throw handleException(e);
} catch (ComponentException e) {
throw handleException(e);
} catch (RemoteException e) {
throw handleException(e);
}
}
public boolean isParametriLivelliPatEnabled(UserContext userContext, Parametri_livelli_epBulk parLiv) throws it.cnr.jada.action.BusinessProcessException {
try {
Parametri_livelli_epComponentSession sessione = (Parametri_livelli_epComponentSession) createComponentSession();
return sessione.isParametriLivelliPatEnabled(userContext, parLiv);
} catch (BusinessProcessException e) {
throw handleException(e);
} catch (DetailedRuntimeException e) {
throw handleException(e);
} catch (ComponentException e) {
throw handleException(e);
} catch (RemoteException e) {
throw handleException(e);
}
}
public boolean isParametriLivelliEcoEnabled(UserContext userContext, Parametri_livelli_epBulk parLiv) throws it.cnr.jada.action.BusinessProcessException {
try {
Parametri_livelli_epComponentSession sessione = (Parametri_livelli_epComponentSession) createComponentSession();
return sessione.isParametriLivelliEcoEnabled(userContext, parLiv);
} catch (BusinessProcessException e) {
throw handleException(e);
} catch (DetailedRuntimeException e) {
throw handleException(e);
} catch (ComponentException e) {
throw handleException(e);
} catch (RemoteException e) {
throw handleException(e);
}
}
public boolean isSearchButtonHidden() {
return true;
}
public boolean isFreeSearchButtonHidden() {
return true;
}
public boolean isNewButtonHidden() {
return true;
}
public boolean isDeleteButtonEnabled() {
return !isEcoDisabled||!isPatDisabled;
}
public boolean isSaveButtonEnabled() {
return !isEcoDisabled||!isPatDisabled;
}
/**
* Genera l'HTML per disegnare nell'interfaccia utente una tabella che presenta nelle righe le funzioni e nelle
* colonne i tipi CDS; inoltre, se il modello passato come parametro e' valorizzato, inizializza le celle
* di questa tabella con i dati presenti nel modello.
*/
public void writeTable(javax.servlet.jsp.JspWriter out, Parametri_livelli_epBulk parLiv) throws java.io.IOException, PersistencyException , it.cnr.jada.comp.ApplicationException, IntrospectionException
{
out.println("
");
out.print("
");
out.print("
");
out.println("
");
writeTableHeader( out, Voce_epHome.ECONOMICA, parLiv);
if (parLiv.getLivelli_eco() != null && parLiv.getLivelli_eco().intValue()>0) {
for (int i=1;i<=8;i++) {
writeTableRow( out, Voce_epHome.ECONOMICA, i , parLiv );
}
}
out.println("
");
out.print("
");
out.print("
");
out.println("
");
writeTableHeader( out, Voce_epHome.PATRIMONIALE, parLiv);
if (parLiv.getLivelli_pat() != null && parLiv.getLivelli_pat().intValue()>0) {
for (int i=1;i<=8;i++) {
writeTableRow( out, Voce_epHome.PATRIMONIALE, i , parLiv );
}
}
out.println("