WhereAreYouTag.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: WhereAreYouTag.java,v 1.7 2004/03/19 14:31:50 sauthieg Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.webapp.taglib;
00027 
00028 import javax.servlet.http.HttpServletRequest;
00029 import javax.servlet.http.HttpServletResponse;
00030 import javax.servlet.jsp.tagext.BodyTagSupport;
00031 
00032 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
00033 
00037 public class WhereAreYouTag extends BodyTagSupport {
00038 
00039 // ----------------------------------------------------- Instance Variables
00040 
00041 // ----------------------------------------------------- Properties
00042 
00043     private boolean usingWhere = false;
00044 
00045     public boolean isUsingWhere() {
00046         return usingWhere;
00047     }
00048 
00049     public boolean getUsingWhere() {
00050         return usingWhere;
00051     }
00052 
00053     public void setUsingWhere(boolean usingWhere) {
00054         this.usingWhere = usingWhere;
00055     }
00056 
00057 // --------------------------------------------------------- Public Methods
00058 
00059     public String getSelectedNameNode() {
00060         String sName = null;
00061         WhereAreYou oWhere = getWhereAreYouInstance();
00062         if (oWhere != null) {
00063             sName = oWhere.getSelectedNameNode();
00064         }
00065         return sName;
00066     }
00067 
00068     public TreeControlNode getSelectedTreeControlNode() {
00069         TreeControlNode oNode = null;
00070         WhereAreYou oWhere = getWhereAreYouInstance();
00071         if (oWhere != null) {
00072             oNode = oWhere.getSelectedTreeControlNode();
00073         }
00074         return oNode;
00075     }
00076 
00077     public String getImagesRoot() {
00078         String sImagesRoot = null;
00079         WhereAreYou oWhere = getWhereAreYouInstance();
00080         if (oWhere != null) {
00081             sImagesRoot = oWhere.getImagesRoot();
00082         }
00083         return sImagesRoot;
00084     }
00085 
00086     public boolean isTreeToRefresh() {
00087         boolean bRefresh = false;
00088         WhereAreYou oWhere = getWhereAreYouInstance();
00089         if (oWhere != null) {
00090             bRefresh = oWhere.isTreeToRefresh();
00091         }
00092         return bRefresh;
00093     }
00094 
00095     public String getUrlToRefreshSelectedNode() {
00096         String sUrl = null;
00097         WhereAreYou oWhere = getWhereAreYouInstance();
00098         if (oWhere != null) {
00099             sUrl = oWhere.getUrlToRefreshSelectedNode((HttpServletRequest) pageContext.getRequest()
00100                 , (HttpServletResponse) pageContext.getResponse());
00101         }
00102         return sUrl;
00103     }
00104 
00105 // --------------------------------------------------------- Protected Methods
00106 
00107     protected WhereAreYou getWhereAreYouInstance() {
00108         return (WhereAreYou) pageContext.getSession().getAttribute(WhereAreYou.SESSION_NAME);
00109     }
00110 }

Generated on Tue Feb 15 15:05:34 2005 for JOnAS by  doxygen 1.3.9.1