//# 0 errors, 408 messages
//#
/*
    //#Templates.java:1:1: class: org.apache.roller.weblogger.ui.struts2.editor.Templates
 * 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.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
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.UserManager;
import org.apache.roller.weblogger.pojos.WeblogPermission;
import org.apache.roller.weblogger.pojos.WeblogTemplate;
import org.apache.roller.weblogger.pojos.WeblogTheme;
import org.apache.roller.weblogger.ui.struts2.util.UIAction;


/**
 * Templates listing page.
 */
public class Templates extends UIAction {
    
    private static Log log = LogFactory.getLog(Templates.class);
    //#Templates.java:42: method: org.apache.roller.weblogger.ui.struts2.editor.Templates.org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init
    //#Templates.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.Templates
    //#    method: org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.add()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addError(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addError(Ljava/lang/String;Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addError(Ljava/lang/String;Ljava/util/List;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;Ljava/util/List;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.errorsExist()Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.execute()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getAbsoluteSiteURL()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getActionName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getActionWeblog()Lorg/apache/roller/weblogger/pojos/Weblog;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getAuthenticatedUser()Lorg/apache/roller/weblogger/pojos/User;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getAvailableActions()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getBooleanProp(Ljava/lang/String;)Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getCommentDaysList()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getDesiredMenu()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getHoursList()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getIntProp(Ljava/lang/String;)I
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getLocalesList()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getMediumDateFormat()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getMenu()Lorg/apache/roller/weblogger/ui/core/util/menu/Menu;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getMinutesList()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getNewTmplAction()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getNewTmplName()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getPageTitle()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getProp(Ljava/lang/String;)Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getSecondsList()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getShortDateFormat()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getSiteURL()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getTemplates()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getTimeZonesList()Ljava/util/List;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getWeblog()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.isUserIsAdmin()Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.isUserRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.isWeblogRequired()Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.messagesExist()Z
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.myPrepare()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.myValidate()V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.requiredUserRole()Ljava/lang/String;
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.requiredWeblogPermissions()S
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setActionName(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setActionWeblog(Lorg/apache/roller/weblogger/pojos/Weblog;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setAuthenticatedUser(Lorg/apache/roller/weblogger/pojos/User;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setAvailableActions(Ljava/util/List;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setDesiredMenu(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setNewTmplAction(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setNewTmplName(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setPageTitle(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setTemplates(Ljava/util/List;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setWeblog(Ljava/lang/String;)V
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): log
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): org/apache/roller/weblogger/ui/struts2/util/UIAction.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#output(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): org/apache/roller/weblogger/ui/struts2/util/UISecurityEnforced.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): org/apache/roller/weblogger/ui/struts2/util/UIAction.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): org/apache/roller/weblogger/ui/struts2/util/UIActionPreparable.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): org/apache/roller/weblogger/ui/struts2/util/UISecurityEnforced.__Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.add()Ljava/lang/String; == &add
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addError(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.addError
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addError(Ljava/lang/String;Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.addError
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addError(Ljava/lang/String;Ljava/util/List;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.addError
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.addMessage
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.addMessage
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.addMessage(Ljava/lang/String;Ljava/util/List;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.addMessage
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.errorsExist()Z == &org/apache/roller/weblogger/ui/struts2/util/UIAction.errorsExist
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.execute()Ljava/lang/String; == &execute
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getAbsoluteSiteURL()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getAbsoluteSiteURL
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getActionName()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getActionName
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getActionWeblog()Lorg/apache/roller/weblogger/pojos/Weblog; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getActionWeblog
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getAuthenticatedUser()Lorg/apache/roller/weblogger/pojos/User; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getAuthenticatedUser
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getAvailableActions()Ljava/util/List; == &getAvailableActions
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getBooleanProp(Ljava/lang/String;)Z == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getBooleanProp
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getCommentDaysList()Ljava/util/List; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getCommentDaysList
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getDesiredMenu()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getDesiredMenu
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getHoursList()Ljava/util/List; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getHoursList
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getIntProp(Ljava/lang/String;)I == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getIntProp
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getLocalesList()Ljava/util/List; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getLocalesList
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getMediumDateFormat()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getMediumDateFormat
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getMenu()Lorg/apache/roller/weblogger/ui/core/util/menu/Menu; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getMenu
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getMinutesList()Ljava/util/List; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getMinutesList
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getNewTmplAction()Ljava/lang/String; == &getNewTmplAction
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getNewTmplName()Ljava/lang/String; == &getNewTmplName
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getPageTitle()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getPageTitle
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getProp(Ljava/lang/String;)Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getProp
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getSecondsList()Ljava/util/List; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getSecondsList
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getShortDateFormat()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getShortDateFormat
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getSiteURL()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getSiteURL
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getTemplates()Ljava/util/List; == &getTemplates
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getTimeZonesList()Ljava/util/List; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getTimeZonesList
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.getWeblog()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.getWeblog
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.isUserIsAdmin()Z == &org/apache/roller/weblogger/ui/struts2/util/UIAction.isUserIsAdmin
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.isUserRequired()Z == &org/apache/roller/weblogger/ui/struts2/util/UIAction.isUserRequired
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.isWeblogRequired()Z == &org/apache/roller/weblogger/ui/struts2/util/UIAction.isWeblogRequired
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.messagesExist()Z == &org/apache/roller/weblogger/ui/struts2/util/UIAction.messagesExist
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.myPrepare()V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.myPrepare
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.myValidate()V == &myValidate
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.requiredUserRole()Ljava/lang/String; == &org/apache/roller/weblogger/ui/struts2/util/UIAction.requiredUserRole
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.requiredWeblogPermissions()S == &requiredWeblogPermissions
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setActionName(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.setActionName
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setActionWeblog(Lorg/apache/roller/weblogger/pojos/Weblog;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.setActionWeblog
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setAuthenticatedUser(Lorg/apache/roller/weblogger/pojos/User;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.setAuthenticatedUser
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setAvailableActions(Ljava/util/List;)V == &setAvailableActions
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setDesiredMenu(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.setDesiredMenu
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setNewTmplAction(Ljava/lang/String;)V == &setNewTmplAction
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setNewTmplName(Ljava/lang/String;)V == &setNewTmplName
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setPageTitle(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.setPageTitle
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setTemplates(Ljava/util/List;)V == &setTemplates
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): __Dispatch_Table.setWeblog(Ljava/lang/String;)V == &org/apache/roller/weblogger/ui/struts2/util/UIAction.setWeblog
    //#post(org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init): init'ed(log)
    //#Templates.java:42: end of method: org.apache.roller.weblogger.ui.struts2.editor.Templates.org.apache.roller.weblogger.ui.struts2.editor.Templates__static_init
    
    // list of templates to display
    private List<WeblogTemplate> templates = Collections.EMPTY_LIST;
    
    // list of template action types user is allowed to create
    private List availableActions = Collections.EMPTY_LIST;
    
    // name and action of new template if we are adding a template
    private String newTmplName = null;
    private String newTmplAction = null;
    
    
    public Templates() {
    //#Templates.java:55: method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.org.apache.roller.weblogger.ui.struts2.editor.Templates()
    //#input(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): java.util.Collections.EMPTY_LIST
    //#input(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.actionName
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.actionWeblog
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.authenticatedUser
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.availableActions
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.desiredMenu
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.newTmplAction
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.newTmplName
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.pageTitle
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.templates
    //#output(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.weblog
    //#presumption(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): init'ed(java.util.Collections.EMPTY_LIST)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.actionName == &"templates"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.actionWeblog == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.authenticatedUser == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.newTmplAction == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.newTmplName == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.weblog == null
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.availableActions == java.util.Collections.EMPTY_LIST
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): (soft) init'ed(this.availableActions)
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.templates == this.availableActions
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.desiredMenu == &"editor"
    //#post(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): this.pageTitle == &"pagesForm.title"
    //#unanalyzed(void org.apache.roller.weblogger.ui.struts2.editor.Templates()): Effects-of-calling:com.opensymphony.xwork2.ActionSupport
        this.actionName = "templates";
        this.desiredMenu = "editor";
        this.pageTitle = "pagesForm.title";
    }
    //#Templates.java:59: end of method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.org.apache.roller.weblogger.ui.struts2.editor.Templates()
    
    
    public short requiredWeblogPermissions() {
        return WeblogPermission.ADMIN;
    //#Templates.java:63: method: short org.apache.roller.weblogger.ui.struts2.editor.Templates.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)
    //#Templates.java:63: end of method: short org.apache.roller.weblogger.ui.struts2.editor.Templates.requiredWeblogPermissions()
    }
    
    
    public String execute() {
        
        // query for templates list
        try {
            UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#Templates.java:71: method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.execute()
    //#Templates.java:71: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#Templates.java:71: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#input(String execute()): "Error getting templates for weblog - "._tainted
    //#input(String execute()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#input(String execute()): __Descendant_Table[others]
    //#input(String execute()): __Dispatch_Table.addError(Ljava/lang/String;)V
    //#input(String execute()): __Dispatch_Table.getActionWeblog()Lorg/apache/roller/weblogger/pojos/Weblog;
    //#input(String execute()): __Dispatch_Table.getTemplates()Ljava/util/List;
    //#input(String execute()): __Dispatch_Table.setAvailableActions(Ljava/util/List;)V
    //#input(String execute()): __Dispatch_Table.setTemplates(Ljava/util/List;)V
    //#input(String execute()): log
    //#input(String execute()): this
    //#input(String execute()): this.__Tag
    //#input(String execute()): this.actionWeblog
    //#output(String execute()): new ArrayList(execute#1) num objects
    //#output(String execute()): new ArrayList(execute#2) num objects
    //#output(String execute()): return_value
    //#output(String execute()): this.availableActions
    //#output(String execute()): this.templates
    //#new obj(String execute()): new ArrayList(execute#1)
    //#new obj(String execute()): new ArrayList(execute#2)
    //#pre[5] (String execute()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/Templates
    //#pre[6] (String execute()): this.actionWeblog != null
    //#pre[1] (String execute()): (soft) log != null
    //#presumption(String execute()): java.util.Iterator:next(...)@95 != null
    //#presumption(String execute()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@71 != null
    //#presumption(String execute()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@71 != null
    //#presumption(String execute()): org.apache.roller.weblogger.pojos.Weblog:getTheme(...)@77 != null
    //#presumption(String execute()): org.apache.roller.weblogger.pojos.Weblog:getTheme(...)@78 != null
    //#presumption(String execute()): org.apache.roller.weblogger.pojos.WeblogTheme:getStylesheet(...)@78 != null
    //#post(String execute()): return_value == &"list"
    //#post(String execute()): this.availableActions == One-of{&new ArrayList(execute#2), old this.availableActions}
    //#post(String execute()): this.templates == One-of{&new ArrayList(execute#1), old this.templates}
    //#post(String execute()): new ArrayList(execute#1) num objects <= 1
    //#post(String execute()): new ArrayList(execute#2) num objects <= 1
    //#unanalyzed(String execute()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.util.UIAction:getText
    //#unanalyzed(String execute()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.util.UIAction:addActionError
    //#test_vector(String execute()): java.lang.String:equals(...)@87: {0}, {1}
    //#test_vector(String execute()): java.lang.String:equals(...)@96: {1}, {0}
    //#test_vector(String execute()): java.util.Iterator:hasNext(...)@95: {0}, {1}
    //#test_vector(String execute()): org.apache.roller.weblogger.pojos.WeblogTheme:getStylesheet(...)@77: Addr_Set{null}, Inverse{null}
            
            // get current list of templates, minus custom stylesheet
            List<WeblogTemplate> raw = mgr.getPages(getActionWeblog()); 
    //#Templates.java:74: Warning: method not available
    //#    -- call on List org.apache.roller.weblogger.business.UserManager:getPages(Weblog)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: List org.apache.roller.weblogger.business.UserManager:getPages(Weblog)
            List<WeblogTemplate> pages = new ArrayList<WeblogTemplate>();
            pages.addAll(raw);
            if(getActionWeblog().getTheme().getStylesheet() != null) {
    //#Templates.java:77: Warning: method not available
    //#    -- call on WeblogTheme org.apache.roller.weblogger.pojos.Weblog:getTheme()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: WeblogTheme org.apache.roller.weblogger.pojos.Weblog:getTheme()
    //#Templates.java:77: Warning: method not available
    //#    -- call on ThemeTemplate org.apache.roller.weblogger.pojos.WeblogTheme:getStylesheet()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: ThemeTemplate org.apache.roller.weblogger.pojos.WeblogTheme:getStylesheet()
                pages.remove(mgr.getPageByLink(getActionWeblog(), 
    //#Templates.java:78: Warning: method not available
    //#    -- call on WeblogTheme org.apache.roller.weblogger.pojos.Weblog:getTheme()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: WeblogTheme org.apache.roller.weblogger.pojos.Weblog:getTheme()
    //#Templates.java:78: Warning: method not available
    //#    -- call on ThemeTemplate org.apache.roller.weblogger.pojos.WeblogTheme:getStylesheet()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: ThemeTemplate org.apache.roller.weblogger.pojos.WeblogTheme:getStylesheet()
    //#Templates.java:78: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.ThemeTemplate:getLink()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.ThemeTemplate:getLink()
    //#Templates.java:78: Warning: method not available
    //#    -- call on WeblogTemplate org.apache.roller.weblogger.business.UserManager:getPageByLink(Weblog, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: WeblogTemplate org.apache.roller.weblogger.business.UserManager:getPageByLink(Weblog, String)
                        getActionWeblog().getTheme().getStylesheet().getLink()));
            }
            setTemplates(pages);
            
            // build list of action types that may be added
            List availableActions = new ArrayList();
            availableActions.add(WeblogTemplate.ACTION_CUSTOM);
            
            if(WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme())) {
    //#Templates.java:87: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getEditorTheme()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getEditorTheme()
                // if the weblog is using a custom theme then determine which
                // action templates are still available to be created
                availableActions.add(WeblogTemplate.ACTION_PERMALINK);
                availableActions.add(WeblogTemplate.ACTION_SEARCH);
                availableActions.add(WeblogTemplate.ACTION_WEBLOG);
                availableActions.add(WeblogTemplate.ACTION_TAGSINDEX);
                
                for(WeblogTemplate tmpPage : getTemplates()) {
                    if(!WeblogTemplate.ACTION_CUSTOM.equals(tmpPage.getAction())) {
    //#Templates.java:96: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogTemplate:getAction()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogTemplate:getAction()
                        availableActions.remove(tmpPage.getAction());
    //#Templates.java:97: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogTemplate:getAction()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogTemplate:getAction()
                    }
                }
            }
            setAvailableActions(availableActions);

        } catch (WebloggerException ex) {
            log.error("Error getting templates for weblog - "+getActionWeblog().getHandle(), ex);
    //#Templates.java:104: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String execute()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#Templates.java:104: 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.Templates
    //#    method: String execute()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("Error getting template list");
        }
        
        return LIST;
    //#Templates.java:109: end of method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.execute()
    }
    
    
    /**
     * Save a new template.
     */
    public String add() {
        
        // validation
        myValidate();
    //#Templates.java:119: method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.add()
    //#input(String add()): "Error adding new template for weblog - "._tainted
    //#input(String add()): "Error getting templates for weblog - "._tainted
    //#input(String add()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#input(String add()): __Descendant_Table[others]
    //#input(String add()): __Dispatch_Table.addError(Ljava/lang/String;)V
    //#input(String add()): __Dispatch_Table.addError(Ljava/lang/String;Ljava/lang/String;)V
    //#input(String add()): __Dispatch_Table.execute()Ljava/lang/String;
    //#input(String add()): __Dispatch_Table.getActionWeblog()Lorg/apache/roller/weblogger/pojos/Weblog;
    //#input(String add()): __Dispatch_Table.getNewTmplAction()Ljava/lang/String;
    //#input(String add()): __Dispatch_Table.getNewTmplName()Ljava/lang/String;
    //#input(String add()): __Dispatch_Table.getTemplates()Ljava/util/List;
    //#input(String add()): __Dispatch_Table.setAvailableActions(Ljava/util/List;)V
    //#input(String add()): __Dispatch_Table.setNewTmplAction(Ljava/lang/String;)V
    //#input(String add()): __Dispatch_Table.setNewTmplName(Ljava/lang/String;)V
    //#input(String add()): __Dispatch_Table.setTemplates(Ljava/util/List;)V
    //#input(String add()): log
    //#input(String add()): this
    //#input(String add()): this.__Tag
    //#input(String add()): this.actionWeblog
    //#input(String add()): this.newTmplAction
    //#input(String add()): this.newTmplName
    //#output(String add()): new ArrayList(execute#1) num objects
    //#output(String add()): new ArrayList(execute#2) num objects
    //#output(String add()): return_value
    //#output(String add()): this.availableActions
    //#output(String add()): this.newTmplAction
    //#output(String add()): this.newTmplName
    //#output(String add()): this.templates
    //#new obj(String add()): new ArrayList(execute#1)
    //#new obj(String add()): new ArrayList(execute#2)
    //#pre[3] (String add()): init'ed(this.newTmplAction)
    //#pre[7] (String add()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/Templates
    //#pre[1] (String add()): (soft) log != null
    //#pre[4] (String add()): (soft) this.newTmplName != null
    //#pre[8] (String add()): (soft) this.actionWeblog != null
    //#presumption(String add()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@142 != null
    //#presumption(String add()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@142 != null
    //#presumption(String add()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@153 != null
    //#post(String add()): return_value == &"list"
    //#post(String add()): this.availableActions == One-of{&new ArrayList(execute#2), old this.availableActions}
    //#post(String add()): this.newTmplAction == One-of{old this.newTmplAction, null}
    //#post(String add()): init'ed(this.newTmplAction)
    //#post(String add()): this.newTmplName == One-of{old this.newTmplName, null}
    //#post(String add()): (soft) init'ed(this.newTmplName)
    //#post(String add()): this.templates == One-of{&new ArrayList(execute#1), old this.templates}
    //#post(String add()): new ArrayList(execute#1) num objects <= 1
    //#post(String add()): new ArrayList(execute#2) num objects == new ArrayList(execute#1) num objects
    //#unanalyzed(String add()): Effects-of-calling:org.apache.commons.lang.StringUtils:isEmpty
    //#unanalyzed(String add()): Effects-of-calling:addError
    //#unanalyzed(String add()): Effects-of-calling:java.lang.String:length
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.business.Weblogger:getUserManager
    //#unanalyzed(String add()): Effects-of-calling:getActionWeblog
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.business.UserManager:getPageByName
    //#unanalyzed(String add()): Effects-of-calling:java.lang.Throwable:__curr_excep_obj
    //#unanalyzed(String add()): Effects-of-calling:org.apache.commons.logging.Log:error
    //#unanalyzed(String add()): Effects-of-calling:java.lang.String:equals
    //#unanalyzed(String add()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(String add()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.pojos.Weblog:getHandle
    //#unanalyzed(String add()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.business.UserManager:getPages
    //#unanalyzed(String add()): Effects-of-calling:java.util.ArrayList
    //#unanalyzed(String add()): Effects-of-calling:java.util.List:addAll
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.pojos.Weblog:getTheme
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogTheme:getStylesheet
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.pojos.ThemeTemplate:getLink
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.business.UserManager:getPageByLink
    //#unanalyzed(String add()): Effects-of-calling:java.util.List:remove
    //#unanalyzed(String add()): Effects-of-calling:java.util.List:add
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.pojos.Weblog:getEditorTheme
    //#unanalyzed(String add()): Effects-of-calling:java.util.List:iterator
    //#unanalyzed(String add()): Effects-of-calling:java.util.Iterator:hasNext
    //#unanalyzed(String add()): Effects-of-calling:java.util.Iterator:next
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.pojos.WeblogTemplate:getAction
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.util.UIAction:getText
    //#unanalyzed(String add()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.util.UIAction:addActionError
    //#test_vector(String add()): java.lang.String:equals(...)@137: {1}, {0}
    //#test_vector(String add()): java.lang.String:equals(...)@147: {0}, {1}
    //#test_vector(String add()): org.apache.roller.weblogger.ui.struts2.editor.Templates:hasActionErrors(...)@121: {1}, {0}
        
        if(!hasActionErrors()) try {
    //#Templates.java:121: Warning: method not available
    //#    -- call on bool org.apache.roller.weblogger.ui.struts2.editor.Templates:hasActionErrors()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: bool org.apache.roller.weblogger.ui.struts2.editor.Templates:hasActionErrors()
            
            WeblogTemplate newTemplate = new WeblogTemplate();
    //#Templates.java:123: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate()
            newTemplate.setWebsite(getActionWeblog());
    //#Templates.java:124: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setWebsite(Weblog)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setWebsite(Weblog)
            newTemplate.setAction(getNewTmplAction());
    //#Templates.java:125: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setAction(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setAction(String)
            newTemplate.setName(getNewTmplName());
    //#Templates.java:126: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setName(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setName(String)
            newTemplate.setDescription(newTemplate.getName());
    //#Templates.java:127: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogTemplate:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogTemplate:getName()
    //#Templates.java:127: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setDescription(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setDescription(String)
            newTemplate.setContents(getText("pageForm.newTemplateContent"));
    //#Templates.java:128: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.ui.struts2.editor.Templates:getText(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: String org.apache.roller.weblogger.ui.struts2.editor.Templates:getText(String)
    //#Templates.java:128: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setContents(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setContents(String)
            newTemplate.setHidden(false);
    //#Templates.java:129: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setHidden(bool)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setHidden(bool)
            newTemplate.setNavbar(false);
    //#Templates.java:130: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setNavbar(bool)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setNavbar(bool)
            newTemplate.setLastModified( new Date() );
    //#Templates.java:131: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setLastModified(Date)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setLastModified(Date)
            
            // all templates start out as velocity templates
            newTemplate.setTemplateLanguage("velocity");
    //#Templates.java:134: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setTemplateLanguage(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setTemplateLanguage(String)
            
            // for now, all templates just use _decorator
            if(!"_decorator".equals(newTemplate.getName())) {
    //#Templates.java:137: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogTemplate:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogTemplate:getName()
                newTemplate.setDecoratorName("_decorator");
    //#Templates.java:138: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.WeblogTemplate:setDecoratorName(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.WeblogTemplate:setDecoratorName(String)
            }
            
            // save the new Template
            UserManager mgr = WebloggerFactory.getWeblogger().getUserManager();
    //#Templates.java:142: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#Templates.java:142: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
            mgr.savePage( newTemplate );
    //#Templates.java:143: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.UserManager:savePage(WeblogTemplate)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.UserManager:savePage(WeblogTemplate)
            
            // if this person happened to create a Weblog template from
            // scratch then make sure and set the defaultPageId
            if(WeblogTemplate.DEFAULT_PAGE.equals(newTemplate.getName())) {
    //#Templates.java:147: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogTemplate:getName()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogTemplate:getName()
                getActionWeblog().setDefaultPageId(newTemplate.getId());
    //#Templates.java:148: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.WeblogTemplate:getId()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.WeblogTemplate:getId()
    //#Templates.java:148: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.pojos.Weblog:setDefaultPageId(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.pojos.Weblog:setDefaultPageId(String)
                mgr.saveWebsite(getActionWeblog());
    //#Templates.java:149: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.UserManager:saveWebsite(Weblog)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.UserManager:saveWebsite(Weblog)
            }
            
            // flush results to db
            WebloggerFactory.getWeblogger().flush();
    //#Templates.java:153: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#Templates.java:153: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.business.Weblogger:flush()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.roller.weblogger.business.Weblogger:flush()
            
            // reset form fields
            setNewTmplName(null);
            setNewTmplAction(null);
            
        } catch (WebloggerException ex) {
            log.error("Error adding new template for weblog - "+getActionWeblog().getHandle(), ex);
    //#Templates.java:160: Warning: method not available
    //#    -- call on String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: String add()
    //#    unanalyzed callee: String org.apache.roller.weblogger.pojos.Weblog:getHandle()
    //#Templates.java:160: 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.Templates
    //#    method: String add()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            // TODO: i18n
            addError("Error adding new template");
        }
        
        return execute();
    //#Templates.java:165: end of method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.add()
    }
    
    
    // validation when adding a new template
    private void myValidate() {
        
        // make sure name is non-null and within proper size
        if(StringUtils.isEmpty(getNewTmplName())) {
    //#Templates.java:173: method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.myValidate()
    //#Templates.java:173: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: void myValidate()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isEmpty(String)
    //#input(void myValidate()): __Descendant_Table[org/apache/roller/weblogger/ui/struts2/editor/Templates]
    //#input(void myValidate()): __Descendant_Table[others]
    //#input(void myValidate()): __Dispatch_Table.addError(Ljava/lang/String;)V
    //#input(void myValidate()): __Dispatch_Table.addError(Ljava/lang/String;Ljava/lang/String;)V
    //#input(void myValidate()): __Dispatch_Table.getActionWeblog()Lorg/apache/roller/weblogger/pojos/Weblog;
    //#input(void myValidate()): __Dispatch_Table.getNewTmplAction()Ljava/lang/String;
    //#input(void myValidate()): __Dispatch_Table.getNewTmplName()Ljava/lang/String;
    //#input(void myValidate()): log
    //#input(void myValidate()): this
    //#input(void myValidate()): this.__Tag
    //#input(void myValidate()): this.actionWeblog
    //#input(void myValidate()): this.newTmplAction
    //#input(void myValidate()): this.newTmplName
    //#pre[3] (void myValidate()): this.__Tag == org/apache/roller/weblogger/ui/struts2/editor/Templates
    //#pre[5] (void myValidate()): init'ed(this.newTmplAction)
    //#pre[1] (void myValidate()): (soft) log != null
    //#pre[4] (void myValidate()): (soft) init'ed(this.actionWeblog)
    //#pre[6] (void myValidate()): (soft) this.newTmplName != null
    //#presumption(void myValidate()): org.apache.roller.weblogger.business.Weblogger:getUserManager(...)@186 != null
    //#presumption(void myValidate()): org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger(...)@186 != null
    //#unanalyzed(void myValidate()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.util.UIAction:getText
    //#unanalyzed(void myValidate()): Effects-of-calling:org.apache.roller.weblogger.ui.struts2.util.UIAction:addActionError
    //#test_vector(void myValidate()): java.lang.String:length(...)@175: {0..255}, {256..4_294_967_295}
    //#test_vector(void myValidate()): org.apache.commons.lang.StringUtils:isEmpty(...)@173: {0}, {1}
    //#test_vector(void myValidate()): org.apache.commons.lang.StringUtils:isEmpty(...)@180: {0}, {1}
    //#test_vector(void myValidate()): org.apache.roller.weblogger.business.UserManager:getPageByName(...)@187: Addr_Set{null}, Inverse{null}
            addError("TemplateEdit.error.nameNull");
        } else if(getNewTmplName().length() > 255) {
            addError("TemplateEdit.error.nameSize");
        }
        
        // make sure action is a valid
        if(StringUtils.isEmpty(getNewTmplAction())) {
    //#Templates.java:180: Warning: method not available
    //#    -- call on bool org.apache.commons.lang.StringUtils:isEmpty(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: void myValidate()
    //#    unanalyzed callee: bool org.apache.commons.lang.StringUtils:isEmpty(String)
            addError("TemplateEdit.error.actionNull");
        }
        
        // check if template by that name already exists
        try {
            UserManager umgr = WebloggerFactory.getWeblogger().getUserManager();
    //#Templates.java:186: Warning: method not available
    //#    -- call on Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: void myValidate()
    //#    unanalyzed callee: Weblogger org.apache.roller.weblogger.business.WebloggerFactory:getWeblogger()
    //#Templates.java:186: Warning: method not available
    //#    -- call on UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: void myValidate()
    //#    unanalyzed callee: UserManager org.apache.roller.weblogger.business.Weblogger:getUserManager()
            WeblogTemplate existingPage = umgr.getPageByName(getActionWeblog(), getNewTmplName());
    //#Templates.java:187: Warning: method not available
    //#    -- call on WeblogTemplate org.apache.roller.weblogger.business.UserManager:getPageByName(Weblog, String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.ui.struts2.editor.Templates
    //#    method: void myValidate()
    //#    unanalyzed callee: WeblogTemplate org.apache.roller.weblogger.business.UserManager:getPageByName(Weblog, String)
            if(existingPage != null) {
                addError("pagesForm.error.alreadyExists", getNewTmplName());
            }
        } catch (WebloggerException ex) {
            log.error("Error checking for existing template", ex);
    //#Templates.java:192: 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.Templates
    //#    method: void myValidate()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
        }
    }
    //#Templates.java:194: end of method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.myValidate()
    
    
    public List<WeblogTemplate> getTemplates() {
        return templates;
    //#Templates.java:198: method: List org.apache.roller.weblogger.ui.struts2.editor.Templates.getTemplates()
    //#input(List getTemplates()): this
    //#input(List getTemplates()): this.templates
    //#output(List getTemplates()): return_value
    //#pre[2] (List getTemplates()): init'ed(this.templates)
    //#post(List getTemplates()): return_value == this.templates
    //#post(List getTemplates()): init'ed(return_value)
    //#Templates.java:198: end of method: List org.apache.roller.weblogger.ui.struts2.editor.Templates.getTemplates()
    }

    public void setTemplates(List<WeblogTemplate> templates) {
        this.templates = templates;
    //#Templates.java:202: method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setTemplates(List)
    //#input(void setTemplates(List)): templates
    //#input(void setTemplates(List)): this
    //#output(void setTemplates(List)): this.templates
    //#post(void setTemplates(List)): this.templates == templates
    //#post(void setTemplates(List)): init'ed(this.templates)
    }
    //#Templates.java:203: end of method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setTemplates(List)

    public List getAvailableActions() {
        return availableActions;
    //#Templates.java:206: method: List org.apache.roller.weblogger.ui.struts2.editor.Templates.getAvailableActions()
    //#input(List getAvailableActions()): this
    //#input(List getAvailableActions()): this.availableActions
    //#output(List getAvailableActions()): return_value
    //#pre[2] (List getAvailableActions()): init'ed(this.availableActions)
    //#post(List getAvailableActions()): return_value == this.availableActions
    //#post(List getAvailableActions()): init'ed(return_value)
    //#Templates.java:206: end of method: List org.apache.roller.weblogger.ui.struts2.editor.Templates.getAvailableActions()
    }

    public void setAvailableActions(List availableActions) {
        this.availableActions = availableActions;
    //#Templates.java:210: method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setAvailableActions(List)
    //#input(void setAvailableActions(List)): availableActions
    //#input(void setAvailableActions(List)): this
    //#output(void setAvailableActions(List)): this.availableActions
    //#post(void setAvailableActions(List)): this.availableActions == availableActions
    //#post(void setAvailableActions(List)): init'ed(this.availableActions)
    }
    //#Templates.java:211: end of method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setAvailableActions(List)
    
    public String getNewTmplName() {
        return newTmplName;
    //#Templates.java:214: method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.getNewTmplName()
    //#input(String getNewTmplName()): this
    //#input(String getNewTmplName()): this.newTmplName
    //#output(String getNewTmplName()): return_value
    //#pre[2] (String getNewTmplName()): init'ed(this.newTmplName)
    //#post(String getNewTmplName()): return_value == this.newTmplName
    //#post(String getNewTmplName()): init'ed(return_value)
    //#Templates.java:214: end of method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.getNewTmplName()
    }

    public void setNewTmplName(String newTmplName) {
        this.newTmplName = newTmplName;
    //#Templates.java:218: method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setNewTmplName(String)
    //#input(void setNewTmplName(String)): newTmplName
    //#input(void setNewTmplName(String)): this
    //#output(void setNewTmplName(String)): this.newTmplName
    //#post(void setNewTmplName(String)): this.newTmplName == newTmplName
    //#post(void setNewTmplName(String)): init'ed(this.newTmplName)
    }
    //#Templates.java:219: end of method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setNewTmplName(String)

    public String getNewTmplAction() {
        return newTmplAction;
    //#Templates.java:222: method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.getNewTmplAction()
    //#input(String getNewTmplAction()): this
    //#input(String getNewTmplAction()): this.newTmplAction
    //#output(String getNewTmplAction()): return_value
    //#pre[2] (String getNewTmplAction()): init'ed(this.newTmplAction)
    //#post(String getNewTmplAction()): return_value == this.newTmplAction
    //#post(String getNewTmplAction()): init'ed(return_value)
    //#Templates.java:222: end of method: String org.apache.roller.weblogger.ui.struts2.editor.Templates.getNewTmplAction()
    }

    public void setNewTmplAction(String newTmplAction) {
        this.newTmplAction = newTmplAction;
    //#Templates.java:226: method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setNewTmplAction(String)
    //#input(void setNewTmplAction(String)): newTmplAction
    //#input(void setNewTmplAction(String)): this
    //#output(void setNewTmplAction(String)): this.newTmplAction
    //#post(void setNewTmplAction(String)): this.newTmplAction == newTmplAction
    //#post(void setNewTmplAction(String)): init'ed(this.newTmplAction)
    }
    //#Templates.java:227: end of method: void org.apache.roller.weblogger.ui.struts2.editor.Templates.setNewTmplAction(String)
    
}
    //#Templates.java:: end of class: org.apache.roller.weblogger.ui.struts2.editor.Templates
