Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.MetadataValidationRepository


            // getValidationInfo
            // -1 : not evaluated
            // 0 : invalid
            // 1 : valid
            MetadataValidationRepository metadataValidationRepository = _applicationContext.getBean(MetadataValidationRepository.class);
            List<MetadataValidation> validationInfo = metadataValidationRepository.findAllById_MetadataId(id$);
            if (validationInfo.isEmpty()) {
                moreFields.add(SearchManager.makeField("_valid", "-1", true, true));
            } else {
                String isValid = "1";
                for (MetadataValidation vi : validationInfo) {
View Full Code Here


     * @param date the validation date time
     */
    private void saveValidationStatus (String id, Map<String, Integer[]> valTypeAndStatus, String date) throws Exception {
        clearValidationStatus(id);

        final MetadataValidationRepository validationRepository = _applicationContext.getBean(MetadataValidationRepository.class);

        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

     * Removes validation status information for a metadata record.
     *
     * @param id   the metadata record internal identifier
     */
    private void clearValidationStatus (String id) throws Exception {
        final MetadataValidationRepository validationRepository = _applicationContext.getBean(MetadataValidationRepository.class);

        validationRepository.deleteAllById_MetadataId(Integer.valueOf(id));
    }
View Full Code Here

TOP

Related Classes of org.fao.geonet.repository.MetadataValidationRepository

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.