gpt4 book ai didi

pl.edu.icm.model.bwmeta.utils.YRTHelper类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 03:29:31 28 4
gpt4 key购买 nike

本文整理了Java中pl.edu.icm.model.bwmeta.utils.YRTHelper类的一些代码示例,展示了YRTHelper类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YRTHelper类的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.utils.YRTHelper
类名称:YRTHelper

YRTHelper介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private String getXMLFragmentFrom(YAttribute attribute){
  if(attribute == null){
    return null;
  }
  
  YRichText yrichText = attribute.getRichValue();
  final String result = YRTHelper.toXmlFragment(yrichText, "");
  
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

/**
 * Returns the content of an element as {@link YRichText}. If the element is null, returns empty text.
 *
 * @param e the element to get the text value from, may be null
 * @return text extracted from the element content
 */
private YRichText textOfElement(org.jdom.Element e) {
  if (e == null) {
    return new YRichText();
  }
  return YRTHelper.buildYrichText(e);
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

private LocalizedString extractLocalizedStringFrom(YName yName){
  YRichText text = yName.getRichText();
  if(StringUtils.isBlank(yName.getText())){
    return null;
  } else {
    String langCode = languageExtractor.extractLanguageCode(yName.getLanguage());
    return new LocalizedString(langCode, YRTHelper.toXmlFragmentWithoutNamespaces(text));
  }
}

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

private LocalizedString convertIntoLocalizedStringFrom(YDescription description){
  return new LocalizedString(getLangCodeFor(description.getLanguage()), YRTHelper.toXmlFragmentWithoutNamespaces(description.getRichText()));
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-client-common-api

private String toText(final YRichText richText, final boolean flattenText) {
  if (richText == null) {
    return "";
  } else if (flattenText) {
    return richText.toText();
  } else {
    return YRTHelper.toXmlFragment(richText, "\n");
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

page.setContent(description.getText());
} else {
  String text = YRTHelper.toXmlFragmentWithoutNamespaces(yRichText);
  page.setContent(text);

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

YRichText yrt=YRTHelper.buildYrichText(e);
ArrayList<YRichText.Part> parts=new ArrayList<>();
for (Part pt:yrt.toParts()) {

代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core

private String getXMLFragmentFrom(YAttribute referanceText) {
  if(referanceText == null){
    return "";
  } else {
    YRichText yrichText = referanceText.getRichValue();
    final String result = YRTHelper.toXmlFragment(yrichText, "");
    
    return result;
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

public static String xmlFromRichText(YName name) {
    return name != null ? YRTHelper.toXmlFragment(name.getRichText()) : "";
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private Map<String, List<LocalizedString>> prepareTypedNames(YElement element,
    IFilteringContext filteringContext) {
  Map<String, List<LocalizedString>> result = new HashMap<String, List<LocalizedString>>();
  for (YName name : element.getNames()) {
      String lang = languageDictionary.getShortDescription(name.getLanguage().getShortCode());
      String text = detailsFilter.filter(YRTHelper.toXmlFragment(name.getRichText()),
          InputType.RICH_TEXT, filteringContext);
      LocalizedString ls = new LocalizedString(lang, text);
      
      List<LocalizedString> list;
      String type = name.getType();
      if (!result.containsKey(type)) {
        list = new ArrayList<LocalizedString>();
        result.put(type, list);
      } else {
        list = result.get(type);
      }
      list.add(ls);
  }
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

protected List<LocalizedString> getDescription(YInstitution element,
    IFilteringContext filteringContext, String type) {
  List<LocalizedString> result = new ArrayList<LocalizedString>();
  
  for (YDescription description : element.getDescriptions()) {
    if (type.equals(description.getType())) {
      result.add(new LocalizedString(languageDictionary.getShortDescription(
        description.getLanguage().getShortCode()),
        detailsFilter.filter(YRTHelper.toXmlFragment(description.getRichText()), InputType.RICH_TEXT,
        filteringContext)));
    }
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

protected List<LocalizedString> getDescription(YElement element,
      IFilteringContext filteringContext, String type) {
  List<LocalizedString> result = new ArrayList<LocalizedString>();
  
  for (YDescription description : element.getDescriptions()) {
    if (type.equals(description.getType())) {
      result.add(new LocalizedString(languageDictionary.getShortDescription(
        description.getLanguage().getShortCode()),
        detailsFilter.filter(YRTHelper.toXmlFragment(description.getRichText()), InputType.RICH_TEXT,
        filteringContext)));
    }
  }
  
  return result;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private Object prepareTitles(List<YName> names, YName defaultName, IFilteringContext filteringContext) {
  List<LocalizedString> res = new ArrayList<LocalizedString>();
  if (names != null)
    for (YName name : names) {
      if (defaultName != name && YNameAndYDescriptionSorter.isMainOrAlternativeName(name.getType())) {
        String lang = languageDictionary.getShortDescription(name.getLanguage().getShortCode());
        res.add(new LocalizedString(lang, detailsFilter.filter(YRTHelper.toXmlFragment(name.getRichText()),
            InputType.RICH_TEXT, filteringContext)));
      }
    }
  return res;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

@Override
protected Object buildElementViewPart(YExportable exp,
    String[] elementTags, Map<String, Object> additionalParameters,
    IFilteringContext filteringContext) {
  YInstitution inst = (YInstitution) exp;
  Map<String, Object> partModel = new HashMap<String, Object>();
  partModel.put("extId", detailsFilter.filter(inst.getId(),
      InputType.PLAIN_TEXT, filteringContext));
  partModel.put("title", detailsFilter.filter(
      YRTHelper.toXmlFragment(inst.getDefaultName().getRichText()),
      InputType.RICH_TEXT, filteringContext));
  partModel.put("titles", prepareTitles(inst.getNames(), inst.getDefaultName(), filteringContext));
  partModel.put("addresses", getAddresses(inst, filteringContext));
  partModel.put("contacts", CommonBuilderUtils.resolveContacts(inst, filteringContext, detailsFilter));
  partModel.put("description", getDescription(inst, filteringContext, YConstants.DS_ABSTRACT));
  partModel.put("fullAddress", getFullAddress(inst, filteringContext));
  partModel.put("notes", getDescription(inst, filteringContext, YConstants.DS_NOTE));
  
  if (pageTitleFactory!=null) {
    String role = (String) additionalParameters.get(DetailsConstants.PARAM_ROLE);
    String title = pageTitleFactory.getTitleForContributor(role, inst.getDefaultName().getText());
    additionalParameters.put(DetailsConstants.VIEW_PARAM_PAGE_TITLE, title);
  }
  
  return partModel;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

protected List<LocalizedString> prepareTitles(YElement element, IFilteringContext filteringContext) {
  YName oneName = element.getDefaultName();
  List<LocalizedString> res = new ArrayList<LocalizedString>();
  for (YName name : element.getNames()) {
    if (name != oneName && YNameAndYDescriptionSorter.isMainOrAlternativeName(name.getType())) {
      String lang = languageDictionary.getShortDescription(name.getLanguage().getShortCode());
      res.add(new LocalizedString(lang, detailsFilter.filter(
          YRTHelper.toXmlFragment(name.getRichText()),
          InputType.RICH_TEXT, filteringContext)));
    }
  }
  return res;
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

} else {
  descr = detailsFilter.filter(
      YRTHelper.toXmlFragment(file.getDefaultName().getRichText()),
      InputType.RICH_TEXT, filteringContext);
  pdescr = detailsFilter.filter(file.getDefaultName().getText(),

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com