Package net.sourceforge.pebble.permalink

Examples of net.sourceforge.pebble.permalink.DefaultPermalinkProvider


      Class<?> c = Class.forName(getPermalinkProviderName());
      setPermalinkProvider(instantiate(c.asSubclass(PermalinkProvider.class)));
    } catch (Exception e) {
      error("Could not load permalink provider \"" + getPermalinkProviderName() + "\"");
      e.printStackTrace();
      setPermalinkProvider(new DefaultPermalinkProvider());
    }

    // load categories
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
View Full Code Here


      Class<?> c = Class.forName(getPermalinkProviderName());
      setPermalinkProvider(instantiate(c.asSubclass(PermalinkProvider.class)));
    } catch (Exception e) {
      error("Could not load permalink provider \"" + getPermalinkProviderName() + "\"");
      e.printStackTrace();
      setPermalinkProvider(new DefaultPermalinkProvider());
    }

    // load categories
    try {
      DAOFactory factory = DAOFactory.getConfiguredFactory();
View Full Code Here

      } else {
        matchOnPermalinkProvider(url, blog.getPermalinkProvider());

        if (getName() == null) {
          // try with the default permalink provider
          DefaultPermalinkProvider defaultPermalinkProvider = new DefaultPermalinkProvider();
          defaultPermalinkProvider.setBlog(blog);
          matchOnPermalinkProvider(url, defaultPermalinkProvider);
        }
      }
    }
View Full Code Here

   * @return    the URI to used to service the original request (could be
   *            the same)
   */
  public String getUri(String uri, Blog blog) {
    PermalinkProvider permalinkProvider = blog.getPermalinkProvider();
    DefaultPermalinkProvider defaultPermalinkProvider = new DefaultPermalinkProvider();
    defaultPermalinkProvider.setBlog(permalinkProvider.getBlog());

    log.trace("URI before transformation : " + uri);

    if (uri == null || uri.trim().equals("")) {
      uri = "/";
View Full Code Here

    assertEquals("/viewBlogEntry.action?entry=" + blogEntry.getId(), transformer.getUri(blog.getPermalinkProvider().getPermalink(blogEntry), blog));
  }

  public void testBlogEntryFallsBackToDefaultPermalinkProvider() throws Exception {
    DefaultPermalinkProvider defaultProvider = new DefaultPermalinkProvider();
    defaultProvider.setBlog(blog);
    blog.setPermalinkProvider(new TitlePermalinkProvider());

    BlogService service = new BlogService();
    BlogEntry blogEntry = new BlogEntry(blog);
    blogEntry.setTitle("Some title");
    service.putBlogEntry(blogEntry);

    assertEquals("/viewBlogEntry.action?entry=" + blogEntry.getId(), transformer.getUri(defaultProvider.getPermalink(blogEntry), blog));
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.permalink.DefaultPermalinkProvider

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.