//# 0 errors, 226 messages
//#
/*
    //#Install.java:1:1: class: org.apache.roller.weblogger.ui.struts2.core.Install
 * 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.io.PrintWriter;
import java.io.StringWriter;
import java.sql.Connection;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.planet.business.GuicePlanetProvider;
import org.apache.roller.planet.business.PlanetFactory;
import org.apache.roller.planet.business.PlanetProvider;
import org.apache.roller.planet.business.startup.PlanetStartup;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.business.startup.StartupException;
import org.apache.roller.weblogger.business.startup.WebloggerStartup;
import org.apache.roller.weblogger.config.WebloggerConfig;
import org.apache.roller.weblogger.ui.struts2.util.UIAction;
import org.springframework.beans.factory.access.BootstrapException;


/**
 * Walk user through install process.
 */
public class Install extends UIAction {
    //#Install.java:43: method: void org.apache.roller.weblogger.ui.struts2.core.Install.org.apache.roller.weblogger.ui.struts2.core.Install()
    //#Install.java:43: 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.Install
    //#    method: void org.apache.roller.weblogger.ui.struts2.core.Install()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#input(void org.apache.roller.weblogger.ui.struts2.core.Install()): this
    //#output(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.databaseName
    //#output(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.error
    //#output(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.messages
    //#output(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.rootCauseException
    //#output(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.success
    //#post(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.databaseName == &"Unknown"
    //#post(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.error == 0
    //#post(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.success == 0
    //#post(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.messages == null
    //#post(void org.apache.roller.weblogger.ui.struts2.core.Install()): this.rootCauseException == null
    
    private static Log log = LogFactory.getLog(Install.class);
    //#Install.java:45: method: org.apache.roller.weblogger.ui.struts2.core.Install.org.apache.roller.weblogger.ui.struts2.core.Install__static_init
    //#Install.java:45: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: org.apache.roller.weblogger.ui.struts2.core.Install__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/Install]
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.bootstrap()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.create()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.execute()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getDatabaseName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getDatabaseProductName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getMessages()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getProp(Ljava/lang/String;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getRootCauseException()Ljava/lang/Throwable;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getRootCauseStackTrace()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isError()Z
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isSuccess()Z
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isUpgradeRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isUserRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isWeblogRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.upgrade()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): log
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/Install] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.bootstrap()Ljava/lang/String; == &bootstrap
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.create()Ljava/lang/String; == &create
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.execute()Ljava/lang/String; == &execute
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getDatabaseName()Ljava/lang/String; == &getDatabaseName
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getDatabaseProductName()Ljava/lang/String; == &getDatabaseProductName
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getMessages()Ljava/util/List; == &getMessages
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getProp(Ljava/lang/String;)Ljava/lang/String; == &getProp
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getRootCauseException()Ljava/lang/Throwable; == &getRootCauseException
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.getRootCauseStackTrace()Ljava/lang/String; == &getRootCauseStackTrace
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isError()Z == &isError
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isSuccess()Z == &isSuccess
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isUpgradeRequired()Z == &isUpgradeRequired
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isUserRequired()Z == &isUserRequired
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.isWeblogRequired()Z == &isWeblogRequired
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): __Dispatch_Table.upgrade()Ljava/lang/String; == &upgrade
    //#post(org.apache.roller.weblogger.ui.struts2.core.Install__static_init): init'ed(log)
    //#Install.java:45: end of method: org.apache.roller.weblogger.ui.struts2.core.Install.org.apache.roller.weblogger.ui.struts2.core.Install__static_init
    
    private static final String DATABASE_ERROR = "database_error";
    private static final String CREATE_DATABASE = "create_database";
    private static final String UPGRADE_DATABASE = "upgrade_database";
    private static final String BOOTSTRAP = "bootstrap";
    
    private Throwable rootCauseException = null;
    private boolean error = false;
    private boolean success = false;
    private List<String> messages = null;
    private String databaseName = "Unknown";
    //#Install.java:56: end of method: void org.apache.roller.weblogger.ui.struts2.core.Install.org.apache.roller.weblogger.ui.struts2.core.Install()
    
    
    public boolean isUserRequired() {
        return false;
    //#Install.java:60: method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isUserRequired()
    //#output(bool isUserRequired()): return_value
    //#post(bool isUserRequired()): return_value == 0
    //#Install.java:60: end of method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isUserRequired()
    }
    
    public boolean isWeblogRequired() {
        return false;
    //#Install.java:64: method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isWeblogRequired()
    //#output(bool isWeblogRequired()): return_value
    //#post(bool isWeblogRequired()): return_value == 0
    //#Install.java:64: end of method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isWeblogRequired()
    }
    
    
    public String execute() {
        
        if (WebloggerFactory.isBootstrapped()) {
    //#Install.java:70: method: String org.apache.roller.weblogger.ui.struts2.core.Install.execute()
    //#Install.java:70: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#input(String execute()): log
    //#input(String execute()): this
    //#output(String execute()): return_value
    //#output(String execute()): this.messages
    //#output(String execute()): this.rootCauseException
    //#pre[1] (String execute()): (soft) log != null
    //#presumption(String execute()): org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProviderException(...)@75 != null
    //#post(String execute()): return_value in Addr_Set{&"bootstrap",&"upgrade_database",&"create_database",&"database_error",&"success"}
    //#post(String execute()): possibly_updated(this.messages)
    //#post(String execute()): possibly_updated(this.rootCauseException)
    //#test_vector(String execute()): org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped(...)@70: {0}, {1}
    //#test_vector(String execute()): org.apache.roller.weblogger.business.startup.StartupException:getRootCause(...)@76: Addr_Set{null}, Inverse{null}
    //#test_vector(String execute()): org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProviderException(...)@74: Addr_Set{null}, Inverse{null}
    //#test_vector(String execute()): org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseCreationRequired(...)@88: {0}, {1}
    //#test_vector(String execute()): org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseUpgradeRequired(...)@93: {0}, {1}
            return SUCCESS;
        }
        
        if (WebloggerStartup.getDatabaseProviderException() != null) {
    //#Install.java:74: Warning: method not available
    //#    -- call on StartupException org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProviderException()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: StartupException org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProviderException()
            StartupException se = WebloggerStartup.getDatabaseProviderException();
    //#Install.java:75: Warning: method not available
    //#    -- call on StartupException org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProviderException()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: StartupException org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProviderException()
            if (se.getRootCause() != null) {
    //#Install.java:76: Warning: method not available
    //#    -- call on Throwable org.apache.roller.weblogger.business.startup.StartupException:getRootCause()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: Throwable org.apache.roller.weblogger.business.startup.StartupException:getRootCause()
                rootCauseException = se.getRootCause();
    //#Install.java:77: Warning: method not available
    //#    -- call on Throwable org.apache.roller.weblogger.business.startup.StartupException:getRootCause()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: Throwable org.apache.roller.weblogger.business.startup.StartupException:getRootCause()
            } else {
                rootCauseException = se;
            }
            messages = se.getStartupLog();
    //#Install.java:81: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.startup.StartupException:getStartupLog()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.startup.StartupException:getStartupLog()
            
            log.debug("Forwarding to database error page");
    //#Install.java:83: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            setPageTitle("installer.error.connection.pageTitle");
    //#Install.java:84: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
            return DATABASE_ERROR;
        }   
        
        if (WebloggerStartup.isDatabaseCreationRequired()) {
    //#Install.java:88: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseCreationRequired()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseCreationRequired()
            log.debug("Forwarding to database table creation page");
    //#Install.java:89: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            setPageTitle("installer.database.creation.pageTitle");
    //#Install.java:90: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
            return CREATE_DATABASE;
        }
        if (WebloggerStartup.isDatabaseUpgradeRequired()) {
    //#Install.java:93: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseUpgradeRequired()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseUpgradeRequired()
            log.debug("Forwarding to database table upgrade page");
    //#Install.java:94: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:debug(Object)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:debug(Object)
            setPageTitle("installer.database.upgrade.pageTitle");
    //#Install.java:95: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
            return UPGRADE_DATABASE;
        }
        setPageTitle("installer.error.unknown.pageTitle");        
    //#Install.java:98: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
        return BOOTSTRAP;
    //#Install.java:99: end of method: String org.apache.roller.weblogger.ui.struts2.core.Install.execute()
    }
    
    
    public String create() {
        
        if(WebloggerFactory.isBootstrapped()) {
    //#Install.java:105: method: String org.apache.roller.weblogger.ui.struts2.core.Install.create()
    //#Install.java:105: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String create()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#input(String create()): this
    //#output(String create()): return_value
    //#output(String create()): this.error
    //#output(String create()): this.messages
    //#output(String create()): this.success
    //#post(String create()): return_value in Addr_Set{&"create_database",&"success"}
    //#post(String create()): possibly_updated(this.error)
    //#post(String create()): possibly_updated(this.messages)
    //#post(String create()): possibly_updated(this.success)
    //#test_vector(String create()): org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped(...)@105: {0}, {1}
            return SUCCESS;
        }
        
        try {
            messages = WebloggerStartup.createDatabase();
    //#Install.java:110: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.startup.WebloggerStartup:createDatabase()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String create()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.startup.WebloggerStartup:createDatabase()
            
            success = true;
        } catch (StartupException se) {
            error = true;
            messages = se.getStartupLog();
    //#Install.java:115: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.startup.StartupException:getStartupLog()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String create()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.startup.StartupException:getStartupLog()
        }
        
        setPageTitle("installer.database.creation.pageTitle");
    //#Install.java:118: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String create()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
        return CREATE_DATABASE;
    //#Install.java:119: end of method: String org.apache.roller.weblogger.ui.struts2.core.Install.create()
    }
    
    
    public String upgrade() {
        
        if(WebloggerFactory.isBootstrapped()) {
    //#Install.java:125: method: String org.apache.roller.weblogger.ui.struts2.core.Install.upgrade()
    //#Install.java:125: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String upgrade()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#input(String upgrade()): this
    //#output(String upgrade()): return_value
    //#output(String upgrade()): this.error
    //#output(String upgrade()): this.messages
    //#output(String upgrade()): this.success
    //#post(String upgrade()): return_value in Addr_Set{&"upgrade_database",&"success"}
    //#post(String upgrade()): possibly_updated(this.error)
    //#post(String upgrade()): possibly_updated(this.messages)
    //#post(String upgrade()): possibly_updated(this.success)
    //#test_vector(String upgrade()): org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped(...)@125: {0}, {1}
            return SUCCESS;
        }
        
        try {
            messages = WebloggerStartup.upgradeDatabase(true);
    //#Install.java:130: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.startup.WebloggerStartup:upgradeDatabase(bool)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String upgrade()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.startup.WebloggerStartup:upgradeDatabase(bool)
            
            success = true;
        } catch (StartupException se) {
            error = true;
            messages = se.getStartupLog();
    //#Install.java:135: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.startup.StartupException:getStartupLog()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String upgrade()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.startup.StartupException:getStartupLog()
        }
        
        setPageTitle("installer.database.upgrade.pageTitle");
    //#Install.java:138: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String upgrade()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
        return UPGRADE_DATABASE;
    //#Install.java:139: end of method: String org.apache.roller.weblogger.ui.struts2.core.Install.upgrade()
    }
    
    
    public String bootstrap() {
        
        if(WebloggerFactory.isBootstrapped()) {
    //#Install.java:145: method: String org.apache.roller.weblogger.ui.struts2.core.Install.bootstrap()
    //#Install.java:145: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped()
    //#input(String bootstrap()): log
    //#input(String bootstrap()): this
    //#output(String bootstrap()): return_value
    //#output(String bootstrap()): this.rootCauseException
    //#pre[1] (String bootstrap()): (soft) log != null
    //#presumption(String bootstrap()): org.apache.roller.planet.business.PlanetFactory:getPlanet(...)@174 != null
    //#presumption(String bootstrap()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@154 != null
    //#post(String bootstrap()): return_value in Addr_Set{&"success",&"bootstrap"}
    //#post(String bootstrap()): possibly_updated(this.rootCauseException)
    //#test_vector(String bootstrap()): org.apache.roller.weblogger.business.WebloggerFactory:isBootstrapped(...)@145: {0}, {1}
    //#test_vector(String bootstrap()): org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(...)@157: {0}, {1}
            return SUCCESS;
        }
        
        try {
            // trigger bootstrapping process
            WebloggerFactory.bootstrap();
    //#Install.java:151: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.WebloggerFactory:bootstrap()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.WebloggerFactory:bootstrap()
            
            // trigger initialization process
            WebloggerFactory.getWeblogger().initialize();
    //#Install.java:154: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#Install.java:154: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:initialize()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:initialize()
            
            // also need to do planet if it's configured
            if (WebloggerConfig.getBooleanProperty("planet.aggregator.enabled")) {
    //#Install.java:157: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
                
                // Now prepare the core services of planet so we can bootstrap it
                try {
                    PlanetStartup.prepare();
    //#Install.java:161: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.startup.PlanetStartup:prepare()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.roller.planet.business.startup.PlanetStartup:prepare()
                } catch (Throwable ex) {
                    log.fatal("Roller Planet startup failed during app preparation", ex);
    //#Install.java:163: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
                }
                
                try {
                    // trigger planet bootstrapping process
                    // we planet to use our own planet provider for integration
                    String guiceModule = WebloggerConfig.getProperty("planet.aggregator.guice.module");
    //#Install.java:169: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
                    PlanetProvider provider = new GuicePlanetProvider(guiceModule);
    //#Install.java:170: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.GuicePlanetProvider(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.roller.planet.business.GuicePlanetProvider(String)
                    PlanetFactory.bootstrap(provider);
    //#Install.java:171: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.PlanetFactory:bootstrap(PlanetProvider)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.roller.planet.business.PlanetFactory:bootstrap(PlanetProvider)
                    
                    // and now initialize planet
                    PlanetFactory.getPlanet().initialize();
    //#Install.java:174: Warning: method not available
    //#    -- call on Planet org.apache.roller.planet.business.PlanetFactory:getPlanet()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: Planet org.apache.roller.planet.business.PlanetFactory:getPlanet()
    //#Install.java:174: Warning: method not available
    //#    -- call on void org.apache.roller.planet.business.Planet:initialize()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.roller.planet.business.Planet:initialize()
                    
                } catch (Throwable t) {
                    log.fatal("Roller Planet bootstrapping failed", t);
    //#Install.java:177: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:fatal(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:fatal(Object, Throwable)
                }
            }

            return SUCCESS;
            
        } catch (BootstrapException ex) {
            rootCauseException = ex;
        } catch (WebloggerException ex) {
            rootCauseException = ex;
        }
        
        setPageTitle("installer.error.unknown.pageTitle");                
    //#Install.java:189: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String bootstrap()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.Install:setPageTitle(String)
        return BOOTSTRAP;
    //#Install.java:190: end of method: String org.apache.roller.weblogger.ui.struts2.core.Install.bootstrap()
    }
    
    
    public String getDatabaseProductName() {
        String name = "unknown";
    //#Install.java:195: method: String org.apache.roller.weblogger.ui.struts2.core.Install.getDatabaseProductName()
    //#output(String getDatabaseProductName()): return_value
    //#presumption(String getDatabaseProductName()): java.sql.Connection:getMetaData(...)@200 != null
    //#presumption(String getDatabaseProductName()): org.apache.roller.weblogger.business.DatabaseProvider:getConnection(...)@199 != null
    //#presumption(String getDatabaseProductName()): org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProvider(...)@199 != null
    //#post(String getDatabaseProductName()): init'ed(return_value)
        
        Connection con = null;
        try {
            con = WebloggerStartup.getDatabaseProvider().getConnection();
    //#Install.java:199: Warning: method not available
    //#    -- call on DatabaseProvider org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProvider()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String getDatabaseProductName()
    //#    unanalyzed callee: DatabaseProvider org.apache.roller.weblogger.business.startup.WebloggerStartup:getDatabaseProvider()
    //#Install.java:199: Warning: method not available
    //#    -- call on Connection org.apache.roller.weblogger.business.DatabaseProvider:getConnection()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String getDatabaseProductName()
    //#    unanalyzed callee: Connection org.apache.roller.weblogger.business.DatabaseProvider:getConnection()
            name = con.getMetaData().getDatabaseProductName();
        } catch (Exception intentionallyIgnored) {
    //#Install.java:201: Warning: unused assignment
    //#    unused assignment into intentionallyIgnored
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String getDatabaseProductName()
            // ignored
        } finally {
            if(con != null) try {
                con.close();
            } catch(Exception ex) {}
        }
        
        return name;
    //#Install.java:209: end of method: String org.apache.roller.weblogger.ui.struts2.core.Install.getDatabaseProductName()
    }
    
    public String getProp(String key) {
        // Static config only, we don't have database yet
        String value = WebloggerConfig.getProperty(key);
    //#Install.java:214: method: String org.apache.roller.weblogger.ui.struts2.core.Install.getProp(String)
    //#Install.java:214: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: String getProp(String)
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#input(String getProp(String)): key
    //#output(String getProp(String)): return_value
    //#post(String getProp(String)): init'ed(return_value)
        return (value == null) ? key : value;
    //#Install.java:215: end of method: String org.apache.roller.weblogger.ui.struts2.core.Install.getProp(String)
    }
    
    
    public Throwable getRootCauseException() {
        return rootCauseException;
    //#Install.java:220: method: Throwable org.apache.roller.weblogger.ui.struts2.core.Install.getRootCauseException()
    //#input(Throwable getRootCauseException()): this
    //#input(Throwable getRootCauseException()): this.rootCauseException
    //#output(Throwable getRootCauseException()): return_value
    //#pre[2] (Throwable getRootCauseException()): init'ed(this.rootCauseException)
    //#post(Throwable getRootCauseException()): return_value == this.rootCauseException
    //#post(Throwable getRootCauseException()): init'ed(return_value)
    //#Install.java:220: end of method: Throwable org.apache.roller.weblogger.ui.struts2.core.Install.getRootCauseException()
    }
    
    public String getRootCauseStackTrace() {
        String stackTrace = "";
    //#Install.java:224: method: String org.apache.roller.weblogger.ui.struts2.core.Install.getRootCauseStackTrace()
    //#input(String getRootCauseStackTrace()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/Install]
    //#input(String getRootCauseStackTrace()): __Descendant_Table[others]
    //#input(String getRootCauseStackTrace()): __Dispatch_Table.getRootCauseException()Ljava/lang/Throwable;
    //#input(String getRootCauseStackTrace()): this
    //#input(String getRootCauseStackTrace()): this.__Tag
    //#input(String getRootCauseStackTrace()): this.rootCauseException
    //#output(String getRootCauseStackTrace()): return_value
    //#pre[2] (String getRootCauseStackTrace()): this.__Tag == org/apache/roller/weblogger/ui/struts2/core/Install
    //#pre[3] (String getRootCauseStackTrace()): init'ed(this.rootCauseException)
    //#post(String getRootCauseStackTrace()): return_value != null
    //#test_vector(String getRootCauseStackTrace()): this.rootCauseException: Addr_Set{null}, Inverse{null}
        if (getRootCauseException() != null) {
            StringWriter sw = new StringWriter();
            getRootCauseException().printStackTrace(new PrintWriter(sw));
            stackTrace = sw.toString().trim();
        }
        return stackTrace;
    //#Install.java:230: end of method: String org.apache.roller.weblogger.ui.struts2.core.Install.getRootCauseStackTrace()
    }

    public boolean isUpgradeRequired() {
        return WebloggerStartup.isDatabaseUpgradeRequired();
    //#Install.java:234: method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isUpgradeRequired()
    //#Install.java:234: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseUpgradeRequired()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.Install
    //#    method: bool isUpgradeRequired()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.business.startup.WebloggerStartup:isDatabaseUpgradeRequired()
    //#output(bool isUpgradeRequired()): return_value
    //#post(bool isUpgradeRequired()): init'ed(return_value)
    //#Install.java:234: end of method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isUpgradeRequired()
    }
        
    public boolean isError() {
        return error;
    //#Install.java:238: method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isError()
    //#input(bool isError()): this
    //#input(bool isError()): this.error
    //#output(bool isError()): return_value
    //#pre[2] (bool isError()): init'ed(this.error)
    //#post(bool isError()): return_value == this.error
    //#post(bool isError()): init'ed(return_value)
    //#Install.java:238: end of method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isError()
    }

    public List<String> getMessages() {
        return messages;
    //#Install.java:242: method: List org.apache.roller.weblogger.ui.struts2.core.Install.getMessages()
    //#input(List getMessages()): this
    //#input(List getMessages()): this.messages
    //#output(List getMessages()): return_value
    //#pre[2] (List getMessages()): init'ed(this.messages)
    //#post(List getMessages()): return_value == this.messages
    //#post(List getMessages()): init'ed(return_value)
    //#Install.java:242: end of method: List org.apache.roller.weblogger.ui.struts2.core.Install.getMessages()
    }

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

    public boolean isSuccess() {
        return success;
    //#Install.java:250: method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isSuccess()
    //#input(bool isSuccess()): this
    //#input(bool isSuccess()): this.success
    //#output(bool isSuccess()): return_value
    //#pre[2] (bool isSuccess()): init'ed(this.success)
    //#post(bool isSuccess()): return_value == this.success
    //#post(bool isSuccess()): init'ed(return_value)
    //#Install.java:250: end of method: bool org.apache.roller.weblogger.ui.struts2.core.Install.isSuccess()
    }
    
}
    //#Install.java:: end of class: org.apache.roller.weblogger.ui.struts2.core.Install
