use of org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder in project drools-wb by kiegroup.
the class TestScenarioFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final Scenario model = ScenarioXMLPersistence.getInstance().unmarshal(content);
final ModuleDataModelOracle dmo = getModuleDataModelOracle(path);
final Module project = moduleService.resolveModule(Paths.convert(path));
final Package pkg = moduleService.resolvePackage(Paths.convert(path));
final DefaultIndexBuilder builder = new DefaultIndexBuilder(Paths.convert(path).getFileName(), project, pkg);
final TestScenarioIndexVisitor visitor = new TestScenarioIndexVisitor(dmo, builder, model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder, visitor);
return builder;
}
use of org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final GuidedDecisionTableEditorGraphModel model = GuidedDTGraphXMLPersistence.getInstance().unmarshal(content);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final GuidedDecisionTableGraphModelIndexVisitor visitor = new GuidedDecisionTableGraphModelIndexVisitor(builder, model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder, visitor);
return builder;
}
use of org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder in project drools-wb by kiegroup.
the class EnumFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String enumDefinition = ioService.readAllString(path);
final DataEnumLoader enumLoader = new DataEnumLoader(enumDefinition, mvelEvaluator);
if (enumLoader.hasErrors()) {
logger.info("Unable to index '" + path.toUri().toString() + "'. Related errors follow:");
for (String e : enumLoader.getErrors()) {
logger.info(e);
}
}
final ModuleDataModelOracle dmo = getModuleDataModelOracle(path);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final EnumIndexVisitor visitor = new EnumIndexVisitor(dmo, path, enumLoader);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder, visitor);
return builder;
}
use of org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder in project drools-wb by kiegroup.
the class GuidedRuleTemplateFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final TemplateModel model = RuleTemplateModelXMLPersistenceImpl.getInstance().unmarshal(content);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final GuidedRuleTemplateIndexVisitor visitor = new GuidedRuleTemplateIndexVisitor(builder, model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder, visitor);
return builder;
}
use of org.kie.workbench.common.services.refactoring.backend.server.indexing.DefaultIndexBuilder in project drools-wb by kiegroup.
the class GuidedScoreCardFileIndexer method fillIndexBuilder.
@Override
public DefaultIndexBuilder fillIndexBuilder(final Path path) throws Exception {
final String content = ioService.readAllString(path);
final ScoreCardModel model = GuidedScoreCardXMLPersistence.getInstance().unmarshall(content);
final ModuleDataModelOracle dmo = getModuleDataModelOracle(path);
final DefaultIndexBuilder builder = getIndexBuilder(path);
if (builder == null) {
return null;
}
final GuidedScoreCardIndexVisitor visitor = new GuidedScoreCardIndexVisitor(dmo, model);
visitor.visit();
addReferencedResourcesToIndexBuilder(builder, visitor);
return builder;
}
Aggregations