net.anotheria.anosite.gen.asresourcedata.action.EditPushNotificationTemplateAction Maven / Gradle / Ivy
/**
********************************************************************************
*** EditPushNotificationTemplateAction.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.EditPushNotificationTemplateFB;
import net.anotheria.anosite.gen.asresourcedata.data.PushNotificationTemplate;
import net.anotheria.asg.data.MultilingualObject;
import net.anotheria.asg.data.LockableObject;
public class EditPushNotificationTemplateAction extends ShowPushNotificationTemplatesAction{
// 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);
EditPushNotificationTemplateFB form = new EditPushNotificationTemplateFB() ;
PushNotificationTemplate pushnotificationtemplate = getASResourceDataService().getPushNotificationTemplate(id);
checkPushNotificationTemplates(pushnotificationtemplate, req);
if(pushnotificationtemplate instanceof LockableObject && !((LockableObject)pushnotificationtemplate).isLocked() && isAutoLockingEnabled())
lockPushNotificationTemplates(pushnotificationtemplate, req);
form.setId(pushnotificationtemplate.getId());
form.setName(pushnotificationtemplate.getName());
form.setMessageEN(pushnotificationtemplate.getMessageEN());
form.setMessageDE(pushnotificationtemplate.getMessageDE());
// localizations is a table, storing size only
form.setLocalizations(pushnotificationtemplate.getLocalizationsSize());
form.setMultilingualInstanceDisabled(((MultilingualObject)pushnotificationtemplate).isMultilingualDisabledInstance());
form.setLocked(((LockableObject)pushnotificationtemplate).isLocked());
form.setLockerId(((LockableObject)pushnotificationtemplate).getLockerId());
form.setLockingTime(net.anotheria.util.NumberUtils.makeISO8601TimestampString(((LockableObject)pushnotificationtemplate).getLockingTime()) + " automatic unlock expected AT : " + net.anotheria.util.NumberUtils.makeISO8601TimestampString(((LockableObject)pushnotificationtemplate).getLockingTime() + getLockingTimeout()));
addBeanToRequest(req, "objectId" , pushnotificationtemplate.getId());
addBeanToRequest(req, "EditASResourceDataPushNotificationTemplateForm" , form);
addBeanToRequest(req, "objectInfoString" , pushnotificationtemplate.getObjectInfo().toString());
addBeanToRequest(req, "apply.label.prefix", "Apply");
addBeanToRequest(req, "save.label.prefix", "Save");
addBeanToRequest(req, "transfer.label.prefix", "Transfer");
addFieldExplanations(req, pushnotificationtemplate);
return mapping.success();
}
}