//# 1 errors, 237 messages
//#
/*
    //#CreateWeblog.java:1:1: class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
 * 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.List;
import org.apache.commons.lang.CharSetUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.config.WebloggerConfig;
import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.business.themes.ThemeManager;
import org.apache.roller.weblogger.business.UserManager;
import org.apache.roller.weblogger.pojos.User;
import org.apache.roller.weblogger.pojos.Weblog;
import org.apache.roller.weblogger.ui.struts2.util.UIAction;
import org.apache.roller.weblogger.util.Utilities;
import org.apache.struts2.interceptor.validation.SkipValidation;


/**
 * Allows user to create a new website.
 */
public class CreateWeblog extends UIAction {
    
    private static Log log = LogFactory.getLog(CreateWeblog.class);
    //#CreateWeblog.java:44: method: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init
    //#CreateWeblog.java:44: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblog]
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.execute()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean;
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.getThemes()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.isWeblogRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.myValidate()V
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.save()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.setBean(Lorg/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean;)V
    //#output(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): log
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblog] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.execute()Ljava/lang/String; == &execute
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean; == &getBean
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.getThemes()Ljava/util/List; == &getThemes
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.isWeblogRequired()Z == &isWeblogRequired
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.myValidate()V == &myValidate
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.save()Ljava/lang/String; == &save
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): __Dispatch_Table.setBean(Lorg/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean;)V == &setBean
    //#post(org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init): init'ed(log)
    //#CreateWeblog.java:44: end of method: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.org.apache.roller.weblogger.ui.struts2.core.CreateWeblog__static_init
    
    private CreateWeblogBean bean = new CreateWeblogBean();
    

    public CreateWeblog() {
    //#CreateWeblog.java:49: method: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()
    //#CreateWeblog.java:49: 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.CreateWeblog
    //#    method: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#input(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): this
    //#output(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): new CreateWeblogBean(CreateWeblog#1) num objects
    //#output(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): this.bean.__Tag
    //#output(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): this.bean
    //#output(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): this.pageTitle
    //#new obj(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): new CreateWeblogBean(CreateWeblog#1)
    //#post(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): this.bean == &new CreateWeblogBean(CreateWeblog#1)
    //#post(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): this.pageTitle == &"createWebsite.title"
    //#post(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): new CreateWeblogBean(CreateWeblog#1) num objects == 1
    //#post(void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()): this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean
        this.pageTitle = "createWebsite.title";
    }
    //#CreateWeblog.java:51: end of method: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.org.apache.roller.weblogger.ui.struts2.core.CreateWeblog()
    
    
    // override default security, we do not require an action weblog
    public boolean isWeblogRequired() {
        return false;
    //#CreateWeblog.java:56: method: bool org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.isWeblogRequired()
    //#output(bool isWeblogRequired()): return_value
    //#post(bool isWeblogRequired()): return_value == 0
    //#CreateWeblog.java:56: end of method: bool org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.isWeblogRequired()
    }
    
    
    @SkipValidation
    public String execute() {
        
        User user = getAuthenticatedUser();
    //#CreateWeblog.java:63: method: String org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.execute()
    //#CreateWeblog.java:63: Warning: method not available
    //#    -- call on User org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:getAuthenticatedUser()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: User org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:getAuthenticatedUser()
    //#input(String execute()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblog]
    //#input(String execute()): __Descendant_Table[others]
    //#input(String execute()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean;
    //#input(String execute()): log
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean]
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Descendant_Table[others]
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.setEmailAddress(Ljava/lang/String;)V
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.setLocale(Ljava/lang/String;)V
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.setTimeZone(Ljava/lang/String;)V
    //#input(String execute()): this
    //#input(String execute()): this.__Tag
    //#input(String execute()): this.bean
    //#input(String execute()): this.bean.__Tag
    //#output(String execute()): return_value
    //#output(String execute()): this.bean.emailAddress
    //#output(String execute()): this.bean.locale
    //#output(String execute()): this.bean.timeZone
    //#pre[1] (String execute()): (soft) log != null
    //#pre[6] (String execute()): (soft) this.__Tag == org/apache/roller/weblogger/ui/struts2/core/CreateWeblog
    //#pre[7] (String execute()): (soft) this.bean != null
    //#pre[8] (String execute()): (soft) this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean
    //#presumption(String execute()): org.apache.roller.weblogger.business.UserManager:getAllPermissions(...)@68 != null
    //#presumption(String execute()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@67 != null
    //#presumption(String execute()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@67 != null
    //#presumption(String execute()): org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:getAuthenticatedUser(...)@63 != null
    //#post(String execute()): return_value in Addr_Set{&"menu",&"input"}
    //#post(String execute()): possibly_updated(this.bean.emailAddress)
    //#post(String execute()): possibly_updated(this.bean.locale)
    //#post(String execute()): possibly_updated(this.bean.timeZone)
        
        try {
            if (!WebloggerConfig.getBooleanProperty("groupblogging.enabled")) {
    //#CreateWeblog.java:66: 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.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
                UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#CreateWeblog.java:67: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CreateWeblog.java:67: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
                List permissions = mgr.getAllPermissions(user);
    //#CreateWeblog.java:68: 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.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.UserManager:getAllPermissions(User)
                if (permissions.size() > 0) {
                    // sneaky user trying to get around 1 blog limit that applies
                    // only when group blogging is disabled
                    // TODO: i18n
                    addError("Sorry, you are only allowed to have 1 weblog.");
    //#CreateWeblog.java:73: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
                    return "menu";
                }
            }
        } catch (WebloggerException ex) {
            log.error("error checking for existing weblogs count", ex);
    //#CreateWeblog.java:78: 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.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
        }
        
        // pre-populate with some logical defaults
        getBean().setLocale(user.getLocale());
    //#CreateWeblog.java:82: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.User:getLocale()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.User:getLocale()
        getBean().setTimeZone(user.getTimeZone());
    //#CreateWeblog.java:83: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.User:getTimeZone()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.User:getTimeZone()
        getBean().setEmailAddress(user.getEmailAddress());
    //#CreateWeblog.java:84: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.User:getEmailAddress()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.User:getEmailAddress()
        
        return INPUT;
    //#CreateWeblog.java:86: end of method: String org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.execute()
    }
    
    
    public String save() {
        
        User user = getAuthenticatedUser();
    //#CreateWeblog.java:92: method: String org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.save()
    //#CreateWeblog.java:92: Warning: method not available
    //#    -- call on User org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:getAuthenticatedUser()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: User org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:getAuthenticatedUser()
    //#input(String save()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblog]
    //#input(String save()): __Descendant_Table[others]
    //#input(String save()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean;
    //#input(String save()): __Dispatch_Table.myValidate()V
    //#input(String save()): log
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean]
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Descendant_Table[others]
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getDescription()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getEmailAddress()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getHandle()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getLocale()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getName()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getTheme()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getTimeZone()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.setHandle(Ljava/lang/String;)V
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/core/Register.DEFAULT_ALLOWED_CHARS
    //#input(String save()): this
    //#input(String save()): this.__Tag
    //#input(String save()): this.bean
    //#input(String save()): this.bean.__Tag
    //#input(String save()): this.bean.description
    //#input(String save()): this.bean.emailAddress
    //#input(String save()): this.bean.handle
    //#input(String save()): this.bean.locale
    //#input(String save()): this.bean.name
    //#input(String save()): this.bean.theme
    //#input(String save()): this.bean.timeZone
    //#output(String save()): return_value
    //#output(String save()): this.bean.handle
    //#pre[1] (String save()): (soft) log != null
    //#pre[2] (String save()): (soft) init'ed(this.bean.handle)
    //#pre[3] (String save()): (soft) init'ed(org/apache/roller/weblogger/ui/struts2/core/Register.DEFAULT_ALLOWED_CHARS)
    //#pre[5] (String save()): (soft) this.__Tag == org/apache/roller/weblogger/ui/struts2/core/CreateWeblog
    //#pre[6] (String save()): (soft) this.bean != null
    //#pre[7] (String save()): (soft) this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean
    //#pre[8] (String save()): (soft) init'ed(this.bean.description)
    //#pre[9] (String save()): (soft) init'ed(this.bean.emailAddress)
    //#pre[10] (String save()): (soft) init'ed(this.bean.locale)
    //#pre[11] (String save()): (soft) init'ed(this.bean.name)
    //#pre[12] (String save()): (soft) init'ed(this.bean.theme)
    //#pre[13] (String save()): (soft) init'ed(this.bean.timeZone)
    //#presumption(String save()): defs.length@126 >= 1
    //#presumption(String save()): org.apache.roller.weblogger.business.UserManager:getAllPermissions(...)@96 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@131 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@95 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@131 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@133 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@95 != null
    //#presumption(String save()): org.apache.roller.weblogger.util.Utilities:stringToStringArray(...)@126 != null
    //#post(String save()): return_value in Addr_Set{&"menu",&"success",&"input"}
    //#post(String save()): this.bean.handle == One-of{old this.bean.handle, null}
    //#post(String save()): (soft) init'ed(this.bean.handle)
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.config.WebloggerConfig:getProperty
    //#unanalyzed(String save()): Effects-of-calling:java.lang.String:trim
    //#unanalyzed(String save()): Effects-of-calling:java.lang.String:length
    //#unanalyzed(String save()): Effects-of-calling:org.apache.commons.lang.CharSetUtils:keep
    //#unanalyzed(String save()): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError
    //#unanalyzed(String save()): Effects-of-calling:org.apache.commons.lang.StringUtils:isEmpty
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.business.Weblogger:getUserManager
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.business.UserManager:getWebsiteByHandle
    //#unanalyzed(String save()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String save()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#test_vector(String save()): org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:hasActionErrors(...)@111: {1}, {0}
        try {
            if (!WebloggerConfig.getBooleanProperty("groupblogging.enabled")) {
    //#CreateWeblog.java:94: 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.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.config.WebloggerConfig:getBooleanProperty(String)
                UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#CreateWeblog.java:95: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CreateWeblog.java:95: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
                List permissions = mgr.getAllPermissions(user);
    //#CreateWeblog.java:96: 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.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.UserManager:getAllPermissions(User)
                if (permissions.size() > 0) {
                    // sneaky user trying to get around 1 blog limit that applies
                    // only when group blogging is disabled
                    // TODO: i18n
                    addError("Sorry, you are only allowed to have 1 weblog.");
    //#CreateWeblog.java:101: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
                    return "menu";
                }
            }
        } catch (WebloggerException ex) {
            log.error("error checking for existing weblogs count", ex);
    //#CreateWeblog.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.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
        }
        
        myValidate();
        
        if(!hasActionErrors()) {
    //#CreateWeblog.java:111: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:hasActionErrors()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:hasActionErrors()
            
            Weblog wd = new Weblog(
    //#CreateWeblog.java:113: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.Weblog(String, User, String, String, String, String, String, String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.Weblog(String, User, String, String, String, String, String, String, String)
                    getBean().getHandle(),
                    user,
                    getBean().getName(),
                    getBean().getDescription(),
                    getBean().getEmailAddress(),
                    getBean().getEmailAddress(),
                    getBean().getTheme(),
                    getBean().getLocale(),
                    getBean().getTimeZone());
            
            // pick a weblog editor for this weblog
            String def = WebloggerRuntimeConfig.getProperty("users.editor.pages");
    //#CreateWeblog.java:125: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getProperty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerRuntimeConfig:getProperty(String)
            String[] defs = Utilities.stringToStringArray(def,",");
    //#CreateWeblog.java:126: Warning: method not available
    //#    -- call on String[] org.apache.roller.weblogger.util.Utilities:stringToStringArray(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: String[] org.apache.roller.weblogger.util.Utilities:stringToStringArray(String, String)
            wd.setEditorPage(defs[0]);
    //#CreateWeblog.java:127: ?use of default init
    //#    init'ed(defs[0])
    //#    severity: SUPPRESSED
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    basic block: bb_8
    //#    assertion: init'ed(defs[0])
    //#    VN: undefined
    //#    Expected: Univ-VN-Set
    //#    Bad: {Invalid}
    //#    Attribs:  Ptr  Bad only invalid
    //#CreateWeblog.java:127: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.Weblog:setEditorPage(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.Weblog:setEditorPage(String)
            
            try {
                // add weblog and flush
                UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#CreateWeblog.java:131: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CreateWeblog.java:131: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
                mgr.addWebsite(wd);
    //#CreateWeblog.java:132: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.UserManager:addWebsite(Weblog)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.UserManager:addWebsite(Weblog)
                WebloggerFactory.getWeblogger().flush();
    //#CreateWeblog.java:133: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CreateWeblog.java:133: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:flush()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:flush()
                
                // tell the user their weblog was created
                addMessage("createWebsite.created", getBean().getHandle());
    //#CreateWeblog.java:136: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addMessage(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addMessage(String, String)
                
                return SUCCESS;
                
            } catch (WebloggerException e) {
                log.error("ERROR adding weblog", e);
    //#CreateWeblog.java:141: 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.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
                // TODO: error handling
                addError(e.getMessage());
    //#CreateWeblog.java:143: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.WebloggerException:getMessage()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: String org.apache.roller.weblogger.WebloggerException:getMessage()
    //#CreateWeblog.java:143: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
            }
            
        }
        
        return INPUT;
    //#CreateWeblog.java:148: end of method: String org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.save()
    }
    
    
    public void myValidate()  {
        
        String allowed = WebloggerConfig.getProperty("username.allowedChars");
    //#CreateWeblog.java:154: method: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.myValidate()
    //#CreateWeblog.java:154: 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.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: String org.apache.roller.weblogger.config.WebloggerConfig:getProperty(String)
    //#input(void myValidate()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblog]
    //#input(void myValidate()): __Descendant_Table[others]
    //#input(void myValidate()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean;
    //#input(void myValidate()): log
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean]
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Descendant_Table[others]
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.getHandle()Ljava/lang/String;
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean.__Dispatch_Table.setHandle(Ljava/lang/String;)V
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/core/Register.DEFAULT_ALLOWED_CHARS
    //#input(void myValidate()): this
    //#input(void myValidate()): this.__Tag
    //#input(void myValidate()): this.bean
    //#input(void myValidate()): this.bean.__Tag
    //#input(void myValidate()): this.bean.handle
    //#output(void myValidate()): this.bean.handle
    //#pre[2] (void myValidate()): init'ed(this.bean.handle)
    //#pre[5] (void myValidate()): this.__Tag == org/apache/roller/weblogger/ui/struts2/core/CreateWeblog
    //#pre[6] (void myValidate()): this.bean != null
    //#pre[7] (void myValidate()): this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/core/CreateWeblogBean
    //#pre[1] (void myValidate()): (soft) log != null
    //#pre[3] (void myValidate()): (soft) init'ed(org/apache/roller/weblogger/ui/struts2/core/Register.DEFAULT_ALLOWED_CHARS)
    //#presumption(void myValidate()): org.apache.commons.lang.CharSetUtils:keep(...)@160 != null
    //#presumption(void myValidate()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@169 != null
    //#presumption(void myValidate()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@169 != null
    //#post(void myValidate()): this.bean.handle == One-of{old this.bean.handle, null}
    //#post(void myValidate()): init'ed(this.bean.handle)
    //#test_vector(void myValidate()): java.lang.String:equals(...)@161: {1}, {0}
    //#test_vector(void myValidate()): java.lang.String:length(...)@155: {1..4_294_967_295}, {0}
    //#test_vector(void myValidate()): org.apache.commons.lang.StringUtils:isEmpty(...)@168: {1}, {0}
    //#test_vector(void myValidate()): org.apache.roller.weblogger.business.UserManager:getWebsiteByHandle(...)@170: Addr_Set{null}, Inverse{null}
    //#test_vector(void myValidate()): org.apache.roller.weblogger.config.WebloggerConfig:getProperty(...)@154: Addr_Set{null}, Inverse{null}
        if(allowed == null || allowed.trim().length() == 0) {
            allowed = Register.DEFAULT_ALLOWED_CHARS;
        }
        
        // make sure handle only contains safe characters
        String safe = CharSetUtils.keep(getBean().getHandle(), allowed);
    //#CreateWeblog.java:160: Warning: method not available
    //#    -- call on String org.apache.commons.lang.CharSetUtils:keep(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: String org.apache.commons.lang.CharSetUtils:keep(String, String)
        if (!safe.equals(getBean().getHandle()) ) {
            addError("createWeblog.error.invalidHandle");
    //#CreateWeblog.java:162: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
        }
        
        // make sure theme was specified and is a valid value
        
        // make sure handle isn't already taken
        if(!StringUtils.isEmpty(getBean().getHandle())) try {
    //#CreateWeblog.java:168: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isEmpty(String)
            UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#CreateWeblog.java:169: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CreateWeblog.java:169: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
            if (mgr.getWebsiteByHandle(getBean().getHandle()) != null) {
    //#CreateWeblog.java:170: Warning: method not available
    //#    -- call on Weblog org.apache.roller.weblogger.business.UserManager:getWebsiteByHandle(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: Weblog org.apache.roller.weblogger.business.UserManager:getWebsiteByHandle(String)
                addError("createWeblog.error.handleExists");
    //#CreateWeblog.java:171: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
                // reset handle
                getBean().setHandle(null);
            }
        } catch (WebloggerException ex) {
            log.error("error checking for weblog", ex);
    //#CreateWeblog.java:176: 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.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("unexpected error");
    //#CreateWeblog.java:178: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog:addError(String)
        }
    }
    //#CreateWeblog.java:180: end of method: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.myValidate()
    
    
    public List getThemes() {
        ThemeManager themeMgr = WebloggerFactory.getWeblogger().getThemeManager();
    //#CreateWeblog.java:184: method: List org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.getThemes()
    //#CreateWeblog.java:184: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: List getThemes()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CreateWeblog.java:184: Warning: method not available
    //#    -- call on ThemeManager org.apache.roller.weblogger.business.Weblogger:getThemeManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: List getThemes()
    //#    unanalyzed callee: ThemeManager org.apache.roller.weblogger.business.Weblogger:getThemeManager()
    //#output(List getThemes()): return_value
    //#presumption(List getThemes()): org.apache.roller.weblogger.business.Weblogger:getThemeManager(...)@184 != null
    //#presumption(List getThemes()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@184 != null
    //#post(List getThemes()): init'ed(return_value)
        return themeMgr.getEnabledThemesList();
    //#CreateWeblog.java:185: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.themes.ThemeManager:getEnabledThemesList()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
    //#    method: List getThemes()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.themes.ThemeManager:getEnabledThemesList()
    //#CreateWeblog.java:185: end of method: List org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.getThemes()
    }
    
    
    public CreateWeblogBean getBean() {
        return bean;
    //#CreateWeblog.java:190: method: CreateWeblogBean org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.getBean()
    //#input(CreateWeblogBean getBean()): this
    //#input(CreateWeblogBean getBean()): this.bean
    //#output(CreateWeblogBean getBean()): return_value
    //#pre[2] (CreateWeblogBean getBean()): init'ed(this.bean)
    //#post(CreateWeblogBean getBean()): return_value == this.bean
    //#post(CreateWeblogBean getBean()): init'ed(return_value)
    //#CreateWeblog.java:190: end of method: CreateWeblogBean org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.getBean()
    }

    public void setBean(CreateWeblogBean bean) {
        this.bean = bean;
    //#CreateWeblog.java:194: method: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.setBean(CreateWeblogBean)
    //#input(void setBean(CreateWeblogBean)): bean
    //#input(void setBean(CreateWeblogBean)): this
    //#output(void setBean(CreateWeblogBean)): this.bean
    //#post(void setBean(CreateWeblogBean)): this.bean == bean
    //#post(void setBean(CreateWeblogBean)): init'ed(this.bean)
    }
    //#CreateWeblog.java:195: end of method: void org.apache.roller.weblogger.ui.struts2.core.CreateWeblog.setBean(CreateWeblogBean)
    
}
    //#CreateWeblog.java:: end of class: org.apache.roller.weblogger.ui.struts2.core.CreateWeblog
