Package net.sourceforge.pebble.api.event.blogentry

Examples of net.sourceforge.pebble.api.event.blogentry.BlogEntryListener


    log.debug("Registering blog entry listeners");

    for (String className : getBlogEntryListeners()) {
      try {
        Class<?> c = Class.forName(className.trim());
        BlogEntryListener listener = instantiate(c.asSubclass(BlogEntryListener.class));
        eventListenerList.addBlogEntryListener(listener);
      } catch (Exception e) {
        error("Could not start blog entry listener \"" + className + "\" - check the class name is correct on the <a href=\"viewPlugins.secureaction#blogEntryListeners\">plugins page</a>.");
        log.error("Blog entry listener " + className + " could not be registered", e);
      }
View Full Code Here


    log.debug("Registering blog entry listeners");

    for (String className : getBlogEntryListeners()) {
      try {
        Class<?> c = Class.forName(className.trim());
        BlogEntryListener listener = instantiate(c.asSubclass(BlogEntryListener.class));
        eventListenerList.addBlogEntryListener(listener);
      } catch (Exception e) {
        error("Could not start blog entry listener \"" + className + "\" - check the class name is correct on the <a href=\"viewPlugins.secureaction#blogEntryListeners\">plugins page</a>.");
        log.error("Blog entry listener " + className + " could not be registered", e);
      }
View Full Code Here

   * @param event   the BlogEntryEvent instance
   */
  public void fireBlogEntryEvent(BlogEntryEvent event) {
    Iterator it = getEventListenerList().getBlogEntryListeners().iterator();
    while (it.hasNext()) {
      BlogEntryListener listener = (BlogEntryListener)it.next();
      if (event.getType() == BlogEntryEvent.BLOG_ENTRY_ADDED) {
        listener.blogEntryAdded(event);
      } else if (event.getType() == BlogEntryEvent.BLOG_ENTRY_REMOVED) {
        listener.blogEntryRemoved(event);
      } else if (event.getType() == BlogEntryEvent.BLOG_ENTRY_CHANGED) {
        listener.blogEntryChanged(event);
      } else if (event.getType() == BlogEntryEvent.BLOG_ENTRY_PUBLISHED) {
        listener.blogEntryPublished(event);
      } else if (event.getType() == BlogEntryEvent.BLOG_ENTRY_UNPUBLISHED) {
        listener.blogEntryUnpublished(event);
      }

      // has the event been vetoed?
      if (event.isVetoed()) {
        break;
View Full Code Here

  public void testListenersFiredWhenBlogEntryPublished() throws Exception {
    final StringBuffer buf = new StringBuffer("123");
    blogEntry.setPublished(false);
    service.putBlogEntry(blogEntry);

    BlogEntryListener listener = new BlogEntryListener() {
      public void blogEntryAdded(BlogEntryEvent event) {
        fail();
      }

      public void blogEntryRemoved(BlogEntryEvent event) {
View Full Code Here

  public void testListenersFiredWhenBlogEntryUnpublished() throws Exception {
    final StringBuffer buf = new StringBuffer("123");
    blogEntry.setPublished(true);
    service.putBlogEntry(blogEntry);

    BlogEntryListener listener = new BlogEntryListener() {
      public void blogEntryAdded(BlogEntryEvent event) {
        fail();
      }

      public void blogEntryRemoved(BlogEntryEvent event) {
View Full Code Here

    BlogService service = new BlogService();
    service.putBlogEntry(blogEntry);

    final StringBuffer buf = new StringBuffer("123");

    BlogEntryListener listener = new BlogEntryListener() {
      public void blogEntryAdded(BlogEntryEvent event) {
        fail();
      }

      public void blogEntryRemoved(BlogEntryEvent event) {
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.api.event.blogentry.BlogEntryListener

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.