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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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.
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.
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.
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.