private ScheduledJob getJob(String scheduledJobId) { ScheduledJob scheduledJob = dataService.findOneById(SCHEDULED_JOB, scheduledJobId, ScheduledJob.class); if (scheduledJob == null) { throw new UnknownEntityException(SCHEDULED_JOB, scheduledJobId); } return scheduledJob; }
private void upsertScheduledJobTypes() { dataService .getRepository(SCHEDULED_JOB_TYPE, ScheduledJobType.class) .upsertBatch(scheduledJobTypes); }
@Override public void deleteAll() { throw new MolgenisDataException( "Cannot delete all boostrap themes, at least one theme is needed for the application"); }
private boolean viewExists(String viewName) { Queryable templateRepository = dataService.getQueryableRepository(FreemarkerTemplate.ENTITY_NAME); return templateRepository.count(new QueryImpl().eq("Name", viewName + ".ftl")) > 0; }
/** Retrieves the query to get all index actions sorted */ static Query<IndexAction> createQueryGetAllIndexActions(String transactionId) { QueryRule rule = new QueryRule(INDEX_ACTION_GROUP_ATTR, EQUALS, transactionId); QueryImpl<IndexAction> q = new QueryImpl<>(rule); q.setSort(new Sort(ACTION_ORDER)); return q; }
private Repository<Entity> getTargetRepository(String entityTypeId, EntityType targetMetadata) { Repository<Entity> targetRepo; if (!dataService.hasRepository(entityTypeId)) { targetRepo = addTargetEntityType(targetMetadata); } else { targetRepo = dataService.getRepository(entityTypeId); compareTargetMetadatas(targetRepo.getEntityType(), targetMetadata); } return targetRepo; }
@Override public void addSettings(String annotationSourceFileName) { pluginSettings.set(fileLocationAttributeName, annotationSourceFileName); }
@Override public String apply(AttributeMetaData attributeMetaData) { return attributeMetaData.getName(); } }));
static MolgenisDataAccessException createMolgenisDataAccessExceptionReadOnlyAttribute( String entityTypeId, String attributeName) { return new MolgenisDataAccessException( "Operation failed. Attribute '" + attributeName + "' of entity '" + entityTypeId + "' is readonly"); }
@Override public void delete(String mappingProjectId) { dataService.deleteById(MAPPING_PROJECT, mappingProjectId); } }
/** * Create a label for an attribute based on the attribute label in the original repository and the original * repository name itself. */ private String getMergedAttributeLabel(Repository repository, String attributeLabel) { return attributeLabel + "(" + repository.getName() + ")"; }
@Override public EntityMetaData apply(String entityName) { return dataService.getEntityMetaData(entityName); } });
@Override public AggregateQuery visit(OrNode node) { throw new MolgenisQueryException( "RSQL query operator OR (';' or 'or') not allowed in aggregates query"); }
private Sort.Direction toDirection(String editorDirection) { if (editorDirection == null) { return null; } return Sort.Direction.valueOf(editorDirection); }
@Override protected void processQueryResults(Entity entity, Iterable<Entity> annotationSourceEntities, boolean updateMode) { if (updateMode) { throw new MolgenisDataException("This annotator/filter does not support updating of values"); } List<Entity> refMatches = determineRefMatches(entity, annotationSourceEntities); setGoNLFrequencies(entity, refMatches); } };
@Override public void delete(String mappingProjectId) { dataService.deleteById(MAPPING_PROJECT, mappingProjectId); } }
/** * Create a name for an attribute based on the attribute name in the original repository and the original repository * name itself. */ private String getMergedAttributeName(Repository repository, String attributeName) { return repository.getName() + "_" + attributeName; }