All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anosite.gen.assitedata.action.MultiOpPageTemplatesScriptsAction Maven / Gradle / Ivy

The newest version!
/**
 ********************************************************************************
 *** MultiOpPageTemplatesScriptsAction.java                                   ***
 *** generated by AnoSiteGenerator (ASG), Version: 4.2.2                      ***
 *** Copyright (C) 2005 - 2025 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 java.util.List;
import java.util.ArrayList;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import net.anotheria.maf.action.ActionCommand;
import net.anotheria.maf.action.ActionMapping;
import net.anotheria.anosite.gen.assitedata.data.PageTemplateFactory;
import net.anotheria.anosite.gen.assitedata.data.PageTemplate;
import net.anotheria.anosite.gen.assitedata.bean.ScriptsElementFB;
import net.anotheria.asg.util.bean.PopulateUtility;
import net.anotheria.anosite.gen.assitedata.bean.ScriptsQuickAddFB;
import net.anotheria.anosite.gen.assitedata.data.Script;
import net.anotheria.anosite.gen.assitedata.data.ScriptSortType;
import net.anotheria.asg.util.bean.LabelValueBean;
import net.anotheria.anodoc.data.NoSuchDocumentException;
import net.anotheria.util.StringUtils;
import net.anotheria.asg.exception.ASGRuntimeException;

public class MultiOpPageTemplatesScriptsAction extends BasePageTemplateAction{

	// Generated by: class net.anotheria.asg.generator.view.action.ModuleActionsGenerator.generateContainerMultiOpAction

	public ActionCommand anoDocExecute(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception{
		String path = stripPath(mapping.getPath());
		if (path.equals("assitedataPageTemplateScriptsShow"))
			return assitedataPageTemplateScriptsShow(mapping, req, res);
		if (path.equals("assitedataPageTemplateScriptsAdd"))
			return assitedataPageTemplateScriptsAdd(mapping, req, res);
		if (path.equals("assitedataPageTemplateScriptsDelete"))
			return assitedataPageTemplateScriptsDelete(mapping, req, res);
		if (path.equals("assitedataPageTemplateScriptsMove"))
			return assitedataPageTemplateScriptsMove(mapping, req, res);
		if (path.equals("assitedataPageTemplateScriptsQuickAdd"))
			return assitedataPageTemplateScriptsQuickAdd(mapping, req, res);
		throw new IllegalArgumentException("Unknown path: "+path);
	}

	// Generated by: class net.anotheria.asg.generator.view.action.ModuleActionsGenerator.generateListShowActionMethod

	public ActionCommand assitedataPageTemplateScriptsShow(ActionMapping mapping, HttpServletRequest req, HttpServletResponse res) throws Exception{
		String id = getStringParameter(req, "ownerId");
		PageTemplate pagetemplate = getASSiteDataService().getPageTemplate(id);
		addBeanToRequest(req, "ownerId", id);
		checkPageTemplates(pagetemplate, req);

		ScriptsElementFB form = new ScriptsElementFB() ;
		form.setPosition(-1);
		form.setOwnerId(pagetemplate.getId());
		addBeanToRequest(req, "assitedataPageTemplateScriptsElementForm", form);

		ScriptsQuickAddFB quickAddForm = new ScriptsQuickAddFB() ;
		quickAddForm.setOwnerId(pagetemplate.getId());
		addBeanToRequest(req, "assitedataPageTemplateScriptsQuickAddForm", quickAddForm);


		//link scripts to ASSiteData.Script
		List