//# 0 errors, 98 messages
//#
/*
    //#CustomPingTargets.java:1:1: class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
 * 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.editor;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.business.pings.PingTargetManager;
import org.apache.roller.weblogger.config.PingConfig;
import org.apache.roller.weblogger.pojos.WeblogPermission;
import org.apache.roller.weblogger.ui.struts2.common.PingTargetsBase;


/**
 * Action for managing weblog custom ping targets.
 */
public class CustomPingTargets extends PingTargetsBase {
    
    private static Log log = LogFactory.getLog(CustomPingTargets.class);
    //#CustomPingTargets.java:36: method: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init
    //#CustomPingTargets.java:36: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets]
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.delete()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.deleteConfirm()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.execute()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getLogger()Lorg/apache/commons/logging/Log;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getPingTarget()Lorg/apache/roller/weblogger/pojos/PingTarget;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getPingTargetId()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getPingTargets()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.isWeblogRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.loadPingTargets()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.myPrepare()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.requiredWeblogPermissions()S
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.setPingTarget(Lorg/apache/roller/weblogger/pojos/PingTarget;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.setPingTargetId(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.setPingTargets(Ljava/util/List;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): log
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets]
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.delete()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.delete
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.deleteConfirm()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.deleteConfirm
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.execute()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.execute
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getLogger()Lorg/apache/commons/logging/Log; == &getLogger
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getPingTarget()Lorg/apache/roller/weblogger/pojos/PingTarget; == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.getPingTarget
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getPingTargetId()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.getPingTargetId
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.getPingTargets()Ljava/util/List; == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.getPingTargets
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.isWeblogRequired()Z == &isWeblogRequired
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.loadPingTargets()V == &loadPingTargets
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.myPrepare()V == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.myPrepare
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.requiredWeblogPermissions()S == &requiredWeblogPermissions
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.setPingTarget(Lorg/apache/roller/weblogger/pojos/PingTarget;)V == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.setPingTarget
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.setPingTargetId(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.setPingTargetId
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): __Dispatch_Table.setPingTargets(Ljava/util/List;)V == &org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.setPingTargets
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init): init'ed(log)
    //#CustomPingTargets.java:36: end of method: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets__static_init
    
    
    public CustomPingTargets() {
    //#CustomPingTargets.java:39: method: void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()
    //#input(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.java.util.Collections.EMPTY_LIST
    //#input(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.actionName
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.desiredMenu
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pageTitle
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pingTarget
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pingTargetId
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pingTargets
    //#presumption(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): init'ed(org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.java.util.Collections.EMPTY_LIST)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.actionName == &"customPingTargets"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.desiredMenu == &"editor"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pageTitle == &"customPingTargets.customPingTargets"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pingTarget == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pingTargetId == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): this.pingTargets == org/apache/roller/weblogger/ui/struts2/common/PingTargetsBase.java.util.Collections.EMPTY_LIST
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): init'ed(this.pingTargets)
    //#unanalyzed(void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.util.UIAction
        this.actionName = "customPingTargets";
        this.desiredMenu = "editor";
        this.pageTitle = "customPingTargets.customPingTargets";
    }
    //#CustomPingTargets.java:43: end of method: void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets()
    
    
    // no weblog required
    public boolean isWeblogRequired() {
        return true;
    //#CustomPingTargets.java:48: method: bool org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.isWeblogRequired()
    //#output(bool isWeblogRequired()): return_value
    //#post(bool isWeblogRequired()): return_value == 1
    //#CustomPingTargets.java:48: end of method: bool org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.isWeblogRequired()
    }
    
    public short requiredWeblogPermissions() {
        return WeblogPermission.ADMIN;
    //#CustomPingTargets.java:52: method: short org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.requiredWeblogPermissions()
    //#input(short requiredWeblogPermissions()): org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#output(short requiredWeblogPermissions()): return_value
    //#presumption(short requiredWeblogPermissions()): init'ed(org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN)
    //#post(short requiredWeblogPermissions()): return_value == org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#post(short requiredWeblogPermissions()): (soft) init'ed(return_value)
    //#CustomPingTargets.java:52: end of method: short org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.requiredWeblogPermissions()
    }
    
    
    protected Log getLogger() {
        return log;
    //#CustomPingTargets.java:57: method: Log org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.getLogger()
    //#input(Log getLogger()): log
    //#output(Log getLogger()): return_value
    //#pre[1] (Log getLogger()): init'ed(log)
    //#post(Log getLogger()): return_value == log
    //#post(Log getLogger()): init'ed(return_value)
    //#CustomPingTargets.java:57: end of method: Log org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.getLogger()
    }
    
    
    public void loadPingTargets() {
        
        if(!PingConfig.getDisallowCustomTargets()) try {
    //#CustomPingTargets.java:63: method: void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.loadPingTargets()
    //#CustomPingTargets.java:63: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.PingConfig:getDisallowCustomTargets()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: void loadPingTargets()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.PingConfig:getDisallowCustomTargets()
    //#input(void loadPingTargets()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets]
    //#input(void loadPingTargets()): __Descendant_Table[others]
    //#input(void loadPingTargets()): __Dispatch_Table.setPingTargets(Ljava/util/List;)V
    //#input(void loadPingTargets()): log
    //#input(void loadPingTargets()): this
    //#input(void loadPingTargets()): this.__Tag
    //#output(void loadPingTargets()): this.pingTargets
    //#pre[1] (void loadPingTargets()): (soft) log != null
    //#pre[4] (void loadPingTargets()): (soft) this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CustomPingTargets
    //#presumption(void loadPingTargets()): org.apache.roller.weblogger.business.Weblogger:getPingTargetManager(...)@64 != null
    //#presumption(void loadPingTargets()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@64 != null
    //#post(void loadPingTargets()): possibly_updated(this.pingTargets)
    //#test_vector(void loadPingTargets()): org.apache.roller.weblogger.config.PingConfig:getDisallowCustomTargets(...)@63: {1}, {0}
            PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
    //#CustomPingTargets.java:64: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: void loadPingTargets()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CustomPingTargets.java:64: Warning: method not available
    //#    -- call on PingTargetManager org.apache.roller.weblogger.business.Weblogger:getPingTargetManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: void loadPingTargets()
    //#    unanalyzed callee: PingTargetManager org.apache.roller.weblogger.business.Weblogger:getPingTargetManager()
            setPingTargets(pingTargetMgr.getCustomPingTargets(getActionWeblog()));
    //#CustomPingTargets.java:65: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets:getActionWeblog()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: void loadPingTargets()
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets:getActionWeblog()
    //#CustomPingTargets.java:65: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.pings.PingTargetManager:getCustomPingTargets(Weblog)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: void loadPingTargets()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.pings.PingTargetManager:getCustomPingTargets(Weblog)
        } catch (WebloggerException ex) {
            log.error("Error loading common ping targets", ex);
    //#CustomPingTargets.java:67: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: void loadPingTargets()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("Error loading common ping targets");
    //#CustomPingTargets.java:69: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
    //#    method: void loadPingTargets()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets:addError(String)
        }
    }
    //#CustomPingTargets.java:71: end of method: void org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets.loadPingTargets()
    
}
    //#CustomPingTargets.java:: end of class: org.apache.roller.weblogger.ui.struts2.editor.CustomPingTargets
