[Bedework-commit] dumprestore r250 - trunk/src/org/bedework/dumprestore/restore/rules

svnadmin at bedework.org svnadmin at bedework.org
Mon Nov 24 14:30:53 EST 2008


Author: douglm
Date: 2008-11-24 14:30:52 -0500 (Mon, 24 Nov 2008)
New Revision: 250

Modified:
   trunk/src/org/bedework/dumprestore/restore/rules/CreatorRule.java
   trunk/src/org/bedework/dumprestore/restore/rules/OwnerRule.java
   trunk/src/org/bedework/dumprestore/restore/rules/PrincipalFieldRule.java
Log:
Delete principal type definitions in AccessPrincipal and use the WhoDefs version instead.

Required mapping pre 3.5 restore principal kind

Modified: trunk/src/org/bedework/dumprestore/restore/rules/CreatorRule.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/rules/CreatorRule.java	2008-11-20 20:12:01 UTC (rev 249)
+++ trunk/src/org/bedework/dumprestore/restore/rules/CreatorRule.java	2008-11-24 19:30:52 UTC (rev 250)
@@ -1,31 +1,3 @@
-/*
- Copyright (c) 2000-2005 University of Washington.  All rights reserved.
-
- Redistribution and use of this distribution in source and binary forms,
- with or without modification, are permitted provided that:
-
-   The above copyright notice and this permission notice appear in
-   all copies and supporting documentation;
-
-   The name, identifiers, and trademarks of the University of Washington
-   are not used in advertising or publicity without the express prior
-   written permission of the University of Washington;
-
-   Recipients acknowledge that this distribution is made available as a
-   research courtesy, "as is", potentially with defects, without
-   any obligation on the part of the University of Washington to
-   provide support, services, or repair;
-
-   THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR
-   IMPLIED, WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION
-   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-   PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
-   WASHINGTON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-   DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-   PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING
-   NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
-   THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
 /* **********************************************************************
     Copyright 2005 Rensselaer Polytechnic Institute. All worldwide rights reserved.
 
@@ -53,13 +25,14 @@
 */
 package org.bedework.dumprestore.restore.rules;
 
-import org.bedework.calfacade.BwPrincipal;
 import org.bedework.calfacade.BwUser;
 import org.bedework.calfacade.base.BwShareableDbentity;
 import org.bedework.calfacade.svc.EventInfo;
 import org.bedework.dumprestore.restore.PrincipalInfo;
 import org.bedework.dumprestore.restore.RestoreGlobals;
 
+import edu.rpi.cmt.access.Ace;
+
 import org.xml.sax.Attributes;
 
 /** Retrieve a creator and leave on the stack.
@@ -97,7 +70,7 @@
     }
 
     // XXX could be a group?
-    if (oi.getKind() == BwPrincipal.principalGroup) {
+    if (oi.getKind() == Ace.whoTypeGroup) {
       throw new Exception("Group creator not implemented");
     }
 

Modified: trunk/src/org/bedework/dumprestore/restore/rules/OwnerRule.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/rules/OwnerRule.java	2008-11-20 20:12:01 UTC (rev 249)
+++ trunk/src/org/bedework/dumprestore/restore/rules/OwnerRule.java	2008-11-24 19:30:52 UTC (rev 250)
@@ -26,7 +26,6 @@
 package org.bedework.dumprestore.restore.rules;
 
 import org.bedework.calfacade.BwOrganizer;
-import org.bedework.calfacade.BwPrincipal;
 import org.bedework.calfacade.BwUser;
 import org.bedework.calfacade.base.BwOwnedDbentity;
 import org.bedework.calfacade.svc.BwAdminGroup;
@@ -36,6 +35,8 @@
 import org.bedework.dumprestore.restore.OwnerUidKey;
 import org.bedework.dumprestore.restore.RestoreGlobals;
 
+import edu.rpi.cmt.access.Ace;
+
 import org.xml.sax.Attributes;
 
 /** Retrieve an owner and leave on the stack.
@@ -60,7 +61,7 @@
     PrincipalInfo oi = (PrincipalInfo)pop();
 
     // XXX could be a group?
-    if (oi.getKind() == BwPrincipal.principalGroup) {
+    if (oi.getKind() == Ace.whoTypeGroup) {
       throw new Exception("Group owner not implemented");
     }
 

Modified: trunk/src/org/bedework/dumprestore/restore/rules/PrincipalFieldRule.java
===================================================================
--- trunk/src/org/bedework/dumprestore/restore/rules/PrincipalFieldRule.java	2008-11-20 20:12:01 UTC (rev 249)
+++ trunk/src/org/bedework/dumprestore/restore/rules/PrincipalFieldRule.java	2008-11-24 19:30:52 UTC (rev 250)
@@ -25,10 +25,11 @@
 */
 package org.bedework.dumprestore.restore.rules;
 
-import org.bedework.calfacade.BwPrincipal;
 import org.bedework.dumprestore.restore.PrincipalInfo;
 import org.bedework.dumprestore.restore.RestoreGlobals;
 
+import edu.rpi.cmt.access.Ace;
+
 /**
  * @author Mike Douglass   douglm at rpi.edu
  * @version 1.0
@@ -42,15 +43,15 @@
     PrincipalInfo oi = (PrincipalInfo)top();
 
     if (name.equals("user")) {
-      oi.setKind(BwPrincipal.principalUser);
+      oi.setKind(Ace.whoTypeUser);
     } else if (name.equals("group")) {
-      oi.setKind(BwPrincipal.principalGroup);
+      oi.setKind(Ace.whoTypeGroup);
     } else if (name.equals("adminGroup")) {
-      oi.setKind(BwPrincipal.principalGroup);
+      oi.setKind(Ace.whoTypeGroup);
     } else if (name.equals("account")) {
       oi.setAccount(stringFld());
     } else if (name.equals("kind")) {           // PRE3.5
-      oi.setKind(intFld());
+      oi.setKind(intFld() - 1);
     } else {
       unknownTag(name);
     }



More information about the Bedework-commit mailing list