Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.ThesaurusActivationRepository


        ThesaurusManager tm = gc.getBean(ThesaurusManager.class);
        Thesaurus t = tm.getThesaurusByName(fname);

        if (t != null) {
            // Save activated status in the database
            final ThesaurusActivationRepository thesaurusRepository = context.getBean(ThesaurusActivationRepository.class);

            final ThesaurusActivation activation = new ThesaurusActivation();
            activation.setId(fname);
            activation.setActivated(Constants.toBoolean_fromYNChar(activated.charAt(0)));

            thesaurusRepository.save(activation);

        } else {
            // Thesaurus does not exist
            throw new Exception("Thesaurus not found");
        }
View Full Code Here


    String theKey = tm.createUpdateThesaurusFromRegister(uuid, type, context);

    Thesaurus gst = tm.getThesaurusByName(theKey);
    String fname = gst.getFname();

        final ThesaurusActivationRepository activationRepository = context.getBean(ThesaurusActivationRepository.class);

        final ThesaurusActivation activation = new ThesaurusActivation();
        activation.setId(fname);
        activation.setActivated(Constants.toBoolean_fromYNChar(activated.charAt(0)));

        activationRepository.save(activation);

    Element elResp = new Element(Jeeves.Elem.RESPONSE);
    Element elRef = new Element("ref");   
    elRef.addContent(theKey);
    elResp.addContent(elRef);
View Full Code Here

    // Remove file
    if (item.exists()) {
      IO.delete(item, true, Geonet.THESAURUS);

            // Delete thesaurus record in the database
            ThesaurusActivationRepository repo = context.getBean(ThesaurusActivationRepository.class);
            String thesaurusId = thesaurus.getFname();
            if (repo.exists(thesaurusId)) {
                repo.delete(thesaurusId);
            }
        } else {
            throw new IllegalArgumentException("Thesaurus not found --> " + name);
        }
   
View Full Code Here

            elDefaultURI.addContent(defaultURI);
           
         
      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

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

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.