<?xml version="1.0" encoding="UTF-8"?>
<ObjectDefinition xmlns:xi="http://www.w3.org/2001/XInclude" type="glo">
	<Document type="default">
		<xi:include href="../../../components/ILIAS/ILIASObject/LuceneDataSource.xml" />
		<xi:include href="../../../components/ILIAS/Tagging/LuceneDataSource.xml" />
		<xi:include href="../../../components/ILIAS/MetaData/LuceneDataSource.xml" />
		<DataSource type="JDBC" action="append">
			<Query>
				SELECT 1 as offline FROM glossary
				WHERE is_online = 'n'
				AND id IN(?)
			</Query>
			<Param format="list" type="int" value="objId" />
			<Field store="YES" index="NOT_ANALYZED" column="offline" type="text" name="offline" />
		</DataSource>
	</Document>
	<Document type="subItem">
		<DataSource type="JDBC" action="create">
			<Query>
				SELECT 'glo' objType,term,glo_id,id,'term' metaType,id metaObjId,glo_id metaRbacId
				FROM glossary_term gt
				WHERE glo_id IN (?)
			</Query>
			<Param format="list" type="int" value="objId" />
			<Field store="YES" index="ANALYZED" column="term" type="text" name="propertyMedium" />
			<Field store="YES" index="NOT_ANALYZED" column="id" type="integer" name="subItem" />
            <Field store="YES" index="NOT_ANALYZED" column="metaType" type="text" name="subType" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="glo_id" type="integer" name="objId"  />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="objType" type="text" name="type"  />
			<xi:include href="../../../components/ILIAS/AdvancedMetaData/LuceneSubItemDataSource.xml" />
			<DataSource type="JDBC" action="append">
				<Query>
					SELECT content FROM glossary_term
					JOIN page_object ON id = page_id
					WHERE id = ?
					AND parent_type = 'term'
				</Query>
				<Param format="single" type="int" value="id" />
				<Field store="YES" index="ANALYZED" column="content" type="clob" name="content">
					<Transformer name="ContentObjectTransformer" />
				</Field>
			</DataSource>
		</DataSource>
	</Document>
</ObjectDefinition>
