Class XmlExporter
java.lang.Object
edu.internet2.middleware.grouper.xml.XmlExporter
Utility class for exporting data from the Groups Registry in XML format.
This class can export all-or-port of a Groups Registry as a stem/group
hierarchy. Alternatively, collections of Stem
s, Group
s,
Subject
s or Membership
s may be exported.
Exported stem and group data may be imported, as is, or with modifications,
into the same repository or into another repository. See XmlImporter
.
The API for this class will change in future Grouper releases.
- Since:
- 1.0
- Version:
- $Id: XmlExporter.java,v 1.17 2009-12-07 07:31:09 mchyzer Exp $
-
Constructor Summary
ConstructorsConstructorDescriptionXmlExporter
(GrouperSession s, Properties userOptions) Export the Groups Registry to XML. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Exports data for the entire repositoryvoid
Export a single group.void
Export a single stem.void
Export a single stem.void
export
(Writer writer, Collection items, String msg) Export a Collection of Stems, Groups, Members, Subjects or Memberships.internal_groupToXML
(Group g, boolean writeAbsoluteName) Return a String containing a Group as XML.Return a String containing a Membership as XML.internal_subjectToXML
(Subject subj, String immediate) Return a String containing a Subject as XML.static void
Export Groups Registry to XML output.
-
Constructor Details
-
XmlExporter
Export the Groups Registry to XML.The export process is configured using the follow properties.
Key Values Default Value Description export.metadata true/false true If true Group type and field information as well as Subject sources will be exported. export.data true/false true If true data will be exported. export.privs.naming true/false true If true naming privileges will be exported along with Stems. export.privs.access true/false true If true access privileges will be exported along with Groups. export.privs.immediate-only true/false false If true only directly granted privileges will be exported. export.group.members true/false true If true group memberships are exported. export.group.members.immediate-only true/false true If true only immediate group memberships will be exported. export.group.lists true/false true If true custom list attributes will be exported. export.group.lists.immediate-only true/false true If true only immediate list members will be exported. export.uuids true/false true If true group and stem uuids will be exported export.group.internal-attributes true/false true If true system-maintained Group attributes (eg. modifyDate) will be exported. export.group.custom-attributes true/false true If true custom attributes will be exported. export.stem.internal-attributes true/false true If true system-maintained Stem attributes (eg. modifyDate) will be exported. export.privs.for-parents true/false false If true and only exporting a partial hierarchy then privileges for parent stems will be exported. export.data.fail-on-unresolvable-subject true/false false If true and there is a problem resolving a subject attribute abort. export.subject-attributes.source.<source name>.<subject type> Space separated list of attribute names ? Specifices any attributes that should be exported with a Subject given the specified Source and Subject Type. export.subject-attributes.source.<source name> Space separated list of attribute names ? Specifies any attributes that should be exported with a Subject given the specified Source. export.subject-attributes.type.<subject type> Space separated list of attribute names ? Specifies any attributes that should be exported with a Subject given the Subject Type. - Parameters:
s
- Perform export within this session.userOptions
- User-specified configuration parameters.- Throws:
GrouperException
- Since:
- 1.1.0
-
-
Method Details
-
main
Export Groups Registry to XML output.- Since:
- 1.1.0
-
export
Exports data for the entire repository- Parameters:
writer
- Write XML here.- Throws:
GrouperException
- Since:
- 1.1.0
-
export
public void export(Writer writer, Group g, boolean relative, boolean includeParent) throws GrouperException Export a single group.- Parameters:
writer
- Write XML here.g
- Export this group.relative
- If true export in a format suitable for relocating within the Groups Registry.includeParent
- Include parent stem in export.- Throws:
GrouperException
- Since:
- 1.1.0
-
export
Export a single stem.- Parameters:
writer
- Write XML here.ns
- Export this stem.relative
- If true export in a format suitable for relocating within the Groups Registry.- Throws:
GrouperException
- Since:
- 1.1.0
-
export
public void export(Writer writer, Stem ns, boolean relative, boolean childrenOnly) throws GrouperException Export a single stem.- Parameters:
writer
- Write XML here.ns
- Export this stem.relative
- If true export in a format suitable for relocating within the Groups Registry.childrenOnly
- If true omit the actual stem and only export child stems/groups- Throws:
GrouperException
- Since:
- 1.4.0
-
export
Export a Collection of Stems, Groups, Members, Subjects or Memberships.NOTE: XmlImporter cannot currently import the XML generated by this method.
- Parameters:
writer
- Write XML here.items
- Collection to export.msg
- Comment to indicate how collection was generated.- Throws:
GrouperException
- Since:
- 1.1.0
-
internal_getOptions
-
internal_groupToXML
Return a String containing a Group as XML.- Since:
- 1.2.0
-
internal_membershipToXML
public String internal_membershipToXML(Membership ms) throws GroupNotFoundException, MemberNotFoundException, SubjectNotFoundException Return a String containing a Membership as XML.- Throws:
GroupNotFoundException
MemberNotFoundException
SubjectNotFoundException
- Since:
- 1.2.0
-
internal_subjectToXML
Return a String containing a Subject as XML.- Since:
- 1.2.0
-