//# 1 errors, 211 messages
//#
/*
    //#MainMenu.java:1:1: class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
 * 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.core;

import java.util.Collections;
import java.util.List;
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.UserManager;
import org.apache.roller.weblogger.pojos.WeblogPermission;
import org.apache.roller.weblogger.pojos.User;
import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.roller.weblogger.ui.struts2.util.UIAction;


/**
 * Allows user to view and pick from list of his/her websites.
 */
public class MainMenu extends UIAction {
    
    private static Log log = LogFactory.getLog(MainMenu.class);
    //#MainMenu.java:39: method: org.apache.roller.weblogger.ui.struts2.core.MainMenu.org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init
    //#MainMenu.java:39: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/MainMenu]
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.accept()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.decline()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.execute()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getExistingPermissions()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getInviteId()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getPendingPermissions()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getWebsiteId()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.isWeblogRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.resign()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.setInviteId(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.setWebsiteId(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): log
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/MainMenu] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.accept()Ljava/lang/String; == &accept
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.decline()Ljava/lang/String; == &decline
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.execute()Ljava/lang/String; == &execute
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getExistingPermissions()Ljava/util/List; == &getExistingPermissions
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getInviteId()Ljava/lang/String; == &getInviteId
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getPendingPermissions()Ljava/util/List; == &getPendingPermissions
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.getWebsiteId()Ljava/lang/String; == &getWebsiteId
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.isWeblogRequired()Z == &isWeblogRequired
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.resign()Ljava/lang/String; == &resign
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.setInviteId(Ljava/lang/String;)V == &setInviteId
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): __Dispatch_Table.setWebsiteId(Ljava/lang/String;)V == &setWebsiteId
    //#post(org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init): init'ed(log)
    //#MainMenu.java:39: end of method: org.apache.roller.weblogger.ui.struts2.core.MainMenu.org.apache.roller.weblogger.ui.struts2.core.MainMenu__static_init
    
    private String websiteId = null;
    private String inviteId = null;
    
    
    public MainMenu() {
    //#MainMenu.java:45: method: void org.apache.roller.weblogger.ui.struts2.core.MainMenu.org.apache.roller.weblogger.ui.struts2.core.MainMenu()
    //#MainMenu.java:45: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: void org.apache.roller.weblogger.ui.struts2.core.MainMenu()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#input(void org.apache.roller.weblogger.ui.struts2.core.MainMenu()): this
    //#output(void org.apache.roller.weblogger.ui.struts2.core.MainMenu()): this.inviteId
    //#output(void org.apache.roller.weblogger.ui.struts2.core.MainMenu()): this.pageTitle
    //#output(void org.apache.roller.weblogger.ui.struts2.core.MainMenu()): this.websiteId
    //#post(void org.apache.roller.weblogger.ui.struts2.core.MainMenu()): this.inviteId == null
    //#post(void org.apache.roller.weblogger.ui.struts2.core.MainMenu()): this.websiteId == null
    //#post(void org.apache.roller.weblogger.ui.struts2.core.MainMenu()): this.pageTitle == &"yourWebsites.title"
        this.pageTitle = "yourWebsites.title";
    }
    //#MainMenu.java:47: end of method: void org.apache.roller.weblogger.ui.struts2.core.MainMenu.org.apache.roller.weblogger.ui.struts2.core.MainMenu()
    
    
    // override default security, we do not require an action weblog
    public boolean isWeblogRequired() {
        return false;
    //#MainMenu.java:52: method: bool org.apache.roller.weblogger.ui.struts2.core.MainMenu.isWeblogRequired()
    //#output(bool isWeblogRequired()): return_value
    //#post(bool isWeblogRequired()): return_value == 0
    //#MainMenu.java:52: end of method: bool org.apache.roller.weblogger.ui.struts2.core.MainMenu.isWeblogRequired()
    }
    
    
    public String execute() {
        
        return SUCCESS;
    //#MainMenu.java:58: method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.execute()
    //#output(String execute()): return_value
    //#post(String execute()): return_value == &"success"
    //#MainMenu.java:58: end of method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.execute()
    }
    
    
    public String accept() {
        
        try {
            UserManager userMgr = WebloggerFactory.getWeblogger().getUserManager();
    //#MainMenu.java:65: method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.accept()
    //#MainMenu.java:65: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:65: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#input(String accept()): "Error handling invitation accept - "._tainted
    //#input(String accept()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/MainMenu]
    //#input(String accept()): __Descendant_Table[others]
    //#input(String accept()): __Dispatch_Table.getInviteId()Ljava/lang/String;
    //#input(String accept()): log
    //#input(String accept()): this
    //#input(String accept()): this.__Tag
    //#input(String accept()): this.inviteId
    //#input(String accept()): this.inviteId._tainted
    //#output(String accept()): return_value
    //#pre[3] (String accept()): this.__Tag == org/apache/roller/weblogger/ui/struts2/core/MainMenu
    //#pre[4] (String accept()): init'ed(this.inviteId)
    //#pre[1] (String accept()): (soft) log != null
    //#presumption(String accept()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@65 != null
    //#presumption(String accept()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@65 != null
    //#presumption(String accept()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@72 != null
    //#presumption(String accept()): org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite(...)@74 != null
    //#post(String accept()): return_value == &"success"
    //#test_vector(String accept()): org.apache.roller.weblogger.business.UserManager:getPermissions(...)@66: Addr_Set{null}, Inverse{null}
            WeblogPermission perms = userMgr.getPermissions(getInviteId());
    //#MainMenu.java:66: Warning: method not available
    //#    -- call on WeblogPermission org.apache.roller.weblogger.business.UserManager:getPermissions(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: WeblogPermission org.apache.roller.weblogger.business.UserManager:getPermissions(String)
            if (perms != null) {        
                // TODO ROLLER_2.0: notify inviter that invitee has accepted invitation
                // TODO EXCEPTIONS: better exception handling
                perms.setPending(false);
    //#MainMenu.java:70: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogPermission:setPending(bool)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogPermission:setPending(bool)
                userMgr.savePermissions(perms);
    //#MainMenu.java:71: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.UserManager:savePermissions(WeblogPermission)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.UserManager:savePermissions(WeblogPermission)
                WebloggerFactory.getWeblogger().flush();
    //#MainMenu.java:72: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:72: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:flush()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:flush()

                addMessage("yourWebsites.accepted", perms.getWebsite().getHandle());
    //#MainMenu.java:74: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite()
    //#MainMenu.java:74: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#MainMenu.java:74: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addMessage(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addMessage(String, String)
            } else {
                addError("yourWebsites.permNotFound");
    //#MainMenu.java:76: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
            }
        } catch (WebloggerException ex) {
            log.error("Error handling invitation accept - "+getInviteId(), ex);
    //#MainMenu.java:79: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("invite accept failed.");
    //#MainMenu.java:81: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String accept()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
        }
        
        return SUCCESS;
    //#MainMenu.java:84: end of method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.accept()
    }
    
    
    public String decline() {
        
        try {
            UserManager userMgr = WebloggerFactory.getWeblogger().getUserManager();
    //#MainMenu.java:91: method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.decline()
    //#MainMenu.java:91: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:91: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#input(String decline()): "Error handling invitation decline - "._tainted
    //#input(String decline()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/MainMenu]
    //#input(String decline()): __Descendant_Table[others]
    //#input(String decline()): __Dispatch_Table.getInviteId()Ljava/lang/String;
    //#input(String decline()): log
    //#input(String decline()): this
    //#input(String decline()): this.__Tag
    //#input(String decline()): this.inviteId
    //#input(String decline()): this.inviteId._tainted
    //#output(String decline()): return_value
    //#pre[3] (String decline()): this.__Tag == org/apache/roller/weblogger/ui/struts2/core/MainMenu
    //#pre[4] (String decline()): init'ed(this.inviteId)
    //#pre[1] (String decline()): (soft) log != null
    //#presumption(String decline()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@91 != null
    //#presumption(String decline()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@91 != null
    //#presumption(String decline()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@99 != null
    //#presumption(String decline()): org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite(...)@94 != null
    //#post(String decline()): return_value == &"success"
    //#test_vector(String decline()): org.apache.roller.weblogger.business.UserManager:getPermissions(...)@92: Addr_Set{null}, Inverse{null}
            WeblogPermission perms = userMgr.getPermissions(getInviteId());
    //#MainMenu.java:92: Warning: method not available
    //#    -- call on WeblogPermission org.apache.roller.weblogger.business.UserManager:getPermissions(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: WeblogPermission org.apache.roller.weblogger.business.UserManager:getPermissions(String)
            if (perms != null) {
                String handle = perms.getWebsite().getHandle();
    //#MainMenu.java:94: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite()
    //#MainMenu.java:94: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
                        
                // TODO ROLLER_2.0: notify inviter that invitee has declined invitation
                // TODO EXCEPTIONS: better exception handling here
                userMgr.removePermissions(perms);
    //#MainMenu.java:98: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.UserManager:removePermissions(WeblogPermission)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.UserManager:removePermissions(WeblogPermission)
                WebloggerFactory.getWeblogger().flush();
    //#MainMenu.java:99: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:99: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:flush()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:flush()

                addMessage("yourWebsites.declined", handle);
    //#MainMenu.java:101: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addMessage(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addMessage(String, String)
            } else {
                addError("yourWebsites.permNotFound");
    //#MainMenu.java:103: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
            }
        } catch (WebloggerException ex) {
            log.error("Error handling invitation decline - "+getInviteId(), ex);
    //#MainMenu.java:106: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("invite decline failed.");
    //#MainMenu.java:108: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String decline()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
        }
        
        return SUCCESS;
    //#MainMenu.java:111: end of method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.decline()
    }
    
    
    public String resign() {
        
        User user = getAuthenticatedUser();
    //#MainMenu.java:117: method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.resign()
    //#MainMenu.java:117: Warning: method not available
    //#    -- call on User org.apache.roller.weblogger.ui.struts2.core.MainMenu:getAuthenticatedUser()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: User org.apache.roller.weblogger.ui.struts2.core.MainMenu:getAuthenticatedUser()
    //#input(String resign()): "Error doing weblog resign - "._tainted
    //#input(String resign()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/MainMenu]
    //#input(String resign()): __Descendant_Table[others]
    //#input(String resign()): __Dispatch_Table.getWebsiteId()Ljava/lang/String;
    //#input(String resign()): log
    //#input(String resign()): this
    //#input(String resign()): this.__Tag
    //#input(String resign()): this.websiteId
    //#input(String resign()): this.websiteId._tainted
    //#output(String resign()): return_value
    //#pre[3] (String resign()): this.__Tag == org/apache/roller/weblogger/ui/struts2/core/MainMenu
    //#pre[4] (String resign()): init'ed(this.websiteId)
    //#pre[1] (String resign()): (soft) log != null
    //#presumption(String resign()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@120 != null
    //#presumption(String resign()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@123 != null
    //#presumption(String resign()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@120 != null
    //#presumption(String resign()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@123 != null
    //#presumption(String resign()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@130 != null
    //#presumption(String resign()): org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite(...)@133 != null
    //#post(String resign()): return_value == &"success"
    //#test_vector(String resign()): org.apache.roller.weblogger.business.UserManager:getPermissions(...)@124: Addr_Set{null}, Inverse{null}
        
        try {
            UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#MainMenu.java:120: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:120: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
            Weblog website = mgr.getWebsite(getWebsiteId());
    //#MainMenu.java:121: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.business.UserManager:getWebsite(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.business.UserManager:getWebsite(String)
            
            UserManager userMgr = WebloggerFactory.getWeblogger().getUserManager();
    //#MainMenu.java:123: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:123: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
            WeblogPermission perms = userMgr.getPermissions(website, user);
    //#MainMenu.java:124: Warning: method not available
    //#    -- call on WeblogPermission org.apache.roller.weblogger.business.UserManager:getPermissions(Weblog, User)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: WeblogPermission org.apache.roller.weblogger.business.UserManager:getPermissions(Weblog, User)
            
            if (perms != null) {
                // TODO ROLLER_2.0: notify website members that user has resigned
                // TODO EXCEPTIONS: better exception handling
                userMgr.removePermissions(perms);
    //#MainMenu.java:129: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.UserManager:removePermissions(WeblogPermission)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.UserManager:removePermissions(WeblogPermission)
                WebloggerFactory.getWeblogger().flush();
    //#MainMenu.java:130: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:130: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:flush()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:flush()
            }
            
            addMessage("yourWebsites.resigned", perms.getWebsite().getHandle());
    //#MainMenu.java:133: ?null dereference
    //#    perms != null
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    basic block: bb_4
    //#    assertion: perms != null
    //#    VN: org.apache.roller.weblogger.business.UserManager:getPermissions(...)@124
    //#    Expected: Inverse{null} or Invalid
    //#    Bad: Addr_Set{null}
    //#    Attribs:  Ptr  null in Bad  Uncertain
    //#MainMenu.java:133: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.pojos.WeblogPermission:getWebsite()
    //#MainMenu.java:133: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#MainMenu.java:133: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addMessage(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addMessage(String, String)
        } catch (WebloggerException ex) {
            log.error("Error doing weblog resign - "+getWebsiteId(), ex);
    //#MainMenu.java:135: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("resignation failed.");
    //#MainMenu.java:137: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: String resign()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.MainMenu:addError(String)
        }
        
        return SUCCESS;
    //#MainMenu.java:140: end of method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.resign()
    }
    
    
    public List getExistingPermissions() {
        try {
            UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#MainMenu.java:146: method: List org.apache.roller.weblogger.ui.struts2.core.MainMenu.getExistingPermissions()
    //#MainMenu.java:146: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getExistingPermissions()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:146: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getExistingPermissions()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#input(List getExistingPermissions()): java.util.Collections.EMPTY_LIST
    //#input(List getExistingPermissions()): this
    //#output(List getExistingPermissions()): return_value
    //#presumption(List getExistingPermissions()): init'ed(java.util.Collections.EMPTY_LIST)
    //#presumption(List getExistingPermissions()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@146 != null
    //#presumption(List getExistingPermissions()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@146 != null
    //#post(List getExistingPermissions()): init'ed(return_value)
            return mgr.getAllPermissions(getAuthenticatedUser());
    //#MainMenu.java:147: Warning: method not available
    //#    -- call on User org.apache.roller.weblogger.ui.struts2.core.MainMenu:getAuthenticatedUser()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getExistingPermissions()
    //#    unanalyzed callee: User org.apache.roller.weblogger.ui.struts2.core.MainMenu:getAuthenticatedUser()
    //#MainMenu.java:147: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.UserManager:getAllPermissions(User)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getExistingPermissions()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.UserManager:getAllPermissions(User)
        } catch(Exception e) {
            return Collections.EMPTY_LIST;
    //#MainMenu.java:149: end of method: List org.apache.roller.weblogger.ui.struts2.core.MainMenu.getExistingPermissions()
        }
    }
    
    public List getPendingPermissions() {
        try {
            UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#MainMenu.java:155: method: List org.apache.roller.weblogger.ui.struts2.core.MainMenu.getPendingPermissions()
    //#MainMenu.java:155: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getPendingPermissions()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#MainMenu.java:155: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getPendingPermissions()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#input(List getPendingPermissions()): java.util.Collections.EMPTY_LIST
    //#input(List getPendingPermissions()): this
    //#output(List getPendingPermissions()): return_value
    //#presumption(List getPendingPermissions()): init'ed(java.util.Collections.EMPTY_LIST)
    //#presumption(List getPendingPermissions()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@155 != null
    //#presumption(List getPendingPermissions()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@155 != null
    //#post(List getPendingPermissions()): init'ed(return_value)
            return mgr.getPendingPermissions(getAuthenticatedUser());
    //#MainMenu.java:156: Warning: method not available
    //#    -- call on User org.apache.roller.weblogger.ui.struts2.core.MainMenu:getAuthenticatedUser()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getPendingPermissions()
    //#    unanalyzed callee: User org.apache.roller.weblogger.ui.struts2.core.MainMenu:getAuthenticatedUser()
    //#MainMenu.java:156: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.UserManager:getPendingPermissions(User)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
    //#    method: List getPendingPermissions()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.UserManager:getPendingPermissions(User)
        } catch(Exception e) {
            return Collections.EMPTY_LIST;
    //#MainMenu.java:158: end of method: List org.apache.roller.weblogger.ui.struts2.core.MainMenu.getPendingPermissions()
        }
    }
    

    public String getWebsiteId() {
        return websiteId;
    //#MainMenu.java:164: method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.getWebsiteId()
    //#input(String getWebsiteId()): this
    //#input(String getWebsiteId()): this.websiteId
    //#output(String getWebsiteId()): return_value
    //#pre[2] (String getWebsiteId()): init'ed(this.websiteId)
    //#post(String getWebsiteId()): return_value == this.websiteId
    //#post(String getWebsiteId()): init'ed(return_value)
    //#MainMenu.java:164: end of method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.getWebsiteId()
    }

    public void setWebsiteId(String websiteId) {
        this.websiteId = websiteId;
    //#MainMenu.java:168: method: void org.apache.roller.weblogger.ui.struts2.core.MainMenu.setWebsiteId(String)
    //#input(void setWebsiteId(String)): this
    //#input(void setWebsiteId(String)): websiteId
    //#output(void setWebsiteId(String)): this.websiteId
    //#post(void setWebsiteId(String)): this.websiteId == websiteId
    //#post(void setWebsiteId(String)): init'ed(this.websiteId)
    }
    //#MainMenu.java:169: end of method: void org.apache.roller.weblogger.ui.struts2.core.MainMenu.setWebsiteId(String)

    public String getInviteId() {
        return inviteId;
    //#MainMenu.java:172: method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.getInviteId()
    //#input(String getInviteId()): this
    //#input(String getInviteId()): this.inviteId
    //#output(String getInviteId()): return_value
    //#pre[2] (String getInviteId()): init'ed(this.inviteId)
    //#post(String getInviteId()): return_value == this.inviteId
    //#post(String getInviteId()): init'ed(return_value)
    //#MainMenu.java:172: end of method: String org.apache.roller.weblogger.ui.struts2.core.MainMenu.getInviteId()
    }

    public void setInviteId(String inviteId) {
        this.inviteId = inviteId;
    //#MainMenu.java:176: method: void org.apache.roller.weblogger.ui.struts2.core.MainMenu.setInviteId(String)
    //#input(void setInviteId(String)): inviteId
    //#input(void setInviteId(String)): this
    //#output(void setInviteId(String)): this.inviteId
    //#post(void setInviteId(String)): this.inviteId == inviteId
    //#post(void setInviteId(String)): init'ed(this.inviteId)
    }
    //#MainMenu.java:177: end of method: void org.apache.roller.weblogger.ui.struts2.core.MainMenu.setInviteId(String)
    
}
    //#MainMenu.java:: end of class: org.apache.roller.weblogger.ui.struts2.core.MainMenu
