Package org.fao.geonet.kernel

Examples of org.fao.geonet.kernel.ThesaurusManager$InitThesauriTableTask


        KeywordsSearcher searcher = null;

        // perform the search and save search result into session
        GeonetContext gc = (GeonetContext) context
                .getHandlerContext(Geonet.CONTEXT_NAME);
        ThesaurusManager thesaurusMan = gc.getBean(ThesaurusManager.class);
       
       
        Element root = null;
       
        if (uri == null) {
View Full Code Here


   *   @see Params.NAME key value
   */
  public Element exec(Element params, ServiceContext context) throws Exception
  {
    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    ThesaurusManager manager = gc.getBean(ThesaurusManager.class);
   
    String name  = Util.getParam(params, Params.REF);
   
    Thesaurus directory = manager.getThesaurusByName(name);
    if (directory == null)
      throw new IllegalArgumentException("Thesaurus not found --> " + name);
   
    File directoryFile = directory.getFile();
    if (!directoryFile.exists())
View Full Code Here

  //--------------------------------------------------------------------------

  public Element serviceSpecificExec(Element params, ServiceContext context) throws Exception
  {
    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    ThesaurusManager manager = gc.getBean(ThesaurusManager.class);
   
    // Get parameters
    String name = Util.getParam(params, Params.REF);
   

    // Load file
    Thesaurus thesaurus = manager.getThesaurusByName(name);
    File item = thesaurus.getFile();
   
    // Remove old file from thesaurus manager
    manager.remove(name);
   
    // Remove file
    if (item.exists()) {
      IO.delete(item, true, Geonet.THESAURUS);
View Full Code Here

            newid = UUID.randomUUID().toString();
        }
    String thesaType = Util.getParam(params, "refType");
    Element elResp = new Element(Jeeves.Elem.RESPONSE);

    ThesaurusManager manager = gc.getBean(ThesaurusManager.class);
    Thesaurus thesaurus = manager.getThesaurusByName(ref);

    if (thesaurus.isFreeCode(null, newid)) {

        KeywordBean keyword = new KeywordBean(context.getBean(IsoLanguagesMapper.class))
              .setNamespaceCode(namespace)
View Full Code Here

  public Element exec(Element params, ServiceContext context)
      throws Exception {
    Element response = new Element(Jeeves.Elem.RESPONSE);
   
    ThesaurusManager th = context.getBean(ThesaurusManager.class);
    Map<String, Thesaurus> thTable = th.getThesauriMap();
   
    response.addContent(buildResultfromThTable(context, thTable));
   
    return response;
  }
View Full Code Here

   
     
    // perform the search and save search result into session
    GeonetContext gc = (GeonetContext) context
        .getHandlerContext(Geonet.CONTEXT_NAME);
    ThesaurusManager thesaurusMan = gc.getBean(ThesaurusManager.class);

        if(Log.isDebugEnabled("KeywordsManager")) Log.debug("KeywordsManager","Creating new keywords searcher");
    searcher = new KeywordsSearcher(context, thesaurusMan);
   
    String request = Util.getParam(params, "request");
View Full Code Here

        this.thesaurusName = thesaurusName;
    }

    private synchronized Thesaurus getThesaurus(ServiceContext context) throws Exception {
        GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
        ThesaurusManager th = gc.getBean(ThesaurusManager.class);
        Thesaurus regions = th.getThesaurusByName(thesaurusName);
        if(regions != null) {
            return regions;
        }
        Set<Entry<String, Thesaurus>> all = th.getThesauriMap().entrySet();
        for (Entry<String, Thesaurus> entry : all) {
            if(entry.getKey().contains("regions")) {
                return entry.getValue();
            }
        }
View Full Code Here

TOP

Related Classes of org.fao.geonet.kernel.ThesaurusManager$InitThesauriTableTask

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.