Search in sources :

Example 1 with StringUtils.substring

use of org.apache.commons.lang3.StringUtils.substring in project mule-migration-assistant by mulesoft.

the class NotFilter method negateValidator.

public Element negateValidator(Element validator, MigrationReport report, Element original) {
    if ("is-true".equals(validator.getName())) {
        validator.setName("is-false");
    } else if ("is-false".equals(validator.getName())) {
        validator.setName("is-true");
    } else if ("matches-regex".equals(validator.getName())) {
        Attribute regexAttr = validator.getAttribute("regex");
        if (regexAttr.getValue().startsWith("(?!") && regexAttr.getValue().endsWith(")")) {
            regexAttr.setValue(StringUtils.substring(regexAttr.getValue(), 3, -1));
        } else {
            regexAttr.setValue("(?!" + regexAttr.getValue() + ")");
        }
    } else if ("any".equals(validator.getName())) {
        validator.setName("all");
        validator.getChildren().forEach(c -> negateValidator(c, report, original));
    } else if ("all".equals(validator.getName())) {
        validator.setName("any");
        validator.getChildren().forEach(c -> negateValidator(c, report, original));
    } else {
        report.report("filters.negated", original, validator);
    }
    return validator;
}
Also used : Collectors.toList(java.util.stream.Collectors.toList) Attribute(org.jdom2.Attribute) List(java.util.List) XmlDslUtils.getCoreXPathSelector(com.mulesoft.tools.migration.step.util.XmlDslUtils.getCoreXPathSelector) XmlDslUtils.addElementsAfter(com.mulesoft.tools.migration.step.util.XmlDslUtils.addElementsAfter) MigrationReport(com.mulesoft.tools.migration.step.category.MigrationReport) StringUtils(org.apache.commons.lang3.StringUtils) Content(org.jdom2.Content) Element(org.jdom2.Element) Attribute(org.jdom2.Attribute)

Example 2 with StringUtils.substring

use of org.apache.commons.lang3.StringUtils.substring in project solo by 88250.

the class Markdowns method toHTML.

/**
 * Converts the specified markdown text to HTML.
 *
 * @param markdownText the specified markdown text
 * @return converted HTML, returns an empty string "" if the specified markdown text is "" or {@code null}, returns
 * 'markdownErrorLabel' if exception
 */
public static String toHTML(final String markdownText) {
    if (StringUtils.isBlank(markdownText)) {
        return "";
    }
    final String cachedHTML = getHTML(markdownText);
    if (null != cachedHTML) {
        return cachedHTML;
    }
    final LangPropsService langPropsService = BeanManager.getInstance().getReference(LangPropsService.class);
    final ExecutorService pool = Executors.newSingleThreadExecutor();
    final long[] threadId = new long[1];
    final Callable<String> call = () -> {
        threadId[0] = Thread.currentThread().getId();
        String html = null;
        if (LUTE_AVAILABLE) {
            try {
                html = toHtmlByLute(markdownText);
            } catch (final Exception e) {
                LOGGER.log(Level.WARN, "Failed to use Lute [" + LUTE_ENGINE_URL + "] for markdown [md=" + StringUtils.substring(markdownText, 0, 256) + "]: " + e.getMessage());
            }
        }
        if (StringUtils.isBlank(html)) {
            html = toHtmlByFlexmark(markdownText);
        }
        final Document doc = Jsoup.parseBodyFragment(html);
        doc.select("a").forEach(a -> {
            final String src = a.attr("href");
            if (!StringUtils.startsWithIgnoreCase(src, Latkes.getServePath()) && !StringUtils.startsWithIgnoreCase(src, "#")) {
                a.attr("target", "_blank");
            }
            a.removeAttr("id");
        });
        final List<Node> toRemove = new ArrayList<>();
        doc.traverse(new NodeVisitor() {

            @Override
            public void head(final org.jsoup.nodes.Node node, int depth) {
                if (node instanceof org.jsoup.nodes.TextNode) {
                    final org.jsoup.nodes.TextNode textNode = (org.jsoup.nodes.TextNode) node;
                    final org.jsoup.nodes.Node parent = textNode.parent();
                    if (parent instanceof Element) {
                        final Element parentElem = (Element) parent;
                        if (parentElem.tagName().equals("code") || parentElem.tagName().equals("pre")) {
                            return;
                        }
                        if (parentElem.tagName().equals("span") && StringUtils.startsWithIgnoreCase(parentElem.attr("class"), "hljs")) {
                            return;
                        }
                        String text = textNode.getWholeText();
                        text = Emotions.convert(text);
                        if (text.contains("@<a href=") || text.contains("<img")) {
                            final List<org.jsoup.nodes.Node> nodes = Parser.parseFragment(text, parentElem, "");
                            final int index = textNode.siblingIndex();
                            parentElem.insertChildren(index, nodes);
                            toRemove.add(node);
                        } else {
                            textNode.text(text);
                        }
                    }
                }
            }

            @Override
            public void tail(org.jsoup.nodes.Node node, int depth) {
            }
        });
        toRemove.forEach(Node::remove);
        doc.outputSettings().prettyPrint(false);
        Images.qiniuImgProcessing(doc);
        String ret = doc.body().html();
        ret = StringUtils.trim(ret);
        // cache it
        putHTML(markdownText, ret);
        return ret;
    };
    Stopwatchs.start("Md to HTML");
    try {
        final Future<String> future = pool.submit(call);
        return future.get(MD_TIMEOUT, TimeUnit.MILLISECONDS);
    } catch (final TimeoutException e) {
        LOGGER.log(Level.ERROR, "Markdown timeout [md=" + markdownText + "]");
        Callstacks.printCallstack(Level.ERROR, new String[] { "org.b3log" }, null);
        final Set<Thread> threads = Thread.getAllStackTraces().keySet();
        for (final Thread thread : threads) {
            if (thread.getId() == threadId[0]) {
                thread.stop();
                break;
            }
        }
    } catch (final Exception e) {
        LOGGER.log(Level.ERROR, "Markdown failed [md=" + markdownText + "]", e);
    } finally {
        pool.shutdownNow();
        Stopwatchs.end();
    }
    return langPropsService.get("contentRenderFailedLabel");
}
Also used : NodeVisitor(org.jsoup.select.NodeVisitor) HttpURLConnection(java.net.HttpURLConnection) java.util(java.util) URL(java.net.URL) Level(org.apache.logging.log4j.Level) StringUtils(org.apache.commons.lang3.StringUtils) Parser(org.jsoup.parser.Parser) JSONObject(org.json.JSONObject) Element(org.jsoup.nodes.Element) StrikethroughExtension(com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension) AutolinkExtension(com.vladsch.flexmark.ext.autolink.AutolinkExtension) Option(org.b3log.solo.model.Option) Whitelist(org.jsoup.safety.Whitelist) OutputStream(java.io.OutputStream) java.util.concurrent(java.util.concurrent) LangPropsService(org.b3log.latke.service.LangPropsService) StandardCharsets(java.nio.charset.StandardCharsets) IOUtils(org.apache.commons.io.IOUtils) Latkes(org.b3log.latke.Latkes) Node(org.jsoup.nodes.Node) Callstacks(org.b3log.latke.util.Callstacks) Logger(org.apache.logging.log4j.Logger) DataHolder(com.vladsch.flexmark.util.data.DataHolder) Document(org.jsoup.nodes.Document) TaskListExtension(com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension) Stopwatchs(org.b3log.latke.util.Stopwatchs) BeanManager(org.b3log.latke.ioc.BeanManager) Jsoup(org.jsoup.Jsoup) DigestUtils(org.apache.commons.codec.digest.DigestUtils) HtmlRenderer(com.vladsch.flexmark.html.HtmlRenderer) MutableDataSet(com.vladsch.flexmark.util.data.MutableDataSet) LogManager(org.apache.logging.log4j.LogManager) TablesExtension(com.vladsch.flexmark.ext.tables.TablesExtension) InputStream(java.io.InputStream) MutableDataSet(com.vladsch.flexmark.util.data.MutableDataSet) Node(org.jsoup.nodes.Node) Element(org.jsoup.nodes.Element) Document(org.jsoup.nodes.Document) NodeVisitor(org.jsoup.select.NodeVisitor) LangPropsService(org.b3log.latke.service.LangPropsService) Node(org.jsoup.nodes.Node)

Example 3 with StringUtils.substring

use of org.apache.commons.lang3.StringUtils.substring in project ebase-boot by ebase-projects.

the class DataScopeFilterInterceptor method getSqlFilter.

/**
 * 获取数据过滤的SQL
 */
private String getSqlFilter(UserInfoDetails user, MappedStatement mappedStatement) throws Exception {
    StringBuilder sqlFilter = new StringBuilder();
    // 组合角色数据
    String roleIds = user.getRoleId();
    Set<Long> roleIdSet = new HashSet<>();
    if (!StringUtils.isBlank(roleIds)) {
        String[] roleIdStrs = StringUtils.split(roleIds, ",");
        List<String> roleIdStrList = Arrays.asList(roleIdStrs);
        if (roleIdStrList != null && roleIdStrList.size() != 0) {
            roleIdStrList.forEach(p -> {
                roleIdSet.add(Long.parseLong(p));
            });
        }
    }
    // 根据角色信息查询拥有的数据权限列表
    List<RoleDataScopeModel> roleDataScopeModels = getDataScopeByRoleId(roleIdSet);
    // 查询DataScopeFilter注释
    Class<?> classType = Class.forName(mappedStatement.getId().substring(0, mappedStatement.getId().lastIndexOf(".")));
    String mName = mappedStatement.getId().substring(mappedStatement.getId().lastIndexOf(".") + 1, mappedStatement.getId().length());
    for (Method method : classType.getDeclaredMethods()) {
        if (method.isAnnotationPresent(DataScopeFilter.class) && mName.equals(method.getName())) {
            DataScopeFilter dataFilter = method.getAnnotation(DataScopeFilter.class);
            // 获取表的别名
            String tableAlias = dataFilter.tableAlias();
            if (StringUtils.isNotBlank(tableAlias)) {
                tableAlias += ".";
            }
            // 设置优先级
            if (roleDataScopeModels == null || roleDataScopeModels.size() == 0) {
                if (getDataScopeLevel().equalsIgnoreCase("ALL")) {
                    // 默认全部
                    return "";
                } else {
                    sqlFilter.append(" (");
                    sqlFilter.append(tableAlias).append(dataFilter.createBy()).append("=").append(user.getUserId());
                    sqlFilter.append(")");
                    return sqlFilter.toString();
                }
            }
            // 根据type 分组
            Map<Integer, List<RoleDataScopeModel>> roleDataScopeModelsByMap = roleDataScopeModels.stream().sorted(Comparator.comparing(RoleDataScopeModel::getScopeType)).collect(Collectors.groupingBy(RoleDataScopeModel::getScopeType));
            if (roleDataScopeModelsByMap.containsKey(DataScopeViewEnum.ALL.getValue())) {
                // 全部
                return "";
            }
            // 部门集合
            Set<Long> customDeptId = new HashSet<>();
            // 是否包含自己
            boolean isContainOwn = false;
            if (roleDataScopeModelsByMap.containsKey(DataScopeViewEnum.CUSTOM.getValue())) {
                // 自定义
                List<RoleDataScopeModel> tmp = roleDataScopeModelsByMap.get(DataScopeViewEnum.CUSTOM.getValue());
                if (tmp != null && tmp.size() > 0) {
                    for (RoleDataScopeModel roleDataScopeModel : tmp) {
                        if (roleDataScopeModel != null) {
                            String deptIdStrs = roleDataScopeModel.getDeptIds();
                            if (StringUtils.isNotBlank(deptIdStrs)) {
                                String[] split = StringUtils.substring(deptIdStrs, 1, deptIdStrs.length() - 1).split(",");
                                List<String> deptIdStrList = Arrays.asList(split);
                                Set<Long> customDeptIdTmp = deptIdStrList.stream().map(x -> (Long.parseLong(StringUtils.trim(x)))).collect(Collectors.toSet());
                                customDeptId.addAll(customDeptIdTmp);
                            }
                        }
                    }
                }
            }
            if (roleDataScopeModelsByMap.containsKey(DataScopeViewEnum.OWN.getValue())) {
                // 自己
                isContainOwn = true;
            }
            if (roleDataScopeModelsByMap.containsKey(DataScopeViewEnum.DEPT.getValue())) {
                // 部门
                String deptIdStr = SecurityUtils.getUser().getDeptId();
                if (!StringUtils.isBlank(deptIdStr)) {
                    long deptId = Long.parseLong(deptIdStr);
                    customDeptId.add(deptId);
                }
            }
            if (roleDataScopeModelsByMap.containsKey(DataScopeViewEnum.DEPT_CHILD.getValue())) {
                // 部门及子部门
                String deptIdStr = SecurityUtils.getUser().getDeptId();
                if (!StringUtils.isBlank(deptIdStr)) {
                    long deptId = Long.parseLong(deptIdStr);
                    customDeptId.add(deptId);
                    List<Long> list = getSubDeptBydeptId(deptId);
                    customDeptId.addAll(list);
                }
            }
            sqlFilter.append(" (");
            // 部门ID列表
            if (CollUtil.isNotEmpty(customDeptId)) {
                sqlFilter.append(tableAlias).append(dataFilter.createDept());
                sqlFilter.append(" in(").append(StringUtils.join(customDeptId, ",")).append(")");
            }
            // 查询本人数据
            if (CollUtil.isNotEmpty(customDeptId)) {
                if (isContainOwn) {
                    sqlFilter.append(" or ");
                    sqlFilter.append(tableAlias).append(dataFilter.createBy()).append("=").append(user.getUserId());
                }
            } else {
                if (isContainOwn) {
                    sqlFilter.append(tableAlias).append(dataFilter.createBy()).append("=").append(user.getUserId());
                }
            }
            sqlFilter.append(")");
            break;
        }
    }
    return sqlFilter.toString();
}
Also used : DataScopeFilter(me.dwliu.framework.core.datascope.annotation.DataScopeFilter) java.util(java.util) SneakyThrows(lombok.SneakyThrows) NamedParameterJdbcTemplate(org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate) MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource) RowBounds(org.apache.ibatis.session.RowBounds) PlainSelect(net.sf.jsqlparser.statement.select.PlainSelect) StringUtils(org.apache.commons.lang3.StringUtils) JSQLParserException(net.sf.jsqlparser.JSQLParserException) JdbcTemplate(org.springframework.jdbc.core.JdbcTemplate) AndExpression(net.sf.jsqlparser.expression.operators.conditional.AndExpression) UserInfoDetails(me.dwliu.framework.core.security.entity.UserInfoDetails) BoundSql(org.apache.ibatis.mapping.BoundSql) DataScopeModel(me.dwliu.framework.core.datascope.model.DataScopeModel) Method(java.lang.reflect.Method) RoleDataScopeModel(me.dwliu.framework.core.datascope.model.RoleDataScopeModel) CCJSqlParserUtil(net.sf.jsqlparser.parser.CCJSqlParserUtil) Executor(org.apache.ibatis.executor.Executor) DataScopeConstant(me.dwliu.framework.core.datascope.constant.DataScopeConstant) ResultHandler(org.apache.ibatis.session.ResultHandler) Expression(net.sf.jsqlparser.expression.Expression) Collectors(java.util.stream.Collectors) SecurityUtils(me.dwliu.framework.core.security.utils.SecurityUtils) CollUtil(cn.hutool.core.collection.CollUtil) Slf4j(lombok.extern.slf4j.Slf4j) Select(net.sf.jsqlparser.statement.select.Select) MappedStatement(org.apache.ibatis.mapping.MappedStatement) DataScopeViewEnum(me.dwliu.framework.core.datascope.enums.DataScopeViewEnum) PluginUtils(com.baomidou.mybatisplus.core.toolkit.PluginUtils) StringValue(net.sf.jsqlparser.expression.StringValue) QueryInterceptor(me.dwliu.framework.core.mybatis.interceptor.QueryInterceptor) RoleDataScopeModel(me.dwliu.framework.core.datascope.model.RoleDataScopeModel) Method(java.lang.reflect.Method) DataScopeFilter(me.dwliu.framework.core.datascope.annotation.DataScopeFilter)

Example 4 with StringUtils.substring

use of org.apache.commons.lang3.StringUtils.substring in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ExperienceFragmentDataImpl method getLocalizedFragmentVariationPath.

/**
 * Returns the localized path of the experience fragment variation if the experience fragment resource is defined
 * in a template.
 *
 * @return Localized experience fragment variation path
 * @see ExperienceFragment#getLocalizedFragmentVariationPath()
 */
@Nullable
public String getLocalizedFragmentVariationPath() {
    if (localizedFragmentVariationPath != null) {
        return localizedFragmentVariationPath;
    }
    // get the configured fragment variation path
    String fragmentVariationPath = resource.getValueMap().get(ExperienceFragment.PN_FRAGMENT_VARIATION_PATH, String.class);
    if (currentPage != null && inTemplate()) {
        final Resource pageResource = Optional.ofNullable(currentPage).map(p -> p.adaptTo(Resource.class)).orElse(null);
        final String currentPageRootPath = pageResource != null ? LocalizationUtils.getLocalizationRoot(pageResource, resourceResolver, languageManager, relationshipManager) : null;
        // we should use getLocalizationRoot instead of getXfLocalizationRoot once the XF UI supports creating Live and Language Copies
        String xfRootPath = getXfLocalizationRoot(fragmentVariationPath, currentPageRootPath);
        if (StringUtils.isNotEmpty(currentPageRootPath) && StringUtils.isNotEmpty(xfRootPath)) {
            String xfRelativePath = StringUtils.substring(fragmentVariationPath, xfRootPath.length());
            String localizedXfRootPath = StringUtils.replace(currentPageRootPath, CONTENT_ROOT, ExperienceFragmentsConstants.CONTENT_PATH, 1);
            localizedFragmentVariationPath = StringUtils.join(localizedXfRootPath, xfRelativePath, PATH_DELIMITER_CHAR, NN_CONTENT);
        }
    }
    String xfContentPath = String.join(Character.toString(PATH_DELIMITER_CHAR), fragmentVariationPath, NN_CONTENT);
    if (!resourceExists(localizedFragmentVariationPath) && resourceExists(xfContentPath)) {
        localizedFragmentVariationPath = xfContentPath;
    }
    if (!isExperienceFragmentVariation(localizedFragmentVariationPath)) {
        localizedFragmentVariationPath = null;
    }
    return localizedFragmentVariationPath;
}
Also used : ResourceResolver(org.apache.sling.api.resource.ResourceResolver) ExperienceFragmentsConstants(com.adobe.cq.xf.ExperienceFragmentsConstants) Resource(org.apache.sling.api.resource.Resource) ExperienceFragment(com.adobe.cq.wcm.core.components.models.ExperienceFragment) Text(com.day.text.Text) LanguageManager(com.day.cq.wcm.api.LanguageManager) NN_CONTENT(com.day.cq.wcm.api.NameConstants.NN_CONTENT) StringUtils(org.apache.commons.lang3.StringUtils) Page(com.day.cq.wcm.api.Page) SlingHttpServletRequest(org.apache.sling.api.SlingHttpServletRequest) LiveRelationshipManager(com.day.cq.wcm.msm.api.LiveRelationshipManager) LocalizationUtils(com.adobe.cq.wcm.core.components.util.LocalizationUtils) PageManager(com.day.cq.wcm.api.PageManager) Nullable(org.jetbrains.annotations.Nullable) ScriptVariable(org.apache.sling.models.annotations.injectorspecific.ScriptVariable) InjectionStrategy(org.apache.sling.models.annotations.injectorspecific.InjectionStrategy) Template(com.day.cq.wcm.api.Template) Model(org.apache.sling.models.annotations.Model) PostConstruct(javax.annotation.PostConstruct) Optional(java.util.Optional) OSGiService(org.apache.sling.models.annotations.injectorspecific.OSGiService) SlingObject(org.apache.sling.models.annotations.injectorspecific.SlingObject) Resource(org.apache.sling.api.resource.Resource) Nullable(org.jetbrains.annotations.Nullable)

Example 5 with StringUtils.substring

use of org.apache.commons.lang3.StringUtils.substring in project inception by inception-project.

the class ConceptFeatureEditor method getCandidates.

private List<KBHandle> getCandidates(IModel<AnnotatorState> aStateModel, AnnotationActionHandler aHandler, String aInput) {
    if (aInput == null) {
        return emptyList();
    }
    String input = aInput;
    // Extract filter on the description
    final String descriptionFilter;
    if (input.contains("::")) {
        descriptionFilter = substringAfter(input, "::").trim();
        input = substringBefore(input, "::");
    } else {
        descriptionFilter = null;
    }
    // Extract exact match filter on the query
    boolean labelFilter = false;
    String trimmedInput = input.trim();
    if (trimmedInput.length() > 2 && trimmedInput.startsWith("\"") && trimmedInput.endsWith("\"")) {
        input = StringUtils.substring(trimmedInput, 1, -1).trim();
        labelFilter = true;
    }
    final String finalInput = input;
    List<KBHandle> choices;
    try {
        AnnotationFeature feat = getModelObject().feature;
        ConceptFeatureTraits traits = readFeatureTraits(feat);
        String repoId = traits.getRepositoryId();
        // Check if kb is actually enabled
        if (!(repoId == null || kbService.isKnowledgeBaseEnabled(feat.getProject(), repoId))) {
            return Collections.emptyList();
        }
        // If there is a selection, we try obtaining its text from the CAS and use it as an
        // additional item in the query. Note that there is not always a mention, e.g. when the
        // feature is used in a document-level annotations.
        CAS cas = aHandler != null ? aHandler.getEditorCas() : null;
        String mention = aStateModel != null ? aStateModel.getObject().getSelection().getText() : null;
        int mentionBegin = aStateModel != null ? aStateModel.getObject().getSelection().getBegin() : -1;
        choices = clService.getLinkingInstancesInKBScope(traits.getRepositoryId(), traits.getScope(), traits.getAllowedValueType(), finalInput, mention, mentionBegin, cas, feat.getProject());
    } catch (Exception e) {
        choices = asList(new KBHandle("http://ERROR", "ERROR", e.getMessage(), "en"));
        error("An error occurred while retrieving entity candidates: " + e.getMessage());
        LOG.error("An error occurred while retrieving entity candidates", e);
        RequestCycle.get().find(IPartialPageRequestHandler.class).ifPresent(target -> target.addChildren(getPage(), IFeedback.class));
    }
    if (labelFilter) {
        choices = choices.stream().filter(kb -> containsIgnoreCase(kb.getUiLabel(), finalInput)).collect(Collectors.toList());
    }
    if (isNotBlank(descriptionFilter)) {
        choices = choices.stream().filter(kb -> containsIgnoreCase(kb.getDescription(), descriptionFilter)).collect(Collectors.toList());
    }
    return choices.stream().limit(entityLinkingProperties.getCandidateDisplayLimit()).collect(Collectors.toList());
}
Also used : SpringBean(org.apache.wicket.spring.injection.annot.SpringBean) KeyBindingsPanel(de.tudarmstadt.ukp.clarin.webanno.api.annotation.keybindings.KeyBindingsPanel) AjaxFormComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior) StringUtils.containsIgnoreCase(org.apache.commons.lang3.StringUtils.containsIgnoreCase) LoggerFactory(org.slf4j.LoggerFactory) ConceptFeatureTraits(de.tudarmstadt.ukp.inception.kb.ConceptFeatureTraits) ExternalLink(org.apache.wicket.markup.html.link.ExternalLink) EntityLinkingProperties(de.tudarmstadt.ukp.inception.conceptlinking.config.EntityLinkingProperties) StringUtils(org.apache.commons.lang3.StringUtils) KnowledgeBaseService(de.tudarmstadt.ukp.inception.kb.KnowledgeBaseService) WebRequest(org.apache.wicket.request.http.WebRequest) RequestCycle(org.apache.wicket.request.cycle.RequestCycle) JavaScriptHeaderItem.forReference(org.apache.wicket.markup.head.JavaScriptHeaderItem.forReference) AjaxRequestAttributes(org.apache.wicket.ajax.attributes.AjaxRequestAttributes) BUBBLE(org.apache.wicket.event.Broadcast.BUBBLE) LambdaBehavior.visibleWhen(de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaBehavior.visibleWhen) Arrays.asList(java.util.Arrays.asList) Locale(java.util.Locale) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IModel(org.apache.wicket.model.IModel) StringValue(org.apache.wicket.util.string.StringValue) Label(org.apache.wicket.markup.html.basic.Label) Collections.emptyList(java.util.Collections.emptyList) Model(org.apache.wicket.model.Model) MarkupContainer(org.apache.wicket.MarkupContainer) IHeaderResponse(org.apache.wicket.markup.head.IHeaderResponse) Collectors(java.util.stream.Collectors) IFeedback(org.apache.wicket.feedback.IFeedback) FeatureSupport(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupport) List(java.util.List) StringUtils.isNotBlank(org.apache.commons.lang3.StringUtils.isNotBlank) KBHandle(de.tudarmstadt.ukp.inception.kb.graph.KBHandle) FeatureEditor(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.FeatureEditor) FeatureSupportRegistry(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistry) KendoChoiceDescriptionScriptReference(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.KendoChoiceDescriptionScriptReference) FeatureEditorValueChangedEvent(de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.event.FeatureEditorValueChangedEvent) AnnotatorState(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState) JQueryBehavior(com.googlecode.wicket.jquery.core.JQueryBehavior) CAS(org.apache.uima.cas.CAS) ConceptLinkingService(de.tudarmstadt.ukp.inception.conceptlinking.service.ConceptLinkingService) FormComponent(org.apache.wicket.markup.html.form.FormComponent) CompoundPropertyModel(org.apache.wicket.model.CompoundPropertyModel) SerializableFunction(org.danekja.java.util.function.serializable.SerializableFunction) StringUtils.substringAfter(org.apache.commons.lang3.StringUtils.substringAfter) IRequestParameters(org.apache.wicket.request.IRequestParameters) FeatureState(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.FeatureState) Logger(org.slf4j.Logger) AjaxFormChoiceComponentUpdatingBehavior(org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior) AnnotationActionHandler(de.tudarmstadt.ukp.clarin.webanno.api.annotation.action.AnnotationActionHandler) LoadableDetachableModel(org.apache.wicket.model.LoadableDetachableModel) IriInfoBadge(de.tudarmstadt.ukp.inception.ui.kb.IriInfoBadge) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AnnotationFeature(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature) IConverter(org.apache.wicket.util.convert.IConverter) StringUtils.substringBefore(org.apache.commons.lang3.StringUtils.substringBefore) Collections(java.util.Collections) IPartialPageRequestHandler(org.apache.wicket.core.request.handler.IPartialPageRequestHandler) CAS(org.apache.uima.cas.CAS) KBHandle(de.tudarmstadt.ukp.inception.kb.graph.KBHandle) AnnotationFeature(de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature) ConceptFeatureTraits(de.tudarmstadt.ukp.inception.kb.ConceptFeatureTraits)

Aggregations

StringUtils (org.apache.commons.lang3.StringUtils)14 Collectors (java.util.stream.Collectors)7 List (java.util.List)5 Logger (org.slf4j.Logger)5 LoggerFactory (org.slf4j.LoggerFactory)5 Map (java.util.Map)4 HashMap (java.util.HashMap)3 Optional (java.util.Optional)3 Set (java.util.Set)3 Pattern (java.util.regex.Pattern)3 Service (org.springframework.stereotype.Service)3 AnnotationActionHandler (de.tudarmstadt.ukp.clarin.webanno.api.annotation.action.AnnotationActionHandler)2 FeatureSupportRegistry (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.FeatureSupportRegistry)2 FeatureEditor (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.FeatureEditor)2 KendoChoiceDescriptionScriptReference (de.tudarmstadt.ukp.clarin.webanno.api.annotation.feature.editor.KendoChoiceDescriptionScriptReference)2 AnnotatorState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)2 FeatureState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.FeatureState)2 AnnotationFeature (de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature)2 EntityLinkingProperties (de.tudarmstadt.ukp.inception.conceptlinking.config.EntityLinkingProperties)2 ConceptLinkingService (de.tudarmstadt.ukp.inception.conceptlinking.service.ConceptLinkingService)2