Project

General

Profile

« Previous | Next » 

Revision 4419

replicate xml_access entries across servers.
see: http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3464
note: still needs to be tested...but needed to be checked in for other metacat installations to be updated....

View differences:

MetacatReplication.java
682 682
                               dbaction, docid, user, null, homeServer, 
683 683
                               server, createdDate, updatedDate);
684 684

  
685
      //process extra access rules
686
      Vector accessControlList = (Vector) docinfoHash.get("accessControl");
687
      if (accessControlList != null) {
688
    	  for (int i = 0; i < accessControlList.size(); i++) {
689
        	  AccessControlForSingleFile acfsf = (AccessControlForSingleFile) accessControlList.get(i);
690
        	  acfsf.insertPermissions();
691
          }
692
      }
693
      
685 694
      MetacatReplication.replLog("document " + docid + " added to DB with " +
686 695
                                 "action " + dbaction);
687 696
      EventLog.getInstance().log(request.getRemoteAddr(), REPLICATIONUSER, docid, dbaction);
......
832 841
        DocumentImpl.writeDataFileInReplication(url.openStream(), datafilePath,
833 842
                            docName, docType, docid, user,docHomeServer,server, 
834 843
                            DocumentImpl.DOCUMENTTABLE, false, createdDate, updatedDate);
844
        //process extra access rules
845
        Vector accessControlList = (Vector) docinfoHash.get("accessControl");
846
        if (accessControlList != null) {
847
      	  for (int i = 0; i < accessControlList.size(); i++) {
848
          	  AccessControlForSingleFile acfsf = (AccessControlForSingleFile) accessControlList.get(i);
849
          	  acfsf.insertPermissions();
850
            }
851
        }
852
        
835 853
                            //false means non-timed replication
836 854
        MetacatReplication.replLog("datafile " + docid + " added to DB with " +
837 855
                "action " + dbaction);
......
945 963
      sb.append("</home_server>");
946 964
      sb.append("<public_access>").append(doc.getPublicaccess());
947 965
      sb.append("</public_access><rev>").append(doc.getRev());
948
      sb.append("</rev></documentinfo>");
966
      sb.append("</rev>");
967
      
968
      //permissions on the document
969
      PermissionController permController = new PermissionController(docid);
970
      Vector accessControlList = permController.getAccessControl();
971
      sb.append("<accessControl>");
972
      for (int i = 0; i < accessControlList.size(); i++) {
973
    	  AccessControlForSingleFile acfsf = (AccessControlForSingleFile) accessControlList.get(i);
974
    	  sb.append(acfsf.getAccessString());
975
      }
976
      sb.append("</accessControl>");
977
      
978
      sb.append("</documentinfo>");
949 979
      response.setContentType("text/xml");
950 980
      out.println(sb.toString());
951 981

  

Also available in: Unified diff