示例#1
0
 @Override
 public void process(TemplatingContext templatingContext) throws ProcessingException {
   RequestParameters parameters = RequestParameters.getRequestParameters(context);
   super.process(templatingContext);
   if (parameters.get("exportType").equals("full") || parameters.get("exportType").equals("xml")) {
     templatingContext.put("recordDetails", recordDetailsExport);
     templatingContext.put("dateConverter", new PatternDateConverter("yyyyMMdd"));
   }
   if (parameters.get("exportType").equals("xml")) {
     HttpContext httpContext = HttpContext.getHttpContext(context);
     httpContext.setContentType("application/xml");
   }
 }
 public void prepareDefault(Context context) throws ProcessingException {
   Parameters parameters = RequestParameters.getRequestParameters(context);
   CoralSession coralSession = (CoralSession) context.getAttribute(CoralSession.class);
   HttpContext httpContext = HttpContext.getHttpContext(context);
   I18nContext i18nContext = I18nContext.getI18nContext(context);
   TemplatingContext templatingContext = TemplatingContext.getTemplatingContext(context);
   SiteResource site = getSite();
   try {
     templatingContext.put("styles", Arrays.asList(styleService.getStyles(coralSession, site)));
     long parent_node_id = parameters.getLong("parent_node_id", -1);
     if (parent_node_id == -1) {
       templatingContext.put("parent_node", getHomePage());
     } else {
       templatingContext.put(
           "parent_node",
           NavigationNodeResourceImpl.getNavigationNodeResource(coralSession, parent_node_id));
     }
   } catch (Exception e) {
     throw new ProcessingException("Screen Error " + e);
   }
 }