//# 0 errors, 49 messages
//#
/*
    //#UIActionPrepareInterceptor.java:1:1: class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
 * Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  The ASF licenses this file to You
 * under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.  For additional information regarding
 * copyright in this work, please see the NOTICE file in the top level
 * directory of this distribution.
 */

package org.apache.roller.weblogger.ui.struts2.util;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


/**
 * A struts2 interceptor for doing custom prepare logic.
 */
public class UIActionPrepareInterceptor extends AbstractInterceptor {
    //#UIActionPrepareInterceptor.java:31: method: void org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor.org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor()
    //#UIActionPrepareInterceptor.java:31: Warning: method not available
    //#    -- call on void com.opensymphony.xwork2.interceptor.AbstractInterceptor()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: void org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor()
    //#    unanalyzed callee: void com.opensymphony.xwork2.interceptor.AbstractInterceptor()
    //#input(void org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor()): this
    //#UIActionPrepareInterceptor.java:31: end of method: void org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor.org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor()
    
    private static Log log = LogFactory.getLog(UIActionPrepareInterceptor.class);
    //#UIActionPrepareInterceptor.java:33: method: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor.org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init
    //#UIActionPrepareInterceptor.java:33: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/util/UIActionPrepareInterceptor]
    //#output(org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init): __Dispatch_Table.intercept(Lcom/opensymphony/xwork2/ActionInvocation;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init): log
    //#post(org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/util/UIActionPrepareInterceptor] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init): __Dispatch_Table.intercept(Lcom/opensymphony/xwork2/ActionInvocation;)Ljava/lang/String; == &intercept
    //#post(org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init): init'ed(log)
    //#UIActionPrepareInterceptor.java:33: end of method: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor.org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor__static_init
    
    
    public String intercept(ActionInvocation invocation) throws Exception {
        
        log.debug("Entering UIActionPrepareInterceptor");
    //#UIActionPrepareInterceptor.java:38: method: String org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor.intercept(ActionInvocation)
    //#UIActionPrepareInterceptor.java:38: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: String intercept(ActionInvocation)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
    //#input(String intercept(ActionInvocation)): invocation
    //#input(String intercept(ActionInvocation)): log
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/editor/TemplateRemove.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/editor/Templates.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/editor/WeblogRemove.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIAction.__Dispatch_Table.myPrepare()V
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/TemplateRemove]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/WeblogRemove]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/util/UIAction]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[others]
    //#input(String intercept(ActionInvocation)): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Dispatch_Table.myPrepare()V
    //#output(String intercept(ActionInvocation)): return_value
    //#pre[1] (String intercept(ActionInvocation)): invocation != null
    //#pre[2] (String intercept(ActionInvocation)): log != null
    //#post(String intercept(ActionInvocation)): init'ed(return_value)
        
        final Object action = invocation.getAction();
    //#UIActionPrepareInterceptor.java:40: Warning: method not available
    //#    -- call on Object com.opensymphony.xwork2.ActionInvocation:getAction()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: String intercept(ActionInvocation)
    //#    unanalyzed callee: Object com.opensymphony.xwork2.ActionInvocation:getAction()
        final ActionContext context = invocation.getInvocationContext();
    //#UIActionPrepareInterceptor.java:41: Warning: unused assignment
    //#    unused assignment into context
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: String intercept(ActionInvocation)
    //#UIActionPrepareInterceptor.java:41: Warning: method not available
    //#    -- call on ActionContext com.opensymphony.xwork2.ActionInvocation:getInvocationContext()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: String intercept(ActionInvocation)
    //#    unanalyzed callee: ActionContext com.opensymphony.xwork2.ActionInvocation:getInvocationContext()
        
        // is this one of our own UIAction classes?
        if (action instanceof UIActionPreparable) {
            
            log.debug("action is UIActionPreparable, calling myPrepare() method");
    //#UIActionPrepareInterceptor.java:46: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: String intercept(ActionInvocation)
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            
            UIActionPreparable theAction = (UIActionPreparable) action;
            theAction.myPrepare();
    //#UIActionPrepareInterceptor.java:49: Warning: call too complex - analysis skipped
    //#    -- call on void myPrepare()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: String intercept(ActionInvocation)
    //#    unanalyzed callee: void myPrepare()
        }
        
        return invocation.invoke();
    //#UIActionPrepareInterceptor.java:52: Warning: method not available
    //#    -- call on String com.opensymphony.xwork2.ActionInvocation:invoke()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
    //#    method: String intercept(ActionInvocation)
    //#    unanalyzed callee: String com.opensymphony.xwork2.ActionInvocation:invoke()
    //#UIActionPrepareInterceptor.java:52: end of method: String org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor.intercept(ActionInvocation)
    }
    
}
    //#UIActionPrepareInterceptor.java:: end of class: org.apache.roller.weblogger.ui.struts2.util.UIActionPrepareInterceptor
