Package net.sourceforge.pebble

Examples of net.sourceforge.pebble.PluginProperties


     * @param context the context in which the decoration is running
     * @param blogEntry the blog entry to be decorated
     */
    public void decorate(ContentDecoratorContext context, BlogEntry blogEntry) {
        Blog blog = blogEntry.getBlog();
        PluginProperties props = blog.getPluginProperties();
        String suffix;
        synchronized(props) {
            suffix = props.getProperty(SUFFIX);
        }

        if (suffix != null && suffix.trim().length() > 0) {
            Map<String,String> map = new HashMap();
            map.put("blogEntry.title", blogEntry.getTitle());
View Full Code Here


      * @param request the HttpServletRequest used in the confirmation
      */
     public void setupConfirmation(HttpServletRequest request) {
          
           Blog blog = (Blog)request.getAttribute(Constants.BLOG_KEY);
           PluginProperties props = blog.getPluginProperties();
          
           boolean keySuccess = true;
          
           if (!props.hasProperty(RECAPTCHA_PUBLIC_KEY)) {
               keySuccess = false;
               log.error("failed to retrieve reCAPTCHA public API key");
           }
           if (!props.hasProperty(RECAPTCHA_PRIVATE_KEY)) {
               keySuccess = false;
               log.error("failed to retrieve reCAPTCHA private API key");
           }
          
           if (keySuccess) {
               String publicKey = props.getProperty(RECAPTCHA_PUBLIC_KEY);
               String privateKey = props.getProperty(RECAPTCHA_PRIVATE_KEY);
        
               ReCaptcha c = ReCaptchaFactory.newReCaptcha(publicKey, privateKey, false);
          
               request.getSession().setAttribute(CHALLENGE, c.createRecaptchaHtml(null, null));
           } else {
View Full Code Here

     public boolean isConfirmed(HttpServletRequest request) {
        
           String remoteAddr = request.getRemoteAddr();
          
           Blog blog = (Blog)request.getAttribute(Constants.BLOG_KEY);
           PluginProperties props = blog.getPluginProperties();
          
           if (!props.hasProperty(RECAPTCHA_PRIVATE_KEY)) {
               log.error("failed to retrieve reCAPTCHA private API key");
               return false;
           }
          
           String privateKey = props.getProperty(RECAPTCHA_PRIVATE_KEY);
            
           ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
           reCaptcha.setPrivateKey(privateKey);

           String challenge = request.getParameter("recaptcha_challenge_field");
View Full Code Here

  /**
   *
   */
  public void run() {
    try {
      PluginProperties props = blog.getPluginProperties();
      XmlRpcClient xmlrpc = new XmlRpcClient(props.getProperty(getPropertyPrefix() + XMLRPC_URL_KEY));
      Vector<Object> params = new Vector<Object>();
      params.add(props.getProperty(getPropertyPrefix() + BLOG_KEY));
      params.add(props.getProperty(getPropertyPrefix() + USERNAME_KEY));
      params.add(props.getProperty(getPropertyPrefix() + PASSWORD_KEY));

      int numberOfBlogEntries = 10;
      try {
        numberOfBlogEntries = Integer.parseInt(props.getProperty(getPropertyPrefix() + BLOG_ENTRIES_KEY));
      } catch (NumberFormatException nfe) {
        // do nothing, the value has already been defaulted
      }
      params.add(numberOfBlogEntries);

View Full Code Here

   *
   * @param comment the Comment being confirmed
   * @return true if the comment should be confirmed, false otherwise
   */
  public boolean confirmationRequired(Comment comment) {
    PluginProperties props = comment.getBlogEntry().getBlog().getPluginProperties();
    String required = props.getProperty(REQUIRED_KEY);

    Blog blog = comment.getBlogEntry().getBlog();
    if (SecurityUtils.isUserAuthorisedForBlog(blog)) {
      return false;
    } else {
View Full Code Here

  }
 
  private String getProperty(BlogEntry blogEntry, String property) {
    Blog blog = blogEntry.getBlog();
    String blogName = blog.getName();
    PluginProperties pluginProperties = blog.getPluginProperties();
    String result = pluginProperties.getProperty("twitter." + blogName + "." + property);
    if(result == null) {
      result = pluginProperties.getProperty("twitter." + property);
      if(result == null) {
        log.error("Twitter credentials (" + property + ") not found. Please configure twitter." + property + " in order to post to twitter");
      } else {
        log.debug("found twitter credentials in twitter." + property );
      }
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.PluginProperties

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.