You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by mi...@apache.org on 2003/07/23 17:32:38 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting XopusHandlerAction.java

michi       2003/07/23 08:32:37

  Modified:    src/java/org/apache/lenya/cms/cocoon/acting
                        XopusHandlerAction.java
  Log:
  ac2.Identity implemented
  
  Revision  Changes    Path
  1.34      +15 -9     cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/XopusHandlerAction.java
  
  Index: XopusHandlerAction.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/acting/XopusHandlerAction.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- XopusHandlerAction.java	23 Jul 2003 13:21:30 -0000	1.33
  +++ XopusHandlerAction.java	23 Jul 2003 15:32:35 -0000	1.34
  @@ -268,7 +268,7 @@
                           true));
                   new DOMWriter(new FileOutputStream(tempFile)).printWithoutFormatting(contentDocument);
               } catch (Exception e) {
  -                getLogger().error(".act(): Exception during writing to temp file: " + e);
  +                getLogger().error(".act(): Exception during writing to temp file", e);
               }
           }
   
  @@ -286,15 +286,21 @@
                       throw new Exception("No session");
                   }
   
  -                Identity identity = (Identity) session.getAttribute(
  -                        "org.apache.lenya.cms.ac.Identity");
  -                getLogger().debug(".act(): Checkin: " + reqFile + "::" + identity.getUsername());
  -                rc.reservedCheckIn(xmlRoot + reqFile, identity.getUsername(), true);
  +                Identity identity = (Identity) session.getAttribute("org.apache.lenya.cms.ac.Identity");
  +                org.apache.lenya.cms.ac2.Identity identityTwo = (org.apache.lenya.cms.ac2.Identity) session.getAttribute("org.apache.lenya.cms.ac2.Identity");
  +                String username = null;
  +                if (identity != null) {
  +                    username = identity.getUsername();
  +                } else if (identityTwo != null) {
  +                    username = identityTwo.getUser().getId();
  +                } else {
  +                    getLogger().error(".act(): No identity!");
  +                }
  +                getLogger().debug(".act(): Checkin: " + reqFile + "::" + username);
  +                rc.reservedCheckIn(xmlRoot + reqFile, username, true);
                   FileUtil.copyFile(tempFile, permFile);
               } catch (Exception e) {
  -                getLogger().error(".act(): Exception during checkin of " + xmlRoot + reqFile +
  -                    " (" + e + ")");
  -
  +                getLogger().error(".act(): Exception during checkin of " + xmlRoot + reqFile, e);
                   return null;
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org