//# 0 errors, 277 messages
//#
/*
    //#BookmarkAdd.java:1:1: class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
 * 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 java.net.MalformedURLException;
import java.net.URL;
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.BookmarkManager;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.pojos.WeblogBookmark;
import org.apache.roller.weblogger.pojos.WeblogBookmarkFolder;
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;


/**
 * Add a new bookmark to a folder.
 */
public class BookmarkAdd extends UIAction {
    
    private static Log log = LogFactory.getLog(BookmarkAdd.class);
    //#BookmarkAdd.java:42: method: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init
    //#BookmarkAdd.java:42: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd]
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.execute()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/BookmarkBean;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.getFolder()Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.getFolderId()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.myPrepare()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.myValidate()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.requiredWeblogPermissions()S
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.save()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.setBean(Lorg/apache/roller/weblogger/ui/struts2/editor/BookmarkBean;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.setFolder(Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.setFolderId(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.validURL(Ljava/lang/String;)Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): log
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.execute()Ljava/lang/String; == &execute
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/BookmarkBean; == &getBean
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.getFolder()Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder; == &getFolder
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.getFolderId()Ljava/lang/String; == &getFolderId
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.myPrepare()V == &myPrepare
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.myValidate()V == &myValidate
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.requiredWeblogPermissions()S == &requiredWeblogPermissions
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.save()Ljava/lang/String; == &save
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.setBean(Lorg/apache/roller/weblogger/ui/struts2/editor/BookmarkBean;)V == &setBean
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.setFolder(Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;)V == &setFolder
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.setFolderId(Ljava/lang/String;)V == &setFolderId
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): __Dispatch_Table.validURL(Ljava/lang/String;)Z == &validURL
    //#post(org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init): init'ed(log)
    //#BookmarkAdd.java:42: end of method: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd__static_init
    
    // the id of the folder we are adding the bookmark into
    private String folderId = null;
    
    // the folder we are adding the bookmark into
    private WeblogBookmarkFolder folder = null;
    
    // bean for managing form data
    private BookmarkBean bean = new BookmarkBean();
    
    
    public BookmarkAdd() {
    //#BookmarkAdd.java:54: method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()
    //#BookmarkAdd.java:54: 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.BookmarkAdd
    //#    method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#input(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new BookmarkBean(BookmarkAdd#1) num objects
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.__Tag
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.description
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.feedUrl
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.id
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.image
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.name
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.priority
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.url
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.weight
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new Integer(BookmarkBean#1) num objects
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new Integer(BookmarkBean#2) num objects
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.actionName
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.desiredMenu
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.folder
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.folderId
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.pageTitle
    //#new obj(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new BookmarkBean(BookmarkAdd#1)
    //#new obj(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new Integer(BookmarkBean#1)
    //#new obj(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new Integer(BookmarkBean#2)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.actionName == &"bookmarkAdd"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean == &new BookmarkBean(BookmarkAdd#1)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.desiredMenu == &"editor"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.folder == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.folderId == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.description == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.feedUrl == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.id == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.image == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.name == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.url == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.pageTitle == &"bookmarkForm.add.title"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new BookmarkBean(BookmarkAdd#1) num objects == 1
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new Integer(BookmarkBean#1) num objects == 1
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): new Integer(BookmarkBean#2) num objects == 1
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.priority == &new Integer(BookmarkBean#2)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): this.bean.weight == &new Integer(BookmarkBean#1)
    //#unanalyzed(void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()): Effects-of-calling:java.lang.Integer
        this.actionName = "bookmarkAdd";
        this.desiredMenu = "editor";
        this.pageTitle = "bookmarkForm.add.title";
    }
    //#BookmarkAdd.java:58: end of method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd()
    
    
    public short requiredWeblogPermissions() {
        return WeblogPermission.ADMIN;
    //#BookmarkAdd.java:62: method: short org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.requiredWeblogPermissions()
    //#input(short requiredWeblogPermissions()): org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#output(short requiredWeblogPermissions()): return_value
    //#presumption(short requiredWeblogPermissions()): init'ed(org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN)
    //#post(short requiredWeblogPermissions()): return_value == org.apache.roller.weblogger.pojos.WeblogPermission.ADMIN
    //#post(short requiredWeblogPermissions()): (soft) init'ed(return_value)
    //#BookmarkAdd.java:62: end of method: short org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.requiredWeblogPermissions()
    }
    
    
    public void myPrepare() {
        try {
            BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
    //#BookmarkAdd.java:68: method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.myPrepare()
    //#BookmarkAdd.java:68: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myPrepare()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#BookmarkAdd.java:68: Warning: method not available
    //#    -- call on BookmarkManager org.apache.roller.weblogger.business.Weblogger:getBookmarkManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myPrepare()
    //#    unanalyzed callee: BookmarkManager org.apache.roller.weblogger.business.Weblogger:getBookmarkManager()
    //#input(void myPrepare()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd]
    //#input(void myPrepare()): __Descendant_Table[others]
    //#input(void myPrepare()): __Dispatch_Table.getFolderId()Ljava/lang/String;
    //#input(void myPrepare()): __Dispatch_Table.setFolder(Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;)V
    //#input(void myPrepare()): log
    //#input(void myPrepare()): this
    //#input(void myPrepare()): this.__Tag
    //#input(void myPrepare()): this.folderId
    //#output(void myPrepare()): this.folder
    //#pre[1] (void myPrepare()): (soft) log != null
    //#pre[4] (void myPrepare()): (soft) this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd
    //#pre[5] (void myPrepare()): (soft) init'ed(this.folderId)
    //#presumption(void myPrepare()): org.apache.roller.weblogger.business.Weblogger:getBookmarkManager(...)@68 != null
    //#presumption(void myPrepare()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@68 != null
    //#post(void myPrepare()): possibly_updated(this.folder)
    //#test_vector(void myPrepare()): org.apache.commons.lang.StringUtils:isEmpty(...)@69: {1}, {0}
            if(!StringUtils.isEmpty(getFolderId())) {
    //#BookmarkAdd.java:69: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myPrepare()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isEmpty(String)
                setFolder(bmgr.getFolder(getFolderId()));
    //#BookmarkAdd.java:70: Warning: method not available
    //#    -- call on WeblogBookmarkFolder org.apache.roller.weblogger.business.BookmarkManager:getFolder(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myPrepare()
    //#    unanalyzed callee: WeblogBookmarkFolder org.apache.roller.weblogger.business.BookmarkManager:getFolder(String)
            }
        } catch (WebloggerException ex) {
            log.error("Error looking up folder", ex);
    //#BookmarkAdd.java:73: 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.BookmarkAdd
    //#    method: void myPrepare()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
        }
    }
    //#BookmarkAdd.java:75: end of method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.myPrepare()
    
    
    @SkipValidation
    public String execute() {
        
        if(getFolder() == null) {
    //#BookmarkAdd.java:81: method: String org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.execute()
    //#input(String execute()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd]
    //#input(String execute()): __Descendant_Table[others]
    //#input(String execute()): __Dispatch_Table.getFolder()Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;
    //#input(String execute()): this
    //#input(String execute()): this.__Tag
    //#input(String execute()): this.folder
    //#output(String execute()): return_value
    //#pre[2] (String execute()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd
    //#pre[3] (String execute()): init'ed(this.folder)
    //#post(String execute()): return_value in Addr_Set{&"input",&"error"}
    //#test_vector(String execute()): this.folder: Inverse{null}, Addr_Set{null}
            // TODO: i18n
            addError("Cannot add bookmark to null folder");
    //#BookmarkAdd.java:83: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String)
            return ERROR;
        }
        
        return INPUT;
    //#BookmarkAdd.java:87: end of method: String org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.execute()
    }

    
    public String save() {
        
        if(getFolder() == null) {
    //#BookmarkAdd.java:93: method: String org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.save()
    //#input(String save()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd]
    //#input(String save()): __Descendant_Table[others]
    //#input(String save()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/BookmarkBean;
    //#input(String save()): __Dispatch_Table.getFolder()Lorg/apache/roller/weblogger/pojos/WeblogBookmarkFolder;
    //#input(String save()): __Dispatch_Table.myValidate()V
    //#input(String save()): __Dispatch_Table.validURL(Ljava/lang/String;)Z
    //#input(String save()): log
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean]
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Descendant_Table[others]
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Dispatch_Table.copyTo(Lorg/apache/roller/weblogger/pojos/WeblogBookmark;)V
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Dispatch_Table.getFeedUrl()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Dispatch_Table.getImage()Ljava/lang/String;
    //#input(String save()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Dispatch_Table.getUrl()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.feedUrl
    //#input(String save()): this.bean.image
    //#input(String save()): this.bean.name
    //#input(String save()): this.bean.priority
    //#input(String save()): this.bean.url
    //#input(String save()): this.bean.weight
    //#input(String save()): this.folder
    //#output(String save()): return_value
    //#pre[3] (String save()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd
    //#pre[13] (String save()): init'ed(this.folder)
    //#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/BookmarkBean
    //#pre[6] (String save()): (soft) init'ed(this.bean.description)
    //#pre[7] (String save()): (soft) init'ed(this.bean.feedUrl)
    //#pre[8] (String save()): (soft) init'ed(this.bean.image)
    //#pre[9] (String save()): (soft) init'ed(this.bean.name)
    //#pre[10] (String save()): (soft) init'ed(this.bean.priority)
    //#pre[11] (String save()): (soft) init'ed(this.bean.url)
    //#pre[12] (String save()): (soft) init'ed(this.bean.weight)
    //#presumption(String save()): org.apache.roller.weblogger.business.Weblogger:getBookmarkManager(...)@108 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@108 != null
    //#presumption(String save()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@110 != null
    //#post(String save()): return_value in Addr_Set{&"success",&"input",&"error"}
    //#unanalyzed(String save()): Effects-of-calling:java.net.URL
    //#unanalyzed(String save()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogBookmark:setName
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogBookmark:setDescription
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogBookmark:setUrl
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogBookmark:setWeight
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogBookmark:setPriority
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogBookmark:setImage
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogBookmark:setFeedUrl
    //#unanalyzed(String save()): Effects-of-calling:org.apache.commons.lang.StringUtils:isNotEmpty
    //#unanalyzed(String save()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError
    //#test_vector(String save()): this.folder: Inverse{null}, Addr_Set{null}
    //#test_vector(String save()): org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:hasActionErrors(...)@102: {1}, {0}
            // TODO: i18n
            addError("Cannot add bookmark to null folder");
    //#BookmarkAdd.java:95: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String)
            return ERROR;
        }
        
        // validation
        myValidate();
        
        if(!hasActionErrors()) try {
    //#BookmarkAdd.java:102: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:hasActionErrors()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:hasActionErrors()
            
            WeblogBookmark newBookmark = new WeblogBookmark();
    //#BookmarkAdd.java:104: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogBookmark()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogBookmark()
            newBookmark.setFolder(getFolder());
    //#BookmarkAdd.java:105: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogBookmark:setFolder(WeblogBookmarkFolder)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogBookmark:setFolder(WeblogBookmarkFolder)
            getBean().copyTo(newBookmark);
            
            BookmarkManager bmgr = WebloggerFactory.getWeblogger().getBookmarkManager();
    //#BookmarkAdd.java:108: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#BookmarkAdd.java:108: Warning: method not available
    //#    -- call on BookmarkManager org.apache.roller.weblogger.business.Weblogger:getBookmarkManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: BookmarkManager org.apache.roller.weblogger.business.Weblogger:getBookmarkManager()
            bmgr.saveBookmark(newBookmark);
    //#BookmarkAdd.java:109: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.BookmarkManager:saveBookmark(WeblogBookmark)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.BookmarkManager:saveBookmark(WeblogBookmark)
            WebloggerFactory.getWeblogger().flush();
    //#BookmarkAdd.java:110: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#BookmarkAdd.java:110: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:flush()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:flush()
            
            CacheManager.invalidate(newBookmark);
    //#BookmarkAdd.java:112: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.util.cache.CacheManager:invalidate(WeblogBookmark)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.util.cache.CacheManager:invalidate(WeblogBookmark)
            
            // TODO: i18n
            addMessage("bookmark added");
    //#BookmarkAdd.java:115: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addMessage(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addMessage(String)
            
            return SUCCESS;
            
        } catch(Exception ex) {
            log.error("Error saving new bookmark", ex);
    //#BookmarkAdd.java:120: 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.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("Error saving new bookmark");
    //#BookmarkAdd.java:122: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: String save()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String)
        }

        
        return INPUT;
    //#BookmarkAdd.java:126: end of method: String org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.save()
    }

    
    // TODO: validation
    public void myValidate() {
        
        // name is required, max length, no html
        
        // url is required, valid url
        
        if (StringUtils.isNotEmpty(getBean().getUrl()) && !validURL(getBean().getUrl())) {
    //#BookmarkAdd.java:137: method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.myValidate()
    //#BookmarkAdd.java:137: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isNotEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myValidate()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isNotEmpty(String)
    //#input(void myValidate()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd]
    //#input(void myValidate()): __Descendant_Table[others]
    //#input(void myValidate()): __Dispatch_Table.getBean()Lorg/apache/roller/weblogger/ui/struts2/editor/BookmarkBean;
    //#input(void myValidate()): __Dispatch_Table.validURL(Ljava/lang/String;)Z
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean]
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Descendant_Table[others]
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Dispatch_Table.getFeedUrl()Ljava/lang/String;
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Dispatch_Table.getImage()Ljava/lang/String;
    //#input(void myValidate()): org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean.__Dispatch_Table.getUrl()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.feedUrl
    //#input(void myValidate()): this.bean.image
    //#input(void myValidate()): this.bean.url
    //#pre[2] (void myValidate()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd
    //#pre[3] (void myValidate()): this.bean != null
    //#pre[4] (void myValidate()): this.bean.__Tag == org/apache/roller/weblogger/ui/struts2/editor/BookmarkBean
    //#pre[5] (void myValidate()): init'ed(this.bean.feedUrl)
    //#pre[6] (void myValidate()): init'ed(this.bean.image)
    //#pre[7] (void myValidate()): init'ed(this.bean.url)
    //#unanalyzed(void myValidate()): Effects-of-calling:java.net.URL
    //#unanalyzed(void myValidate()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#test_vector(void myValidate()): org.apache.commons.lang.StringUtils:isNotEmpty(...)@137: {0}, {1}
    //#test_vector(void myValidate()): org.apache.commons.lang.StringUtils:isNotEmpty(...)@140: {0}, {1}
    //#test_vector(void myValidate()): org.apache.commons.lang.StringUtils:isNotEmpty(...)@143: {0}, {1}
            addError("bookmarkForm.error.invalidURL", getBean().getUrl());
    //#BookmarkAdd.java:138: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String, String)
        }
        if (StringUtils.isNotEmpty(getBean().getFeedUrl()) && !validURL(getBean().getFeedUrl())) {
    //#BookmarkAdd.java:140: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isNotEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myValidate()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isNotEmpty(String)
            addError("bookmarkForm.error.invalidURL", getBean().getFeedUrl());
    //#BookmarkAdd.java:141: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String, String)
        }
        if (StringUtils.isNotEmpty(getBean().getImage()) && !validURL(getBean().getImage())) {
    //#BookmarkAdd.java:143: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isNotEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myValidate()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isNotEmpty(String)
            addError("bookmarkForm.error.invalidURL", getBean().getImage());
    //#BookmarkAdd.java:144: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd:addError(String, String)
        }
    }
    //#BookmarkAdd.java:146: end of method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.myValidate()
    
    public boolean validURL(String url) {
        boolean valid = false;
    //#BookmarkAdd.java:149: method: bool org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.validURL(String)
    //#input(bool validURL(String)): url
    //#output(bool validURL(String)): return_value
    //#post(bool validURL(String)): init'ed(return_value)
        try {
            URL test = new URL(url);
    //#BookmarkAdd.java:151: Warning: unused assignment
    //#    unused assignment into test
    //#    severity: LOW
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd
    //#    method: bool validURL(String)
            valid = true;
        } catch (MalformedURLException intentionallyIgnored) {}
        return valid;
    //#BookmarkAdd.java:154: end of method: bool org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.validURL(String)
    }
    
    
    public String getFolderId() {
        return folderId;
    //#BookmarkAdd.java:159: method: String org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.getFolderId()
    //#input(String getFolderId()): this
    //#input(String getFolderId()): this.folderId
    //#output(String getFolderId()): return_value
    //#pre[2] (String getFolderId()): init'ed(this.folderId)
    //#post(String getFolderId()): return_value == this.folderId
    //#post(String getFolderId()): init'ed(return_value)
    //#BookmarkAdd.java:159: end of method: String org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.getFolderId()
    }

    public void setFolderId(String folderId) {
        this.folderId = folderId;
    //#BookmarkAdd.java:163: method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.setFolderId(String)
    //#input(void setFolderId(String)): folderId
    //#input(void setFolderId(String)): this
    //#output(void setFolderId(String)): this.folderId
    //#post(void setFolderId(String)): this.folderId == folderId
    //#post(void setFolderId(String)): init'ed(this.folderId)
    }
    //#BookmarkAdd.java:164: end of method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.setFolderId(String)

    public WeblogBookmarkFolder getFolder() {
        return folder;
    //#BookmarkAdd.java:167: method: WeblogBookmarkFolder org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.getFolder()
    //#input(WeblogBookmarkFolder getFolder()): this
    //#input(WeblogBookmarkFolder getFolder()): this.folder
    //#output(WeblogBookmarkFolder getFolder()): return_value
    //#pre[2] (WeblogBookmarkFolder getFolder()): init'ed(this.folder)
    //#post(WeblogBookmarkFolder getFolder()): return_value == this.folder
    //#post(WeblogBookmarkFolder getFolder()): init'ed(return_value)
    //#BookmarkAdd.java:167: end of method: WeblogBookmarkFolder org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.getFolder()
    }

    public void setFolder(WeblogBookmarkFolder folder) {
        this.folder = folder;
    //#BookmarkAdd.java:171: method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.setFolder(WeblogBookmarkFolder)
    //#input(void setFolder(WeblogBookmarkFolder)): folder
    //#input(void setFolder(WeblogBookmarkFolder)): this
    //#output(void setFolder(WeblogBookmarkFolder)): this.folder
    //#post(void setFolder(WeblogBookmarkFolder)): this.folder == folder
    //#post(void setFolder(WeblogBookmarkFolder)): init'ed(this.folder)
    }
    //#BookmarkAdd.java:172: end of method: void org.apache.roller.weblogger.ui.struts2.editor.BookmarkAdd.setFolder(WeblogBookmarkFolder)

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

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