/** * Determines if the catalog contains a particular dictionary * * @param name * @return */ default boolean containsDictionary(final String name) { return getDictionary(name) != null; }
addDictionary(_immutableDelegate.getDictionary(name), false);
@Override public WizardPageController nextPageController(Map<String, List<String>> formParameters) throws DCUserInputException { final String name = formParameters.get("name").get(0); if (StringUtils.isNullOrEmpty(name)) { throw new DCUserInputException("Please provide a reference data name."); } final TenantContext tenantContext = _context.getTenantContext(); final ReferenceData referenceData = tenantContext.getConfiguration().getReferenceDataCatalog().getDictionary(name); if (referenceData != null) { throw new DCUserInputException("A reference data with the name '" + name + "' already exist."); } final String description = formParameters.get("description").get(0); return nextPageController(name, description); }
final Dictionary dictionary = referenceDataCatalog.getDictionary(str); if (dictionary == null) { throw new IllegalArgumentException("Dictionary not found: " + str);
@Override public boolean removeItem(final TenantIdentifier tenant, final ReferenceDataItem.Type type, final String name) { final ReferenceDataDao dao = new ReferenceDataDaoImpl(); if (type.equals(ReferenceDataItem.Type.DICTIONARY) && getReferenceDataCatalog(tenant).containsDictionary(name)) { dao.removeDictionary(_contextFactory.getContext(tenant), getReferenceDataCatalog(tenant).getDictionary(name)); return true; } if (type.equals(ReferenceDataItem.Type.SYNONYM_CATALOG) && getReferenceDataCatalog(tenant).containsSynonymCatalog(name)) { dao.removeSynonymCatalog(_contextFactory.getContext(tenant), getReferenceDataCatalog(tenant).getSynonymCatalog(name)); return true; } if (type.equals(ReferenceDataItem.Type.STRING_PATTERN) && getReferenceDataCatalog(tenant).containsStringPattern(name)) { dao.removeStringPattern(_contextFactory.getContext(tenant), getReferenceDataCatalog(tenant).getStringPattern(name)); return true; } return false; }