You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by mh...@apache.org on 2004/01/06 19:52:37 UTC

cvs commit: jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms StandardRDBMSAdapter.java

mholz       2004/01/06 10:52:37

  Modified:    src/stores/org/apache/slide/store/impl/rdbms
                        StandardRDBMSAdapter.java
  Log:
  Create uris (but no nodes) for permission SubjectNode and ActionNode.
  
  Revision  Changes    Path
  1.11      +20 -9     jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/StandardRDBMSAdapter.java
  
  Index: StandardRDBMSAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/StandardRDBMSAdapter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- StandardRDBMSAdapter.java	3 Dec 2003 12:00:47 -0000	1.10
  +++ StandardRDBMSAdapter.java	6 Jan 2004 18:52:37 -0000	1.11
  @@ -536,7 +536,6 @@
           throws ServiceAccessException {
           PreparedStatement statement = null;
           ResultSet res = null;
  -        boolean permissionAlreadyGranted;
           int succession = 0;
   
           try {
  @@ -557,7 +556,11 @@
                   close(statement, res);
               }
   
  -            try {
  +            assureUriId(connection,permission.getSubjectUri());
  +            assureUriId(connection,permission.getActionUri());
  +
  +            try {              
  +                
                   int inheritable = permission.isInheritable() ? 1 : 0;
                   int negative = permission.isNegative() ? 1 : 0;
   
  @@ -571,7 +574,14 @@
                   statement.setString(5, permission.getObjectUri());
                   statement.setString(6, permission.getSubjectUri());
                   statement.setString(7, permission.getActionUri());
  -                statement.executeUpdate();
  +                if (statement.executeUpdate() != 1) {
  +                    String msg = "Failed to insert permission ("
  +                    + permission.getObjectUri() 
  +                    + "," + permission.getSubjectUri()
  +                    + "," + permission.getActionUri() 
  +                    + ")"; 
  +                    getLogger().log(msg,LOG_CHANNEL,Logger.ERROR);
  +                }
               } finally {
                   close(statement);
               }
  @@ -719,6 +729,7 @@
           PreparedStatement statement = null;
           ResultSet res = null;
           try {
  +	    // FIXME Statement never executed and asymmetric vs createRevisionDescriptors.
               statement =
                   connection.prepareStatement(
                       "delete VERSION_PREDS from VERSION_PREDS vp, VERSION_HISTORY vh, URI u where vp.VERSION_ID = vh.VERSION_ID and vh.URI_ID = u.URI_ID and u.URI_STRING = ?");
  @@ -1184,7 +1195,7 @@
                       throw ex;
                   }
               }
  -            // Changed (contentlengh - 1) to (contentlength) as DB2 was complaining about
  +            // Changed (contentlength - 1) to (contentlength) as DB2 was complaining about
               // length mismatch for stream in the below method
               // insertStatement.setBinaryStream(2, is, (int)contentLength -1);
               try {
  @@ -1296,7 +1307,7 @@
           return assureLabelId(connection, label);
       }
   
  -    // null means valid for all revisions
  +    // null means permission is valid for all revisions
       protected String getRevisionNumberAsString(NodeRevisionNumber revisionNumber) {
           return revisionNumber != null ? revisionNumber.toString() : null;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org