Examples of findOne()


Examples of org.fao.geonet.repository.MetadataFileUploadRepository.findOne()

        MetadataFileUploadRepository uploadRepo = context.getBean(MetadataFileUploadRepository.class);
        for (MetadataFileDownload fileDownload : records) {
            // User should be the user that uploaded the file
            int fileUploadId = fileDownload.getFileUploadId();
            MetadataFileUpload metadataFileUpload = uploadRepo.findOne(MetadataFileUploadSpecs.hasId(fileUploadId));

            User user = context.getBean(UserRepository.class).findOneByUsername(metadataFileUpload.getUserName());

            String username = user.getUsername();
            String name = (user.getName() != null?user.getName():"");
View Full Code Here

Examples of org.fao.geonet.repository.MetadataRepository.findOne()

        dataMan.setTemplateExt(iId, MetadataType.lookup(isTemplate));
        dataMan.setHarvestedExt(iId, params.uuid);


        MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
        Metadata metadata = metadataRepository.findOne(iId);

        addCategories(metadata, params.getCategories(), localCateg, context, log, null);

        metadata = metadataRepository.findOne(iId);
View Full Code Here

Examples of org.fao.geonet.repository.OperationRepository.findOne()

            if (!userGroups.contains(grpId)) {
                continue;
            }

            Operation operation = operationRepository.findOne(operationAllowed.getId().getOperationId());
            String operName = operation.getName();

            if (grpOwnerId != null && grpOwnerId == grpId) {
                grpOwnerName = grpName;
            }
View Full Code Here

Examples of org.fao.geonet.repository.SchematronCriteriaGroupRepository.findOne()

    private Element renameGroup(Element params, ServiceContext context) {
        final SchematronCriteriaGroupRepository repository = context.getBean(SchematronCriteriaGroupRepository.class);
        String groupName = Util.getParam(params, PARAM_GROUP_NAME);
        int schematronId = Integer.parseInt(Util.getParam(params, PARAM_SCHEMATRON_ID));
        String newRequirement = Util.getParam(params, PARAM_REQUIREMENT, null);
        final SchematronCriteriaGroup group = repository.findOne(new SchematronCriteriaGroupId(groupName, schematronId));

        SchematronRequirement finalRequirement = group.getRequirement();
        if (newRequirement != null) {
            finalRequirement = SchematronRequirement.valueOf(newRequirement.toUpperCase());
        }
View Full Code Here

Examples of org.fao.geonet.repository.SchematronCriteriaRepository.findOne()

                    spec = spec.and(hasGroupSpec);
                }
            }
            element = criteriaRepository.findAllAsXml(spec);
        } else {
            final SchematronCriteria criteria = criteriaRepository.findOne(Integer.parseInt(id));

            if (criteria == null) {
                throw new BadParameterEx(Params.ID, id);
            }
            element = new Element(Jeeves.Elem.RESPONSE).addContent(criteria.asXml());
View Full Code Here

Examples of org.fao.geonet.repository.SchematronRepository.findOne()

        Element result;
        if (id == null) {
            result = repository.findAllAsXml();
        } else {
            final Schematron one = repository.findOne(Integer.parseInt(id));
            if (one == null) {
                throw new BadParameterEx(Params.ID, id);
            }
            result = new Element("schematron").addContent(one.asXml());
        }
View Full Code Here

Examples of org.fao.geonet.repository.ServiceRepository.findOne()

            java.util.List<Service> serviceList = null;
            ServiceRepository serviceRepo = context.getBean(ServiceRepository.class);
            if (serviceIdentifierToLoad == -1) {
                serviceList = serviceRepo.findAll();
            } else {
                serviceList = Collections.singletonList(serviceRepo.findOne(serviceIdentifierToLoad));
            }

            for (Service service : serviceList) {
                if (service != null) {
                    Element srv = new Element("service");
View Full Code Here

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

        String newUuid = values.get(SettingManager.SYSTEM_SITE_SITE_ID_PATH);

        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
View Full Code Here

Examples of org.fao.geonet.repository.StatusValueRepository.findOne()

    public MetadataStatus setStatusExt(ServiceContext context, int id, int status, ISODate changeDate, String changeMessage) throws Exception {
        final StatusValueRepository statusValueRepository = _applicationContext.getBean(StatusValueRepository.class);

        MetadataStatus metatatStatus = new MetadataStatus();
        metatatStatus.setChangeMessage(changeMessage);
        metatatStatus.setStatusValue(statusValueRepository.findOne(status));
        int userId = context.getUserSession().getUserIdAsInt();
        MetadataStatusId mdStatusId = new MetadataStatusId()
                .setStatusId(status)
                .setMetadataId(id)
                .setChangeDate(changeDate)
View Full Code Here

Examples of org.fao.geonet.repository.ThesaurusActivationRepository.findOne()

           
         
      Element elActivated= new Element("activated");
            char activated = Constants.YN_TRUE;
            final ThesaurusActivationRepository activationRepository = context.getBean(ThesaurusActivationRepository.class);
            final ThesaurusActivation activation = activationRepository.findOne(currentTh.getKey());
            if (activation == null || !activation.isActivated()) {
                activated = Constants.YN_FALSE;
            }
            elActivated.setText(""+activated);
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.