//# 0 errors, 76 messages
//#
package net.sourceforge.pebble.web.action;
    //#resetthemeaction.java:1:1: class: net.sourceforge.pebble.web.action.ResetThemeAction
    //#resetthemeaction.java:1:1: method: net.sourceforge.pebble.web.action.ResetThemeAction.net.sourceforge.pebble.web.action.ResetThemeAction__static_init

import net.sourceforge.pebble.web.security.RequireSecurityToken;
import net.sourceforge.pebble.web.view.View;
import net.sourceforge.pebble.web.view.ForwardView;
import net.sourceforge.pebble.domain.Blog;
import net.sourceforge.pebble.Constants;
import net.sourceforge.pebble.util.Utilities;

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

/**
 * Resets the theme associated with a blog back to "default".
 *
 * @author    Simon Brown
 */
@RequireSecurityToken
public class ResetThemeAction extends SecureAction {
    //#resetthemeaction.java:20: method: void net.sourceforge.pebble.web.action.ResetThemeAction.net.sourceforge.pebble.web.action.ResetThemeAction()
    //#input(void net.sourceforge.pebble.web.action.ResetThemeAction()): this
    //#resetthemeaction.java:20: end of method: void net.sourceforge.pebble.web.action.ResetThemeAction.net.sourceforge.pebble.web.action.ResetThemeAction()

  /**
   * 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);
    //#resetthemeaction.java:30: method: View net.sourceforge.pebble.web.action.ResetThemeAction.process(HttpServletRequest, HttpServletResponse)
    //#input(View process(HttpServletRequest, HttpServletResponse)): __Descendant_Table[net/sourceforge/pebble/web/action/ResetThemeAction]
    //#input(View process(HttpServletRequest, HttpServletResponse)): __Descendant_Table[others]
    //#input(View process(HttpServletRequest, HttpServletResponse)): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#input(View process(HttpServletRequest, HttpServletResponse)): net/sourceforge/pebble/util/Utilities.log
    //#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)): 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 ForwardView(process#1) num objects
    //#output(View process(HttpServletRequest, HttpServletResponse)): return_value.__Tag
    //#output(View process(HttpServletRequest, HttpServletResponse)): return_value.uri
    //#output(View process(HttpServletRequest, HttpServletResponse)): return_value
    //#new obj(View process(HttpServletRequest, HttpServletResponse)): new ForwardView(process#1)
    //#pre[2] (View process(HttpServletRequest, HttpServletResponse)): this.__Tag == net/sourceforge/pebble/web/action/ResetThemeAction
    //#pre[3] (View process(HttpServletRequest, HttpServletResponse)): this.model != null
    //#pre[4] (View process(HttpServletRequest, HttpServletResponse)): this.model.__Tag == net/sourceforge/pebble/web/model/Model
    //#pre[5] (View process(HttpServletRequest, HttpServletResponse)): this.model.data != null
    //#presumption(View process(HttpServletRequest, HttpServletResponse)): java.util.HashMap:get(...)@63 != null
    //#post(View process(HttpServletRequest, HttpServletResponse)): return_value == &new ForwardView(process#1)
    //#post(View process(HttpServletRequest, HttpServletResponse)): new ForwardView(process#1) num objects == 1
    //#post(View process(HttpServletRequest, HttpServletResponse)): return_value.__Tag == net/sourceforge/pebble/web/view/ForwardView
    //#post(View process(HttpServletRequest, HttpServletResponse)): return_value.uri == &".reloadBlog.secureaction"
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:java.util.HashMap:get
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:org.apache.commons.logging.Log:info
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:removeProperty
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:net.sourceforge.pebble.domain.Blog:storeProperties
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:net.sourceforge.pebble.domain.BlogServiceException:printStackTrace
    //#unanalyzed(View process(HttpServletRequest, HttpServletResponse)): Effects-of-calling:net.sourceforge.pebble.web.view.View
    Utilities.resetTheme(blog);
    return new ForwardView("/reloadBlog.secureaction");
    //#resetthemeaction.java:32: end of method: View net.sourceforge.pebble.web.action.ResetThemeAction.process(HttpServletRequest, HttpServletResponse)
  }

  /**
   * Gets a list of all roles that are allowed to access this action.
   *
   * @return  an array of Strings representing role names
   * @param request
   */
  public String[] getRoles(HttpServletRequest request) {
    return new String[]{Constants.BLOG_OWNER_ROLE, Constants.BLOG_ADMIN_ROLE};
    //#resetthemeaction.java:42: method: String[] net.sourceforge.pebble.web.action.ResetThemeAction.getRoles(HttpServletRequest)
    //#input(String[] getRoles(HttpServletRequest)): net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE
    //#input(String[] getRoles(HttpServletRequest)): net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
    //#output(String[] getRoles(HttpServletRequest)): new String[](getRoles#1) num objects
    //#output(String[] getRoles(HttpServletRequest)): return_value.length
    //#output(String[] getRoles(HttpServletRequest)): return_value[0]
    //#output(String[] getRoles(HttpServletRequest)): return_value[1]
    //#output(String[] getRoles(HttpServletRequest)): return_value
    //#new obj(String[] getRoles(HttpServletRequest)): new String[](getRoles#1)
    //#presumption(String[] getRoles(HttpServletRequest)): init'ed(net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE)
    //#presumption(String[] getRoles(HttpServletRequest)): init'ed(net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE)
    //#post(String[] getRoles(HttpServletRequest)): return_value == &new String[](getRoles#1)
    //#post(String[] getRoles(HttpServletRequest)): new String[](getRoles#1) num objects == 1
    //#post(String[] getRoles(HttpServletRequest)): return_value.length == 2
    //#post(String[] getRoles(HttpServletRequest)): return_value[0] == net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
    //#post(String[] getRoles(HttpServletRequest)): (soft) init'ed(return_value[0])
    //#post(String[] getRoles(HttpServletRequest)): return_value[1] == net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE
    //#post(String[] getRoles(HttpServletRequest)): (soft) init'ed(return_value[1])
    //#resetthemeaction.java:42: end of method: String[] net.sourceforge.pebble.web.action.ResetThemeAction.getRoles(HttpServletRequest)
  }

}
    //#output(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Descendant_Table[net/sourceforge/pebble/web/action/ResetThemeAction]
    //#output(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Dispatch_Table.getLocalizedString(Ljava/lang/String;)Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model;
    //#output(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Dispatch_Table.getRoles(Ljavax/servlet/http/HttpServletRequest;)[Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.action.ResetThemeAction__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.ResetThemeAction__static_init): __Dispatch_Table.setModel(Lnet/sourceforge/pebble/web/model/Model;)V
    //#output(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): net/sourceforge/pebble/web/action/Action.__Descendant_Table[net/sourceforge/pebble/web/action/ResetThemeAction]
    //#output(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): net/sourceforge/pebble/web/action/SecureAction.__Descendant_Table[net/sourceforge/pebble/web/action/ResetThemeAction]
    //#post(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Descendant_Table[net/sourceforge/pebble/web/action/ResetThemeAction] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): net/sourceforge/pebble/web/action/Action.__Descendant_Table[net/sourceforge/pebble/web/action/ResetThemeAction] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): net/sourceforge/pebble/web/action/SecureAction.__Descendant_Table[net/sourceforge/pebble/web/action/ResetThemeAction] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Dispatch_Table.getLocalizedString(Ljava/lang/String;)Ljava/lang/String; == &net/sourceforge/pebble/web/action/Action.getLocalizedString
    //#post(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Dispatch_Table.getModel()Lnet/sourceforge/pebble/web/model/Model; == &net/sourceforge/pebble/web/action/Action.getModel
    //#post(net.sourceforge.pebble.web.action.ResetThemeAction__static_init): __Dispatch_Table.getRoles(Ljavax/servlet/http/HttpServletRequest;)[Ljava/lang/String; == &getRoles
    //#post(net.sourceforge.pebble.web.action.ResetThemeAction__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.ResetThemeAction__static_init): __Dispatch_Table.setModel(Lnet/sourceforge/pebble/web/model/Model;)V == &net/sourceforge/pebble/web/action/Action.setModel
    //#resetthemeaction.java:: end of method: net.sourceforge.pebble.web.action.ResetThemeAction.net.sourceforge.pebble.web.action.ResetThemeAction__static_init
    //#resetthemeaction.java:: end of class: net.sourceforge.pebble.web.action.ResetThemeAction
