Class XmlImporter
java.lang.Object
edu.internet2.middleware.grouper.xml.XmlImporter
Utility class for importing data in XML import into the Groups Registry.
This class reads an XML file representing all or part of a Groups Registry
and updates-or-creates the equivalent Stem
s, Group
s and
Membership
s. This class can be used to load data exported by
XmlExporter
.
The API for this class will change in future Grouper releases.
- Since:
- 1.0
- Version:
- $Id: XmlImporter.java,v 1.24.2.2 2009-12-18 21:03:44 tzeller Exp $
-
Constructor Summary
ConstructorDescriptionXmlImporter
(GrouperSession s, Properties userOptions) Import the Groups Registry from XML. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
_handleArgs
(XmlImporter importer, Properties rc) void
Populate Groups Registry using the specified Stem as the root of the registry.void
Populate Groups Registry.static void
Process an Xml file as the 'root' user.void
setIgnoreInternal
(boolean ignoreInternal) void
Update memberships and privileges but do not create missing stems or groups.
-
Constructor Details
-
XmlImporter
Import the Groups Registry from XML.The import process is configured through the following properties.
Key Values Default Description import.metadata.group-types true/false true If true create custom group types when importing. import.metadata.group-type-attributes true/false true If true create custom fields when importing. import.data.ignore-internal-attributes-and-uuids=false true/false false If true, do not attempt to set internal attributes or Group/Stem uuids import.data.apply-new-group-types true/false true If true custom group types are applied to pre-existing groups when importing. import.data.update-attributes true/false true If true overwrite attributes on pre-existing groups when importing. import.data.fail-on-unresolvable-subject true/false false If true, and the import file references a subject which cannot be resolved abort the import, otherwise, log the problem and continue. import.data.lists ignore/replace/add replace Determines whether membership lists are ignored, replaced or appended to pre-existing memberships when importing. import.data.privileges ignore/replace/add add Determines whether privileges are ignored, replaced or appended to pre-existing privileges when importing. - Parameters:
s
- Perform import within this session.userOptions
- User-specified configuration parameters.- Since:
- 1.1.0
-
-
Method Details
-
main
Process an Xml file as the 'root' user.- Parameters:
args
- args[0] = name of Xml file to process- Since:
- 1.1.0
-
load
Populate Groups Registry.try { importer.load( XmlReader.getDocumentFromString(s) ); } catch (GrouperException eG) { // error importing }
- Parameters:
doc
- Import this Document.- Throws:
GrouperException
IllegalArgumentException
- if doc is null- Since:
- 1.1.0
-
load
Populate Groups Registry using the specified Stem as the root of the registry.try { importer.load( ns, XmlReader.getDocumentFromString(s) ); } catch (GrouperException eG) { // error importing }
- Parameters:
ns
- Import using this Stem as the root stem.doc
- Import this Document.- Throws:
GrouperException
IllegalArgumentException
- if doc is null- Since:
- 1.1.0
-
update
Update memberships and privileges but do not create missing stems or groups.try { importer.update( XmlReader.getDocumentFromString(s) ); } catch (GrouperException eG) { // error updating }
- Parameters:
doc
- Import this Document.- Throws:
GrouperException
IllegalArgumentException
- if doc is null- Since:
- 1.1.0
-
setIgnoreInternal
public void setIgnoreInternal(boolean ignoreInternal) -
internal_getOptions
-
_handleArgs
- Parameters:
importer
-rc
-- Throws:
GrouperException
- Since:
- 1.1.0
-