Project

General

Profile

« Previous | Next » 

Revision 557

Added by bojilova over 23 years ago

added interface to handle a new "acl" parameter bringing the text of a xml access file for a given metadata document
the "acl" parameter is optional and should be sent on INSERT or UPDATE action.

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
72 72
 * qformat=html -- display resultset from query in HTML<br>
73 73
 * docid=34 -- display the document with the document ID number 34<br>
74 74
 * doctext -- XML text of the document to load into the database<br>
75
 * acl - xml access file for a document to load into the database<br>
75 76
 * query -- actual query text (to go with 'action=query' or 'action=squery')<br>
76 77
 * valtext -- XML text to be validated<br>
77 78
 * action=getdatadoc -- retreive a stored datadocument<br>
......
899 900
    try {
900 901
      // Get the document indicated
901 902
      String[] doctext = (String[])params.get("doctext");
903
      String[] acltext = null;
904

  
905
      StringReader acl = null;
906
      if(params.contains("acl"))
907
      {
908
        acltext = (String[])params.get("acl");
909
        try {
910
          acl = new StringReader(acltext[0]);
911
        } catch (NullPointerException npe) {}
912
      }
913
      
902 914
      StringReader xml = null;
903 915
      try {
904 916
        xml = new StringReader(doctext[0]);
......
924 936
                if (accNumber.equals("")) {
925 937
                    accNumber = null;
926 938
                }
927
                newdocid = DocumentImpl.write(conn, xml, doAction, accNumber, 
928
                                              user, group);
939
                newdocid = DocumentImpl.write(conn, xml, acl, doAction,
940
                                              accNumber, user, group);
929 941
                
930 942
            } catch (NullPointerException npe) {
931
              newdocid = DocumentImpl.write(conn,xml,doAction,null,user,group);
943
              newdocid = DocumentImpl.write(conn, xml, acl, doAction,
944
                                            null, user, group);
932 945
            }
933 946
//        } catch (Exception e) {
934 947
//          response.setContentType("text/html");

Also available in: Unified diff