[Yanel-commits] rev 28299 - public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources

josias at wyona.com josias at wyona.com
Thu Nov 1 09:18:51 CET 2007


Author: josias
Date: 2007-11-01 09:18:50 +0100 (Thu, 01 Nov 2007)
New Revision: 28299

Modified:
   public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/WikiResource.java
Log:
removed IdentityMap, use getEnvironment().getIdentity() instead

Modified: public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/WikiResource.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/WikiResource.java	2007-11-01 08:05:14 UTC (rev 28298)
+++ public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/WikiResource.java	2007-11-01 08:18:50 UTC (rev 28299)
@@ -64,7 +64,6 @@
 import org.wyona.yarep.util.RepoPath;
 
 import org.wyona.security.core.api.Identity;
-import org.wyona.security.core.api.IdentityMap;
 
 import org.xml.sax.InputSource;
 import org.xml.sax.XMLReader;
@@ -81,8 +80,6 @@
     private HashMap properties = new HashMap();
     private final String DEFAULT_WIKI_PARSER_BEAN_ID = "jspWikiParser";
 
-    private static String IDENTITY_MAP_KEY = "identity-map";
-    
     /**
      * 
      */
@@ -173,10 +170,13 @@
                 transformer.setParameter("yarep.back2realm", PathUtil.backToRealm(getPath()));
                 transformer.setParameter("yanel.last.modified", new java.util.Date(getLastModified()));
 
-                IdentityMap identityMap = (IdentityMap) getRequest().getSession(true).getAttribute(IDENTITY_MAP_KEY);
-                if (identityMap != null) {
-                    Identity identity = (Identity) identityMap.get(getRealm().getID());
-                    if (identity != null) transformer.setParameter("yanel.username", identity.getUsername());
+                Identity identity = getEnvironment().getIdentity();
+                if (identity != null) {
+                    String userName = identity.getUsername();
+                    if (userName == null) {
+                        userName = "";
+                    }
+                    transformer.setParameter("yanel.username", userName);
                 }
                 transformer.setParameter("yanel.realm.name", getRealm().getName());
             }



More information about the Yanel-commits mailing list