Project

General

Profile

« Previous | Next » 

Revision 552

Added by berkley over 23 years ago

added support for server_location in the xml_revisions table.

View differences:

src/xmltables.sql
146 146
	doctitle	VARCHAR2(1000),	-- title of document if exists
147 147
	user_owner	VARCHAR2(100),
148 148
	user_updated	VARCHAR2(100),
149
  server_location NUMBER(20),
149 150
	date_created	DATE,
150 151
	date_updated	DATE,
151 152
   CONSTRAINT xml_revisions_pk PRIMARY KEY (revisionid),
153
   CONSTRAINT xml_revisions_rep_fk
154
    FOREIGN KEY (server_location) REFERENCES xml_replication,
152 155
   CONSTRAINT xml_revisions_root_fk 
153 156
		FOREIGN KEY (rootnodeid) REFERENCES xml_nodes
154 157
);
src/edu/ucsb/nceas/metacat/DocumentImpl.java
899 899

  
900 900
  /** Save a document entry in the xml_revisions table */
901 901
  private static void archiveDocRevision(Connection conn, String docid,
902
                                         String user) throws SQLException {
902
                                         String user) 
903
                                         throws SQLException {
903 904
    // create a record in xml_revisions table 
904 905
    // for that document as selected from xml_documents
905 906
    PreparedStatement pstmt = conn.prepareStatement(
906 907
      "INSERT INTO xml_revisions " +
907 908
        "(revisionid, docid, rootnodeid, docname, doctype, doctitle, " +
908
        "user_owner, user_updated, date_created, date_updated) " +
909
        "user_owner, user_updated, date_created, date_updated, server_location) " +
909 910
      "SELECT null, ?, rootnodeid, docname, doctype, doctitle," + 
910
        "user_owner, ?, sysdate, sysdate "+
911
        "user_owner, ?, sysdate, sysdate, server_location "+
911 912
      "FROM xml_documents " +
912 913
      "WHERE docid = ?");
913 914
    // Bind the values to the query and execute it

Also available in: Unified diff