Menu

How does config.properties get loaded?

Yvonne
2004-01-09
2004-01-13
  • Yvonne

    Yvonne - 2004-01-09

    I would appreciate it if someone could help me with this.

    I am trying to find where in the code does Babeldoc load config.properties file into the system.

    For example, if I type:
    babeldoc process -p test -f test/foo.xml

    My pipeline is called "test".  Babeldoc would have to read in my config.properties file for my pipeline before it know what pipeline stage I have configured for my pipeline.

    May I know which Class does this loading? Thanks in advance.

     
    • Dejan Krsmanovic

      Take a look at com.babeldoc.core.EnviromentLoader class and loadEnviroment() method that is called before any babeldoc command is executed. I guess you can follow order in which code is executed.
      And if you want to know exact place where .properties files are loaded take a look at the class com.babeldoc.core.config.light.LightConfigService.
      Note that LightConfigService is just one implementation of ConfigService that is commonly used. You can actualy use load properties from database using com.babeldoc.sql.config.SqlConfigService class which is another implementation.

       
    • Yvonne

      Yvonne - 2004-01-12

      Hi Dejan,

      Thanks for your assistance.

      As I was tracing the code, I got to the ConfigService class which at line 130 says String config = System.getProperty(CONFIG);

      where CONFIG is a final string "babel.config"

      However, I do not seem to see a place where this system property has been set.  The babeldoc.bat also does not seem to set this value when starting up babeldoc too.

      I am very new with Babeldoc here. I wonder if you could help on this.

      Thanks.

       
    • Yvonne

      Yvonne - 2004-01-12

      Hi,

      To follow up, the reason why I need to know where the .properties files are loaded is because, I wish to use the pipelines in Babeldoc. But I do not wish to write my documents after going through Babeldoc's pipelines into a file or to an ftp server. I wish to be able to use the intermediate byte array and further process my data in another java program after that.

      Babeldoc does not seem to have a controller for the pipelines.  All the config.properties and pipeline .properties files seem to be loaded in the loadEnvironment() method which searches from the classpaths.

      I would be great if you could tell me if there is anywhere that I could give your PipelineStage the properties and the data to process.

      Thanks a lot.

       
      • Bill Harrelson

        Bill Harrelson - 2004-01-13

        I just use the scripting stage to call java programs from javascript.  the "document" variable is available to the script, 'document.toString()' gets it as a string.  'document.put(string, string)' adds attributes to the pipeline,  'document.get(string)' accesses them, ImportClass(classname) gets my java program into javascript and then I have all the power of both javascript and Velocity to tweak the parameters to call it.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.