net.anotheria.anosite.gen.asresourcedata.action.EditPdfTemplateAction Maven / Gradle / Ivy
/**
********************************************************************************
*** EditPdfTemplateAction.java ***
*** generated by AnoSiteGenerator (ASG), Version: 3.2.2 ***
*** Copyright (C) 2005 - 2023 Anotheria.net, www.anotheria.net ***
*** All Rights Reserved. ***
********************************************************************************
*** Don't edit this code, if you aren't sure ***
*** that you do exactly know what you are doing! ***
*** It's better to invest time in the generator, as into the generated code. ***
********************************************************************************
*/
package net.anotheria.anosite.gen.asresourcedata.action;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import net.anotheria.maf.action.ActionCommand;
import net.anotheria.maf.action.ActionMapping;
import java.util.List;
import java.util.ArrayList;
import net.anotheria.anosite.gen.asresourcedata.bean.EditPdfTemplateFB;
import net.anotheria.anosite.gen.asresourcedata.data.PdfTemplate;
import net.anotheria.asg.data.MultilingualObject;
import net.anotheria.asg.data.LockableObject;
public class EditPdfTemplateAction extends ShowPdfTemplatesAction{
// Generated by: class net.anotheria.asg.generator.view.action.ModuleActionsGenerator.generateEditAction
// Generated by: class net.anotheria.asg.generator.view.action.ModuleActionsGenerator.generateEditActionMethod
public ActionCommand anoDocExecute(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception{
String id = getStringParameter(req, PARAM_ID);
EditPdfTemplateFB form = new EditPdfTemplateFB() ;
PdfTemplate pdftemplate = getASResourceDataService().getPdfTemplate(id);
checkPdfTemplates(pdftemplate, req);
if(pdftemplate instanceof LockableObject && !((LockableObject)pdftemplate).isLocked() && isAutoLockingEnabled())
lockPdfTemplates(pdftemplate, req);
form.setId(pdftemplate.getId());
form.setName(pdftemplate.getName());
form.setShowPageNumbers(pdftemplate.getShowPageNumbers());
form.setApplyBackgroundStyles(pdftemplate.getApplyBackgroundStyles());
form.setHeaderMargin(pdftemplate.getHeaderMargin());
form.setHeaderTemplateEN(pdftemplate.getHeaderTemplateEN());
form.setHeaderTemplateDE(pdftemplate.getHeaderTemplateDE());
form.setFooterMargin(pdftemplate.getFooterMargin());
form.setFooterTemplateEN(pdftemplate.getFooterTemplateEN());
form.setFooterTemplateDE(pdftemplate.getFooterTemplateDE());
form.setContentTemplateEN(pdftemplate.getContentTemplateEN());
form.setContentTemplateDE(pdftemplate.getContentTemplateDE());
// localizations is a table, storing size only
form.setLocalizations(pdftemplate.getLocalizationsSize());
form.setMultilingualInstanceDisabled(((MultilingualObject)pdftemplate).isMultilingualDisabledInstance());
form.setLocked(((LockableObject)pdftemplate).isLocked());
form.setLockerId(((LockableObject)pdftemplate).getLockerId());
form.setLockingTime(net.anotheria.util.NumberUtils.makeISO8601TimestampString(((LockableObject)pdftemplate).getLockingTime()) + " automatic unlock expected AT : " + net.anotheria.util.NumberUtils.makeISO8601TimestampString(((LockableObject)pdftemplate).getLockingTime() + getLockingTimeout()));
addBeanToRequest(req, "objectId" , pdftemplate.getId());
addBeanToRequest(req, "EditASResourceDataPdfTemplateForm" , form);
addBeanToRequest(req, "objectInfoString" , pdftemplate.getObjectInfo().toString());
addBeanToRequest(req, "apply.label.prefix", "Apply");
addBeanToRequest(req, "save.label.prefix", "Save");
addBeanToRequest(req, "transfer.label.prefix", "Transfer");
addFieldExplanations(req, pdftemplate);
return mapping.success();
}
}