本文整理了Java中pl.edu.icm.model.bwmeta.y.YElement.getContributors()
方法的一些代码示例,展示了YElement.getContributors()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YElement.getContributors()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YElement
类名称:YElement
方法名:getContributors
暂无
代码示例来源:origin: pl.edu.icm.yadda/yadda-polindex
private List<YContributor> authors(YElement element) {
List<YContributor> result = Lists.newArrayList();
for (YContributor contributor : element.getContributors()) {
if (contributor.isInstitution()) {
continue;
}
// TODO - brać tylko autorów i współautorów???
result.add(contributor);
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private Collection<ContributorInfo> contribInfos(YElement yElem) {
final List<ContributorInfo> result = new ArrayList<>();
CollectionUtils.forAllDo(yElem.getContributors(), new Closure() {
@Override
public void execute(Object input) {
YContributor contrib = (YContributor) input;
if (ArrayUtils.contains(ALLOWED_ROLES, contrib.getRole())) {
result.add(contributorInfoBuilder.prepareContributorInfo(contrib));
}
}
});
return result;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
public Map<String, Integer> fetchContributorsRoles(YElement yElement) {
Map<String, Integer> result = new LinkedHashMap<>();
for (String role : Arrays.asList(ContributorRoles.CR_AUTHOR,ContributorRoles.CR_EDITOR,ContributorRoles.CR_REVIEWER)) {
List<YContributor> contributors = yElement.getContributors();
final int count = CollectionUtils.countMatches(contributors, new RolePredicate(role));
if(count>0) {
result.put(role, count);
}
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
@Override
public String constructFieldValue(List<YElement> yelements) {
List<YElement> articles = YElementsParsingToolbox
.filterYElementsOfStructureLevel(yelements,
YConstants.EXT_LEVEL_JOURNAL_ARTICLE);
if (articles.size() == 0) {
return null;
}
if (articles.size() > 1) {
log.error("More than one article found in package of yelements!");
}
YElement article = articles.get(0);
return selectContributors(article.getContributors());
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
@Override
public String constructFieldValue(List<YElement> yelements) {
List<YElement> articles = YElementsParsingToolbox.filterYElementsOfStructureLevel(yelements,
YConstants.EXT_LEVEL_JOURNAL_ARTICLE);
if (articles.size() == 0) {
return null;
}
if (articles.size() > 1) {
log.error("More than one article found in package of yelements!");
}
YElement article = articles.get(0);
StringBuilder au = new StringBuilder();
List<YContributor> zblContribs = article.getContributors();
for (YContributor c : zblContribs) {
appendContributor(c, au);
}
return au.toString();
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
public void parseMetadata(YElement element, ContentMeta cm, YLanguage defaultLanguage) {
element.getContributors().addAll(WileyUtils.parseContributors(cm.getCreators()));
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defauLanguage, List<YElement> ancestors) {
element.getContributors().addAll(WileyUtils.parseContributors(pm.getCreators()));
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
@Override
public Set<String> getCurrentUserRoles(YElement element) {
UserProfile userProfile = userBusinessService.getCurrentUserProfile();
if(userProfile == null){
return Sets.newHashSet();
}
Set<String> roles = new HashSet<>();
String userId = userProfile.getId();
for(YContributor contributor: element.getContributors()){
String identity = BwmetaContributorUtils.getContributorIdentity(contributor);
if(StringUtils.equals(identity, userId)){
roles.add(contributor.getRole());
}
}
return roles;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
public static YContributor getContributor(YElement element, final String requestPersonId) {
for(YContributor contributor:element.getContributors()){
String personId = BwmetaContributorUtils.buildContributorId(element.getId(), contributor);
if(personId.equals(requestPersonId)){
return contributor;
}
}
throw new NotFoundException(requestPersonId);
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
public static List<PersonData> resolveAllElementContributors(YElement element) {
List<PersonData> people = new ArrayList<PersonData>();
Map<String, FilteredString> affiliations = processAffiliations(element);
for (YContributor contributor : element.getContributors()) {
if (!ContributorRoles.CR_PUBLISHER.equals(contributor.getRole()) && contributor.getOneName() != null) {
people.add(parseContributor(contributor, element.getId(), affiliations));
}
}
return people;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
public static List<PersonData> resolveElementContributors(YElement element, String type) {
List<PersonData> people = new ArrayList<PersonData>();
Map<String, FilteredString> affiliations = processAffiliations(element);
for (YContributor contributor : element.getContributors()) {
if (type.equals(contributor.getRole()) && contributor.getOneName() != null) {
people.add(parseContributor(contributor, element.getId(), affiliations));
}
}
return people;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* accomplished
* @throws YaddaException
*/
private void parseContributors(){
//contributors
int contr = 0;
if(!in_item.getContributors().isEmpty()){
for(YContributor yc : in_item.getContributors()){
//Create Statements header for this contributor
paos_doc.add(new PredicateAndObject(RelConstants.RL_HAS_CONTRIBUTOR, RelConstants.NS_CONTRIBUTOR+in_item.getId().substring(0)+"/c"+contr));
Statements s = new Statements(); s.setSubject(RelConstants.NS_CONTRIBUTOR+ in_item.getId()+"/c"+contr); statements.add(s);
LinkedList<PredicateAndObject> pao = new LinkedList<PredicateAndObject>();
pao.add(new PredicateAndObject(RelConstants.RL_HAS_POSITION_IN_DOCUMENT,contr+""));
//Create Statements body for this contributor
ContributorProceeder.proceed(yc,pao, in_item);
//Increment contribution counter, save data, go to next contribution
contr++;
s.setContinuations(pao);
}
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
private void updateStats(YElement yelement) {
List<String> mscRefs = extractMscRefs(yelement.getCategoryRefs());
List<String> fingerprints = extractAuthorsFingerprints(yelement.getContributors());
if (mscRefs.size() == 0 || fingerprints.size() == 0) {
return;
}
log.info("analyzing next yelement = [{}]", yelement);
//kazdemu autorowi dodajemy jedno wystapienie w danej klasie
//kazdej klasie dodajemy jedno wystapienie danego autora
for (String authorFingerprint: fingerprints) {
for (String mscRef: mscRefs) {
increment(authorsInClass, mscRef, authorFingerprint);
increment(classesOfAuthor, authorFingerprint, mscRef);
}
}
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private static void replaceAthorsCoauthorsField(final YElement yElement, final String[] values) {
for (final String value : values) {
if (value != null && value.length() > 0) {
final String rawValue = unhighlight(value);
for (final YContributor cont : yElement.getContributors()) {
final YName name = cont.getOneName();
if (name != null && (rawValue.equals(name.getText()))) {
final YName hlName = new YName(value);
hlName.setType(Y_TYPE_HIGHLIGHTED);
cont.getNames().add(hlName);
}
}
}
}
}
代码示例来源: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-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.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookFromBookSetMetadata(BookSetMetadata bookSetMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().addAll(convertTitles(bookSetMetadata.getTitles()));
bookElement.getContributors().addAll(convert(bookSetMetadata.getContributors(), bookElement));
bookElement.getDates().addAll(convertDates(bookSetMetadata.getPublicationDates()));
bookElement.getRelations().addAll(convertCitationList(bookSetMetadata.getCitationList()));
bookElement.getIds().addAll(convertIsbns(bookSetMetadata.getIsbns()));
if (bookSetMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, bookSetMetadata.getDoiData().getDoi()));
}
String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
getDefaultName(bookElement));
bookElement.setId(id);
return bookElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookFromBookSeriesMetadata(BookSeriesMetadata bookSeriesMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().addAll(convertTitles(bookSeriesMetadata.getTitles()));
bookElement.getContributors().addAll(convert(bookSeriesMetadata.getContributors(), bookElement));
bookElement.getDates().addAll(convertDates(bookSeriesMetadata.getPublicationDates()));
bookElement.getRelations().addAll(convertCitationList(bookSeriesMetadata.getCitationList()));
bookElement.getIds().addAll(convertIsbns(bookSeriesMetadata.getIsbns()));
if (bookSeriesMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, bookSeriesMetadata.getDoiData().getDoi()));
}
String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
getDefaultName(bookElement));
bookElement.setId(id);
return bookElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookFromBookMetadata(BookMetadata bookMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().addAll(convertTitles(bookMetadata.getTitles()));
bookElement.getContributors().addAll(convert(bookMetadata.getContributors(), bookElement));
bookElement.getDates().addAll(convertDates(bookMetadata.getPublicationDates()));
bookElement.getRelations().addAll(convertCitationList(bookMetadata.getCitationList()));
bookElement.getIds().addAll(convertIsbns(bookMetadata.getIsbns()));
if (bookMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, bookMetadata.getDoiData().getDoi()));
}
String id = generator.generateBookId(bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), bookElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_EISBN),
getDefaultName(bookElement));
bookElement.setId(id);
return bookElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildChapterElementFromPaper(ConferencePaper conferencePaper, YElement parent, CrossrefIdGenerator generator) {
YElement chapterElement = new YElement();
YStructure structure = buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_CHAPTER);
chapterElement.addStructure(structure);
chapterElement.getNames().addAll(convertTitles(conferencePaper.getTitles()));
chapterElement.getContributors().addAll(convert(conferencePaper.getContributors(), chapterElement));
chapterElement.getDates().addAll(convertDates(conferencePaper.getPublicationDates()));
chapterElement.getRelations().addAll(convertCitationList(conferencePaper.getCitationList()));
if (conferencePaper.getDoiData() != null) {
chapterElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, conferencePaper.getDoiData().getDoi()));
}
updatePages(conferencePaper.getPages(), structure.getCurrent());
String id = generator.generateBookPartId(parent.getId(), "chapter", chapterElement.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_DOI),
getDefaultName(chapterElement));
chapterElement.setId(id);
return chapterElement;
}
内容来源于网络,如有侵权,请联系作者删除!