Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.SourceRepository.save()


        if (newUuid != null && !currentUuid.equals(newUuid)) {
            final MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
            final SourceRepository sourceRepository = context.getBean(SourceRepository.class);
            final Source source = sourceRepository.findOne(currentUuid);
            Source newSource = new Source(newUuid, source.getName(), source.isLocal());
            sourceRepository.save(newSource);

            PathSpec<Metadata, String> servicesPath = new PathSpec<Metadata, String>() {
                @Override
                public Path<String> getPath(Root<Metadata> root) {
                    return root.get(Metadata_.sourceInfo).get(MetadataSourceInfo_.sourceId);
View Full Code Here


        Group group = bean.findAll().get(0);

        MetadataCategory category = serviceContext.getBean(MetadataCategoryRepository.class).findAll().get(0);

        final SourceRepository sourceRepository = serviceContext.getBean(SourceRepository.class);
        Source source = sourceRepository.save(new Source().setLocal(true).setName("GN").setUuid("sourceuuid"));

        final Element sampleMetadataXml = super.getSampleMetadataXml();
        final Metadata metadata = new Metadata();
        metadata.setDataAndFixCR(sampleMetadataXml)
            .setUuid(UUID.randomUUID().toString());
View Full Code Here

        _applicationContext.getBean(SettingManager.class).setSiteUuid(siteUuid);
        final SourceRepository sourceRepository = _applicationContext.getBean(SourceRepository.class);
        List<Source> sources = sourceRepository.findAll();
        if (sources.isEmpty()) {
            sources = new ArrayList<Source>(1);
            sources.add(sourceRepository.save(new Source().setLocal(true).setName("Name").setUuid(siteUuid)));
        }
        final DataSource dataSource = _applicationContext.getBean(DataSource.class);
        Connection conn = null;
        try {
            conn = dataSource.getConnection();
View Full Code Here

        String schema = dataManager.autodetectSchema(metadata);
        final SourceRepository sourceRepository = _applicationContext.getBean(SourceRepository.class);
        List<Source> sources = sourceRepository.findAll();

        if (sources.isEmpty()) {
            final Source source = sourceRepository.save(new Source().setLocal(true).setName("localsource").setUuid("uuidOfLocalSorce"));
            sources = Lists.newArrayList(source);
        }

        Source source = sources.get(0);
        ArrayList<String> id = new ArrayList<String>(1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.