Call the
CasCrawler.listModules()
method to return a list of
modules you can include in a crawl. Modules include CMS connectors that you
have licensed and enabled, and any data source extensions and manipulator
extensions you may have created using the CAS Extension API.
The syntax of the method is:
CasCrawler.listModules(ModuleType moduleType)
where
moduleType
is an enumeration value of either:
The method returns a
List<ModuleInfo>
object, which has zero or
more
ModuleInfo
objects. Each
ModuleInfo
has the name and ID of a data source or
manipulator.
To list the modules available to a crawl:
Make sure that you have created a connection to the CAS Server. (A
CasCrawler
object namedcrawler
is used in this example.)Call the
CasCrawler.listModules()
method and specify an enumeration value to return either data sources or manipulators.For example:
List<ModuleInfo> modules = crawler.listModules(ModuleType.SOURCE);
Call the
ModuleInfo.getModuleId()
method to get the ID of the module (the data source or manipulator).Call the
ModuleInfo.getModuleType()
method to get the type of the module (the data source or manipulator).Call the
ModuleInfo.getDescription()
method to get the description of the module (the data source or manipulator).Call the
ModuleInfo.getDisplayName()
method to get the display name of the module (the data source or manipulator).
For example:
List<ModuleInfo> moduleInfoList = modules.getModuleInfo(); for (ModuleInfo moduleInfo : moduleInfoList) { System.out.println(moduleInfo.getDisplayName()); System.out.println(" *Id: "+ moduleInfo.getModuleId().getId()); System.out.println(" *Type: "+ moduleInfo.getModuleType()); System.out.println(" *Description: " + moduleInfo.getDescription()); System.out.println(); }
The
CasCrawler.listModules()
method does not throw
checked exceptions if it fails.