/** * @see de.ingrid.portal.portlets.admin.ContentPortlet#processAction(javax.portlet.ActionRequest, * javax.portlet.ActionResponse) */ public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException { if (request.getParameter(PARAMV_ACTION_DB_DO_SAVE) != null) { AdminCMSForm f = (AdminCMSForm) Utils.getActionForm(request, AdminCMSForm.SESSION_KEY, AdminCMSForm.class); f.clear(); f.clearMessages(); // call sub method doActionSave(request); response.setRenderParameter(Settings.PARAM_ACTION, PARAMV_ACTION_DB_DO_SAVE); response.setRenderParameter("cmd", "action processed"); } else if (request.getParameter(PARAMV_ACTION_DB_DO_UPDATE) != null) { AdminCMSForm f = (AdminCMSForm) Utils.getActionForm(request, AdminCMSForm.SESSION_KEY, AdminCMSForm.class); f.clear(); f.clearMessages(); // call sub method doActionUpdate(request); response.setRenderParameter(Settings.PARAM_ACTION, PARAMV_ACTION_DB_DO_UPDATE); response.setRenderParameter("cmd", "action processed"); } else { super.processAction(request, response); } }
/** * @see de.ingrid.portal.portlets.admin.ContentPortlet#doActionDelete(javax.portlet.ActionRequest) */ protected void doActionDelete(ActionRequest request) { Session session = HibernateUtil.currentSession(); Long[] ids = ContentPortlet.convertIds(getIds(request)); for (int i = 0; i < ids.length; i++) { IngridCMS cmsEntry = (IngridCMS) session.load(dbEntityClass, ids[i]); UtilsDB.deleteDBObject(cmsEntry); } }
/** @see javax.portlet.Portlet#init(javax.portlet.PortletConfig) */ public void init(PortletConfig config) throws PortletException { super.init(config); // set specific stuff in mother class psmlPage = "/portal/administration/admin-cms.psml"; viewDefault = "/WEB-INF/templates/administration/admin_cms_browser.vm"; viewEdit = "/WEB-INF/templates/administration/admin_cms_edit.vm"; viewNew = "/WEB-INF/templates/administration/admin_cms_edit.vm"; dbEntityClass = IngridCMS.class; viewTitleKey = "admin.title.content"; }