Package org.fao.geonet.repository

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


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

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

        metadata = metadataRepository.findOne(iId);

    if(!localRating) {
      String rating = general.getChildText("rating");
      if (rating != null) {
                metadata.getDataInfo().setRating(Integer.valueOf(rating));
View Full Code Here

        if (!ri.isMoreRecentThan(date))
    {
            if(log.isDebugEnabled())
                log.debug("  - XML not changed for local metadata with uuid:"+ ri.uuid);
      result.unchangedMetadata++;
            metadata = metadataRepository.findOne(id);
            if (metadata == null) {
                throw new NoSuchElementException("Unable to find a metadata with ID: "+id);
            }
    } else {
            if (!params.xslfilter.equals("")) {
View Full Code Here

            boolean index = false;
            boolean updateDateStamp = true;
            String language = context.getLanguage();
            dataMan.updateMetadata(context, id, md, validate, ufo, index, language, ri.changeDate,
                    updateDateStamp);
            metadata = metadataRepository.findOne(id);
            result.updatedMetadata++;
    }

        metadata.getCategories().clear();
        addCategories(metadata, params.getCategories(), localCateg, context, log, null);
View Full Code Here

            result.updatedMetadata++;
    }

        metadata.getCategories().clear();
        addCategories(metadata, params.getCategories(), localCateg, context, log, null);
        metadata = metadataRepository.findOne(id);

    Element general = info.getChild("general");

    String popularity = general.getChildText("popularity");
View Full Code Here

        }

        // Set owner for all records to be modified.
        for (Integer i : metadata) {
            final MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
            final Metadata metadata1 = metadataRepository.findOne(i);
            metadata1.getSourceInfo().setGroupOwner(targetGrp).setOwner(targetUsr);
            metadataRepository.save(metadata1);
        }

        dm.flush();
View Full Code Here

         dataMan.updateMetadata(context, id, template, validate, ufo, index, language, df.format(date), false);

         int iId = Integer.parseInt(id);

         final MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
         Metadata metadata = metadataRepository.findOne(iId);
         OperationAllowedRepository repository = context.getBean(OperationAllowedRepository.class);
         repository.deleteAllByIdAttribute(OperationAllowedId_.metadataId, iId);
         addPrivileges(id, params.privileges, localGroups, dataMan, context, log);

         metadata.getCategories().clear();
View Full Code Here

            throw new IllegalArgumentException("Group with identifier '" + groupOwner + "' not found.");
        }

        //--- Update groupOwner
        MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
        Metadata metadata = metadataRepository.findOne(iLocalId);
        metadata.getSourceInfo().setGroupOwner(iGroupOwner);
        metadataRepository.save(metadata);

        //--- index metadata
        dataMan.indexMetadata(id, true);
View Full Code Here

      String id   = dm.getMetadataId(uuid);
               
      //--- check access

            final MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
            Metadata info = metadataRepository.findOne(id);
      if (info == null) {
        notFound.add(Integer.valueOf(id));
      } else if (!accessMan.isOwner(context, id)) {
        notOwner.add(Integer.valueOf(id));
      } else {
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.