Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.MetadataValidation


        for (Map.Entry<String, Integer[]> entry : valTypeAndStatus.entrySet()) {
            String type = entry.getKey();
            Integer[] results = entry.getValue();

            MetadataValidation metadataValidation = new MetadataValidation()
                .setStatus(MetadataValidationStatus.values()[results[0]])
                .setTested(results[1])
                .setFailed(results[2])
                .setValidationDate(new ISODate(date));
            MetadataValidationId validationId = new MetadataValidationId(Integer.valueOf(id), type);
            metadataValidation.setId(validationId);
            validationRepository.save(metadataValidation);
        }
    }
View Full Code Here


        if (validationInfo == null || validationInfo.size() == 0) {
            addElement(info, Edit.Info.Elem.VALID, "-1");
        } else {
            String isValid = "1";
            for (Object elem : validationInfo) {
                MetadataValidation vi = (MetadataValidation) elem;
                String type = vi.getId().getValidationType();
                if (!vi.isValid()) {
                    isValid = "0";
                }
                String ratio = "xsd".equals(type) ? "" : vi.getFailed() + "/" + vi.getTested();

                info.addContent(new Element(Edit.Info.Elem.VALID + "_details").
                        addContent(new Element("type").setText(type)).
                        addContent(new Element("status").setText(vi.isValid() ? "1" : "0")).
                        addContent(new Element("ratio").setText(ratio))
                );
            }
            addElement(info, Edit.Info.Elem.VALID, isValid);
        }
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.MetadataValidation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.