Package org.fao.geonet.repository

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


                final MetadataCategoryRepository categoryRepository = context.getBean(MetadataCategoryRepository.class);
                for (Element el : list) {
          String name = el.getName();

          if (name.startsWith("_"))  {
                        final MetadataCategory category = categoryRepository.findOne(Integer.valueOf(name.substring(1)));
                        if (category != null) {
                            info.getCategories().add(category);
                        } else {
                            context.warning("Unable to find category with name: "+name.substring(1));
                        }
View Full Code Here


     * @throws Exception
     */
    public void setCategory(ServiceContext context, String mdId, String categId) throws Exception {
        final MetadataCategoryRepository categoryRepository = _applicationContext.getBean(MetadataCategoryRepository.class);

        final MetadataCategory newCategory = categoryRepository.findOne(Integer.valueOf(categId));
        final boolean[] changed = new boolean[1];
        _metadataRepository.update(Integer.valueOf(mdId), new Updater<Metadata>() {
            @Override
            public void apply(@Nonnull Metadata entity) {
                changed[0] = !entity.getCategories().contains(newCategory);
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.