private void createYtt(String nimi, YhteystietoElementtiDTO extraField, List<OrganisaatioTyyppi> orgTyyppis) { YhteystietojenTyyppiDTO group1 = new YhteystietojenTyyppiDTO(); //group1.setNimiFi(nimi);//"Etsivä nuorisotyö"); group1.getAllLisatietokenttas().add(extraField);//newExtraField(System.currentTimeMillis() + "" + Math.random(), false, "Lankanumero", YhteystietoElementtiTyyppi.PUHELIN)); group1.getSovellettavatOrganisaatios().addAll(orgTyyppis); group1.setOid(createOid()); yttRepo.add(group1); }
@Override public YhteystietojenTyyppiDTO readYhteystietojenTyyppi(String yhteystietojenTyyppiOid) { for (YhteystietojenTyyppiDTO curYtt : yttRepo) { if (curYtt.getOid().equals(yhteystietojenTyyppiOid)) { return curYtt; } } return null; }
public static YhteystietoElementtiDTO getNimike(YhteystietojenTyyppiDTO model) { List<YhteystietoElementtiDTO> elementit = getElementtienLisatietokenttas(model.getAllLisatietokenttas(), YhteystietoElementtiTyyppi.NIMIKE); if (elementit.size() > 0) { return elementit.get(0); } else { return null; } }
public static String getYttCaption(Locale locale, YhteystietojenTyyppiDTO ytt) { String lang = locale.getLanguage().toLowerCase(); if (ytt.getNimi() == null) { return ""; } for (Teksti curTeksti : ytt.getNimi().getTeksti()) { if (curTeksti.getKieliKoodi().equals(lang)) {//getNimiFi() != null) { return curTeksti.getValue(); } } return getAvailableYttName(ytt); }
/** * Create an instance of {@link YhteystietojenTyyppiDTO } * */ public YhteystietojenTyyppiDTO createYhteystietojenTyyppiDTO() { return new YhteystietojenTyyppiDTO(); }
@Override public List<YhteystietojenTyyppiDTO> findYhteystietoMetadataForOrganisaatio(List<String> organisaatioTyyppi) { if (organisaatioTyyppi == null || organisaatioTyyppi.isEmpty()) { return new ArrayList<YhteystietojenTyyppiDTO>(); } List<YhteystietojenTyyppiDTO> ltMetadatasForOrganisaatio = new ArrayList<YhteystietojenTyyppiDTO>(); for (YhteystietojenTyyppiDTO curLtd : yttRepo) { if (isMatchingOrganisaatiotyyppi(curLtd.getSovellettavatOrganisaatios(), organisaatioTyyppi)) { ltMetadatasForOrganisaatio.add(curLtd); } } //return repo.subList(0, Math.min(organisaatioTyypit.size(), repo.size())); return ltMetadatasForOrganisaatio; }
public static YhteystietoElementtiDTO getNimiTieto(YhteystietojenTyyppiDTO model) { List<YhteystietoElementtiDTO> elementit = getElementtienLisatietokenttas(model.getAllLisatietokenttas(), YhteystietoElementtiTyyppi.NIMI); if (elementit.size() > 0) { return elementit.get(0); } else { return null; } }
public static List<YhteystietoElementtiDTO> getPuhelinnumeros(YhteystietojenTyyppiDTO model) { return getElementtienLisatietokenttas(model.getAllLisatietokenttas(), YhteystietoElementtiTyyppi.PUHELIN, YhteystietoElementtiTyyppi.FAKSI); }
public static List<YhteystietoElementtiDTO> getLisatietokenttas(YhteystietojenTyyppiDTO model) { return getElementtienLisatietokenttas(model.getAllLisatietokenttas(), YhteystietoElementtiTyyppi.OSOITE, YhteystietoElementtiTyyppi.OSOITE_ULKOMAA); }
public static List<YhteystietoElementtiDTO> getSahkoinenYhteystietos(YhteystietojenTyyppiDTO model) { return getElementtienLisatietokenttas(model.getAllLisatietokenttas(), YhteystietoElementtiTyyppi.WWW, YhteystietoElementtiTyyppi.EMAIL); }