public static void setDescription(RegistryObjectType ro, String value) { LocalizedStringType lst = rimFactory.createLocalizedStringType(); lst.setValue(value); InternationalStringType is = rimFactory.createInternationalStringType(); is.getLocalizedString().add(lst); ro.setDescription(is); } public static void setName(RegistryObjectType ro, String value) {
/** * Create an instance of {@link InternationalStringType } * */ public InternationalStringType createInternationalStringType() { return new InternationalStringType(); }
public static void setName(RegistryObjectType ro, String value) { LocalizedStringType lst = rimFactory.createLocalizedStringType(); lst.setValue(value); InternationalStringType is = rimFactory.createInternationalStringType(); is.getLocalizedString().add(lst); ro.setName(is); }
public XDSCode getXDSCode(ClassificationType clType, boolean createMissing) throws XDSException { String scheme = clType.getClassificationScheme(); String codeValue = clType.getNodeRepresentation(); String codeDesignator = clType.getSlot().get(0).getValueList().getValue().get(0); if (!createMissing) { if (!adCodes.isClassSchemeCodeDefined(scheme, codeValue, codeDesignator)) { throw new XDSException(XDSException.XDS_ERR_REGISTRY_METADATA_ERROR, "Unknown code:"+ codeValue+"^^"+codeDesignator+" ("+scheme+")", null); } } XDSCode code = new XDSCode(codeValue, codeDesignator, clType.getName().getLocalizedString().get(0).getValue(), scheme); try { return (XDSCode) em.createNamedQuery(XDSCode.FIND_BY_CODE_VALUE) .setParameter(1, codeValue) .setParameter(2, codeDesignator) .setParameter(3, scheme) .getSingleResult(); } catch (NoResultException x) { log.info("Store new XDS Code! code:"+code); em.persist(code); return code; } }
private static void checkCodes(RegistryObjectType roType, List<String> requiredCodes) throws XDSException { List<ClassificationType> clList = roType.getClassification(); String objId = roType.getId(); for (ClassificationType cl : clList) { if( objId.equals(cl.getClassifiedObject())) { if (requiredCodes.remove(cl.getClassificationScheme())) { if (cl.getName() == null || cl.getName().getLocalizedString() == null || cl.getName().getLocalizedString().isEmpty()) { throw new XDSException(XDSException.XDS_ERR_REGISTRY_METADATA_ERROR, "Missing code display name in code '"+cl.getNodeRepresentation()+ "(code classification:"+cl.getClassificationScheme(), null); } } } } if (requiredCodes.size() > 0) throw new XDSException(XDSException.XDS_ERR_REGISTRY_METADATA_ERROR, "Missing code values in '"+objId+"'! codes:"+requiredCodes, null); }
private void copyDescriptions(InternationalStringType isType, RegistryObject ro) { Set<Description> descriptions = new HashSet<Description>(); if (isType != null) { Description desc; for (LocalizedStringType localString : isType.getLocalizedString()) { desc = new Description(); desc.setLang(localString.getLang()); log.info("######## description.setValue:"+localString.getValue()+" parent:"+ro); desc.setValue(localString.getValue()); desc.setCharset(localString.getCharset()); desc.setParent(ro); descriptions.add(desc); } } ro.setDescription(descriptions); }
public static ClassificationType createCodeClassification(String id, String classifiedObjectID, String type, Code code) { ClassificationType cl = createClassification(id, type, classifiedObjectID, code.getValue()); LocalizedStringType lst = rimFactory.createLocalizedStringType(); lst.setValue(code.getMeaning()); InternationalStringType is = rimFactory.createInternationalStringType(); is.getLocalizedString().add(lst); cl.setName(is); cl.getSlot().add(createSlot("codingScheme", null, code.getDesignator())); return cl; }
private void copyName(InternationalStringType isType, RegistryObject ro) { Set<Name> names = new HashSet<Name>(); if (isType != null) { Name name; for (LocalizedStringType localString : isType.getLocalizedString()) { name = new Name(); name.setLang(localString.getLang()); name.setValue(localString.getValue()); name.setCharset(localString.getCharset()); name.setParent(ro); names.add(name); } } ro.setName(names); }
private void copyNameType(Set<Name> name, RegistryObjectType roType) { InternationalStringType is = factory.createInternationalStringType(); List<LocalizedStringType> values = is.getLocalizedString(); LocalizedStringType value; for (Name n : name) { value = factory.createLocalizedStringType(); value.setCharset(n.getCharset()); value.setLang(n.getLang()); value.setValue(n.getValue()); values.add(value); } roType.setName(is); }
private void copyDescriptionType(Set<Description> descriptions, RegistryObjectType roType) { InternationalStringType is = factory.createInternationalStringType(); List<LocalizedStringType> values = is.getLocalizedString(); LocalizedStringType value; for (Description n : descriptions) { value = factory.createLocalizedStringType(); value.setCharset(n.getCharset()); value.setLang(n.getLang()); value.setValue(n.getValue()); values.add(value); } roType.setDescription(is); }
public static ExternalIdentifierType createExternalIdentifier(String id, String scheme, String registryObject, String value, String name) { ExternalIdentifierType ei = rimFactory.createExternalIdentifierType(); ei.setId(id); ei.setIdentificationScheme(scheme); ei.setObjectType("urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExternalIdentifier"); ei.setRegistryObject(registryObject); ei.setValue(value); InternationalStringType is = rimFactory.createInternationalStringType(); LocalizedStringType v = rimFactory.createLocalizedStringType(); v.setValue(name); is.getLocalizedString().add(v); ei.setName(is); return ei; }