本文整理了Java中pl.edu.icm.model.bwmeta.y.YElement.getRelations()
方法的一些代码示例,展示了YElement.getRelations()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YElement.getRelations()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YElement
类名称:YElement
方法名:getRelations
暂无
代码示例来源:origin: pl.edu.icm.yadda/yadda-polindex
public static List<YRelation> references(final YElement element) {
return element.getRelations(RelationTypes.RL_REFERENCE_TO);
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private boolean shouldTitlesBeAdded(HarvestingResult harvestingResult, YElement element) {
if (!properties.contains(Property.HARVEST_TITLE_HISTORY)) {
return false;
}
return element.getRelations(RT_PREVIOUS_TITLES).isEmpty() && element.getRelations(RT_NEXT_TITLES).isEmpty();
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private static void replaceReferencesField(final YElement yElement, final String[] values) {
final List<YRelation> relations = yElement.getRelations();
final List<YRelation> referenceRelations = yElement.getRelations(YConstants.RL_REFERENCE_TO);
relations.removeAll(referenceRelations); // clean existing
for (final String value : values) {
final YRelation rel = new YRelation();
rel.setType(YConstants.RL_REFERENCE_TO);
rel.addAttribute(YConstants.AT_REFERENCE_TEXT, value);
relations.add(rel);
}
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private List<YRelation> removeReferencesToFromRelations() {
List<YRelation> yRelations = new ArrayList<>();
for (YRelation yRelation : safe(article.getRelations())) {
if (!yRelation.getType().equals(YConstants.RL_REFERENCE_TO)) {
yRelations.add(yRelation);
}
}
return yRelations;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
@Override
public ElementMetadata postProcess(ElementMetadata metadata) {
YElement element = (YElement) metadata.getContent();
for(Iterator<YRelation> relationsIt = element.getRelations().iterator();relationsIt.hasNext();){
YRelation relation = relationsIt.next();
if(RelationTypes.RL_REFERENCE_TO.equals(relation.getType())){
relationsIt.remove();
}
}
return metadata;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
private static YElement correctRelations(YElement yelement) {
LinkedList<YRelation> yrl = new LinkedList<YRelation>();
for(YRelation yr : yelement.getRelations()) yrl.add(transformRelation(yr));
yelement.setRelations(yrl);
return yelement;
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
private static YElement correctRelations(YElement yelement) {
LinkedList<YRelation> yrl = new LinkedList<YRelation>();
for(YRelation yr : yelement.getRelations()) yrl.add(transformRelation(yr));
yelement.setRelations(yrl);
return yelement;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
private void fillConference(HtmlMetaHeaders headers, YElement yElement) {
List<YRelation> relationList = yElement.getRelations(RelationTypes.RL_PROCEEDINGS_OF);
for (YRelation rel : relationList) {
String confName = getConfName(rel);
if (StringUtils.isNotBlank(confName)) {
headers.addMetadataName(WP_CONFERENCE, confName);
return;
}
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private boolean addTitleHistory(TitleHistory titleHistory, YElement element) {
if (titleHistory == null) {
return false;
}
addTitleList(element, titleHistory.getPreviousTitles(), RT_PREVIOUS_TITLES);
addTitleList(element, titleHistory.getNextTitles(), RT_NEXT_TITLES);
return !(element.getRelations(RT_PREVIOUS_TITLES).isEmpty() && element.getRelations(RT_NEXT_TITLES).isEmpty());
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
protected void fillRelations(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
// relation element
for (YRelation yRelation : yElement.getRelations()) {
if (yRelation.getTarget() != null) {
if (!ret.containsKey(E_RELATION)) {
ret.put(E_RELATION, new ArrayList<StringWithAttributes>());
}
ret.get(E_RELATION).add(new StringWithAttributes(yRelation.getTarget().getValue()));
}
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
protected void fillRelations(HtmlMetaHeaders metadata, YElement yElement) {
for (YRelation yRelation : yElement.getRelations()) {
if (yRelation.getTarget() != null) {
metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_RELATION, yRelation.getTarget().getValue());
}
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
protected void enhanceRelationsInYElement(YElement ye, ZblBwMetaPathsGenerator zblPathGenerator) throws Exception {
// sprawdź czy referencje głównego dokumentu mają id Zblattowe
for (YRelation yr : ye.getRelations()) {
if ("reference-to".equals(yr.getType()) || "related-to".equals(yr.getType())) {
String extZblId = yr.getOneAttributeSimpleValue("reference-parsed-id-zbl");
if (extZblId != null) {
String zblId = mapExtZblToZbl(extZblId, zblPathGenerator.getExtZblToZblMappingFilePath());
if (zblId != null) {
List<YElement> zblyel = loadZblYElements(zblId, zblPathGenerator);
if (zblyel.size() != 0)
enhanceRelationElement(yr, zblyel);
}
}
}
}
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookSeriesElement(SeriesMetadata seriesMetadata, YElement conferenceEventElement, CrossrefIdGenerator generator) {
YElement element = new YElement();
extractSeriesMetadata(null, generator, element, seriesMetadata);
YRelation proceedingsRelation = new YRelation(RelationTypes.RL_PROCEEDINGS_OF, new YId(StringUtils.EMPTY, conferenceEventElement.getId()));
element.getRelations().add(proceedingsRelation);
return element;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
@Override
public String render(Model model, ElementMetadata metadata, HttpServletRequest request, Locale locale) {
super.render(model, metadata, request, locale);
YElement yElement = (YElement) metadata.getContent();
final List<YRelation> relations = yElement.getRelations(RelationTypes.RL_REFERENCE_TO);
PagingParams pagingParams = buildPagingParams(request, relations);
model.addAttribute(COMP_REFERENCES_FULL,
relatedDisplayUtils.prepareReferences(relations.subList(pagingParams.getFirst(), pagingParams.getLast()), ElementType.ARTICLE));
storePagingParams(pagingParams, model);
new ContentHandlerUtils(resourceDisplayUtils, relatedDisplayUtils).exposeContentDetails(yElement, model);
return ResourceDetailViewConstants.TAB_BOOK_REFERENCES;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
@Override
public String render(Model model, ElementMetadata metadata, HttpServletRequest request, Locale locale) {
super.render(model, metadata, request, locale);
YElement yElement = (YElement) metadata.getContent();
final List<YRelation> relations = yElement.getRelations(RelationTypes.RL_REFERENCE_TO);
PagingParams pagingParams = buildPagingParams(request, relations);
model.addAttribute(COMP_REFERENCES_FULL, relatedDisplayUtils.prepareReferences(relations.subList(pagingParams.getFirst(), pagingParams.getLast()), ElementType.ARTICLE));
storePagingParams(pagingParams, model);
new ContentHandlerUtils(resourceDisplayUtils, relatedDisplayUtils).exposeContentDetails(yElement, model);
return ResourceDetailViewConstants.TAB_COMMON_REFERENCES;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
private static YElement putRelationReferenceToLeafsIntoNodes(YElement yelement) {
for(YRelation yr : yelement.getRelations()){
// LinkedList<YAttribute> lya = new LinkedList<YAttribute>();
for(YAttribute ya : yr.getAttributes()){
if(! ll.contains(ya.getKey()))continue;
removeGivenTag("sc", ya.getRichValue().toParts());
ya.setValue(new YRichText(extractLeafs(removeNodeWithGivenTag("ext-link", ya.getRichValue().toParts()))));
// lya.add(ya);
}
// if(lya.size()>0)yr.setAttributes(lya);
}
return yelement;
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
private static YElement putRelationReferenceToLeafsIntoNodes(YElement yelement) {
for(YRelation yr : yelement.getRelations()){
for(YAttribute ya : yr.getAttributes()){
if(! ll.contains(ya.getKey()))continue;
removeGivenTag("sc", ya.getRichValue().toParts());
ya.setValue(new YRichText(extractLeafs(removeNodeWithGivenTag("ext-link", ya.getRichValue().toParts()))));
}
}
return yelement;
}
代码示例来源: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 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;
}
内容来源于网络,如有侵权,请联系作者删除!