gpt4 book ai didi

pl.edu.icm.model.bwmeta.utils.YRTHelper.toXmlFragment()方法的使用及代码示例

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

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

YRTHelper.toXmlFragment介绍

暂无

代码示例

代码示例来源: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-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.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(),

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