<?xml version="1.0" encoding="UTF-8"?>
<ObjectDefinition xmlns:xi="http://www.w3.org/2001/XInclude" type="wiki">
	<Document type="default">
		<xi:include href="../../Services/Object/LuceneDataSource.xml" />
		<xi:include href="../../Services/Tagging/LuceneDataSource.xml" />
		<DataSource type="JDBC" action="append">
			<Query>
				SELECT introduction 
				FROM il_wiki_data
				WHERE id IN(?)
			</Query>
			<Param format="list" type="int" value="objId" />
			<Field store="YES" index="ANALYZED" column="introduction" type="clob" name="propertyLow" />
		</DataSource>
	</Document>
	<Document type="subItem">
		<DataSource type="JDBC" action="create">
			<Query>
				SELECT wiki_id, file_id, file_name, version, 'file' AS type FROM il_wiki_page wpg
				JOIN file_usage fu ON wpg.id = usage_id 
				JOIN file_data fd ON fu.id = file_id
				WHERE wiki_id IN(?)
				AND usage_type = 'wpg:pg'
				AND usage_hist_nr = 0
			</Query>
			<Param format="list" type="int" value="objId" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="wiki_id" type="integer" name="objId" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="file_id" type="integer" name="subItem" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="type" type="text" name="type"  />
			<Field global="YES" store="YES" index="ANALYZED" column="file_name" type="text" name="propertyHigh">
				<Transformer name="FilenameExtractor" />
			</Field>
			<DataSource type="File" action="append">
				<PathCreator name="FileListPathCreator41" />
				<Field store="YES" index="ANALYZED" name="content">
					<Transformer name="LinefeedSanitizer" />
				</Field>
			</DataSource>
		</DataSource>
		<DataSource type="JDBC" action="create">
			<Query>
				SELECT 'wiki' type,id,title,wiki_id,create_user,content
				FROM il_wiki_page wp
				JOIN page_object po ON wp.id = po.page_id
				WHERE wiki_id IN(?)
				AND parent_type = 'wpg'
			</Query>
			<Param format="list" type="int" value="objId" />
			<Field store="YES" index="ANALYZED" column="title" type="text" name="propertyMedium" />
			<Field store="YES" index="ANALYZED" column="content" type="clob" name="content">
				<Transformer name="ContentObjectTransformer" />
			</Field>
			<Field store="YES" index="NOT_ANALYZED" column="create_user" type="integer" name="owner" />
			<Field store="YES" index="NOT_ANALYZED" column="id" type="integer" name="subItem" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="wiki_id" type="integer" name="objId" />
			<Field global="NO" store="YES" index="NOT_ANALYZED" column="type" type="text" name="type" />
		</DataSource>
	</Document>
</ObjectDefinition>