<?xml version="1.0" encoding="UTF-8"?>
<!--
SDX: Documentary System in XML.
Copyright (C) 2000, 2001, 2002  Ministere de la culture et de la communication (France), AJLSM

Ministere de la culture et de la communication,
Mission de la recherche et de la technologie
3 rue de Valois, 75042 Paris Cedex 01 (France)
mrt@culture.fr, michel.bottin@culture.fr

AJLSM, 17, rue Vital Carles, 33000 Bordeaux (France)
sevigny@ajlsm.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the
Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
or connect to:
http://www.fsf.org/copyleft/gpl.html
-->
<!--

        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.

-->
<!--
            The top element refers to the system and public ID of the application,
            and also to the default language
-->
<sdx:application xmlns:sdx="http://www.culture.gouv.fr/ns/sdx/sdx" id="fr.gouv.culture.sdx.sdxtest" xml:lang="fr-FR" xmlns="http://www.culture.gouv.fr/ns/sdx/sdx">
	<!--

            The access section gives information about who can access this
            application from the outside, or see the information.

            By default, an SDX application is public. This means that other
            applications can query and view its content, and that anyone can
            see it's name and description.

            If it is private, no other application can query its content and
            view its documents, nor see any name or description.

            If it is restricted, it is considered private except for the exceptions
            listed in the sdx:exception sub-elements.

    -->
	<sdx:access type="restricted">
		<!-- An exception for hosts matching two regexps -->
		<sdx:allow host=".*\.culture\.fr .*\.culture\.gouv\.fr"/>
		<!-- An exeption for an exact IP address -->
		<sdx:allow ip="132.204.10.24"/>
		<!-- An exception for a SDX application with a given public ID -->
		<sdx:allow id="portail.culture.fr"/>
	</sdx:access>
	<!--
            The information section contains some human information about the application.
    -->
	<sdx:userDocumentBase>
		<sdx:repositories>
			<sdx:repository id="users" type="FS" baseDirectory="users/xml" depth="0" extent="1000"/>
		</sdx:repositories>
		<sdx:fieldList xml:lang="fr-FR" variant="">
			<sdx:field name="name" type="field" brief="true"/>
			<sdx:field name="firstname" type="field" brief="true"/>
			<sdx:field name="lastname" type="field" brief="true"/>
			<sdx:field name="description" type="word"/>
			<sdx:field name="lang" type="field" brief="true"/>
			<sdx:field name="variant" type="field" brief="true"/>
			<sdx:field name="email" type="field" brief="true"/>
			<sdx:field name="content" type="word" default="true">
				<sdx:name xml:lang="fr-FR">Texte intégral</sdx:name>
			</sdx:field>
		</sdx:fieldList>
		<sdx:index>
			<sdx:pipeline>
				<sdx:transformation id="step1" type="XSLT" src="/sdx/resources/indexation/index-identity.xsl"/>
			</sdx:pipeline>
		</sdx:index>
	</sdx:userDocumentBase>
	<!-- Configuring the default administration group and user within that group and an optional "userPassword" attribute -->
	<sdx:admin groupId="admins" userId="admin" userPassword="admin"/>
	<!--
     |
     |
     | About repositories for documentBases
     |
     |
     |-->
	<!-- A document base : the id attribute must be unique -->
	<!--
    An RDBMS repository : the datasource must be configured within cocoon.xconf.

    The id attribute must be unique among repositories for this document base.

    The rdbms type must identify the RDBMS vendor or product. It will be used
    to find a proper class, by looking for a class having this name within the
    fr.gouv.culture.sdx.repository.rdbms package.

    Other options may include in the future :

        - the name to use for the table names
            default : sdx_ + appId + "_" + dbId + "_" + repositoryId + ("adoc" or "xdoc")

                -->
	<!--<sdx:repository id="r1" type="rdbms" rdbmsType="mysql" datasource="blah"/>-->
	<!--
    An XMLDB repository.

    The id attribute must be unique among repositories for this document base.

    The url attribute specifies the url where the XMLDB server listens.

    Other options may include in the future :

        - the name to use for the collections
            default : sdx_ + appId + "_" + dbId + "_" + repositoryId + ("adoc" or "xdoc")
                -->
	<!--<sdx:repository id="r2" type="xmldb" url="http://localhost:4060"/>-->
	<!--
    A file system repository.

    The id attribute must be unique among repositories for this document base.

    The baseDirectory attribute specifies the root location where the files
    should be stored. If it is relative, it must be relative to the application
    base directory. It can also be an absolute path.

    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.

    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.

-->
	<!--
    <sdx:repository type="FS" id="docs" baseDirectory="repos/documents" depth="0" extent="100" default="true"/>
-->
	<!--
    A URL repository.

    The id attribute must be unique among repositories for this document base.

    The baseDirectory attribute specifies the root location where indexing information will be stored.

    There are no further configuration parameters for this kind of repository. But
    if one wants to cache the files, it must add some cache sub-elements for
    every URL protocol to cache.

    These sub-elements must give the same information as the filesystem repository :
    an extent, a depth and a base directory. They must also give the URL scheme (e.g.
    http) to cache. Multiple schemes can be specified, they must be separated by
    white-space.

-->
	<!--
    <sdx:repository id="r4" type="url" base="file:///some/path">
            <cache check="onIndexing|onGet">
                        <repository type="FS">

                        </repository>
                </cache>

    </sdx:repository>
                -->
	<!--
     |
     |
     | About fieldlist for documentBases
     |
     |
     |-->
	<!--
    A document in SDX may be defined by some fields for precise indexation  (and searching)

          @name="myField"
     A field must have a unique name within the document base.

          @type="word"
     A field must have a type : field, date, word or unindexed.

          @???
     A field must have a language,
         if not it will be the document base default language,
         if not it will be the application default language,
         if not it will be fr-FR, SDX' default.
     (MAYCHANGE : All this could change for multilinguism support)

          @default="true"
     A field may be the default content for simple search
     Usually it's a plain-text word field

          @brief="true"
     A field may be sorted in short results of a query
     (whitout the docs)

-->
	<!--
        base cherchable sur les applications SDX,
        avec notices locales + pages d'accueil distantes
        -->
	<sdx:documentBases>
		<!-- A document base : the id attribute must be unique -->
		<!--
				The "useCompoundFiles" attribute specifiy if the Compound File format should be used while processing indexation.
				(This makes it 7% slower in worst cases, but much less file handlers are needed, that's the point)
				Default value if unspecified is : true

				The "autoOptimize" attribute allow one to tell SDX if it should optimize the index after each
				document upload or if it has to be done manually via the exploration interface or parameters
				in queries.
				To keep it the same as in SDX 2.2, just let it set to "true". This is the actual default value.
		-->
		<sdx:documentBase id="sdxworld" type="lucene" default="true" keepOriginalDocuments="true" useCompoundFiles="true" autoOptimize="true">
			<!-- Enable cron type index optimization : uncomment this and follow the OAI's cron syntax -->
			<!-- Whatever you put there, the cron is never used if autoOptimize is set to "true" -->
			<!--
	        <sdx:optimization type="cron">
	          <sdx:minute>30</sdx:minute>
	        </sdx:optimization>
	        -->
	        <!--
	        The split tag allows SDX to create a new index when one of the condition is reached
	        Whatever how many index there is, SDX will still search in all of them
	        If this tag doesn't exist, then the index is never splited (this tag with no attribute results in a split with all default values)
			size : default is 500.
			unit : {b|k|m|g} stands for : byte, kilobyte, megabyte, gigabyte. Default is m.
			Size + Unit results in the max index size reachable before splitting.
	        nbDocuments : default value is 500000
	        -->
	        <sdx:split size="500" unit="m" nbDocuments="500000" />
			<sdx:queryParser class="fr.gouv.culture.sdx.search.lucene.queryparser.DefaultQueryParser"/>
			<!-- A document base must have one or more repositories -->
			<sdx:repositories>
                <!--a local HSQLRepository in the standalone sdx hsql database at sdx/{myAppDir}/conf/databases/_hsql-->
				<sdx:repository id="sdxworldRepo" type="HSQL" default="true"/>
				<sdx:repository id="url" type="URL"/>
			</sdx:repositories>
			<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="contenu" type="word" default="true">
					<sdx:name xml:lang="fr-FR">Texte intégral</sdx:name>
				</sdx:field>
				<!--  title of the document for short results  -->
				<sdx:field name="titre" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Titre</sdx:name>
				</sdx:field>
				<sdx:field name="url" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">url</sdx:name>
				</sdx:field>
				<sdx:field name="jour" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Jour</sdx:name>
				</sdx:field>
				<sdx:field name="doc" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Document</sdx:name>
				</sdx:field>
				<sdx:field name="image" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Image</sdx:name>
				</sdx:field>
				<sdx:field name="lien" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Lien</sdx:name>
				</sdx:field>
				<sdx:field name="base" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">URL de base</sdx:name>
				</sdx:field>
			</sdx:fieldList>
			<sdx:index>
				<sdx:pipeline>
					<!-- src is the relative path to your indexation stylesheet from the application's "conf" directory-->
					<sdx:transformation id="index-projet" type="XSLT" src="index-projet.xsl"/>
				</sdx:pipeline>
			</sdx:index>
			<!-- oai repository configuration-->
			<sdx:oai-repository name="test oai repository for sdxworld document base of the sdxtest application" adminEmail="rasik.pandey@ajlsm.com" baseURL="http://localhost:8080/sdx/oai/sdxtest/sdxworld">
                <sdx:oai-format name="OAI Dublin core" metadataPrefix="oai_dc" namespace="http://purl.org/dc/elements/1.1/" schemaUrl="http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
                    <sdx:oai-fields>
                       <sdx:oai-field name="title" sdxField="titre" repeated="concatenate" separator=" ;; "/>
                       <sdx:oai-field name="source" sdxField="url" repeated="concatenate" separator=" ** "/>
								<!-- tells sdx to use it's internal doc id to generate an url/identifier  according to dublin core specs -->
								<sdx:oai-field name="identifier" sdxField="sdxdocid"/>
                    </sdx:oai-fields>
                </sdx:oai-format>
                <sdx:oai-format name="SDX" metadataPrefix="sdx">
							<!-- fields only need to be specified here for concatenation, if not specified by default they will be repeated-->
							<sdx:oai-fields>
                       <sdx:oai-field sdxField="titre" repeated="concatenate" separator=" ;; "/>
                       <sdx:oai-field sdxField="url" repeated="concatenate" separator=" ** "/>
                   </sdx:oai-fields>
               </sdx:oai-format>
                <sdx:oai-subset>
                    <sdx:include query="sdxdocid:a*"/>
                    <sdx:exclude query="sdxdocid:dummyId"/>
               </sdx:oai-subset>
            </sdx:oai-repository>
		</sdx:documentBase>
		<!--
        base cherchable de la documentation sdx locale en html
        -->
		<sdx:documentBase id="sdxdoc" type="lucene" keepOriginalDocuments="true" useCompoundFiles="true" autoOptimize="true">
			<!-- Enable cron type index optimization : uncomment this and follow the OAI's cron syntax -->
			<!-- Whatever you put there, the cron is never used if autoOptimize is set to "true" -->
			<!--
	        <sdx:optimization type="cron">
	          <sdx:minute>30</sdx:minute>
	        </sdx:optimization>
	        -->
			<sdx:queryParser class="fr.gouv.culture.sdx.search.lucene.queryparser.DefaultQueryParser"/>
			<sdx:repositories>
				<sdx:repository id="sdxdocRepo" type="URL" default="true"/>
			</sdx:repositories>
			<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="contenu" type="word" default="true">
					<sdx:name xml:lang="fr-FR">Texte intégral</sdx:name>
				</sdx:field>
				<!--  title of the document for short results  -->
				<sdx:field name="titre" type="field" brief="true">
					<sdx:name xml:lang="fr-FR">Titre</sdx:name>
				</sdx:field>
			</sdx:fieldList>
			<sdx:index>
				<sdx:pipeline>
					<sdx:transformation id="index-html" type="XSLT" src="index-html.xsl"/>
				</sdx:pipeline>
			</sdx:index>
		</sdx:documentBase>
	</sdx:documentBases>
	<sdx:thesauri>
		<sdx:thesaurus id="dico" type="lucene" src="dico.xml">
			<!--now optional, if individual concepts are needed to display in a user interface, use this repository and the
                individual concepts will be stored and hence will be retrievable
            <sdx:repositories>
                <sdx:repository type="HSQL" id="dicoRepo" default="true"/>
            </sdx:repositories>
            -->
			<!--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>
			<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="rt" type="field" brief="true">
                    <sdx:name xml:lang="fr-FR">Related 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:field name="xmllang" type="field" brief="true">
                    <sdx:name xml:lang="fr-FR">xml:lang field</sdx:name>
                </sdx:field>
			</sdx:fieldList>
			<!-- optional processing pipeline for each concept
            <sdx:index>
                <sdx:pipeline>
                    <sdx:transformation id="index-html" type="XSLT" src="index-html.xsl"/>
                </sdx:pipeline>
            </sdx:index>
            -->
		</sdx:thesaurus>
	</sdx:thesauri>
</sdx:application>
