<?xml version="1.0" encoding="UTF-8"?>
<!--
		Sample configuration file for an SDX application.

		Reminder :

			An SDX application is needed in order to give Web access to XML
			documents and to search them. An SDX application contains one or
			more document bases, where the documents are indexed and thus
			searchable.
-->

<!-- General Notes:

Please see the schema, applicationXconf.xsd, for detailed document structure format.

Global Attributes description:

id =
required, A ID for the configuration object must be unique within the xml document

xml:lang =
optional, Standard language indicator for xml (see XML spec at http://www.w3.org)

variant =
optional, Codes used to build Locale objects in Java.  The Variant codes are vendor and browser-specific. For example, use WIN for Windows, MAC for Macintosh, and POSIX for POSIX. Where there are two variants, separate them with an underscore, and put the most important one first. For example, a Traditional Spanish collation might construct a locale with parameters for language, country and variant as: "es", "ES", "Traditional_WIN".

-->

<!-- "application" element - required, the root element for an application.xconf document

Attributes (other than standard namespacing attributes) :

id =
required, The unique public id of this web application, reverse domain name nomenclature strongly suggested

xml:lang =
See "General Notes" above

variant =
See "General Notes" above

-->

<sdx:application xmlns:sdx="http://www.culture.gouv.fr/ns/sdx/sdx" xml:lang="fr-FR" variant="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.culture.gouv.fr/ns/sdx/sdx ../schemas/application-xconf.xsd" id="fr.gouv.culture.sdx.sdxworld">

	<sdx:information/>

	<sdx:access type="restricted">
		<sdx:deny host=""/>
		<sdx:deny ip=""/>
		<sdx:deny id=""/>
	</sdx:access>

	<!-- "catalogs" element - optional, can contain the definition of entity resolution catalogs for the application, if specified, atleast one catalog should be specified-->
	<sdx:catalogs>
		<!-- "catalog" element - optional, can contain the path to the file which  defines an entity resolution catalogs for the application		

		****************************************************************************************************************
		Attributes:	
		src =
		required, specifies the location of an entity resolution catalog file for the parsing of xml documents
		If it is relative, it can be relative to the application configuration directory where THIS file exists, or to the web application directory
		(in this case the path must start with a forward slash "/"). It can also be an absolute FILE path.
		-->
		<sdx:catalog src="path to cataloge file, can be absolute or relative to the directory containing this file"/>
	</sdx:catalogs>

	<!-- "repositories" element - optional, can contain the definition of global repositories for the application, if specified, atleast one repository must be specified-->
	<sdx:repositories>
		<!-- "repository" element - contains attributes for repository configuration

		****************************************************************************************************************
		Attributes:

		type =
		required,	A Name corresponding to the case sensitive suffix of a repository class name in the java package at fr.gouv.culture.sdx.repository
			"FS" will build a  fr.gouv.culture.sdx.repository.FSRepository
			"URL" will build a  fr.gouv.culture.sdx.repository.URLRepository
			"JDBC" will build a  fr.gouv.culture.sdx.repository.JDBCRepository
			"MYSQL" will build a  fr.gouv.culture.sdx.repository.MYSQLRepository
			"HSQL" will build a  fr.gouv.culture.sdx.repository.HSQLRepository
			"POSTGRESQL" will build a fr.gouv.culture.sdx.repository.POSTGRESQL
		The value for this attribute can also be a fully qualified class name. Custom classes can also be used, but they MUST implement the java interface
		fr.gouv.culture.sdx.repository.Repository and be available at configuration time.

		id =
		See "General Notes" above

		default=
		should never be used here

		****************************************************************************************************************
		*Attributes valid for repository type="FS or fr.gouv.culture.sdx.repository.FSRepository"

		baseDirectory =
		required, Specifies the root location where the files should be stored. If it is relative, it can be relative to the application configuration directory
		where THIS file exists, or to the web application directory (in this case the path must start with a forward slash "/"). It can also be an absolute FILE path.

		extent =
		optional, The extent attribute should be a positive integer. It gives the number of
		documents or directories to put within a repository. By default, it is 100.

		depth =
		optional, The depth attribute should be a positive integer. It gives the level of
		directory nesting before putting some documents. By default, it is 3.

		***As an example, a FS repository with an extent of 100 and a depth of 3 will
		have 100 * 100 * 100 = 1 000 000 directories where to put files, with 100 files per
		directory. It will thus take 100 million documents before being filled.

		****************************************************************************************************************
		*Attributes valid for repository type="URL or fr.gouv.culture.sdx.repository.URLRepository"

		base =
		optional, could be used to store resources relative to a base directory. So if we move an application and the documents,
		only the base URL could be changed, and all the resources would still be available. If it is relative, it can be relative to the application configuration directory
		where THIS file exists, or to the web application directory (in this case the path must start with a forward slash "/"). It can also be an absolute FILE or HTTP url.
		if not specified the default of all absolute urls is used

		**Valid Content for a repository type="URL or fr.gouv.culture.sdx.repository.URLRepository if caching of documents is desired, OPTIONAL
		Example:
		<sdx:repository id="repoName" type="URL" base="file:///some/path">

			<sdx:cache check="onIndex | onGet">
                        <sdx:repository type="FS" id="urlRepoFsCache" baseDirectory="a path of directory name"/>
			<sdx:repository ref="myGlobalCache"/>

                    </sdx:cache>
                </sdx:repository>

		****************************************************************************************************************
		*Attributes valid for repository type="JDBC, MYSQL, or HSQL or fr.gouv.culture.sdx.repository.JDBC, MYSQL, or HSQLRepository"

		dsi =
		required, the value of the "name" attribute of the "jdbc" subElement for the  "datasources" element in cocoon.xconf (user must create this information in cocoon.xconf)

		 -->
		<sdx:repository type="FS" id="myRepoId" baseDirectory="blah" depth="3" extent="100"/>
		<sdx:repository type="URL" id="myRepoId2" base="http url, local file url, relative path to the directory which contains this file"/>
		<sdx:repository type="JDBC" id="myRepoId3" dsi="blah3, datasource identifier from cocoon.xconf"/>
	</sdx:repositories>


	<!-- "userDocumentBase" element - optional, if not specified, the default from sdx.xconf will be used, two optional attributes possible for this element, see below "documentBase" element for element content guidelines

	****************************************************************************************************************
	Attributes:

	xml:lang=
	See "General Notes" above

	variant=
	See "General Notes" above

	-->
	<sdx:userDocumentBase>
		<sdx:repositories>
			<sdx:repository type="FS" id="usersRepo" baseDirectory="usersRepoDir"/>
			<sdx:repository ref="myRepoId2"/>
		</sdx:repositories>
		<sdx:fieldList>
			<sdx:field code="name" type="field" brief="true"/>
		</sdx:fieldList>
		<sdx:index>
			<sdx:pipeline>
				<sdx:transformation src="path to stylesheet, can be absolute or relative to the directory containing this file" id="step1" type="xslt"/>
			</sdx:pipeline>
		</sdx:index>
	</sdx:userDocumentBase>


	<!-- "admin" element - required, contains basic information for administrative purposes of an application

	****************************************************************************************************************
	Attributes:
	groupId =
	required, the desired name for the default administration group

	userId =
	required, the desired name for the default administration user

	userPassword = 
	required, the desired password for the default administration user

	-->
	<sdx:admin groupId="admins" userId="admin" userPassword=""/>


	<!-- "documentBases" element - required, can contain a list of "documentBase" elements, but every application must have ATLEAST ONE "documentBase" configuration-->
	<sdx:documentBases>
		<!-- "documentBase" element - required, every application must have ATLEAST ONE "documentBase" configuration

		****************************************************************************************************************
		Attributes:
		type =
		optional, if not specified the default is "lucene", A Name corresponding to the case sensitive suffix of a
		document base class name in the java package at  fr.gouv.culture.sdx.documentbase
			"Lucene" will build a  fr.gouv.culture.sdx.documentbase.LuceneDocumentBase
		The value for this attribute can also be a fully qualified class name. Custom classes can also be used, but they MUST implement the java interface
		fr.gouv.culture.sdx.documentbase.DocumentBase and be available at configuration time.

		default =
		optional, a boolean of" true" or "false", if not specified false is the default

		id =
		See "General Notes" above

		xml:lang=
		See "General Notes" above

		variant=
		See "General Notes" above

        	remote-access=
		optional, a boolean of" true" or "false", if not specified false is the default. Exposes a RemoteIndex for searching this document base.

		keepOriginalDocuments=
		optional, a boolean of" true" or "false", if not specified true is the default. Specifies whether original documents should be kept
		in addition to any transformed documents stored (see the "keep" attribute for "transformation" elements). this can also be overriden
		at indexation time with a parameter in the IndexParameters class.

		maxFieldLength =
		optional, an integer indicating the maximum amount of terms one field in a Lucene index can contain for performance purposes.
		if not specified, the default is 10000.

		****************************************************************************************************************
		Elements: 3 required
		fieldList - definitions of fields for indexing purposes
		index - definition of an indexation pipeline with atleast one transformation step
		repositories - definition of or reference to atleast one or more repositories for this documentbase
		See below for more information

		-->


		<sdx:documentBase id="myDocumentBaseName" type="lucene">
			<!-- "idGenerator element - optional, used to specify a specific id generator to use, if not specified the DefaultIdGenerator will be used
				to produce ids for any documents given for indexation which specify the attribute, generateId="true" on the sdx:document element

				****************************************************************************************************************
				Attributes:
				class =  optional,  the class name of the id generator to use, if not specified the fr.gouv.culture.sdx.documentbase.DefaultIDGenerator will be used
				
				idPrefix = optional, the prefix to append to any generated id 

				idSuffix = optional, the suffix to append to any generated id
			-->
			<sdx:idGenerator class="fr.gouv.culture.sdx.documentbase.DefaultIDGenerator" idPrefix="aPrefixString" idSuffix="aSuffixString"/>

			<!--"queryParser" element, optional, if specified should contain the class attribute specifying the appropriate, fully qualified java class name for the query parser to be used for functions related to 
				this document base.
				***************************************************************************************************************
				Attributes:
				class = 
				optional, fully qualified java class name for the query parser, if not specified the default SDX query parser will be used.

			-->
			<sdx:queryParser class="fr.gouv.culture.sdx.search.lucene.queryparser.DefaultQueryParser"/>

			<!-- "repositories" element - required, atleast one repository must be specified-->
			<sdx:repositories>
				<!-- "repository" element - required, atleast one repository must be specified
				if the "ref" attribute is specified, the value should be an id of a repository declared on the application level,
				the only other attribute taken into account will be "default"; all other attributes will be ignored on this element when a ref is specified,
				see repository section above for further information on the syntax of the "repository" elements, as normal repository declaration can
				also be made here

				***************************************************************************************************************
				Attributes:
				default =
				optional, a boolean of" true" or "false", if not specified false is the default

				-->
				<sdx:repository baseDirectory="blah4" depth="3" extent="100" type="FS" default="true" id="blah4"/>
				<sdx:repository ref="myRepoId"/>
			</sdx:repositories>

			<!-- "fieldList" element - required, every document base must have fields for indexation

			****************************************************************************************************************
			Attributes:

			analyzerConf =
			optional, specifies the location of an analyzer configuration file containing stop words for the analyzer, overrides any other stop words defined in the java class
			(WE NEED AN EXAMPLE HERE for the format of this file). If it is relative, it can be relative to the application configuration directory where THIS file exists, or to the web
			application directory (in this case the path must start with a forward slash "/"). It can also be an absolute FILE path.

			analyzerClass =
			optional, can be the fully qualified class name to an analyzer that implements the interface fr.gouv.culture.sdx.search.lucene.analysis.Analyzer

			default =
			optional, a boolean of" true" or "false", if not specified false is the default

			xml:lang=
			See "General Notes" above

			variant=
			See "General Notes" above
			-->
			<sdx:fieldList xml:lang="fr-FR" variant="" analyzerConf="" analyzerClass="">
				<!-- "field" element - required, required, every document base must have fields for indexation

				****************************************************************************************************************
				Attributes:
				code =
				required, the Name for the field

				type =
				optional, if not specified the default is "word" as a field MUST have a type, if explicitly specified the value can be one of four lucene field types word, field, date, unindexed

				default =
				optional, a boolean of" true" or "false", if not specified false is the default

				brief =
				optional, a boolean of" true" or "false", if not specified false is the default

				analyzerConf =
				optional, specifies the location of an analyzer configuration file containing stop words for the analyzer, overrides any other stop words defined in the java class
				(WE NEED AN EXAMPLE HERE for the format of this file). If it is relative, it can be relative to the application configuration directory where THIS file exists, or to the web
				application directory (in this case the path must start with a forward slash "/"). It can also be an absolute FILE path.

				analyzerClass =
				optional, can be the fully qualified class name to an analyzer that implements the interface fr.gouv.culture.sdx.search.lucene.analysis.Analyzer

				xml:lang=
				See "General Notes" above

				variant=
				See "General Notes" above

				****************************************************************************************************************
				Elements:(WHAT ELSE HERE for name elements which attributes should we have, xml:lang, variant?)
				Fields can have optional "name" elements for further description:

			-->
				<sdx:field code="fieldName" type="word" xml:lang="fr-FR" analyzerClass="" analyzerConf="">
					<sdx:name/>
				</sdx:field>
				<sdx:field code="fieldName2" type="field" xml:lang="fr-FR" brief="true">
					<sdx:name/>
				</sdx:field>
				<sdx:field code="fieldName3" type="date" xml:lang="fr-FR">
					<sdx:name/>
				</sdx:field>
				<sdx:field code="fieldName4" type="unindexed" xml:lang="fr-FR">
					<sdx:name/>
				</sdx:field>
			</sdx:fieldList>

			<!-- "index" element - required, must contain one pipeline element with atleast one transformation specified-->
			<sdx:index>

				<!-- "pipeline" element - required, must contain atleast one transformation specified, the id is fixed-->
				<sdx:pipeline>

					<!-- "transformation" element - required, must contain atleast one transformation specified

					***************************************************************************************************************
					Attributes:

					id =
					See "General Notes" above

					type=
					required, currently the only value supported is "xslt"

					src=
					required, specifies the location of a xslt stylesheet for preparing documents for indexation (creating the necessary element corresponding to fields in the fieldList).
					If it is relative, it can be relative to the application configuration directory where THIS file exists, or to the web application directory
					(in this case the path must start with a forward slash "/"). It can also be an absolute FILE path.

					keep=
					optional, boolean value "true" or "false", if specified as "true" the tranformation results from this attribute step will be saved in addition to the original document.
					 if the attribute is not specfied the default is false and only the original will be saved. if more than one step has the this attribute set to true, only the results of the last
					transformation in the list having this attribute set to true will be saved.
					-->
					<sdx:transformation src="path to stylesheet, can be absolute or relative to the directory containing this file" id="step2" type="xslt"/>
					<sdx:transformation src="path to stylesheet, can be absolute or relative to the directory containing this file" id="step3" type="xslt" keep="true"/>
				</sdx:pipeline>
			</sdx:index>
			<!-- "repositories" element - required, a document base must use atleast one repository, repository configurations here can be either full declarations for references-->
		</sdx:documentBase>
	</sdx:documentBases>


	<!-- "thesauri" element - optional, must contain atleast one "thesaurus" specified
	-->
	<sdx:thesauri>
	
		<!--Declation of "dico", the thesaurus use in SDXTest to compare french and english words.-->
		<sdx:thesaurus id="dico" type="lucene" src="dico.xml">
			<!--
				Default depth for thesaurus relation exploration, 0 indicates relations of the current term will be explored
			-->
			<sdx:depth>0</sdx:depth>
			<!--
					Default relations for thesaurus exploration
			-->
			<sdx:relations>
				<!--
						The EQUIVALENT TERM relation, for our multilingual thesaurus
				-->
				<sdx:relation>et</sdx:relation>
			</sdx:relations>
			
			<!--
					FieldList of the thesaurus. Declaration of the fields in the thesaurus. See the "dico.xml" file for details.
			-->
			<sdx:fieldList xml:lang="fr-FR" variant="" analyzerConf="/sdx/resources/conf/analysis/fr.xml">
				<!--
						Default field for plain-text indexing (@type="word")
				-->
				<sdx:field name="term" type="word" brief="true" default="true">
					<sdx:name xml:lang="fr-FR">Term</sdx:name>
				</sdx:field>
				<sdx:field name="fterm" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Term TYPE Field</sdx:name>
				</sdx:field>
				<sdx:field name="bts" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Broader TermS</sdx:name>
				</sdx:field>
				<sdx:field name="bt" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Broader Term</sdx:name>
				</sdx:field>
				<sdx:field name="nt" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Narrower Term</sdx:name>
				</sdx:field>
				<sdx:field name="et" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Equivalent Term</sdx:name>
				</sdx:field>
				<sdx:field name="pe" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Partial Equivalence</sdx:name>
				</sdx:field>
				<sdx:field name="use" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Use</sdx:name>
				</sdx:field>
				<sdx:field name="uf" type="word" brief="true">
					<sdx:name xml:lang="fr-FR">Used For</sdx:name>
				</sdx:field>
				<sdx:field name="fuf" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Used For TYPE Field</sdx:name>
				</sdx:field>
				<sdx:field name="sn" type="word" brief="true">
					<sdx:name xml:lang="fr-FR">Scope note</sdx:name>
				</sdx:field>
			</sdx:fieldList>
		</sdx:thesaurus>
	</sdx:thesauri>
</sdx:application>
