private static void proceedIdentity(YContributor yc, LinkedList<PredicateAndObject> pao) { if(!yc.getIdentity().isEmpty()) pao.add(new PredicateAndObject(RelConstants.RL_IS_PERSON,RelConstants.NS_PERSON+yc.getIdentity())); }
private static void proceedInstitutions(YContributor yc, LinkedList<PredicateAndObject> pao) { if(yc.isInstitution()){ if (yc.getIdentity()!=null & ! yc.getIdentity().isEmpty()) pao.add(new PredicateAndObject(RelConstants.RL_IS_INSTITUTION,RelConstants.NS_INSTITUTION+yc.getIdentity())); } }
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); } }
protected void fillContributors(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) { // creator element for (YContributor yContributor : yElement.getContributors()) { String dcRoleElementName = null; String role=yContributor.getRole(); if (role.equals(ContributorRoles.CR_AUTHOR) || role.equals(ContributorRoles.CR_EDITOR)) { dcRoleElementName = E_CREATOR; } else if (role.equals(ContributorRoles.CR_PUBLISHER)) { dcRoleElementName = E_PUBLISHER; } else if (role.equals(ContributorRoles.CR_OTHER)) { dcRoleElementName = E_CONTRIBUTOR; } if (dcRoleElementName != null) { if (!ret.containsKey(dcRoleElementName)) { ret.put(dcRoleElementName, new ArrayList<StringWithAttributes>()); } if (StringUtils.isNotBlank(yContributor.getIdentity())) { ret.get(dcRoleElementName).add(new StringWithAttributes(yContributor.getIdentity())); } else { ret.get(dcRoleElementName).add(new StringWithAttributes(yContributor.getDefaultName().getText())); } } } }
public List<String> getBasicIds(YElement elem) { ArrayList<String> ret = new ArrayList<String>(); for (YAffiliation aff: elem.getAffiliations()) { if (aff.getIdentity()!=null && !aff.getIdentity().isEmpty()){ ret.add(aff.getIdentity()); } } for (YContributor cont : elem.getContributors()) { if (!cont.getIdentity().isEmpty()) { ret.add(cont.getIdentity()); } } for (YStructure struct : elem.getStructures()) { for (YAncestor anc : struct.getAncestors()) { if (!anc.getIdentity().isEmpty()) { ret.add(anc.getIdentity()); } } } return ret; }
if(!yc.getIdentity().isEmpty()) pao.add(new PredicateAndObject(RelConstants.RL_IS_PERSON,RelConstants.NS_PERSON+yc.getIdentity())); if(!yc.getNames().isEmpty()){ String sname = ""; if (yc.getIdentity()!=null & ! yc.getIdentity().isEmpty()) pao.add(new PredicateAndObject(RelConstants.RL_IS_INSTITUTION,RelConstants.NS_INSTITUTION+yc.getIdentity()));
private void buildViewContributors(final IFilteringContext filteringContext, final YElement element, final List<ViewContributor> partModel) { final List<YContributor> result = new ArrayList<YContributor>(element.getContributors()); for (final YContributor yContr : result) { if (isVisible(yContr)) { ContributorInfo contrInfo = contributorInfoBuilder.prepareContributorInfo(yContr); String title = prepareTitle(yContr, contrInfo); final ViewContributor viewContributor = new ViewContributor(contrInfo.getMd5(), detailsFilter.filter(title, InputType.PLAIN_TEXT, filteringContext), detailsFilter.filter(yContr.getRole(), InputType.IDENTIFIER, filteringContext), filterEmail(resolveEmail(yContr), filteringContext), resolveAffiliations(yContr, element, filteringContext)); viewContributor.getAddresses().addAll(resolveAddresses(yContr, filteringContext)); viewContributor.getContacts().addAll(resolveContributorContacts(yContr, filteringContext)); if (personalityContacts && yContr.getIdentity() != null && yContr.getIdentity().length() > 0) { fetchPersonality(yContr, viewContributor, filteringContext); } partModel.add(viewContributor); } } }
if(!yc.getIdentity().isEmpty()) pao.add(new PredicateAndObject(RelConstants.RL_IS_PERSON,RelConstants.NS_PERSON+yc.getIdentity())); if(!yc.getNames().isEmpty()){ String sname = ""; if (yc.getIdentity()!=null & ! yc.getIdentity().isEmpty()) pao.add(new PredicateAndObject(RelConstants.RL_IS_INSTITUTION,RelConstants.NS_INSTITUTION+yc.getIdentity()));