Changeset 5229


Ignore:
Timestamp:
05/19/14 11:46:01 (10 years ago)
Author:
teckart@informatik.uni-leipzig.de
Message:

Changed some log levels to reduce default importer output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vlo/trunk/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIComponentProfileNamePostProcessor.java

    r4507 r5229  
    22
    33import com.ximpleware.AutoPilot;
     4import com.ximpleware.NavException;
    45import com.ximpleware.VTDGen;
    56import com.ximpleware.VTDNav;
     7import com.ximpleware.XPathEvalException;
    68import com.ximpleware.XPathParseException;
    7 import eu.clarin.cmdi.vlo.config.VloConfig;
    89import java.util.HashMap;
    910import org.slf4j.Logger;
     
    1314 * Takes the value of the componentprofileid and uses the componentregistry REST service to transform this to the name of the componentprofile.
    1415 */
    15 public class CMDIComponentProfileNamePostProcessor implements PostProcessor{
    16 
    17     private static String XPATH = "/CMD_ComponentSpec/Header/Name/text()";
     16public class CMDIComponentProfileNamePostProcessor implements PostProcessor {
     17    private static final String XPATH = "/CMD_ComponentSpec/Header/Name/text()";
    1818    private String BASE_URL = null;
    19     AutoPilot ap = null;
    20     VTDGen vg = null;
    21     VTDNav vn = null;
     19    private AutoPilot ap = null;
     20    private VTDGen vg = null;
     21    private VTDNav vn = null;
    2222
    2323    private static final String _EMPTY_STRING = "";
     
    3232                result = cache.get(profileId);
    3333            }
    34             else{
     34            else {
    3535                setup();
    3636                // get the name of the profile from the expanded xml in the component registry
    3737                if(vg.parseHttpUrl(BASE_URL + profileId + "/xml", true)){
    38                     LOG.info("PARSED: "+BASE_URL+profileId);
     38                    LOG.debug("PARSED: "+BASE_URL+profileId);
    3939                    vn = vg.getNav();
    4040                    ap.bind(vn);
     
    4242                    try {
    4343                        idx = ap.evalXPath();
    44                         LOG.info("EVALUATED XPATH: "+XPATH+ " found idx: "+idx);
     44                        LOG.debug("EVALUATED XPATH: "+XPATH+ " found idx: "+idx);
    4545                        if(idx == -1){ // idx represent the nodeId in the xml file, if -1 the xpath evaluates to nothing.
    4646                            return result;
     
    4848                        result = vn.toString(idx);
    4949                        cache.put(profileId, result);
    50                     } catch (Exception e) {
     50                    } catch (NavException e) {
     51                        LOG.error(e.getLocalizedMessage());
     52                        return result;
     53                    } catch (XPathEvalException e) {
    5154                        LOG.error(e.getLocalizedMessage());
    5255                        return result;
    5356                    }
    5457                }
    55                 else{
    56                     LOG.error("CANNOT OPEN AND/OR PARSE: " + BASE_URL + profileId);
     58                else {
     59                    LOG.error("Cannot open and/or parse XML Schema: {}.", BASE_URL + profileId);
    5760                }
    5861            }
Note: See TracChangeset for help on using the changeset viewer.