File Source: CommonPingTargetAdd.java

     1  /*
     2   * Licensed to the Apache Software Foundation (ASF) under one or more
     3   * contributor license agreements.  The ASF licenses this file to You
     4   * under the Apache License, Version 2.0 (the "License"); you may not
     5   * use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *   http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.  For additional information regarding
    15   * copyright in this work, please see the NOTICE file in the top level
    16   * directory of this distribution.
    17   */
    18  
    19  package org.apache.roller.weblogger.ui.struts2.admin;
    20  
    21  import org.apache.commons.logging.Log;
    22  import org.apache.commons.logging.LogFactory;
    23  import org.apache.roller.weblogger.pojos.PingTarget;
    24  import org.apache.roller.weblogger.ui.struts2.common.PingTargetAddBase;
    25  
    26  
    27  /**
    28   * Action for adding a common ping target.
    29   */
    30  public class CommonPingTargetAdd extends PingTargetAddBase {
    31      
             /* 
    P/P       *  Method: org.apache.roller.weblogger.ui.struts2.admin.CommonPingTargetAdd__static_init
              * 
              *  Postconditions:
              *    init'ed(log)
              */
    32      private static Log log = LogFactory.getLog(CommonPingTargetAdd.class);
    33      
    34      
             /* 
    P/P       *  Method: void org.apache.roller.weblogger.ui.struts2.admin.CommonPingTargetAdd()
              * 
              *  Postconditions:
              *    this.actionName == &"commonPingTargetAdd"
              *    this.bean == &new PingTargetFormBean(PingTargetAddBase#1)
              *    this.desiredMenu == &"admin"
              *    this.pageTitle == &"pingTarget.pingTarget"
              *    new PingTargetFormBean(PingTargetAddBase#1) num objects == 1
              *    new PingTargetFormBean(PingTargetAddBase#1).id == null
              *    new PingTargetFormBean(PingTargetAddBase#1).name == null
              *    new PingTargetFormBean(PingTargetAddBase#1).pingUrl == null
              */
    35      public CommonPingTargetAdd() {
    36          this.actionName = "commonPingTargetAdd";
    37          this.desiredMenu = "admin";
    38          this.pageTitle = "pingTarget.pingTarget";
    39      }
    40      
    41      
    42      public String requiredUserRole() {
                 /* 
    P/P           *  Method: String requiredUserRole()
                  * 
                  *  Postconditions:
                  *    return_value == &"admin"
                  */
    43          return "admin";
    44      }
    45      
    46      // no weblog required
    47      public boolean isWeblogRequired() {
                 /* 
    P/P           *  Method: bool isWeblogRequired()
                  * 
                  *  Postconditions:
                  *    return_value == 0
                  */
    48          return false;
    49      }
    50      
    51      
    52      protected Log getLogger() {
                 /* 
    P/P           *  Method: Log getLogger()
                  * 
                  *  Preconditions:
                  *    init'ed(log)
                  * 
                  *  Postconditions:
                  *    return_value == log
                  *    init'ed(return_value)
                  */
    53          return log;
    54      }
    55      
    56      
    57      protected PingTarget createPingTarget() {
    58          
                 /* 
    P/P           *  Method: PingTarget createPingTarget()
                  * 
                  *  Preconditions:
                  *    this.bean != null
                  *    init'ed(this.bean.name)
                  *    init'ed(this.bean.pingUrl)
                  * 
                  *  Postconditions:
                  *    return_value == &new PingTarget(createPingTarget#1)
                  *    new PingTarget(createPingTarget#1) num objects == 1
                  */
    59          return new PingTarget(
    60                  null, 
    61                  getBean().getName(), 
    62                  getBean().getPingUrl(), 
    63                  null, 
    64                  false);
    65      }
    66      
    67  }








SofCheck Inspector Build Version : 2.18479
CommonPingTargetAdd.java 2009-Jan-02 14:24:58
CommonPingTargetAdd.class 2009-Sep-04 03:12:46