Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Note
Caution!
Caution!

This is an archived page. For the current version, please see Grouper XML Import/Export.  Thanks!

 


Grouper XML Import / Export for Grouper v1.0

...

A Java class, XmlExporter, provides the export functionality. It can be run from the command line, from within Java code, or as an ant task in grouper/build.xml:

Code Block

ant xml-export \-Dcmd="command line arguments"

The command line usage is:    

Command

Summary of args. 

      args: -h

Prints this message

      args: 

subjectIdentifier [(-id] [-name )] [-relative] [-includeParent] fileName [properties]

The above export args. can be explained as follows:

Command

Description

subjectIdentifier

Identifies a Subject 'who' will create a GrouperSession.

    -id

The Uuid of a Group or Stem to export.

    -name

The name of a Group or Stem to export.

    -relative

If id or name specified do not export parent Stems.

    -includeParent

If id or name identifies a Stem export this stem and child Stems or Groups.

filename

The file where exported data will be written. Will overwrite existing files.

properties

The name of a standard Java properties file which configures the export. Check Javadoc for a list of properties. If 'properties' is not specified, XmlExporter will look for 'export.properties' in the working directory. If this file does not exist XmlExporter will look on the classpath. If 'properties' is not specified and 'export.properties' cannot be found, the export will fail.

The JavaDoc describes the export methods. Including a method which can be used to export an arbitrary Collection of Stems, Groups, Subjects or Memberships returned by various Grouper API methods. This means that the results of any list or search methods can be exported.

...

A Java class, XmlImporter, provides the import functionality. It can be run from the command line, from within Java code, or as an ant task in grouper/build.xml:

Code Block

ant xml-import \-Dcmd="command line arguments"

The command line usage is:

  Command   

Summary of args.

    args: -h

Prints this message

    args:

subjectIdentifier [(-id -name -list)] filename [properties]

The above import args. can be explained as follows:

Commands

Description 

subjectIdentifier

Identifies a Subject 'who' will create a GrouperSession.

         -id


The Uuid of a Stem, into which, data will be imported.
     If no -id is specified, use=ROOT stem.

        -name


The name of a Stem, into which, data will be imported.
If no -name is specified, use=ROOT stem. 

         -list

File contains a flat list of Stems or Groups which may be updated. Missing Stems and Groups are not created.

filename

the file to import

properties

The name of a standard Java properties file which configures the import. Check Javadoc for a list of properties. If 'properties' is not specified, XmlImporter will look for 'import.properties' in the working directory. If this file does not exist XmlImporter will look on the classpath. If 'properties' is not specified and 'import.properties' cannot be found and import options are not included in the XML, the import will fail.

The JavaDoc describes the load methods.

...

When generating XML in the import format, it is likely that relationships between stems and groups will need to be specified. This is problematic because the uuids of groups and stems are unknown prior to creation. In addition, it is not always possible to know the full name of a new Stem or Group, as this will depend on which stem it is imported into. When importing Subjects that are groups, the import tool examines the identifier attribute and makes any necessary changes before further processing. The following notations are recognised:

Notation

Description

*SELF*

Refers to the context group for which the Subject is being processed as a member*, list member or privilegee.
*Actually the API will prevent a Group becoming a member of itself

*

As desribed above, * is replaced with the name of the Stem where the XML is to be imported

.:

Replace with the name of the Stem which contains the context group.

..:

Replace with the parent Stem of the Stem which contains the context group. May occur multiple times.

...

     (question) Questions or comments? (info) Contact us.