//# 0 errors, 35 messages
//#
/*
    //#PlanetUIAction.java:1:1: class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
 * Copyright 2005 Sun Microsystems, Inc.
 *
 * Licensed 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.
 */

package org.apache.roller.weblogger.planet.ui;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.roller.planet.business.PlanetFactory;
import org.apache.roller.planet.business.PlanetManager;
import org.apache.roller.planet.pojos.Planet;
import org.apache.roller.weblogger.ui.struts2.util.UIAction;


/**
 * An extension of the UIAction class specific to the Planet actions.
 */
public abstract class PlanetUIAction extends UIAction {
    //#PlanetUIAction.java:30: method: void org.apache.roller.weblogger.planet.ui.PlanetUIAction.org.apache.roller.weblogger.planet.ui.PlanetUIAction()
    //#PlanetUIAction.java:30: Warning: method not available
    //#    -- call on void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
    //#    method: void org.apache.roller.weblogger.planet.ui.PlanetUIAction()
    //#    unanalyzed callee: void org.apache.roller.weblogger.ui.struts2.util.UIAction()
    //#input(void org.apache.roller.weblogger.planet.ui.PlanetUIAction()): this
    //#output(void org.apache.roller.weblogger.planet.ui.PlanetUIAction()): this.planet
    //#post(void org.apache.roller.weblogger.planet.ui.PlanetUIAction()): this.planet == null
    
    private static Log log = LogFactory.getLog(PlanetUIAction.class);
    //#PlanetUIAction.java:32: method: org.apache.roller.weblogger.planet.ui.PlanetUIAction.org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init
    //#PlanetUIAction.java:32: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
    //#    method: org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init): __Descendant_Table[org/apache/roller/weblogger/planet/ui/PlanetUIAction]
    //#output(org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init): __Dispatch_Table.getPlanet()Lorg/apache/roller/planet/pojos/Planet;
    //#output(org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init): log
    //#post(org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init): __Descendant_Table[org/apache/roller/weblogger/planet/ui/PlanetUIAction] == &__Dispatch_Table
    //#post(org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init): __Dispatch_Table.getPlanet()Lorg/apache/roller/planet/pojos/Planet; == &getPlanet
    //#post(org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init): init'ed(log)
    //#PlanetUIAction.java:32: end of method: org.apache.roller.weblogger.planet.ui.PlanetUIAction.org.apache.roller.weblogger.planet.ui.PlanetUIAction__static_init
    
    public static final String DEFAULT_PLANET_HANDLE = "default";
    
    // the planet used by all Planet actions
    private Planet planet = null;
    //#PlanetUIAction.java:37: end of method: void org.apache.roller.weblogger.planet.ui.PlanetUIAction.org.apache.roller.weblogger.planet.ui.PlanetUIAction()
    
    
    public Planet getPlanet() {
        if(planet == null) {
    //#PlanetUIAction.java:41: method: Planet org.apache.roller.weblogger.planet.ui.PlanetUIAction.getPlanet()
    //#input(Planet getPlanet()): log
    //#input(Planet getPlanet()): this
    //#input(Planet getPlanet()): this.planet
    //#output(Planet getPlanet()): return_value
    //#output(Planet getPlanet()): this.planet
    //#pre[2] (Planet getPlanet()): init'ed(this.planet)
    //#pre[1] (Planet getPlanet()): (soft) log != null
    //#presumption(Planet getPlanet()): org.apache.roller.planet.business.Planet:getPlanetManager(...)@43 != null
    //#presumption(Planet getPlanet()): org.apache.roller.planet.business.PlanetFactory:getPlanet(...)@43 != null
    //#post(Planet getPlanet()): init'ed(return_value)
    //#post(Planet getPlanet()): this.planet == return_value
    //#test_vector(Planet getPlanet()): this.planet: Inverse{null}, Addr_Set{null}
            try {
                PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
    //#PlanetUIAction.java:43: Warning: method not available
    //#    -- call on Planet org.apache.roller.planet.business.PlanetFactory:getPlanet()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
    //#    method: Planet getPlanet()
    //#    unanalyzed callee: Planet org.apache.roller.planet.business.PlanetFactory:getPlanet()
    //#PlanetUIAction.java:43: Warning: method not available
    //#    -- call on PlanetManager org.apache.roller.planet.business.Planet:getPlanetManager()
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
    //#    method: Planet getPlanet()
    //#    unanalyzed callee: PlanetManager org.apache.roller.planet.business.Planet:getPlanetManager()
                planet = pmgr.getPlanet(DEFAULT_PLANET_HANDLE);
    //#PlanetUIAction.java:44: Warning: method not available
    //#    -- call on Planet org.apache.roller.planet.business.PlanetManager:getPlanet(String)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
    //#    method: Planet getPlanet()
    //#    unanalyzed callee: Planet org.apache.roller.planet.business.PlanetManager:getPlanet(String)
            } catch(Exception ex) {
                log.error("Error loading weblogger planet - "+DEFAULT_PLANET_HANDLE, ex);
    //#PlanetUIAction.java:46: Warning: method not available
    //#    -- call on void org.apache.commons.logging.Log:error(Object, Throwable)
    //#    severity: INFORMATIONAL
    //#    class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
    //#    method: Planet getPlanet()
    //#    unanalyzed callee: void org.apache.commons.logging.Log:error(Object, Throwable)
            }
        }
        return planet;
    //#PlanetUIAction.java:49: end of method: Planet org.apache.roller.weblogger.planet.ui.PlanetUIAction.getPlanet()
    }
    
}
    //#PlanetUIAction.java:: end of class: org.apache.roller.weblogger.planet.ui.PlanetUIAction
