gpt4 book ai didi

pl.edu.icm.synat.logic.model.utils.YModelUtils.getDefaultContributor()方法的使用及代码示例

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

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

YModelUtils.getDefaultContributor介绍

[英]Utility function retrieving name of YContributor
[中]检索YContributor名称的实用函数

代码示例

代码示例来源: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 fillContributors(HtmlMetaHeaders metadata, YElement yElement) {
  for (YContributor yContributor : yElement.getContributors()) {
    if (yContributor.getRole().equals(ContributorRoles.CR_AUTHOR)) {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_CREATOR, YModelUtils.getDefaultContributor(yContributor));
    } else if (yContributor.getRole().equals(ContributorRoles.CR_PUBLISHER)) {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_PUBLISHER, YModelUtils.getDefaultContributor(yContributor));
    } else if (yContributor.getRole().equals(ContributorRoles.CR_OTHER)) {
      metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_CONTRIBUTOR, YModelUtils.getDefaultContributor(yContributor));
    }
  }
}

代码示例来源: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-portal-core

private String redirectToContributorSearchResult(String id, Model model, HttpServletRequest request, Locale locale) {
  YElement element = fetchYElementByContributionId(id);
  String searchParams = fetchSearchParams(element, id);
  model.addAttribute(TabConstants.TAB_TYPE, TabConstants.PERSON_PUBLICATIONS);
  searchHandlerResolver.buildModel(SearchViewConfiguration.AUTHOR_RESOURCE, searchParams, model, request, locale);
  model.addAttribute(UriParamConst.PARAM_RESOURCE_ID, id);
  model.addAttribute("searchParamValue", searchParams);
  model.addAttribute("searchURL", "/contributor/" + id + "/tab/publications");
  model.addAttribute(MAIN_TITLE, YModelUtils.getDefaultContributor(fetchContributor(element, id)));
  model.addAttribute(COMP_THUMBNAIL, thumbnailService.resolveThumbnailUrl(new PersonData()));
  return ViewConstants.CONTRIBUTOR_PUBLICATIONS_PAGE;
}

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

@RequestMapping(value=ViewConstants.MAIL_SHARING_PAGE + "/contribution", method=RequestMethod.POST)
public void sendContributionShareMailHandler(@RequestParam(PARAM_EMAIL) String mail,
    @RequestParam(UriParamConst.PARAM_RESOURCE_ID) String contributionId, HttpServletResponse response)
        throws IOException {
  String documentId = PersonDataYModelTransformer.decodeID(contributionId)[1];
  YElement element = (YElement) repositoryFacade.fetchElementMetadata(documentId).getContent();
  PersonData personData = new PersonData(contributionId, YModelUtils.getDefaultContributor(StorePersonDirectoryService.getContributor(element, contributionId)));
  sendShareMailBase(response, mail, personData, new ArrayList<PersonData>(), ElementType.CONTRIBUTOR);
}

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

@RequestMapping(value = "/request/{resourceId:.+}/{authorNo:\\d+}")
@ResponseBody
public Authorship requestAuthorship(@PathVariable String resourceId, @PathVariable Integer authorNo, @RequestParam(required = false) String note) {
  ElementMetadata metadata = repositoryFacade.fetchElementMetadata(resourceId);
  YContributor contributor = BwmetaContributorUtils.getContributorById(authorNo, (YElement) metadata.getContent());
  String name = YModelUtils.getDefaultContributor(contributor);
  Authorship authorship = authorshipService.requestAuthorship(userBusinessService.getCurrentUserId(), resourceId, authorNo, name, contributor.getRole(), note).getResult();
  repositoryFacade.deregisterElementData(resourceId);
  return authorship;
}

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

String contributorName = YModelUtils.getDefaultContributor(contributor);
StringBuilder affiliationList = new StringBuilder();
for (String affId : contributor.getAffiliationRefs()) {

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

protected void fillAuthors(HtmlMetaHeaders metadata, YElement yElement) {
  Map<String, FilteredString> affiliationMap = PersonDataYModelTransformer.processAffiliations(yElement);
  for (YContributor yContributor : yElement.getContributors()) {
    if (yContributor.getRole().equals(ContributorRoles.CR_AUTHOR)) {
      metadata.addMetadataName(WP_AUTHOR, YModelUtils.getDefaultContributor(yContributor));
      List<String> affiliationRefs = yContributor.getAffiliationRefs();
      for (String affId : affiliationRefs) {
        FilteredString affiliation = affiliationMap.get(affId);
        if (affiliation != null && StringUtils.isNotBlank(affiliation.getRawData())) {
          metadata.addMetadataName(WP_AUTHOR_AFFILIATION, affiliation.getRawData());
        }
      }
    }
  }
}

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

YElement element = (YElement) metadata.getContent();
YContributor contributor = BwmetaContributorUtils.getContributorById(authorNo, element);
String name = YModelUtils.getDefaultContributor(contributor);
String currentUserId = userBusinessService.getCurrentUserId();
String requestedUserId;

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

private Document generateDocument(Authorship authorship, Map<String, String> userNames) {
  List<Contribution> contributions = new ArrayList<Contribution>();
  ElementMetadata metadata = repositoryFacade.fetchElementMetadata(authorship.getDocumentId());
  YElement element = (YElement) metadata.getContent();
  for (YContributor contributor : element.getContributors()) {
    Contribution contribution = new Contribution();
    contribution.setContributorId(BwmetaContributorUtils.getContributorId(contributor));
    String name = YModelUtils.getDefaultContributor(contributor);
    if (StringUtils.isBlank(name)) {
      continue;
    }
    contribution.setName(name);
    String contributorIdentity = BwmetaContributorUtils.getContributorIdentity(contributor);
    addUsername(userNames, contributorIdentity);
    contribution.setUserId(contributorIdentity);
    contributions.add(contribution);
  }
  Document document = new Document();
  document.setContributions(contributions);
  document.setName(YModelUtils.getDefaultName(element));
  return document;
}

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

return item;
String contributorName = YModelUtils.getDefaultContributor(contributor);
String contributorRole = contributor.getRole();
final String message = getDescriptionMessage(authorship, contributorRole);

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