@Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { ExecutionStatistics.get().begin(NAME); if (arguments.size() != 1) { throw new TemplateModelException("Error, method expects one argument (" + FileModel.class.getSimpleName() + ")"); } StringModel stringModelArg = (StringModel) arguments.get(0); FileModel fileModel = (FileModel) stringModelArg.getWrappedObject(); ClassificationService classificationService = new ClassificationService(context); Iterable<ClassificationModel> result = classificationService.getClassifications(fileModel); ExecutionStatistics.get().end(NAME); return result; }
@Override public Object exec(@SuppressWarnings("rawtypes") List arguments) throws TemplateModelException { ExecutionStatistics.get().begin(NAME); if (arguments.size() != 1) { throw new TemplateModelException("Error, method expects one argument (" + FileModel.class.getSimpleName() + ")"); } StringModel stringModelArg = (StringModel) arguments.get(0); FileModel fileModel = (FileModel) stringModelArg.getWrappedObject(); ClassificationService classificationService = new ClassificationService(context); Iterable<ClassificationModel> result = classificationService.getClassifications(fileModel); ExecutionStatistics.get().end(NAME); return result; }
@Override public List<Map<String, Object>> getClassifications(Long executionID, Integer fileModelID) { GraphContext context = getGraph(executionID); FileService fileService = new FileService(context); FileModel fileModel = fileService.getById(fileModelID); ClassificationService classificationService = new ClassificationService(context); Iterable<ClassificationModel> classificationModels = classificationService.getClassifications(fileModel); return super.frameIterableToResult(executionID, classificationModels, 1); } }
Iterable<ClassificationModel> classifications = service.getClassifications((FileModel) payload); if (titlePattern == null)
Iterable<ClassificationModel> classifications = service.getClassifications((FileModel) payload); if (titlePattern == null)
persistedTraversalChildFileModel.setClassifications(classificationService.getClassifications(childFile));