|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.xml.XmlImporter
public class 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.
Constructor Summary | |
---|---|
XmlImporter(GrouperSession s,
java.util.Properties userOptions)
Import the Groups Registry from XML. |
Method Summary | |
---|---|
static void |
_handleArgs(XmlImporter importer,
java.util.Properties rc)
|
java.util.Properties |
internal_getOptions()
|
void |
load(org.w3c.dom.Document doc)
Populate Groups Registry. |
void |
load(Stem ns,
org.w3c.dom.Document doc)
Populate Groups Registry using the specified Stem as the root of the registry. |
static void |
main(java.lang.String[] args)
Process an Xml file as the 'root' user. |
void |
setIgnoreInternal(boolean ignoreInternal)
|
void |
update(org.w3c.dom.Document doc)
Update memberships and privileges but do not create missing stems or groups. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlImporter(GrouperSession s, java.util.Properties userOptions)
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. |
s
- Perform import within this session.userOptions
- User-specified configuration parameters.Method Detail |
---|
public static void main(java.lang.String[] args)
args
- args[0] = name of Xml file to processpublic void load(org.w3c.dom.Document doc) throws GrouperException, java.lang.IllegalArgumentException
try { importer.load( XmlReader.getDocumentFromString(s) ); } catch (GrouperException eG) { // error importing }
doc
- Import this Document.
GrouperException
java.lang.IllegalArgumentException
- if doc is nullpublic void load(Stem ns, org.w3c.dom.Document doc) throws GrouperException, java.lang.IllegalArgumentException
try { importer.load( ns, XmlReader.getDocumentFromString(s) ); } catch (GrouperException eG) { // error importing }
ns
- Import using this Stem as the root stem.doc
- Import this Document.
GrouperException
java.lang.IllegalArgumentException
- if doc is nullpublic void update(org.w3c.dom.Document doc) throws GrouperException, java.lang.IllegalArgumentException
try { importer.update( XmlReader.getDocumentFromString(s) ); } catch (GrouperException eG) { // error updating }
doc
- Import this Document.
GrouperException
java.lang.IllegalArgumentException
- if doc is nullpublic void setIgnoreInternal(boolean ignoreInternal)
public java.util.Properties internal_getOptions()
public static void _handleArgs(XmlImporter importer, java.util.Properties rc) throws GrouperException
importer
- rc
-
GrouperException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |