Package org.jzkit.configuration.api

Examples of org.jzkit.configuration.api.Configuration


     GeonetContext gc = (GeonetContext) srvContext.getHandlerContext(Geonet.CONTEXT_NAME);
    ApplicationContext app_context = gc.getApplicationContext();
    Vector<RepositoryInfo> ret = new Vector<RepositoryInfo>();
   
    if (app_context != null) {
      Configuration conf = (Configuration)app_context.getBean("JZKitConfig");
      @SuppressWarnings("unchecked")
            Iterator<SearchServiceDescriptionDBO> it = conf.enumerateRepositories();
              
      while (it.hasNext()) {
         SearchServiceDescriptionDBO ssd = it.next();
         Collection<CollectionDescriptionDBO> col = ssd.getCollections();
        if (col.size()>0) {
View Full Code Here


      
       public ExplainInformationDTO explain() {

           ExplainInformationDTO result = new ExplainInformationDTO();

           Configuration directory = (Configuration) appl_ctx.getBean("JZKitConfig");
           try {
             // Populate explain information
            
               // if we used ValidIndices we would use this code
              
               /*
              
               CollectionDescriptionDBO cd = directory.lookupCollectionDescription("Default");
               if (cd!= null ) {
                      
                       Map<String, AttrValue> mappings = cd.getSearchServiceDescription().getServiceSpecificTranslations();
                       Map<String,String> reverse_mappings = new HashMap<String, String>();
                       for (String key: mappings.keySet()) {
                               reverse_mappings.put(mappings.get(key).toString(), key);
                       }
                      
                       AttributeSetDBO attrs = cd.getSearchServiceDescription().getValidAttrs().get("AccessPoint");
                      
                      
                      
                      
                       List<GNExplainInfoDTO> list = new ArrayList<GNExplainInfoDTO>();
                       for (AttrValue val: attrs.getAttrs() ) {
                      
                               GNExplainInfoDTO exl = new GNExplainInfoDTO();
                               exl.addMapping(val.getValue(), val.getNamespaceIdentifier());
                              
                               String reverse_key = val.getNamespaceIdentifier()+":"+val.getValue();
                               if (reverse_mappings.containsKey(reverse_key)) {
                                       String[] temp = reverse_mappings.get(reverse_key).split("\\.");
                                       if (temp.length==3) exl.addMapping(temp[1]+"."+temp[2], temp[0]);
                                       if (temp.length==2) exl.addMapping(temp[1], temp[0]);
                               }
                              
                               list.add(exl);
                       }
                      
                       result.setDatabaseInfo(list);
                      
               }
              
               */
              
               // but we use Crosswalks (the info on what we actually accept is in the geo profile, but we suppose
               // that the crosswalks will eventually lead to a valid attribute)
              
               // this should really be done differently but unfortunately there is
               // no way to know if a mapping is for an attribute (can be a relation, too)
               // we take as indicator the fact that are is a "1"
               Pattern p = Pattern.compile(".*\\.1\\.([0-9]+)$" );
              
               @SuppressWarnings("unchecked")
            Iterator<CrosswalkDBO> it = directory.enumerateCrosswalks();
              
               List<GNExplainInfoDTO> list = new ArrayList<GNExplainInfoDTO>();
               while (it.hasNext()) {
              
                      
View Full Code Here

TOP

Related Classes of org.jzkit.configuration.api.Configuration

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.