00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
00040
00041
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
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
00106
00107 protected WhereAreYou getWhereAreYouInstance() {
00108 return (WhereAreYou) pageContext.getSession().getAttribute(WhereAreYou.SESSION_NAME);
00109 }
00110 }