protected XmlDefinitionsSet getDefinitions() {
LOG.debug("getDefinitions()");
XmlDefinitionsSet definitions = new XmlDefinitionsSet();
//
// core definitions
//
String configFiles = config.getDefinitionConfigFiles();
LOG.info("config files:" + configFiles);
String[] files = configFiles.split(",");
for (int i = 0; i < files.length; i++) {
LOG.info("Trying to load " + files[i]);
InputStream input = servletContext.getResourceAsStream(files[i]);
LOG.info("Stream: " + input);
if (input != null) {
parseXMLDefinitionSet(input, definitions, files[i], "nutch-core");
} else {
LOG.info("Cannot find static " + files[i]);
}
}
//
// plugged implementations can override defaults if they wish
//
ExtensionPoint point = ServletContextServiceLocator.getInstance(
servletContext).getPluginRepository().getExtensionPoint(
UIExtensionPoint.X_POINT_ID);
if (point != null) {
Extension[] extensions = point.getExtensions();
LOG.info("There are " + extensions.length
+ " extensions available for UI");
for (int i = 0; i < extensions.length; i++) {
LOG.info("Adding definitions from "
+ extensions[i].getDescriptor().getName());
Extension extension = extensions[i];
addToSet(definitions, extension);
}
} else {
LOG.info("Cannot find extension point '" + UIExtensionPoint.X_POINT_ID
+ "'");
}
try {
definitions.resolveInheritances();
} catch (NoSuchDefinitionException e) {
LOG.info("Error resolving:" + e);
}
return definitions;
}