Author: rfelden
Date: Mon Nov 19 10:11:30 2007
New Revision: 19209

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D19209&repname=
=3Djahia
Log:
file name modification (case issue)

Added:
    branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/=
session/LoggedUserTag.java

Added: branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/ht=
ml/session/LoggedUserTag.java
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/branches/JAHIA=
-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/session/LoggedUser=
Tag.java&rev=3D19209&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/=
session/LoggedUserTag.java (added)
+++ branches/JAHIA-INCLUDE-TAG-BRANCH/core/src/java/org/jahia/taglibs/html/=
session/LoggedUserTag.java Mon Nov 19 10:11:30 2007
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2002-2006 Jahia Ltd
+ *
+ * Licensed under the JAHIA COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (J=
CDDL),
+ * Version 1.0 (the "License"), or (at your option) any later version; you=
 may
+ * not use this file except in compliance with the License. You should have
+ * received a copy of the License along with this program; if not, you may=
 obtain
+ * a copy of the License at
+ *
+ *  http://www.jahia.org/license/
+ *
+ * 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.jahia.taglibs.html.session;
+
+import org.jahia.data.JahiaData;
+import org.jahia.taglibs.AbstractJahiaTag;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import java.io.IOException;
+
+/**
+ * Simple tags that prints out the user name of the currently logged user.
+ *
+ * @author Xavier Lawrence
+ */
+public class LoggedUserTag extends AbstractJahiaTag {
+
+    private static final org.apache.log4j.Logger logger =3D
+            org.apache.log4j.Logger.getLogger(LoggedUserTag.class);
+
+    public int doStartTag() throws JspException {
+        try {
+            final HttpServletRequest request =3D (HttpServletRequest) page=
Context.getRequest();
+            final JahiaData jData =3D (JahiaData) request.getAttribute("or=
g.jahia.data.JahiaData");
+            final StringBuffer buff =3D new StringBuffer();
+
+            buff.append("<div");
+
+            if (cssClassName !=3D null && cssClassName.length() > 0) {
+                buff.append(" class=3D\"");
+                buff.append(cssClassName);
+                buff.append("\"");
+            }
+            =

+            buff.append("><span>");
+            buff.append(jData.getProcessingContext().getUser().getUsername=
());
+            buff.append("</span></div>");
+
+            final JspWriter out =3D pageContext.getOut();
+            out.print(buff.toString());
+
+        } catch (final IOException e) {
+            logger.error("IOException in doStartTag", e);
+        }
+
+        return SKIP_BODY;
+    }
+
+    public int doEndTag() throws JspException {
+        cssClassName =3D null;
+        return EVAL_PAGE;
+    }
+
+
+}

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to