GenieGate, Version 1.1.0 (PHP 5) manual

Appendix D. XML export/import

GenieGate supports importing and exporting of XML format files. These are given the mime type of application/x-geniegate-xml.

Many other user management applications support features that aren't directly related to the management of user access. Things such as newsletters, photographs, email's, etc..

XML is GenieGate's answer to desired features that are batch oriented in nature. One could, for example use the XML to produce a list of users who have the property "WantEmail" to produce a monthly newsletter. Another application might apply a stylesheet that generates an HTML report in a format that you find useful. It works the other way around, too. If you have a list of users in some other format and wish to give them access, the answer is in getting that format into the type of XML which GenieGate understands.

Overview of the format

The format consists of group definitions, property definitions and users. The best way to become familiar with it is to view one of the files that have been exported.

Example D.1. Example XML document


<!DOCTYPE GenieGate SYSTEM "geniegate.dtd"> 

<GenieGate>
<GroupDefinitions>
	<GroupDefinition gid="test" name="My test group" />
</GroupDefinitions>

<PropertyDefinitions>
	<PropertySection id="com.example.PhotoAlbum" 
					 title="Properties of a Photo Album">
			<PropertyDefinition property="photo" title="Photograph URL" />
	</PropertySection>
</PropertyDefinitions>

<Users>
	<User uid="test" name="Test User" password="testing" email="test@example.com" confirm="Y">
		<Groups>
			<Group gid="test" />
		</Groups>
		<UserProperties section="com.example.PhotoAlbum">
			<UserProperty property="photo">
http://home.example.com/photo.jpg
			</UserProperty>
		</UserProperties>
		<UserProperties section="genie.form.Public">
			<UserProperty property="city">Any Town</UserProperty>
		</UserProperties>
	</User>
</Users>

</GenieGate>

	

Here we've created a group called " test ". We've also created a property section called com.example.com.PhotoAlbum. (Presumably this is an application using GenieGate on an API level to manage it's own set of user-level properties.) It contains the property "photo".

We've also created (or updated) the user with the id of test. We've given this person access to the "test" group. Since we've defined the property "photo" for our hypothetical photograph album, we can store the url to this persons online photograph.

We've also set this persons "city" to "Any Town" the property is in the "genie.form.Public" section. Since this property is already defined, we can go ahead and use it.