// inherit doc public void execute( Context context, Parameters parameters, MVCContext mvcContext, TemplatingContext templatingContext, HttpContext httpContext, CoralSession coralSession) throws ProcessingException { try { long periodicalId = parameters.getLong("periodical_id"); PeriodicalResource periodical = null; periodical = PeriodicalResourceImpl.getPeriodicalResource(coralSession, periodicalId); templatingContext.put("periodical", periodical); String recipient = null; if (periodical instanceof EmailPeriodicalResource) { templatingContext.put("isEmail", true); EmailPeriodicalsRootResource emailRoot = (EmailPeriodicalsRootResource) periodical.getParent(); recipient = emailRoot.getPreviewRecipient(); if (recipient != null && recipient.trim().length() == 0) { recipient = null; } templatingContext.put("recipient", recipient); } List<FileResource> results = periodicalsService.publishNow( coralSession, periodical, false, recipient != null, recipient); templatingContext.put("results", results); mvcContext.setView("periodicals.PreviewPeriodical"); } catch (Exception e) { templatingContext.put("result", "exception"); templatingContext.put("trace", new StackTrace(e)); } }
/* overriden */ public void execute( Context context, Parameters parameters, MVCContext mvcContext, TemplatingContext templatingContext, HttpContext httpContext, CoralSession coralSession) throws ProcessingException { String skin = parameters.get("skin"); String app = parameters.get("appName"); String screen = parameters.get("screenName"); String variant = parameters.get("variant", "Default"); String state = parameters.get("state", "Default"); ApplicationResource appRes = integrationService.getApplication(coralSession, app); ScreenResource screenRes = integrationService.getScreen(coralSession, appRes, screen); try { skinService.deleteScreenTemplate( coralSession, getSite(context), skin, screenRes.getApplicationName(), screenRes.getScreenName(), variant, state); } catch (Exception e) { templatingContext.put("result", "exception"); templatingContext.put("trace", new StackTrace(e)); } if (templatingContext.containsKey("result")) { mvcContext.setView("appearance.skin.DeletedScreenTemplate"); } else { templatingContext.put("result", "deleted_successfully"); } }