//# 0 errors, 90 messages
//#
package net.sourceforge.pebble.web.action;
    //#generatetrackbacklinkaction.java:1:1: class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction

import net.sourceforge.pebble.Constants;
import net.sourceforge.pebble.api.confirmation.TrackBackConfirmationStrategy;
import net.sourceforge.pebble.domain.*;
import net.sourceforge.pebble.web.view.NotFoundView;
import net.sourceforge.pebble.web.view.View;
import net.sourceforge.pebble.web.view.impl.ConfirmTrackBackView;
import net.sourceforge.pebble.web.view.impl.TrackBackLinkView;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Generates a TrackBack link for a blog entry.
 *
 * @author    Simon Brown
 */
public class GenerateTrackBackLinkAction extends AbstractTrackBackAction {
    //#generatetrackbacklinkaction.java:22: method: void net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction.net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction()
    //#input(void net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction()): this
    //#unanalyzed(void net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction()): Effects-of-calling:net.sourceforge.pebble.web.action.Action
    //#generatetrackbacklinkaction.java:22: end of method: void net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction.net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction()

  /** the log used by this class */
  private static Log log = LogFactory.getLog(GenerateTrackBackLinkAction.class);
    //#generatetrackbacklinkaction.java:25: method: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction.net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init
    //#generatetrackbacklinkaction.java:25: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction]
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.generateTrackBackLink(Lnet/sourceforge/pebble/domain/BlogEntry;)V
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.getLocalizedString(Ljava/lang/String;)Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lnet/sourceforge/pebble/web/view/View;
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.setModel(Lnet/sourceforge/pebble/web/model/Model;)V
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): log
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): net/sourceforge/pebble/web/action/AbstractTrackBackAction.__Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction]
    //#output(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): net/sourceforge/pebble/web/action/Action.__Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction]
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): net/sourceforge/pebble/web/action/AbstractTrackBackAction.__Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): net/sourceforge/pebble/web/action/Action.__Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.generateTrackBackLink(Lnet/sourceforge/pebble/domain/BlogEntry;)V == &net/sourceforge/pebble/web/action/AbstractTrackBackAction.generateTrackBackLink
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.getLocalizedString(Ljava/lang/String;)Ljava/lang/String; == &net/sourceforge/pebble/web/action/Action.getLocalizedString
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model; == &net/sourceforge/pebble/web/action/Action.getModel
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.process(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)Lnet/sourceforge/pebble/web/view/View; == &process
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): __Dispatch_Table.setModel(Lnet/sourceforge/pebble/web/model/Model;)V == &net/sourceforge/pebble/web/action/Action.setModel
    //#post(net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init): init'ed(log)
    //#generatetrackbacklinkaction.java:25: end of method: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction.net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction__static_init

  /**
   * Peforms the processing associated with this action.
   *
   * @param request  the HttpServletRequest instance
   * @param response the HttpServletResponse instance
   * @return the name of the next view
   */
  public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
    //#generatetrackbacklinkaction.java:35: method: View net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction.process(HttpServletRequest, HttpServletResponse)
    //#input(View process(HttpServletRequest, HttpServletResponse)): __Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction]
    //#input(View process(HttpServletRequest, HttpServletResponse)): __Descendant_Table[others]
    //#input(View process(HttpServletRequest, HttpServletResponse)): __Dispatch_Table.generateTrackBackLink(Lnet/sourceforge/pebble/domain/BlogEntry;)V
    //#input(View process(HttpServletRequest, HttpServletResponse)): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/action/AbstractTrackBackAction.__Descendant_Table[net/sourceforge/pebble/web/action/AbstractTrackBackAction]
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/action/AbstractTrackBackAction.__Descendant_Table[net/sourceforge/pebble/web/action/ConfirmTrackBackAction]
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/action/AbstractTrackBackAction.__Descendant_Table[net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction]
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/action/AbstractTrackBackAction.__Descendant_Table[others]
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/action/AbstractTrackBackAction.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/action/ConfirmTrackBackAction.__Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/model/Model.__Descendant_Table[net/sourceforge/pebble/web/model/Model]
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/model/Model.__Descendant_Table[others]
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/model/Model.__Dispatch_Table.get(Ljava/lang/String;)Ljava/lang/Object;
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/web/model/Model.__Dispatch_Table.put(Ljava/lang/String;Ljava/lang/Object;)V
    //#input(View process(HttpServletRequest, HttpServletResponse)): request
    //#input(View process(HttpServletRequest, HttpServletResponse)): this
    //#input(View process(HttpServletRequest, HttpServletResponse)): this.__Tag
    //#input(View process(HttpServletRequest, HttpServletResponse)): this.model
    //#input(View process(HttpServletRequest, HttpServletResponse)): this.model.__Tag
    //#input(View process(HttpServletRequest, HttpServletResponse)): this.model.data
    //#output(View process(HttpServletRequest, HttpServletResponse)): new ConfirmTrackBackView(process#5) num objects
    //#output(View process(HttpServletRequest, HttpServletResponse)): new NotFoundView(process#3) num objects
    //#output(View process(HttpServletRequest, HttpServletResponse)): new NotFoundView(process#4) num objects
    //#output(View process(HttpServletRequest, HttpServletResponse)): new TrackBackLinkView(process#6) num objects
    //#output(View process(HttpServletRequest, HttpServletResponse)): return_value
    //#new obj(View process(HttpServletRequest, HttpServletResponse)): new ConfirmTrackBackView(process#5)
    //#new obj(View process(HttpServletRequest, HttpServletResponse)): new NotFoundView(process#3)
    //#new obj(View process(HttpServletRequest, HttpServletResponse)): new NotFoundView(process#4)
    //#new obj(View process(HttpServletRequest, HttpServletResponse)): new TrackBackLinkView(process#6)
    //#pre[1] (View process(HttpServletRequest, HttpServletResponse)): request != null
    //#pre[3] (View process(HttpServletRequest, HttpServletResponse)): this.__Tag == net/sourceforge/pebble/web/action/GenerateTrackBackLinkAction
    //#pre[4] (View process(HttpServletRequest, HttpServletResponse)): this.model != null
    //#pre[5] (View process(HttpServletRequest, HttpServletResponse)): this.model.__Tag == net/sourceforge/pebble/web/model/Model
    //#pre[6] (View process(HttpServletRequest, HttpServletResponse)): this.model.data != null
    //#presumption(View process(HttpServletRequest, HttpServletResponse)): java.util.HashMap:get(...)@63 != null
    //#presumption(View process(HttpServletRequest, HttpServletResponse)): javax.servlet.http.HttpServletRequest:getSession(...)@57 != null
    //#presumption(View process(HttpServletRequest, HttpServletResponse)): net.sourceforge.pebble.domain.Blog:getTrackBackConfirmationStrategy(...)@54 != null
    //#post(View process(HttpServletRequest, HttpServletResponse)): return_value in Addr_Set{&new TrackBackLinkView(process#6),&new ConfirmTrackBackView(process#5),&new NotFoundView(process#4),&new NotFoundView(process#3)}
    //#post(View process(HttpServletRequest, HttpServletResponse)): new ConfirmTrackBackView(process#5) num objects <= 1
    //#post(View process(HttpServletRequest, HttpServletResponse)): new NotFoundView(process#3) num objects <= 1
    //#post(View process(HttpServletRequest, HttpServletResponse)): new NotFoundView(process#4) num objects <= 1
    //#post(View process(HttpServletRequest, HttpServletResponse)): new TrackBackLinkView(process#6) num objects <= 1
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:getModel
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:java.util.HashMap:get
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:java.util.HashMap:put
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:net.sourceforge.pebble.domain.BlogEntry:getTrackBackLink
    //#test_vector(View process(HttpServletRequest, HttpServletResponse)): net.sourceforge.pebble.api.confirmation.TrackBackConfirmationStrategy:confirmationRequired(...)@56: {0}, {1}
    //#test_vector(View process(HttpServletRequest, HttpServletResponse)): net.sourceforge.pebble.domain.BlogEntry:isTrackBacksEnabled(...)@49: {1}, {0}
    //#test_vector(View process(HttpServletRequest, HttpServletResponse)): net.sourceforge.pebble.domain.BlogService:getBlogEntry(...)@41: Inverse{null}, Addr_Set{null}
    BlogEntry blogEntry;

    String entry = request.getParameter("entry");
    BlogService service = new BlogService();
    //#generatetrackbacklinkaction.java:39: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.domain.BlogService()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void net.sourceforge.pebble.domain.BlogService()
    try {
      blogEntry = service.getBlogEntry(blog, entry);
    //#generatetrackbacklinkaction.java:41: Warning: method not available
    //#    -- call on BlogEntry net.sourceforge.pebble.domain.BlogService:getBlogEntry(Blog, String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: BlogEntry net.sourceforge.pebble.domain.BlogService:getBlogEntry(Blog, String)
    } catch (BlogServiceException e) {
      throw new ServletException(e);
    }
    if (blogEntry == null) {
      // just send back a 404 - this is probably somebody looking for a way
      // to send comment spam ;-)
      return new NotFoundView();
    //#generatetrackbacklinkaction.java:48: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.web.view.NotFoundView()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void net.sourceforge.pebble.web.view.NotFoundView()
    } else if (!blogEntry.isTrackBacksEnabled()) {
    //#generatetrackbacklinkaction.java:49: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.domain.BlogEntry:isTrackBacksEnabled()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: bool net.sourceforge.pebble.domain.BlogEntry:isTrackBacksEnabled()
      return new NotFoundView();
    //#generatetrackbacklinkaction.java:50: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.web.view.NotFoundView()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void net.sourceforge.pebble.web.view.NotFoundView()
    }
    getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);

    TrackBackConfirmationStrategy strategy = blog.getTrackBackConfirmationStrategy();
    //#generatetrackbacklinkaction.java:54: Warning: method not available
    //#    -- call on TrackBackConfirmationStrategy net.sourceforge.pebble.domain.Blog:getTrackBackConfirmationStrategy()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: TrackBackConfirmationStrategy net.sourceforge.pebble.domain.Blog:getTrackBackConfirmationStrategy()

    if (strategy.confirmationRequired(blog)) {
    //#generatetrackbacklinkaction.java:56: Warning: method not available
    //#    -- call on bool net.sourceforge.pebble.api.confirmation.TrackBackConfirmationStrategy:confirmationRequired(Blog)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: bool net.sourceforge.pebble.api.confirmation.TrackBackConfirmationStrategy:confirmationRequired(Blog)
      ((LogFactory) request.getSession()).setAttribute(BLOG_ENTRY_ID, blogEntry.getId());
    //#generatetrackbacklinkaction.java:57: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.domain.BlogEntry:getId()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: String net.sourceforge.pebble.domain.BlogEntry:getId()
    //#generatetrackbacklinkaction.java:57: Warning: method not available
    //#    -- call on void org.apache.commons.logging.LogFactory:setAttribute(String, Object)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void org.apache.commons.logging.LogFactory:setAttribute(String, Object)
      strategy.setupConfirmation(request);
    //#generatetrackbacklinkaction.java:58: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.api.confirmation.TrackBackConfirmationStrategy:setupConfirmation(HttpServletRequest)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void net.sourceforge.pebble.api.confirmation.TrackBackConfirmationStrategy:setupConfirmation(HttpServletRequest)
      return new ConfirmTrackBackView();
    //#generatetrackbacklinkaction.java:59: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.web.view.impl.ConfirmTrackBackView()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void net.sourceforge.pebble.web.view.impl.ConfirmTrackBackView()
    } else {
      generateTrackBackLink(blogEntry);
      return new TrackBackLinkView();
    //#generatetrackbacklinkaction.java:62: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.web.view.impl.TrackBackLinkView()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
    //#    method: View process(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void net.sourceforge.pebble.web.view.impl.TrackBackLinkView()
    //#generatetrackbacklinkaction.java:62: end of method: View net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction.process(HttpServletRequest, HttpServletResponse)
    }
  }

}
    //#generatetrackbacklinkaction.java:: end of class: net.sourceforge.pebble.web.action.GenerateTrackBackLinkAction
