protected void deleteLayoutPrototypes(ActionRequest actionRequest) throws Exception { long[] layoutPrototypeIds = StringUtil.split(ParamUtil.getString(actionRequest, "layoutPrototypeIds"), 0L); for (long layoutPrototypeId : layoutPrototypeIds) { LayoutPrototypeServiceUtil.deleteLayoutPrototype(layoutPrototypeId); } }
protected void updateLayoutPrototype(ActionRequest actionRequest) throws Exception { long layoutPrototypeId = ParamUtil.getLong(actionRequest, "layoutPrototypeId"); Map<Locale, String> nameMap = LocalizationUtil.getLocalizationMap(actionRequest, "name"); String description = ParamUtil.getString(actionRequest, "description"); boolean active = ParamUtil.getBoolean(actionRequest, "active"); if (layoutPrototypeId <= 0) { // Add layout prototoype LayoutPrototypeServiceUtil.addLayoutPrototype(nameMap, description, active); } else { // Update layout prototoype LayoutPrototypeServiceUtil.updateLayoutPrototype( layoutPrototypeId, nameMap, description, active); } }