Skip to Content.
Sympa Menu

grouper-dev - RE: xml export/import v1.6

Subject: Grouper Developers Forum

List archive

RE: xml export/import v1.6


Chronological Thread 
  • From: Chris Hyzer <>
  • To: "" <>
  • Subject: RE: xml export/import v1.6
  • Date: Wed, 20 Jan 2010 10:56:53 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

Here is an example of all tables being exported:

 

I can import about 40% of the tables at this point, need to code the rest.  For an import the data object needs to implement this interface (below).  Its pretty straightforward at this point.

 

For Kuali, we made a lot of progress this week.  My next goal is to do a workflow with a group from Grouper.  I will try to make a form from Penn in edoclite and use grouper for the routing.

 

Thanks,

Chris

 

/**

 * @author mchyzer

 * $Id$

 */

package edu.internet2.middleware.grouper.xml.export;

 

 

/**

 * Hibernated object which can be imported into

 * @param <T> is the type of the object

 */

public interface XmlImportable<T> {

 

  /**

   * retrieve from db by id or key.  throws exception if duplicate

   * @return the object or null if not found

   */

  public T xmlRetrieveByIdOrKey();

 

  /**

   * see if the update cols are different (e.g. last updated)

   * @param other the one to compare with

   * @return true if so

   */

  public boolean xmlDifferentUpdateProperties(T other);

 

  /**

   * see if the non update cols are different (e.g. name)

   * @param other the one to compare with

   * @return true if so

   */

  public boolean xmlDifferentBusinessProperties(T other);

 

  /**

   * save the business properties (not update properties)

   * @param existingRecord null if insert, the object if exists in DB

   * generally just copy the hibernate version number, and last updated to the

   * object and store it

   */

  public void xmlSaveBusinessProperties(T existingRecord);

 

  /**

   * save the udpate properties (e.g. last updated).  Note, this is

   * done with a sql update statement, not with hibernate

   */

  public void xmlSaveUpdateProperties();

 

  /**

   * copy business (non update) properties to an existing record

   * @param existingRecord

   */

  public void xmlCopyBusinessPropertiesToExisting(T existingRecord);

 

}

 

 

 

 

From: Chris Hyzer
Sent: Monday, January 11, 2010 1:22 AM
To: ''
Subject: RE: xml export/import v1.6

 

Here is another example with more tables exported (attached).  Also, I started a wiki page.

 

https://spaces.internet2.edu/display/GrouperWG/Grouper+export+import+v1.6

 

Regards,

Chris

 

From: Chris Hyzer
Sent: Saturday, January 09, 2010 2:23 PM
To: ''
Subject: xml export/import v2

 

Hey,

 

We have been discussing the new version of Grouper export/import which will go in Grouper 1.6.

We will rewrite it with the following improvements:

 

1.       Doesn’t store the XML document in memory (SAX)

2.       Versioned

3.       Doesn’t manually marshal XML (will use xstream)

4.       Will keep logic in beans (more object oriented)

5.       Handles all data columns in the database (e.g. uuids).  Note, in import will need to lookup the business key to see if there is a different UUID, and maintain the existing UUID if it exists, will not change any UUIDs on import

6.       Handles all the new tables (e.g. new attribute framework, though I didn’t think we need to import the “set” tables, e.g. groupSet.  We can calculate that stuff after import.  This is a tradeoff between size of file, speed of import (probably faster to export the “set” tables), and data integrity (probably better to recalc all after import)

7.       Data is sorted so it can be easily diffed

 

The Sax, uuid, and beans part is already being done for the user audit export.  I will reuse this for a few tables.  The current export/import has many configuration settings which I was hoping to eliminate or clamp down on, and only implement the must-haves for the first pass.  Attached is an example of exporting members and stems.  Note the whole file is not indented.  If you want it indented you can indent it, otherwise, I think it is best in that form.

 

Thanks,

Chris

 

Attachment: grouperExport.xml
Description: grouperExport.xml




Archive powered by MHonArc 2.6.16.

Top of Page