net.anotheria.anosite.gen.ascustomdata.action.EditCustomBoxHandlerDefAction Maven / Gradle / Ivy
/**
********************************************************************************
*** EditCustomBoxHandlerDefAction.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.ascustomdata.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.ascustomdata.bean.EditCustomBoxHandlerDefFB;
import net.anotheria.anosite.gen.ascustomdata.data.CustomBoxHandlerDef;
import net.anotheria.asg.data.LockableObject;
public class EditCustomBoxHandlerDefAction extends ShowCustomBoxHandlerDefsAction{
// 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);
EditCustomBoxHandlerDefFB form = new EditCustomBoxHandlerDefFB() ;
CustomBoxHandlerDef customboxhandlerdef = getASCustomDataService().getCustomBoxHandlerDef(id);
checkCustomBoxHandlerDefs(customboxhandlerdef, req);
if(customboxhandlerdef instanceof LockableObject && !((LockableObject)customboxhandlerdef).isLocked() && isAutoLockingEnabled())
lockCustomBoxHandlerDefs(customboxhandlerdef, req);
form.setId(customboxhandlerdef.getId());
form.setName(customboxhandlerdef.getName());
form.setClazz(customboxhandlerdef.getClazz());
form.setLocked(((LockableObject)customboxhandlerdef).isLocked());
form.setLockerId(((LockableObject)customboxhandlerdef).getLockerId());
form.setLockingTime(net.anotheria.util.NumberUtils.makeISO8601TimestampString(((LockableObject)customboxhandlerdef).getLockingTime()) + " automatic unlock expected AT : " + net.anotheria.util.NumberUtils.makeISO8601TimestampString(((LockableObject)customboxhandlerdef).getLockingTime() + getLockingTimeout()));
addBeanToRequest(req, "objectId" , customboxhandlerdef.getId());
addBeanToRequest(req, "EditASCustomDataCustomBoxHandlerDefForm" , form);
addBeanToRequest(req, "objectInfoString" , customboxhandlerdef.getObjectInfo().toString());
addBeanToRequest(req, "apply.label.prefix", "Apply");
addBeanToRequest(req, "save.label.prefix", "Save");
addBeanToRequest(req, "transfer.label.prefix", "Transfer");
addFieldExplanations(req, customboxhandlerdef);
return mapping.success();
}
}