--[[----------------------------------------------------------------------------

WFCatIndexDefinitions.lua

--------------------------------------------------------------------------------

ADOBE CONFIDENTIAL
------------------
Copyright 2015 Adobe Systems Incorporated
All Rights Reserved.

NOTICE: All information contained herein is, and remains the property of
Adobe Systems Incorporated and its suppliers, if any. The intellectual and
technical concepts contained herein are proprietary to Adobe Systems
Incorporated and its suppliers and are protected by all applicable
intellectual property laws, including trade secret and copyright laws.
Dissemination of this information or reproduction of this material is
strictly forbidden unless prior written permission is obtained from
Adobe Systems Incorporated.

----------------------------------------------------------------------------]]--

	-- WF.sqlite.index_store
local WFRxIndexStoreSchema = require 'WFRxIndexStoreSchema'

--==============================================================================

local WFCatIndexDefinitions = {}
	
--============================================================================--

local sqlitePageSize = 4096

local indexStoreSchema = WFRxIndexStoreSchema( sqlitePageSize )

indexStoreSchema:addDatabaseInitRoutine( require 'WFSQLiteSetLogicImp'.registerSetModule )

--------------------------------------------------------------------------------

local function getIndexSchemaGenerators(  )
	return { 
		'DesktopCommonIndexDefinitions',
		'NmbSimpleDocStoreUpdater',
		'NmbPresetDocumentProcessor',
		'NmbPathRestorer',
		'NmbFileMover',
		'NmbExternalDevelopSettings',
		'NmbSmartAlbums',
		'WFCatBinaryUploader',
		'WFCatConflictResolver',
		'WFCatCollaboration',
		'WFCatCollaborator',
		'LrFavoritesIndexDefinitions',
		'LrCommentsIndexDefinitions',
		'NmbDCPDocumentProcessor',
		'WFCatDelete',
		'WFCatErrorHandler',
		'WFCatIdleDownloader',
		'WFCatImportDuplicateFiles',
		'WFCatSearchHandler',
		'WFCatSortHandler',
		'WFCatStacks',
		'WFCatStaleBinaryRemover',
		'WFCatStorage',
		'WFCatSyncStatus',
		'WFCatPerson',
		'WFCatFaces',
		'WFCatVersions',
		'LrWatermarkIndexDefinitions',
		'NmbCameraModelUsageIndexDefinition',
		'WFCatVolumeAgentQueryHelper',
		'WFCatSimpleDocStoreUpdater',
		}
end


--------------------------------------------------------------------------------
local function generateIndexSchema( theIndexStoreSchema )

	local indexSchemaGenerators = getIndexSchemaGenerators()
	
	for _, generator in pairs( indexSchemaGenerators ) do
		require ( generator ).generateIndexSchema( theIndexStoreSchema )
	end
	
end

--------------------------------------------------------------------------------

generateIndexSchema ( indexStoreSchema )

--------------------------------------------------------------------------------

local WFConfiguration = require 'WFConfiguration'

--------------------------------------------------------------------------------

if WFConfiguration.Nimbus.Nmb5582InvalidOriginals then

	require 'WFCatInvalidOriginalHandler'.generateIndexSchema( indexStoreSchema )

end

--------------------------------------------------------------------------------

if WFConfiguration.Shared.enableDashboard then

	require 'NmbCatalogDashboard'.generateIndexSchema( indexStoreSchema )

end

--------------------------------------------------------------------------------

WFCatIndexDefinitions.indexStoreSchema = indexStoreSchema

--------------------------------------------------------------------------------

return WFCatIndexDefinitions
