[Commits] (bcm) add a homedir tag file that, surprisingly enough, calculates the homedir of a

commits at osafoundation.org commits at osafoundation.org
Fri Apr 8 11:22:02 PDT 2005


Commit by: bcm
Modified files:
server/docs/TODO.txt 1.42 1.43
server/web/web/WEB-INF/jsp/welcome.jsp 1.2 1.3
server/web/web/WEB-INF/jsp/user/list.jsp 1.2 1.3
server/webapps/console/web/WEB-INF/tags/homedir.tag 1.2 1.3

Log message:
add a homedir tag file that, surprisingly enough, calculates the homedir of a
user. usage: <cosmo:homedir var="homedir" user="${user}"/>. use the tag file
in the welcome and user list pages.


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/server/docs/TODO.txt.diff?r1=text&tr1=1.42&r2=text&tr2=1.43
http://cvs.osafoundation.org/index.cgi/server/web/web/WEB-INF/jsp/welcome.jsp.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/server/web/web/WEB-INF/jsp/user/list.jsp.diff?r1=text&tr1=1.2&r2=text&tr2=1.3
http://cvs.osafoundation.org/index.cgi/server/webapps/console/web/WEB-INF/tags/homedir.tag.diff?r1=text&tr1=1.2&r2=text&tr2=1.3

Index: server/web/web/WEB-INF/jsp/welcome.jsp
diff -u server/web/web/WEB-INF/jsp/welcome.jsp:1.2 server/web/web/WEB-INF/jsp/welcome.jsp:1.3
--- server/web/web/WEB-INF/jsp/welcome.jsp:1.2	Thu Apr  7 17:14:44 2005
+++ server/web/web/WEB-INF/jsp/welcome.jsp	Fri Apr  8 11:22:00 2005
@@ -2,17 +2,16 @@
 <%@ include file="/WEB-INF/jsp/tagfiles.jsp" %>
 
 <cosmo-core:user var="user"/>
-<c:url var="homedirPage" value="/home/${user.username}/"/>
+<cosmo:homedir var="homedir" user="${user}"/>
 
-<c:set var="homedirUrl"
+<c:set var="homedirBase"
        value="${pageContext.request.scheme}://${pageContext.request.serverName}"/>
 <c:if test="${(pageContext.request.secure &&
             pageContext.request.serverPort != 443) ||
             (pageContext.request.serverPort != 80)}">
-  <c:set var="homedirUrl"
-         value="${homedirUrl}:${pageContext.request.serverPort}"/>
+  <c:set var="homedirBase"
+         value="${homedirBase}:${pageContext.request.serverPort}"/>
 </c:if>
-<c:set var="homedirUrl" value="${homedirUrl}${homedirPage}"/>
 
 <p>
   <fmt:message key="Welcome.WelcomeMsg">
@@ -25,8 +24,8 @@
 <authz:authorize ifAllGranted="ROLE_USER">
   <p>
     <fmt:message key="Welcome.HomeDirectory"/>
-    <html:link page="${homedirPage}">
-      <b>${homedirUrl}</b>
+    <html:link page="${homedir}">
+      <b>${homedirBase}${homedir}</b>
     </html:link>
   </p>
   <p>

Index: server/docs/TODO.txt
diff -u server/docs/TODO.txt:1.42 server/docs/TODO.txt:1.43
--- server/docs/TODO.txt:1.42	Thu Apr  7 17:20:53 2005
+++ server/docs/TODO.txt	Fri Apr  8 11:22:00 2005
@@ -2,7 +2,6 @@
 0.1 RELEASE
 ===========
 
- * use tag files to generate homedir uri and homedir url
  * add server signature to all page footers
  * try putting all stuff from tomcat's common/lib and common/classes
    back into the single webapp

Index: server/web/web/WEB-INF/jsp/user/list.jsp
diff -u server/web/web/WEB-INF/jsp/user/list.jsp:1.2 server/web/web/WEB-INF/jsp/user/list.jsp:1.3
--- server/web/web/WEB-INF/jsp/user/list.jsp:1.2	Thu Apr  7 17:14:46 2005
+++ server/web/web/WEB-INF/jsp/user/list.jsp	Fri Apr  8 11:22:00 2005
@@ -24,7 +24,7 @@
         </td>
       </tr>
       <c:forEach var="user" items="${Users}">
-        <c:url var="homedirPage" value="/home/${user.username}/"/>
+        <cosmo:homedir var="homedir" user="${user}"/>
         <tr>
           <td class="md" nowrap="nowrap">
             <html:link page="/user/${user.username}">
@@ -32,8 +32,8 @@
             </html:link>
           </td>
           <td class="md" nowrap="nowrap">
-            <html:link target="homedir" page="${homedirPage}">
-              ${homedirPage}
+            <html:link target="homedir" page="${homedir}">
+              ${homedir}
             </html:link>
           </td>
           <td class="md" nowrap="nowrap">

Index: server/webapps/console/web/WEB-INF/tags/homedir.tag
diff -u /dev/null server/webapps/console/web/WEB-INF/tags/homedir.tag:1.3
--- /dev/null	Fri Apr  8 11:22:02 2005
+++ server/webapps/console/web/WEB-INF/tags/homedir.tag	Fri Apr  8 11:22:01 2005
@@ -0,0 +1,13 @@
+<%@ include   file="/WEB-INF/jsp/taglibs.jsp"            %>
+<%@ attribute name="user"               required="false"
+              type="org.osaf.chandler.server.model.User" %>
+<%@ attribute name="var"                required="true"
+              rtexprvalue="false"                        %>
+<%@ variable  name-from-attribute="var" alias="result"
+              scope="AT_END"                             %>
+
+<c:if test="${empty user}">
+  <cosmo-core:user var="user"/>
+</c:if>
+
+<c:set var="result" value="/home/${user.username}/"/>



More information about the Commits mailing list