本文整理了Java中pl.edu.icm.model.bwmeta.y.YCurrent.setLevel()
方法的一些代码示例,展示了YCurrent.setLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YCurrent.setLevel()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YCurrent
类名称:YCurrent
方法名:setLevel
暂无
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
protected YCurrent getCurrent(PublicationMeta meta, YElement directAncestor) {
YCurrent current = new YCurrent();
switch (meta.getLevel().toLowerCase()) {
case WileyComponentConstants.PMETA_SERIES:
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_BOOK_SERIES);
break;
case WileyComponentConstants.PMETA_PRODUCT:
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK);
break;
case WileyComponentConstants.PMETA_PART:
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_BOOK_PART);
break;
case WileyComponentConstants.PMETA_UNIT:
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_BOOK_CHAPTER);
break;
default:
throw new ConfigurationException("Unknown level: " + meta.getLevel());
}
return current;
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
protected YCurrent getCurrent(PublicationMeta meta, YElement directAncestor) {
YCurrent current = new YCurrent();
switch (meta.getLevel().toLowerCase()) {
case WileyComponentConstants.PMETA_SERIES:
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_SERIES);
break;
case WileyComponentConstants.PMETA_PRODUCT:
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
break;
case WileyComponentConstants.PMETA_PART:
String lastLevel = getLevel(directAncestor);
current.setLevel(getNextPartLevel(meta, lastLevel));
break;
case WileyComponentConstants.PMETA_UNIT:
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ARTICLE);
break;
default:
throw new ConfigurationException("Unknown level: " + meta.getLevel());
}
return current;
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services
private void fixYearInYear(DocumentRepository repository,
Document document, YElement element) {
String fixedCurrentLevel = HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME;
String newTagValue = HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL + "=" + fixedCurrentLevel;
document.addTagByKey("hierarchyLevel", newTagValue);
YStructure structure = element.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
YCurrent current = structure.getCurrent();
if (!HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR.equals(current.getLevel())) {
System.out.println("current level is = "+current.getLevel()+" expected year. Won't fix");
} else {
current.setLevel(fixedCurrentLevel);
saveDocumentWithElement(repository, document, element);
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services
private boolean changeElementLevel(DocumentRepository repository, String identity) {
NativeDocument fetchDocument = repository.fetchDocument(identity);
Document document = (Document) fetchDocument;
YElement element = (YElement) document.getMetadata();
String fixedCurrentLevel = HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE;
String newTagValue = HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL + "=" + fixedCurrentLevel;
document.addTagByKey("hierarchyLevel", newTagValue);
YStructure structure = element.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
YCurrent current = structure.getCurrent();
if (!HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME.equals(current.getLevel())) {
System.out.println("current level is = "+current.getLevel()+" expected year. Won't fix");
return false;
} else {
current.setLevel(fixedCurrentLevel);
document.setMetadata(element);
repository.storeDocument(document, EventConstants.EVENT_TAG_NO_EVENT);
return true;
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-yadda
Collections.singletonList(id));
yElement.addContent(viedoContnentUrl);
YCurrent currentLevel = new YCurrent().setLevel(VideoConstants.VIDEO_CURRENT_LEVEL);
yElement.addStructure(new YStructure().setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_PUBLICATION).setCurrent(currentLevel));
NativeDocument nativeDocument = documentFactory.createDocument(recordId.getUid());
代码示例来源:origin: pl.edu.icm.synat/synat-importer-speech-to-text
private void prepareYElementFromApi(Video video, YElement yElement) throws ParseException {
yElement.addName(new YName(video.getSnippet().getTitle()));
yElement.addDescription(new YDescription(YLanguage.Undetermined, video.getSnippet().getDescription()
, DescriptionTypes.DS_SUMMARY));
prepareDate(video, yElement);
String license = video.getStatus().getLicense();
if(null != license && license.contains("creativeCommon")) {
yElement.addTagList(new YTagList().setType(YModelUtils.LICENSE).addValue("cc0"));
}
prepareContent(video, yElement);
List<String> tags = video.getSnippet().getTags();
if (CollectionUtils.isNotEmpty(tags)) {
yElement.addTagList(new YTagList().setType(TagTypes.TG_KEYWORD).setValues(tags));
}
YCurrent currentLevel = new YCurrent().setLevel(VideoConstants.VIDEO_CURRENT_LEVEL);
yElement.addStructure(new YStructure()
.setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_PUBLICATION)
.setCurrent(currentLevel));
prepareAttributes(video, yElement);
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
structure.setCurrent(current);
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
structure.setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
YCurrent current = new YCurrent();
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_YEAR);
structure.setCurrent(current);
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME);
structure.setCurrent(current);
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
structure.setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
YCurrent current = new YCurrent();
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE);
structure.setCurrent(current);
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
structure.setHierarchy(HierarchyWithLevelIds.EXT_HIERARCHY_JOURNAL);
YCurrent current = new YCurrent();
current.setLevel(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ARTICLE);
内容来源于网络,如有侵权,请联系作者删除!