本文整理了Java中pl.edu.icm.model.bwmeta.y.YElement.setId()
方法的一些代码示例,展示了YElement.setId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YElement.setId()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YElement
类名称:YElement
方法名:setId
暂无
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
public ArticleBuilder setId(String id) {
article.setId(id);
return this;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
@Override
protected void writeDocument(List<BibEntry> document, Writer output) throws Exception {
List<YExportable> yDocument = new ArrayList<YExportable>(document.size());
int id = 0;
for (BibEntry entry : document) {
YElement element = (YElement) bibEntryToY.convert(entry);
element.setId(Integer.toString(++id));
yDocument.add(element);
}
yWriter.write(output, yDocument);
}
private YToBibEntryTransformer yToBibEntry = new YToBibEntryTransformer();
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
/**
* If yelement has EXT_SCHEME_ZBL than its id is updated.
*/
public void updateYElementIdBasingOnZblId(YElement yelement, String prefix) {
String zblId = yelement.getId(YConstants.EXT_SCHEME_ZBL);
if (zblId != null && zblId.length() > 0) {
yelement.setId(generateUidOfZblId(yelement, prefix));
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
@Override
public YElement extractMetadata(BxDocument document) throws AnalysisException {
Set<EnhancedField> enhancedFields = EnumSet.noneOf(EnhancedField.class);
BxModelUtils.sortZonesRecursively(document);
YElement metadata = new YElement().setId("elementId");
for (Enhancer enhancer : enhancers) {
enhancer.enhanceMetadata(document, metadata, enhancedFields);
}
return metadata;
}
代码示例来源: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);
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
Numbering volumeNumbering = WileyUtils.getNumbering(pm.getNumberingGroup(), WileyComponentConstants.NUMBERING_VOLUME);
String volNum = volumeNumbering.getNumber();
String volume = volumeNumbering.getvalue();
volNum = StringUtils.isNotBlank(volNum) ? volNum : volume;
String id = ancestors.get(ancestors.size() - 1).getId() + "-v-" + volNum;
id = WileyUtils.processId(id);
element.setId(id);
YName nam = new YName(volume);
nam.setSortKey(volNum);
element.addName(nam);
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
protected void extractSeriesMetadata(YElement parent, CrossrefIdGenerator generator, YElement element, SeriesMetadata seriesMetadata) {
List<YName> seriesNames = convertTitles(seriesMetadata.getTitles());
List<YId> seriesIds = new ArrayList<>();
seriesIds.addAll(convertIssns(seriesMetadata.getIssns()));
if (StringUtils.isNotBlank(seriesMetadata.getCoden())) {
seriesIds.add(new YId(IdSchemaIds.EXT_SCHEME_CODEN, seriesMetadata.getCoden()));
}
element.getIds().addAll(seriesIds);
element.getNames().addAll(seriesNames);
String id = generator.generateBookSeriesId(element.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISSN), getDefaultName(element));
element.setId(id);
element.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_SERIES));
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-yadda
private YElement prepareYElement(String id, Properties prop) {
YElement yElement = new YElement();
yElement.setId(id);
if (!prop.getProperty("title").isEmpty()) {
yElement.addName(new YName(prepareProperty("title", prop)));
}
yElement.addDescription(new YDescription(YLanguage.Undetermined, prepareProperty("description", prop), DescriptionTypes.DS_SUMMARY));
if (!prop.getProperty("key-words").isEmpty()) {
List<String> tags = new ArrayList<String>(Arrays.asList(prepareProperty("key-words", prop).split(",")));
yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags));
}
if (!prop.getProperty("supplier").isEmpty()) {
yElement.addAttribute("copyright-holder", prepareProperty("supplier", prop));
}
if (!prop.getProperty("duration").isEmpty()) {
yElement.addAttribute("duration", prepareProperty("duration", prop));
}
yElement.addLanguage(YLanguage.Undetermined);
return yElement;
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
Numbering issueNumbering = WileyUtils.getNumbering(pm.getNumberingGroup(), WileyComponentConstants.NUMBERING_ISSUE, WileyComponentConstants.NUMBERING_SUPPLEMENT);
String issueNumber = issueNumbering.getvalue();
String id = ancestors.get(ancestors.size() - 1).getId() + "-i-" + issueNumber;
id = WileyUtils.processId(id);
element.setId(id);
YName nam = new YName(issueNumber);
element.addName(nam);
if (pm.getCoverDate() != null) {
String coverDate = StringUtils.trim(pm.getCoverDate().getStartDate());
YDate date = WileyUtils.parseDate(coverDate, DateTypes.DT_COVER);
if (date != null) {
element.addDate(date);
}
}
element.getIds().addAll(doiParser.parseIds(pm));
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
/**
* Creates yElement object and sets two things: UID &
* ZentralBlattIdentifier.
*
* @param src
* @return
* @throws TransformationException
*/
private YElement initArticle(ZentralBlattRecord src) {
YElement yelement = new YElement();
if (src.hasField(ZentralBlattRecord.ID_FIELD_NAME)) {
YId zblId = new YId(YConstants.EXT_SCHEME_ZBL, extractZBLId(src));
yelement.addId(zblId);
}
yelement.setId(generateUidOfZblId(yelement, ""));
return yelement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
@Override
public YElement process(Book book, YElement parent, CrossrefIdGenerator generator) {
BookSetMetadata bookSetMetadata = book.getBookSetMetadata();
YElement element = new YElement();
SetMetadata setMetadata = bookSetMetadata.getSetMetadata();
List<YName> setNames = convertTitles(setMetadata.getTitles());
element.getIds().addAll(convertIsbns(setMetadata.getIsbns()));
element.getNames().addAll(setNames);
String id = generator.generateBookSetId(element.getFirstIdOrNullIfAny(IdSchemaIds.EXT_SCHEME_ISBN), getDefaultName(element));
element.setId(id);
element.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_SERIES));
if (StringUtils.isNotBlank(bookSetMetadata.getLanguage())) {
element.addLanguage(YLanguage.byCode(bookSetMetadata.getLanguage()));
}
return element;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildVolumeElementFromSeries(ProceedingsSeriesMetadata proceedingsSeriesMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookVolumeElement = new YElement();
bookVolumeElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_VOLUME));
bookVolumeElement.addName(new YName(proceedingsSeriesMetadata.getVolume()));
String id = generator.generateBookVolumeId(parent.getId(), proceedingsSeriesMetadata.getVolume());
bookVolumeElement.setId(id);
return bookVolumeElement;
}
代码示例来源: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;
}
代码示例来源: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;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildVolumeElement(JournalIssue journalIssue, YElement parentElement, CrossrefIdGenerator generator) {
if (journalIssue == null || journalIssue.getJournalVolume() == null || journalIssue.getJournalVolume().getVolume() == null) {
return null;
}
String volume = journalIssue.getJournalVolume().getVolume();
YElement volumeElement = new YElement();
YStructure structure = buildStructureFromParent(parentElement, HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME);
volumeElement.addStructure(structure);
volumeElement.addName(new YName(volume));
if (StringUtils.isBlank(journalIssue.getIssue())) {
volumeElement.getContributors().addAll(convert(journalIssue.getContributors(), volumeElement));
volumeElement.getDates().addAll(convertDates(journalIssue.getPublicationDates()));
}
String journalId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
String yearId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR);
String volumeId = generator.generateJournalVolumeId(yearId, journalId, volume);
volumeElement.setId(volumeId);
return volumeElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
private YElement buildBookElementFromSeries(ProceedingsSeriesMetadata proceedingsSeriesMetadata, YElement parent, CrossrefIdGenerator generator) {
YElement bookElement = new YElement();
bookElement.addStructure(buildStructureFromParent(parent, HierarchyWithLevelIds.EXT_HIERARCHY_BOOK, HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK));
bookElement.getNames().add(new YName(proceedingsSeriesMetadata.getProceedingsTitle()));
bookElement.getDates().addAll(convertDates(proceedingsSeriesMetadata.getPublicationDates()));
bookElement.getIds().addAll(convertIsbns(proceedingsSeriesMetadata.getIsbns()));
if (StringUtils.isNotBlank(proceedingsSeriesMetadata.getProceedingsSubject())) {
YName subject = new YName(proceedingsSeriesMetadata.getProceedingsSubject());
subject.setType(NameTypes.NM_SUBTITLE);
bookElement.addName(subject);
}
if (proceedingsSeriesMetadata.getDoiData() != null) {
bookElement.getIds().add(new YId(IdSchemaIds.EXT_SCHEME_DOI, proceedingsSeriesMetadata.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 buildIssueElement(JournalIssue journalIssue, YElement parentElement, CrossrefIdGenerator generator) {
if (journalIssue == null) {
return null;
}
String issue = journalIssue.getIssue();
if (issue == null) {
return null;
}
YElement issueElement = new YElement();
YStructure structure = buildStructureFromParent(parentElement, HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE);
issueElement.addStructure(structure);
issueElement.getContributors().addAll(convert(journalIssue.getContributors(), issueElement));
issueElement.getDates().addAll(convertDates(journalIssue.getPublicationDates()));
issueElement.addName(new YName(issue));
String journalId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
String yearId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR);
String volumeId = getAncestorId(structure, HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME);
String issueId = generator.generateJournalIssueId(volumeId, yearId, journalId, issue);
issueElement.setId(issueId);
return issueElement;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
@Override
public YElement process(Book book, YElement parent, CrossrefIdGenerator generator) {
BookSeriesMetadata bookSeriesMetadata = book.getBookSeriesMetadata();
String id = generator.generateBookVolumeId(parent.getId(), bookSeriesMetadata.getVolume());
YElement element = new YElement();
element.setId(id);
element.addName(new YName(bookSeriesMetadata.getVolume()));
YStructure structure = new YStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK);
YCurrent current = new YCurrent(HierarchyWithLevelIds.EXT_LEVEL_BOOK_VOLUME);
structure.setCurrent(current);
structure.getAncestors().addAll(parent.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK).getAncestors());
element.addStructure(structure);
return element;
}
内容来源于网络,如有侵权,请联系作者删除!