From: <ssk...@vh...> - 2005-12-05 15:51:10
|
Author: sskracic Date: 2005-12-05 16:48:55 +0100 (Mon, 05 Dec 2005) New Revision: 1027 Modified: trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java Log: Continuation of r1024, query engines need only a single entry in QueryEngineRegistry. Modified: trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java =================================================================== --- trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2005-12-05 15:47:43 UTC (rev 1026) +++ trunk/ccm-cms/src/com/arsdigita/cms/Initializer.java 2005-12-05 15:48:55 UTC (rev 1027) @@ -68,7 +68,6 @@ import com.arsdigita.workflow.simple.WorkflowTemplate; import com.arsdigita.search.filters.ContentSectionFilterType; import com.arsdigita.search.filters.ObjectTypeFilterType; -import com.arsdigita.search.lucene.BaseQueryEngine; import com.arsdigita.xml.XML; import com.arsdigita.templating.PatternStylesheetResolver; @@ -122,14 +121,14 @@ URLService.registerFinder( Link.BASE_DATA_OBJECT_TYPE, new URLFinder() { - public String find(OID oid, String context) + public String find(OID oid, String context) throws NoValidURLException { return find(oid); } - public String find( OID oid ) + public String find( OID oid ) throws NoValidURLException { - + Link link; try { link = (Link) DomainObjectFactory.newInstance( oid ); @@ -147,7 +146,7 @@ return URLService.locate( target.getOID() ); } catch( URLFinderNotFoundException ex ) { throw new UncheckedWrapperException( ex ); - } + } } } } @@ -156,17 +155,17 @@ ImageSizerFactory.initialize(); registerInstantiators(e.getFactory()); - registerLuceneEngines(); - registerIntermediaEngines(); + registerLuceneEngine(); + registerIntermediaEngine(); registerPatternGenerators(); // register item adapters - XML.parse(ContentSection.getConfig().getItemAdapters(), + XML.parse(ContentSection.getConfig().getItemAdapters(), new TraversalHandler()); try { - QueueManager.setListener((PublishToFileListener) + QueueManager.setListener((PublishToFileListener) ContentSection.getConfig() .getPublishToFileClass().newInstance()); } catch (InstantiationException ex) { @@ -175,7 +174,7 @@ } catch (IllegalAccessException ex) { throw new UncheckedWrapperException ("Couldn't access the listener class", ex); - } + } MetadataProviderRegistry.registerAdapter( FileAsset.BASE_DATA_OBJECT_TYPE, @@ -196,8 +195,8 @@ new ItemDelegatedURLPatternGenerator() ); } - + /** * Registers object instantiators */ @@ -218,7 +217,7 @@ return new Workflow(dataObject); } }); - + f.registerInstantiator (WorkflowTemplate.BASE_DATA_OBJECT_TYPE, new ACSObjectInstantiator() { @@ -226,152 +225,52 @@ return new WorkflowTemplate(dataObject); } }); - + f.registerInstantiator (TemplateContext.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() { public DomainObject doNewInstance(DataObject dataObject) { return new TemplateContext(dataObject); } - public DomainObjectInstantiator + public DomainObjectInstantiator resolveInstantiator(DataObject obj) { return this; } }); } - private void registerLuceneEngines() { - QueryEngineRegistry.registerEngine(IndexerType.LUCENE, - new FilterType[] { - new VersionFilterType() - }, - new LuceneQueryEngine()); + private void registerLuceneEngine() { QueryEngineRegistry.registerEngine(IndexerType.LUCENE, new FilterType[] { + new CategoryFilterType(), + new ContentSectionFilterType(), new ContentTypeFilterType(), - new VersionFilterType() - }, - new LuceneQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.LUCENE, - new FilterType[] { - new ContentTypeFilterType(), - new VersionFilterType(), - new LastModifiedDateFilterType(), new CreationDateFilterType(), new CreationUserFilterType(), - new LastModifiedUserFilterType() + new LastModifiedDateFilterType(), + new LastModifiedUserFilterType(), + new ObjectTypeFilterType(), + new VersionFilterType() }, new LuceneQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.LUCENE, - new FilterType[] { - new ObjectTypeFilterType(), - new ContentSectionFilterType() - }, - new BaseQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.LUCENE, - new FilterType[] { - new VersionFilterType(), - new ContentSectionFilterType() - }, - new LuceneQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.LUCENE, - new FilterType[] { - new VersionFilterType(), - new ContentSectionFilterType(), - new ObjectTypeFilterType() - }, - new LuceneQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.LUCENE, - new FilterType[] { - new VersionFilterType(), - new ContentTypeFilterType(), - new ContentSectionFilterType() - }, - new LuceneQueryEngine()); - - } - - private void registerIntermediaEngines() { - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new PermissionFilterType(), - new VersionFilterType(), - }, - new IntermediaQueryEngine()); - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new PermissionFilterType(), - new VersionFilterType(), - new ContentSectionFilterType() - }, - new IntermediaQueryEngine()); + private void registerIntermediaEngine() { - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new ObjectTypeFilterType(), - new ContentSectionFilterType() - }, - new BaseQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new VersionFilterType(), - new ContentSectionFilterType() - }, - new IntermediaQueryEngine()); - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new VersionFilterType(), - new ContentSectionFilterType(), - new ObjectTypeFilterType() - }, - new IntermediaQueryEngine()); - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new VersionFilterType(), - new ContentTypeFilterType(), - new ContentSectionFilterType() - }, - new IntermediaQueryEngine()); - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, new FilterType[] { - new PermissionFilterType(), - new ContentTypeFilterType(), new CategoryFilterType(), - new VersionFilterType(), - }, - new IntermediaQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new PermissionFilterType(), + new ContentSectionFilterType(), new ContentTypeFilterType(), - new CategoryFilterType(), - new VersionFilterType(), - new LaunchDateFilterType() - }, - new IntermediaQueryEngine()); - - QueryEngineRegistry.registerEngine(IndexerType.INTERMEDIA, - new FilterType[] { - new PermissionFilterType(), - new ContentTypeFilterType(), - new CategoryFilterType(), - new VersionFilterType(), - new LaunchDateFilterType(), - new LastModifiedDateFilterType(), new CreationDateFilterType(), new CreationUserFilterType(), - new LastModifiedUserFilterType() + new LastModifiedDateFilterType(), + new LastModifiedUserFilterType(), + new LaunchDateFilterType(), + new ObjectTypeFilterType(), + new PermissionFilterType(), + new VersionFilterType() }, new IntermediaQueryEngine()); } |