gpt4 book ai didi

pl.edu.icm.synat.logic.model.utils.YModelUtils类的使用及代码示例

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

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

YModelUtils介绍

[英]Class for utility functions for interactions with Ymodel
[中]用于与Ymodel交互的实用函数的类

代码示例

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

/**
 * Utility function retrieving name of YContributor
 *
 * @param contributor
 * @return concatenation of NM_SURNAME and NM_FORENAMES names separated with
 *         ", "
 */
public static String getDefaultContributor(YContributor contributor) {
  String name = fetchNames(contributor);
  final String surname = fetchSurname(contributor);
  if (StringUtils.isNotEmpty(surname) && StringUtils.isNotEmpty(name)) {
    return UserProfileUtils.createFullName(name, surname);
  }
  return getDefaultName(contributor);
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

public static String getContributorNameForSort(YContributor contributor) {
  String name = fetchNames(contributor);
  final String surname = fetchSurname(contributor);
  if (StringUtils.isNotEmpty(surname) && StringUtils.isNotEmpty(name)) {
    return UserProfileUtils.createNameForSorting(name, surname);
  }
  return getDefaultContributor(contributor);
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

/**
 * Creates BriefElementData using YModel (YElement)
 *
 * @param yElement
 *            bwmeta YModel
 */
@Deprecated
public BriefElementData(YElement yElement) {
  this(yElement.getId(), YModelUtils.getDefaultName(yElement));
  String text = YModelUtils.getDefaultDescription(yElement);
  this.description = new HighlightedString(text, -1);
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api

public static String getDefaultDescriptionString(AbstractNDA<?> element, YLanguage language) {
  final YDescription defaultDescription = getDefaultDescription(element, language);
  if (defaultDescription != null) {
    return yRichTextToString(defaultDescription.getRichText());
  } else {
    return "";
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-business-services-impl

private String prepareLabel(YElement yElement) {
  return  YModelUtils.getDefaultName(yElement);
}

代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services

line.add(doi);
String name = YModelUtils.getDefaultName(element);
line.add(name);
    String contributorName = YModelUtils.getDefaultContributor(contributor);
    StringBuilder affiliationList = new StringBuilder();
    for (String affId : contributor.getAffiliationRefs()) {

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

public ResourceContributor transformYContributorToResourceContributor(final String documentId, YContributor contributor) {
  String forenames = YModelUtils.fetchNames(contributor);
  String surname = YModelUtils.fetchSurname(contributor);
  Integer contributorId = BwmetaContributorUtils.getContributorId(contributor);
  final boolean hasSuggestion = fetchHasSuggestions(documentId, contributorId);
    String identity = BwmetaContributorUtils.getContributorIdentity(contributor);
  ResourceContributor resourceContributor = new ResourceContributor(contributorId, identity, hasSuggestion).setAffiliationIds(contributor
      .getAffiliationRefs());
  if (StringUtils.isNotBlank(identity)) {
    resourceContributor.setThumbnailPath(thumbnailService.resolveUserAvatar(identity));
    resourceContributor.setCurrentId(identity);
  }
  final String canonicalName = YModelUtils.getCanonicalName(contributor);
  if (StringUtils.isNotBlank(forenames) && StringUtils.isNotBlank(surname)) {
    resourceContributor.setForenames(forenames).setSurname(surname);
    if (StringUtils.isBlank(canonicalName)) {
      resourceContributor.setCanonicalName(UserProfileUtils.createFullName(forenames, surname));
    }
  } else if (StringUtils.isBlank(canonicalName)) {
    resourceContributor.setCanonicalName(YModelUtils.getDefaultName(contributor));
  }
  if (StringUtils.isNotBlank(canonicalName)) {
    resourceContributor.setCanonicalName(canonicalName);
  }
  return resourceContributor;
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

final String name = YModelUtils.getDefaultName(contributor);
final String surname = YModelUtils.getNameByType(contributor, NameTypes.NM_SURNAME);
final String canonicalName = YModelUtils.getNameByType(contributor, NameTypes.NM_CANONICAL);
String nameName = YModelUtils.getNameByType(contributor, NameTypes.NM_FORENAMES);
if (StringUtils.isBlank(nameName)) {
  nameName = YModelUtils.getNameByType(contributor, NameTypes.NM_FORENAME);
  personData = new ContributorData(id, nameName, surname, personPortalRole, contributor.getRole());
}else {
  final String description = YModelUtils.getDefaultDescription(contributor);
  personData = new ContributorData(id, name, description, personPortalRole, contributor.getRole());

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

@SuppressWarnings("deprecation")
private CharSequence prepareName(YElement yElement, YLanguage language) {
  YName yName = YModelUtils.getDefaultName(yElement, language);
  if (yName != null) {
    return new FilteredString(YModelUtils.yRichTextToString(yName.getRichText()));
  }
  return "";
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@Override
public String generate(YElement element) {
  String name = YModelUtils.getDefaultName(element);
  String normalized = Normalizer.normalize(name, Form.NFC);
  String trimmed = normalized.replaceAll("[^a-zA-Z0-9]", "");
  String lowercase = trimmed.toLowerCase();
  String level = YModelUtils.getType(element);
  StringBuffer id = new StringBuffer();
  switch (level) {

代码示例来源:origin: pl.edu.icm.synat/synat-process-common

IdentityIndexDocument indexDocument = new IdentityIndexDocument(contributorId);
indexDocument.setRole(contributor.getRole());
String surname = YModelUtils.fetchSurname(contributor);
indexDocument.setSurname(StringUtils.trim(surname));
String name = YModelUtils.fetchNames(contributor);
indexDocument.setName(StringUtils.trim(name));
if (StringUtils.isBlank(indexDocument.getName()) && StringUtils.isBlank(indexDocument.getSurname())) {
  YName defaultName = YModelUtils.fetchDefaultName(contributor);
  if (defaultName != null) {
    indexDocument.setName(defaultName.getText().trim());

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

private String fetchSearchParams(YElement element, String contributionId) {
  YContributor contributor = PersonDataYModelTransformer.getContributor(element, contributionId);
  return YModelUtils.getDefaultContributor(contributor);
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

protected void fillTitle(HtmlMetaHeaders metadata, YElement yElement) {
  String title = YModelUtils.getDefaultName(yElement);
  if (StringUtils.isNotEmpty(title)) {
    metadata.addMetadataName(WP_TITLE, title);
  }
  YLanguage language = YModelUtils.getDefaultLanguage(yElement);
  if (language != null && language.getName() != null) {
    metadata.addMetadataName(WP_LANGUAGE, language.getName());
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

private boolean hasLevel(YElement element, String requiredLevel) {
  String type = YModelUtils.getType(element);
  return StringUtils.equalsIgnoreCase(type, requiredLevel);
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

result.addDescription(new LanguageData(description.getLanguage()), YModelUtils.yRichTextToString(description.getRichText()));
    result.addTitle(new LanguageData(name.getLanguage()), YModelUtils.yRichTextToString(name.getRichText()));
result.setType(ResourceDataConstants.MAP_TYPE_TO_CURRENT.inverse().get(YModelUtils.getType(yElement)));
result.setHierarchy(extractHierarchy(yElement));
result.setThumbnailPath(yModelPropertyExtractor.extractThumbnailPath(yElement));

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

@Override
public HtmlMetaHeaders prepareDescriptionMetadata(final YElement yElement) {
  HtmlMetaHeaders descriptionMetadata = new HtmlMetaHeaders();
  String description = YModelUtils.getDefaultDescription(yElement);
  if (description != null && description.length() > 0) {
    descriptionMetadata.addMetadataName("description", description);
  }
  return descriptionMetadata;
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

final List<YLanguage> hasBeenList = new ArrayList<YLanguage>();
final List<LocalizedData<PublicationNameData>> names = new ArrayList<LocalizedData<PublicationNameData>>();
final YLanguage yDefaultLanguage = YModelUtils.getDefaultLanguage(yElement);
  YName yName = yElement.getDefaultName();
  if (yName != null) {
    CharSequence name = new FilteredString(YModelUtils.yRichTextToString(yName.getRichText()));
    final PublicationNameData titleList = new PublicationNameData(name);
    names.add(new LocalizedData<PublicationNameData>(makeLanguageData(yName.getLanguage(), locale), titleList));

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

@Override
public LicensingData prepareLicensingData(final ElementMetadata elementMetadata) {
  YElement yElement = (YElement) elementMetadata.getContent();
  LicensingData license = YModelUtils.prepareLicensingData(yElement, licenseDictionaryService);
  return license;
}

代码示例来源:origin: pl.edu.icm.synat/synat-portal-core

private FilteredString buildFilteredString(YRichText sourceText) {
  String source = YModelUtils.yRichTextToString(sourceText).trim();
  if (!isHtmlText(sourceText)) {
    source = StringEscapeUtils.unescapeHtml4(source);
  }
  return new FilteredString(source.trim());
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
  String partNumber = element.getStructures().get(0).getCurrent().getPosition();
  if(StringUtils.isNotBlank(partNumber)){
    String id = ancestors.get(ancestors.size() - 1).getId() + "-p-" + partNumber;
    id = WileyUtils.processId(id);
    element.setId(id);
  }
  if (element.getNames().size() == 1) {
    YName name = YModelUtils.fetchDefaultName(element);
    if(StringUtils.equals(NameTypes.NM_ALTERNATIVE, name.getType()) && StringUtils.isNotBlank(partNumber)){
      name.setText(BaseYModelUtils.buildRichText(name.getText() + StringUtils.SPACE + partNumber));
    }
    name.setType(NameTypes.NM_CANONICAL);
  }
}

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