[Yanel-commits] rev 42445 - in public/yanel/trunk/src/contributions/resources/yanel-user: src/java/org/wyona/yanel/impl/resources xslt

guillaume at wyona.com guillaume at wyona.com
Mon Apr 20 19:16:28 CEST 2009


Author: guillaume
Date: 2009-04-20 19:16:28 +0200 (Mon, 20 Apr 2009)
New Revision: 42445

Modified:
   public/yanel/trunk/src/contributions/resources/yanel-user/src/java/org/wyona/yanel/impl/resources/YanelUserResource.java
   public/yanel/trunk/src/contributions/resources/yanel-user/xslt/yanel-user-profile.xsl
Log:
Yanel's user profile pages now also use the "blue banner on top, with white Yanel logo aligned right" layout.

Note: this layout should really be done with CSS and not HTML tables, but see issue 7095. 

Also made harmless fixes for most Java generics warnings from Eclipse.

Issue: 5329

Modified: public/yanel/trunk/src/contributions/resources/yanel-user/src/java/org/wyona/yanel/impl/resources/YanelUserResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/yanel-user/src/java/org/wyona/yanel/impl/resources/YanelUserResource.java	2009-04-20 15:04:28 UTC (rev 42444)
+++ public/yanel/trunk/src/contributions/resources/yanel-user/src/java/org/wyona/yanel/impl/resources/YanelUserResource.java	2009-04-20 17:16:28 UTC (rev 42445)
@@ -75,7 +75,7 @@
 
     private static Category log = Category.getInstance(YanelUserResource.class);
 
-    private HashMap properties = new HashMap();
+    private HashMap<String, Object> properties = new HashMap<String, Object>();
 
     /**
      * Constructor
@@ -202,6 +202,10 @@
                 defaultView.setInputStream(new java.io.FileInputStream(xmlFile));
             } else {
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                String backToRealm = org.wyona.yanel.core.util.PathUtil.backToRealm(getPath());
+                String reservedPrefix = yanel.getReservedPrefix();
+                transformer.setParameter("yanel.back2realm", backToRealm);
+                transformer.setParameter("yanel.reservedPrefix", reservedPrefix);
                 transformer.transform(new javax.xml.transform.stream.StreamSource(xmlFile), new StreamResult(baos));
                 defaultView.setInputStream(new java.io.ByteArrayInputStream(baos.toByteArray()));
             }
@@ -282,7 +286,7 @@
      * @see org.wyona.yanel.core.api.attributes.CreatableV2#createRTIProperties(HttpServletRequest)
      */
     public HashMap createRTIProperties(HttpServletRequest request) {
-        HashMap map = new HashMap();
+        HashMap<String, String> map = new HashMap<String, String>();
         map.put("user", request.getParameter("rp.userId"));
         return map;
     }
@@ -525,7 +529,7 @@
         boolean submit = false;
         String action = "defaultView";
 
-        Enumeration enumeration = request.getParameterNames();
+        Enumeration<?> enumeration = request.getParameterNames();
         while (enumeration.hasMoreElements() && !submit) {
             action = enumeration.nextElement().toString();
             if (action.startsWith("submit")) {

Modified: public/yanel/trunk/src/contributions/resources/yanel-user/xslt/yanel-user-profile.xsl
===================================================================
--- public/yanel/trunk/src/contributions/resources/yanel-user/xslt/yanel-user-profile.xsl	2009-04-20 15:04:28 UTC (rev 42444)
+++ public/yanel/trunk/src/contributions/resources/yanel-user/xslt/yanel-user-profile.xsl	2009-04-20 17:16:28 UTC (rev 42445)
@@ -19,6 +19,8 @@
   <xsl:param name="success" select="''"/>
   <xsl:param name="error" select="''"/>
   <xsl:param name="deletion" select="'false'"/>
+  <xsl:param name="yanel.back2realm" select="'BACK2REALM_IS_NULL'"/>
+  <xsl:param name="yanel.reservedPrefix" select="'RESERVEDPREFIX_IS_NULL'"/>
 
   <xsl:template match="/">
     <html xmlns="http://www.w3.org/1999/xhtml">
@@ -26,6 +28,7 @@
         <xsl:when test="contains('true',$deletion)">
           <head>
             <title></title>
+            <link type="text/css" href="{$yanel.back2realm}{$yanel.reservedPrefix}/yanel-css/global.css" rel="stylesheet"></link>
           </head>
           <body>	    
             <xsl:call-template name="show-message"/>
@@ -34,13 +37,18 @@
         <xsl:otherwise>
           <head>
             <title>Change user profile</title>
+            <link type="text/css" href="{$yanel.back2realm}{$yanel.reservedPrefix}/yanel-css/global.css" rel="stylesheet"></link>
           </head>
           <body>        
+            <table id="bodytable" cellpadding="0" cellspacing="0"><tr><td id="title">
+              Change user profile of <xsl:value-of select="$userId"/>
+            </td><td id="logo"><img src="{$yanel.back2realm}{$yanel.reservedPrefix}/yanel-img/yanel_header.png"/></td></tr><tr><td colspan="2" valign="top" width="100%"><div id="content">
             <h1> 
               User Profile of <xsl:value-of select="$userId"/>
             </h1>
               <xsl:call-template name="show-message"/>     
               <xsl:apply-templates select="form"/>
+            </div></td></tr></table>
           </body>
         </xsl:otherwise>
       </xsl:choose>



More information about the Yanel-commits mailing list