net.anotheria.anosite.gen.assitedata.action.NewPageTemplateAction Maven / Gradle / Ivy
/**
********************************************************************************
*** NewPageTemplateAction.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.assitedata.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.assitedata.bean.EditPageTemplateFB;
import net.anotheria.asg.util.helper.cmsview.CMSViewHelperUtil;
import net.anotheria.asg.util.helper.cmsview.CMSViewHelperRegistry;
import net.anotheria.webutils.bean.LabelValueBean;
public class NewPageTemplateAction extends ShowPageTemplatesAction{
public ActionCommand anoDocExecute(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception{
EditPageTemplateFB form = new EditPageTemplateFB() ;
form.setId("");
//link layout to ASLayoutData.PageLayout
List pagelayouts = getASLayoutDataService().getPageLayouts();
List pagelayoutsValues = new ArrayList(pagelayouts.size()+1);
pagelayoutsValues.add(new LabelValueBean("", "-----"));
for (net.anotheria.anosite.gen.aslayoutdata.data.PageLayout pagelayout : pagelayouts){
LabelValueBean bean = new LabelValueBean(pagelayout.getId(), pagelayout.getName() );
pagelayoutsValues.add(bean);
}
form.setLayoutCollection(pagelayoutsValues);
//link site to ASSiteData.Site
List sites = getASSiteDataService().getSites();
List sitesValues = new ArrayList(sites.size()+1);
sitesValues.add(new LabelValueBean("", "-----"));
for (net.anotheria.anosite.gen.assitedata.data.Site site : sites){
LabelValueBean bean = new LabelValueBean(site.getId(), site.getName() );
sitesValues.add(bean);
}
form.setSiteCollection(sitesValues);
addBeanToRequest(req, "EditASSiteDataPageTemplateForm" , form);
addBeanToRequest(req, "save.label.prefix", "Save");
addBeanToRequest(req, "apply.label.prefix" , "Apply");
addBeanToRequest(req, "transfer.label.prefix", "Transfer");
addBeanToRequest(req, "objectInfoString" , "none");
addFieldExplanations(req, null);
return mapping.success();
} //
}