Package net.sourceforge.pebble.web.view.impl

Examples of net.sourceforge.pebble.web.view.impl.StaticPageFormView


    if (staticPage == null) {
      return new NotFoundView();
    } else {
      getModel().put(Constants.STATIC_PAGE_KEY, staticPage);
      if (service.lock(staticPage)) {
        return new StaticPageFormView();
      } else {
        return new StaticPageLockedView();
      }
    }
  }
View Full Code Here


    staticPage.setBody("<p>\n\n</p>");
    staticPage.setAuthor(SecurityUtils.getUsername());

    getModel().put(Constants.STATIC_PAGE_KEY, staticPage);

    return new StaticPageFormView();
  }
View Full Code Here

    ValidationContext validationContext = new ValidationContext();
    staticPage.validate(validationContext);
    getModel().put("validationContext", validationContext);
    getModel().put(Constants.STATIC_PAGE_KEY, staticPage);

    return new StaticPageFormView();
  }
View Full Code Here

    ValidationContext validationContext = new ValidationContext();
    staticPage.validate(validationContext);

    if (validationContext.hasErrors())  {
      getModel().put("validationContext", validationContext);
      return new StaticPageFormView();
    } else {
      try {
        service.putStaticPage(staticPage);
        staticPage.getBlog().info("Static page <a href=\"" + staticPage.getLocalPermalink() + "\">" + staticPage.getTitle() + "</a> saved.");
        service.unlock(staticPage);
        return new RedirectView(staticPage.getLocalPermalink());
      } catch (StaticPageServiceException e) {
        log.error(e.getMessage(), e);

        return new StaticPageFormView();
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.web.view.impl.StaticPageFormView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.