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

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

import org.apache.commons.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.business.WebloggerFactory;
import org.apache.roller.weblogger.business.WeblogManager;
import org.apache.roller.weblogger.pojos.WeblogCategory;
import org.apache.roller.weblogger.pojos.WeblogPermission;
import org.apache.roller.weblogger.ui.struts2.util.UIAction;
import org.apache.roller.weblogger.util.cache.CacheManager;
import org.apache.struts2.interceptor.validation.SkipValidation;


/**
 * Edit an existing Category.
 */
public class CategoryEdit extends UIAction {
    
    private static Log log = LogFactory.getLog(CategoryEdit.class);
    //#CategoryEdit.java:39: method: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init
    //#CategoryEdit.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.editor.CategoryEdit
    //#    method: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit]
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.execute()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.getCategory()Lorg/apache/roller/weblogger/pojos/WeblogCategory;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.myPrepare()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.myValidate()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.requiredWeblogPermissions()S
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.save()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.setBean(Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.setCategory(Lorg/apache/roller/weblogger/pojos/WeblogCategory;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): log
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.execute()Ljava/lang/String; == &execute
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean; == &getBean
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.getCategory()Lorg/apache/roller/weblogger/pojos/WeblogCategory; == &getCategory
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.myPrepare()V == &myPrepare
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.myValidate()V == &myValidate
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.requiredWeblogPermissions()S == &requiredWeblogPermissions
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.save()Ljava/lang/String; == &save
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.setBean(Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean;)V == &setBean
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): __Dispatch_Table.setCategory(Lorg/apache/roller/weblogger/pojos/WeblogCategory;)V == &setCategory
    //#post(org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init): init'ed(log)
    //#CategoryEdit.java:39: end of method: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit__static_init
    
    // the category we are editing
    private WeblogCategory category = null;
    
    // bean for managing form data
    private CategoryBean bean = new CategoryBean();
    
    
    public CategoryEdit() {
    //#CategoryEdit.java:48: method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()
    //#CategoryEdit.java:48: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#input(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): new CategoryBean(CategoryEdit#1) num objects
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.__Tag
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.description
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.id
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.image
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.name
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.actionName
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.category
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.desiredMenu
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.pageTitle
    //#new obj(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): new CategoryBean(CategoryEdit#1)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.actionName == &"categoryEdit"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean == &new CategoryBean(CategoryEdit#1)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.category == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.description == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.id == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.image == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.name == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.desiredMenu == &"editor"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.pageTitle == &"categoryForm.edit.title"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): new CategoryBean(CategoryEdit#1) num objects == 1
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()): this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryBean
        this.actionName = "categoryEdit";
        this.desiredMenu = "editor";
        this.pageTitle = "categoryForm.edit.title";
    }
    //#CategoryEdit.java:52: end of method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit()
    
    
    // author perms required
    public short requiredWeblogPermissions() {
        return WeblogPermission.AUTHOR;
    //#CategoryEdit.java:57: method: short org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.requiredWeblogPermissions()
    //#input(short requiredWeblogPermissions()): org.apache.roller.weblogger.pojos.WeblogPermission.AUTHOR
    //#output(short requiredWeblogPermissions()): return_value
    //#presumption(short requiredWeblogPermissions()): init'ed(org.apache.roller.weblogger.pojos.WeblogPermission.AUTHOR)
    //#post(short requiredWeblogPermissions()): return_value == org.apache.roller.weblogger.pojos.WeblogPermission.AUTHOR
    //#post(short requiredWeblogPermissions()): (soft) init'ed(return_value)
    //#CategoryEdit.java:57: end of method: short org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.requiredWeblogPermissions()
    }
    
    
    public void myPrepare() {
        try {
            WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
    //#CategoryEdit.java:63: method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.myPrepare()
    //#CategoryEdit.java:63: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myPrepare()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CategoryEdit.java:63: Warning: method not available
    //#    -- call on WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myPrepare()
    //#    unanalyzed callee: WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
    //#input(void myPrepare()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit]
    //#input(void myPrepare()): __Descendant_Table[others]
    //#input(void myPrepare()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean;
    //#input(void myPrepare()): __Dispatch_Table.setCategory(Lorg/apache/roller/weblogger/pojos/WeblogCategory;)V
    //#input(void myPrepare()): log
    //#input(void myPrepare()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryBean]
    //#input(void myPrepare()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[others]
    //#input(void myPrepare()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Dispatch_Table.getId()Ljava/lang/String;
    //#input(void myPrepare()): this
    //#input(void myPrepare()): this.__Tag
    //#input(void myPrepare()): this.bean
    //#input(void myPrepare()): this.bean.__Tag
    //#input(void myPrepare()): this.bean.id
    //#output(void myPrepare()): this.category
    //#pre[1] (void myPrepare()): (soft) log != null
    //#pre[4] (void myPrepare()): (soft) this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit
    //#pre[5] (void myPrepare()): (soft) this.bean != null
    //#pre[6] (void myPrepare()): (soft) this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryBean
    //#pre[7] (void myPrepare()): (soft) init'ed(this.bean.id)
    //#presumption(void myPrepare()): org.apache.roller.weblogger.business.Weblogger:getWeblogManager(...)@63 != null
    //#presumption(void myPrepare()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@63 != null
    //#post(void myPrepare()): possibly_updated(this.category)
    //#test_vector(void myPrepare()): org.apache.commons.lang.StringUtils:isEmpty(...)@64: {1}, {0}
            if(!StringUtils.isEmpty(getBean().getId())) {
    //#CategoryEdit.java:64: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myPrepare()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isEmpty(String)
                setCategory(wmgr.getWeblogCategory(getBean().getId()));
    //#CategoryEdit.java:65: Warning: method not available
    //#    -- call on WeblogCategory org.apache.roller.weblogger.business.WeblogManager:getWeblogCategory(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myPrepare()
    //#    unanalyzed callee: WeblogCategory org.apache.roller.weblogger.business.WeblogManager:getWeblogCategory(String)
            }
        } catch (WebloggerException ex) {
            log.error("Error looking up category", ex);
    //#CategoryEdit.java:68: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myPrepare()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
        }
    }
    //#CategoryEdit.java:70: end of method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.myPrepare()
    
    
    /**
     * Show category form.
     */
    @SkipValidation
    public String execute() {
        
        if(getCategory() == null) {
    //#CategoryEdit.java:79: method: String org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.execute()
    //#input(String execute()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit]
    //#input(String execute()): __Descendant_Table[others]
    //#input(String execute()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean;
    //#input(String execute()): __Dispatch_Table.getCategory()Lorg/apache/roller/weblogger/pojos/WeblogCategory;
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryBean]
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[others]
    //#input(String execute()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Dispatch_Table.copyFrom(Lorg/apache/roller/weblogger/pojos/WeblogCategory;)V
    //#input(String execute()): this
    //#input(String execute()): this.__Tag
    //#input(String execute()): this.bean
    //#input(String execute()): this.bean.__Tag
    //#input(String execute()): this.category
    //#output(String execute()): return_value
    //#output(String execute()): this.bean.description
    //#output(String execute()): this.bean.id
    //#output(String execute()): this.bean.image
    //#output(String execute()): this.bean.name
    //#pre[6] (String execute()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit
    //#pre[9] (String execute()): init'ed(this.category)
    //#pre[7] (String execute()): (soft) this.bean != null
    //#pre[8] (String execute()): (soft) this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryBean
    //#post(String execute()): return_value in Addr_Set{&"input",&"error"}
    //#post(String execute()): possibly_updated(this.bean.description)
    //#post(String execute()): possibly_updated(this.bean.id)
    //#post(String execute()): possibly_updated(this.bean.image)
    //#post(String execute()): possibly_updated(this.bean.name)
    //#unanalyzed(String execute()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:getName
    //#unanalyzed(String execute()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:getId
    //#unanalyzed(String execute()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:getDescription
    //#unanalyzed(String execute()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:getImage
    //#test_vector(String execute()): this.category: Inverse{null}, Addr_Set{null}
            // TODO: i18n
            addError("Cannot edit null category");
    //#CategoryEdit.java:81: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String)
            return ERROR;
        }
        
        // make sure bean is properly loaded from pojo data
        getBean().copyFrom(getCategory());
        
        return INPUT;
    //#CategoryEdit.java:88: end of method: String org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.execute()
    }

    
    /**
     * Save new category.
     */
    public String save() {
        
        if(getCategory() == null) {
    //#CategoryEdit.java:97: method: String org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.save()
    //#input(String save()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit]
    //#input(String save()): __Descendant_Table[others]
    //#input(String save()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean;
    //#input(String save()): __Dispatch_Table.getCategory()Lorg/apache/roller/weblogger/pojos/WeblogCategory;
    //#input(String save()): __Dispatch_Table.myValidate()V
    //#input(String save()): log
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryBean]
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[others]
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Dispatch_Table.copyTo(Lorg/apache/roller/weblogger/pojos/WeblogCategory;)V
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Dispatch_Table.getName()Ljava/lang/String;
    //#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.image
    //#input(String save()): this.bean.name
    //#input(String save()): this.category
    //#output(String save()): return_value
    //#pre[3] (String save()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit
    //#pre[9] (String save()): init'ed(this.category)
    //#pre[1] (String save()): (soft) log != null
    //#pre[4] (String save()): (soft) this.bean != null
    //#pre[5] (String save()): (soft) this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryBean
    //#pre[6] (String save()): (soft) init'ed(this.bean.description)
    //#pre[7] (String save()): (soft) init'ed(this.bean.image)
    //#pre[8] (String save()): (soft) init'ed(this.bean.name)
    //#presumption(String save()): org.apache.roller.weblogger.business.Weblogger:getWeblogManager(...)@112 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@112 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@114 != null
    //#post(String save()): return_value in Addr_Set{&"input",&"error"}
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:getName
    //#unanalyzed(String save()): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:updateName
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:setDescription
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:setImage
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:getParent
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogCategory:hasCategory
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError
    //#test_vector(String save()): this.category: Inverse{null}, Addr_Set{null}
    //#test_vector(String save()): org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:hasActionErrors(...)@106: {1}, {0}
            // TODO: i18n
            addError("Cannot edit null category");
    //#CategoryEdit.java:99: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String)
            return ERROR;
        }
        
        // validation
        myValidate();
        
        if(!hasActionErrors()) try {
    //#CategoryEdit.java:106: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:hasActionErrors()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:hasActionErrors()
            
            // copy updated attributes
            getBean().copyTo(getCategory());
            
            // save changes
            WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
    //#CategoryEdit.java:112: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CategoryEdit.java:112: Warning: method not available
    //#    -- call on WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: WeblogManager org.apache.roller.weblogger.business.Weblogger:getWeblogManager()
            wmgr.saveWeblogCategory(getCategory());
    //#CategoryEdit.java:113: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.WeblogManager:saveWeblogCategory(WeblogCategory)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.WeblogManager:saveWeblogCategory(WeblogCategory)
            WebloggerFactory.getWeblogger().flush();
    //#CategoryEdit.java:114: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#CategoryEdit.java:114: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:flush()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:flush()
            
            // notify caches
            CacheManager.invalidate(getCategory());
    //#CategoryEdit.java:117: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.CacheManager:invalidate(WeblogCategory)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.CacheManager:invalidate(WeblogCategory)
            
            // TODO: i18n
            addMessage("category updated");
    //#CategoryEdit.java:120: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addMessage(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addMessage(String)
            
        } catch(Exception ex) {
            log.error("Error saving category", ex);
    //#CategoryEdit.java:123: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("Error saving category");
    //#CategoryEdit.java:125: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String)
        }
        
        return INPUT;
    //#CategoryEdit.java:128: end of method: String org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.save()
    }

    
    // TODO: validation
    public void myValidate() {
        
        // name is required, has max length, no html
        
        // make sure new name is not a duplicate of an existing category
        if(!getCategory().getName().equals(getBean().getName())) {
    //#CategoryEdit.java:138: method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.myValidate()
    //#CategoryEdit.java:138: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogCategory:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myValidate()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogCategory:getName()
    //#input(void myValidate()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit]
    //#input(void myValidate()): __Descendant_Table[others]
    //#input(void myValidate()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/CategoryBean;
    //#input(void myValidate()): __Dispatch_Table.getCategory()Lorg/apache/roller/weblogger/pojos/WeblogCategory;
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/CategoryBean]
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Descendant_Table[others]
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/CategoryBean.__Dispatch_Table.getName()Ljava/lang/String;
    //#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.name
    //#input(void myValidate()): this.category
    //#pre[2] (void myValidate()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit
    //#pre[3] (void myValidate()): this.bean != null
    //#pre[4] (void myValidate()): this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/editor/CategoryBean
    //#pre[5] (void myValidate()): init'ed(this.bean.name)
    //#pre[6] (void myValidate()): this.category != null
    //#presumption(void myValidate()): org.apache.roller.weblogger.pojos.WeblogCategory:getName(...)@138 != null
    //#test_vector(void myValidate()): java.lang.String:equals(...)@138: {1}, {0}
    //#test_vector(void myValidate()): org.apache.roller.weblogger.pojos.WeblogCategory:getParent(...)@139: Addr_Set{null}, Inverse{null}
    //#test_vector(void myValidate()): org.apache.roller.weblogger.pojos.WeblogCategory:hasCategory(...)@140: {0}, {1}
            WeblogCategory parent = getCategory().getParent();
    //#CategoryEdit.java:139: Warning: method not available
    //#    -- call on WeblogCategory org.apache.roller.weblogger.pojos.WeblogCategory:getParent()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myValidate()
    //#    unanalyzed callee: WeblogCategory org.apache.roller.weblogger.pojos.WeblogCategory:getParent()
            if(parent != null && parent.hasCategory(getBean().getName())) {
    //#CategoryEdit.java:140: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.pojos.WeblogCategory:hasCategory(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myValidate()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.pojos.WeblogCategory:hasCategory(String)
                addError("categoryForm.error.duplicateName", getBean().getName());
    //#CategoryEdit.java:141: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit:addError(String, String)
            }
        }
    }
    //#CategoryEdit.java:144: end of method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.myValidate()


    public WeblogCategory getCategory() {
        return category;
    //#CategoryEdit.java:148: method: WeblogCategory org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.getCategory()
    //#input(WeblogCategory getCategory()): this
    //#input(WeblogCategory getCategory()): this.category
    //#output(WeblogCategory getCategory()): return_value
    //#pre[2] (WeblogCategory getCategory()): init'ed(this.category)
    //#post(WeblogCategory getCategory()): return_value == this.category
    //#post(WeblogCategory getCategory()): init'ed(return_value)
    //#CategoryEdit.java:148: end of method: WeblogCategory org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.getCategory()
    }

    public void setCategory(WeblogCategory category) {
        this.category = category;
    //#CategoryEdit.java:152: method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.setCategory(WeblogCategory)
    //#input(void setCategory(WeblogCategory)): category
    //#input(void setCategory(WeblogCategory)): this
    //#output(void setCategory(WeblogCategory)): this.category
    //#post(void setCategory(WeblogCategory)): this.category == category
    //#post(void setCategory(WeblogCategory)): init'ed(this.category)
    }
    //#CategoryEdit.java:153: end of method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.setCategory(WeblogCategory)

    public CategoryBean getBean() {
        return bean;
    //#CategoryEdit.java:156: method: CategoryBean org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.getBean()
    //#input(CategoryBean getBean()): this
    //#input(CategoryBean getBean()): this.bean
    //#output(CategoryBean getBean()): return_value
    //#pre[2] (CategoryBean getBean()): init'ed(this.bean)
    //#post(CategoryBean getBean()): return_value == this.bean
    //#post(CategoryBean getBean()): init'ed(return_value)
    //#CategoryEdit.java:156: end of method: CategoryBean org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.getBean()
    }

    public void setBean(CategoryBean bean) {
        this.bean = bean;
    //#CategoryEdit.java:160: method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.setBean(CategoryBean)
    //#input(void setBean(CategoryBean)): bean
    //#input(void setBean(CategoryBean)): this
    //#output(void setBean(CategoryBean)): this.bean
    //#post(void setBean(CategoryBean)): this.bean == bean
    //#post(void setBean(CategoryBean)): init'ed(this.bean)
    }
    //#CategoryEdit.java:161: end of method: void org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit.setBean(CategoryBean)
    
}
    //#CategoryEdit.java:: end of class: org.apache.roller.weblogger.ui.struts2.editor.CategoryEdit
