本文整理了Java中pl.edu.icm.model.bwmeta.y.YInstitution
类的一些代码示例,展示了YInstitution
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YInstitution
类的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YInstitution
类名称:YInstitution
暂无
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
protected List<Statements> processInstitution(YInstitution item) {
List<Statements> retL = new LinkedList<Statements>();
if(!item.getNames().isEmpty()){
Statements s = new Statements();
s.setSubject(RelConstants.NS_INSTITUTION+item.getId());
LinkedList<PredicateAndObject> pao = new LinkedList<PredicateAndObject>();
for(YName name : item.getNames()){
pao.add(new PredicateAndObject(RelConstants.RL_NAME,name.getText()));
}
s.setContinuations(pao);
retL.add(s);
}else;
return retL;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private List<String> getAddresses(YInstitution inst, IFilteringContext fc) {
List<String> result = new ArrayList<String>();
for (YAttribute attr : inst.getAttributes(YConstants.AT_CONTACT_LOCATION)) {
result.add(detailsFilter.filter(attr.getValue(), InputType.RICH_TEXT, fc));
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
@Override
protected Object buildElementViewPart(YExportable exp,
String[] elementTags, Map<String, Object> additionalParameters,
IFilteringContext filteringContext) {
YInstitution inst = (YInstitution) exp;
Map<String, Object> partModel = new HashMap<String, Object>();
partModel.put("extId", detailsFilter.filter(inst.getId(),
InputType.PLAIN_TEXT, filteringContext));
partModel.put("title", detailsFilter.filter(
YRTHelper.toXmlFragment(inst.getDefaultName().getRichText()),
InputType.RICH_TEXT, filteringContext));
partModel.put("titles", prepareTitles(inst.getNames(), inst.getDefaultName(), filteringContext));
partModel.put("addresses", getAddresses(inst, filteringContext));
partModel.put("contacts", CommonBuilderUtils.resolveContacts(inst, filteringContext, detailsFilter));
partModel.put("description", getDescription(inst, filteringContext, YConstants.DS_ABSTRACT));
partModel.put("fullAddress", getFullAddress(inst, filteringContext));
partModel.put("notes", getDescription(inst, filteringContext, YConstants.DS_NOTE));
if (pageTitleFactory!=null) {
String role = (String) additionalParameters.get(DetailsConstants.PARAM_ROLE);
String title = pageTitleFactory.getTitleForContributor(role, inst.getDefaultName().getText());
additionalParameters.put(DetailsConstants.VIEW_PARAM_PAGE_TITLE, title);
}
return partModel;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected IViewBuilder<CatalogInformationEnhancedObject<YExportable>> resolveInstitution(YInstitution e,
Map<String, Object> parameters) {
IViewBuilder<CatalogInformationEnhancedObject<YExportable>> result;
String role = (String) parameters.get(DetailsConstants.PARAM_ROLE);
result = institutionViewBuildersMap.get(role);
if (result == null) {
if (institutionViewBuilder == null) {
throw new SystemException(Modules.DETAILS, "View for institution"
+ e.getId() + " not found");
}
result = institutionViewBuilder;
}
return result;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
/**
* Processes <code>journal-meta</code> metadata creating a publisher
* element.
*
* @param jmeta
* the metadata element to extract publisher info from
* @return the created publisher element
*/
private YElement processPublisher(org.jdom.Element jmeta,List<YExportable> list, boolean addPublisher) {
YName pname = y.canonicalName(YLanguage.Undetermined,
JDOMHelper.getTextTrim(JDOMHelper.optDescendant(jmeta, "publisher", "publisher-name")));
// TODO: add publisher-localization
String id=getIdGenerator().getPublisherId(pname.getText());
YInstitution inst=new YInstitution();
String instId=IdPrefixes.EXT_PREFIX_INSTITUTION+idgen.generateIdSuffix((pname.getText().toLowerCase().replaceAll("\\s", " ").replaceAll(" +", " ").trim()));
inst.setId(instId);
inst.addName(pname);
if (addPublisher) {
list.add(inst);
}
return factory.element(EXT_LEVEL_JOURNAL_PUBLISHER, pname, ROOT ,id).addContributor(
new YContributor(CR_PUBLISHER, true).addName(pname).setIdentity(instId));
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
private Address getFullAddress(YInstitution inst, IFilteringContext fc) {
Address a = new Address();
a.setStreet(detailsFilter.filter(inst.getOneAttributeSimpleValue(
YConstants.AT_ADDRESS_STREET), InputType.PLAIN_TEXT, fc));
a.setState(detailsFilter.filter(inst.getOneAttributeSimpleValue(
YConstants.AT_ADDRESS_STATE), InputType.PLAIN_TEXT, fc));
a.setCity(detailsFilter.filter(inst.getOneAttributeSimpleValue(
YConstants.AT_ADDRESS_CITY), InputType.PLAIN_TEXT, fc));
a.setPostcode(detailsFilter.filter(inst.getOneAttributeSimpleValue(
YConstants.AT_ADDRESS_POSTCODE), InputType.PLAIN_TEXT, fc));
a.setPobox(detailsFilter.filter(inst.getOneAttributeSimpleValue(
YConstants.AT_ADDRESS_POBOX), InputType.PLAIN_TEXT, fc));
a.setCountry(detailsFilter.filter(inst.getOneAttributeSimpleValue(
YConstants.AT_ADDRESS_COUNTRY), InputType.PLAIN_TEXT, fc));
return a;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<LocalizedString> getDescription(YInstitution element,
IFilteringContext filteringContext, String type) {
List<LocalizedString> result = new ArrayList<LocalizedString>();
for (YDescription description : element.getDescriptions()) {
if (type.equals(description.getType())) {
result.add(new LocalizedString(languageDictionary.getShortDescription(
description.getLanguage().getShortCode()),
detailsFilter.filter(YRTHelper.toXmlFragment(description.getRichText()), InputType.RICH_TEXT,
filteringContext)));
}
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
final YInstitution institution = dataSourcefactory.getYCatalogDataSource().getInstitutionById(element.getContributorId());
if (institution != null) {
final YDescription oneDescription = institution.getOneDescription(YConstants.DS_ABSTRACT);
if (notEmpty(oneDescription)) {
result.put("description", oneDescription.getText());
final YDescription noteDescription = institution.getOneDescription(YConstants.DS_NOTE);
if(notEmpty(noteDescription)){
result.put(YConstants.DS_NOTE, noteDescription.getText());
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected void fetchPersonality(final YContributor contributor, final ViewContributor viewContributor,
final IFilteringContext filteringContext) {
if (!contributor.isInstitution() || contributor.getIdentity() == null || contributor.getIdentity().isEmpty()) {
return;
}
try {
final YInstitution inst = dataSourcesFactory.getYCatalogDataSource()
.getInstitutionById(contributor.getIdentity());
if (inst != null) {
final String addr = inst.getOneAttributeSimpleValue(YConstants.AT_CONTACT_LOCATION);
viewContributor.setPublisherId(contributor.getIdentity());
viewContributor.getAddresses().add(detailsFilter.filter(addr, InputType.RICH_TEXT, filteringContext));
viewContributor.getContacts()
.addAll(CommonBuilderUtils.resolveContacts(inst, filteringContext, detailsFilter));
}
} catch (final Exception e) {
throw new SystemException(Modules.DETAILS, "Error fetching intitution: " + contributor.getIdentity(), e);
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-content
protected List<Statements> processInstitution(YInstitution item) {
List<Statements> retL = new LinkedList<Statements>();
if(!item.getNames().isEmpty()){
Statements s = new Statements();
s.setSubject(RelConstants.NS_INSTITUTION+item.getId());
LinkedList<PredicateAndObject> pao = new LinkedList<PredicateAndObject>();
for(YName name : item.getNames()){
pao.add(new PredicateAndObject(RelConstants.RL_NAME,name.getText()));
}
s.setContinuations(pao);
retL.add(s);
}else;
return retL;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<String> resolveAddresses(final YInstitution personality) {
final List<String> addresses = new LinkedList<String>();
List<YAttribute> yadresses = personality.getAttributes(YConstants.AT_CONTACT_LOCATION);
if (yadresses != null && !yadresses.isEmpty()) {
// get address from contact location
for (final YAttribute address : yadresses) {
addresses.add(detailsFilter.filter(address.getValue(), InputType.PLAIN_TEXT));
}
} else {
// get address from address attributes
final List<String> addressKeys = new ArrayList<String>();
addressKeys.add(YConstants.AT_ADDRESS_STREET);
addressKeys.add(YConstants.AT_ADDRESS_POSTCODE);
addressKeys.add(YConstants.AT_ADDRESS_CITY);
addressKeys.add(YConstants.AT_ADDRESS_POBOX);
addressKeys.add(YConstants.AT_ADDRESS_STATE);
addressKeys.add(YConstants.AT_ADDRESS_COUNTRY);
for (final String addressKey : addressKeys) {
yadresses = personality.getAttributes(addressKey);
if (yadresses != null) {
for (final YAttribute address : yadresses) {
addresses.add(detailsFilter.filter(address.getValue(), InputType.PLAIN_TEXT));
}
}
}
}
return addresses;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
protected List<Statements> processInstitution(YInstitution item) {
List<Statements> retL = new LinkedList<Statements>();
if(!item.getNames().isEmpty()){
Statements s = new Statements();
s.setSubject(RelConstants.NS_INSTITUTION+item.getId());
LinkedList<PredicateAndObject> pao = new LinkedList<PredicateAndObject>();
for(YName name : item.getNames()){
pao.add(new PredicateAndObject(RelConstants.RL_NAME,name.getText()));
}
s.setContinuations(pao);
retL.add(s);
}else;
return retL;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<ViewContact> resolveContacts(final YInstitution personality) {
final List<ViewContact> contacts = new LinkedList<ViewContact>();
final List<String> contactKeys = new ArrayList<String>();
contactKeys.add(YConstants.AT_CONTACT);
contactKeys.add(YConstants.AT_CONTACT_LOCATION);
contactKeys.add(YConstants.AT_CONTACT_URL);
contactKeys.add(YConstants.AT_CONTACT_EMAIL);
contactKeys.add(YConstants.AT_CONTACT_PHONE);
contactKeys.add(YConstants.AT_CONTACT_FAX);
for (final String contactKey : contactKeys) {
final List<YAttribute> ycontacts = personality.getAttributes(contactKey);
if (ycontacts != null) {
for (final YAttribute contact : ycontacts) {
final ViewContact viewContact = new ViewContact(contact.getKey(), detailsFilter.filter(
contact.getValue(), InputType.PLAIN_TEXT));
contacts.add(viewContact);
}
}
}
return contacts;
}
内容来源于网络,如有侵权,请联系作者删除!