<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Specifying filepath in a config file that is deployed with the project in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Specifying-filepath-in-a-config-file-that-is-deployed-with-the/m-p/2255792#M38385</link>
    <description>You can change value of context variables at any time by editing the properties file associated to the desired context.
&lt;BR /&gt;You can also choose to store the context variables into a specific file (outside from the standard context folder) or into a database.
&lt;BR /&gt;Thank's to the "--context_param" parameter, you may also pass the value on the command line.
&lt;BR /&gt;As you can see, you have the choice with context variables and don't have to return into the Studio to change their value.
&lt;BR /&gt;Just refer to the documentation.</description>
    <pubDate>Thu, 11 Oct 2018 23:22:18 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2018-10-11T23:22:18Z</dc:date>
    <item>
      <title>Specifying filepath in a config file that is deployed with the project</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Specifying-filepath-in-a-config-file-that-is-deployed-with-the/m-p/2255791#M38384</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt; 
&lt;P&gt;I have a fairly standard job that reads in data from several files, does some transformations and outputs a file.&amp;nbsp; It is all working as it should on my local machine as I define the filepath&amp;nbsp;as absolute paths.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;However, I will deploy the project on a server over which I don't have control over the file structure.&amp;nbsp; I would therefore like to create something along the lines of a key-value config/properties file that is packaged with the project.&amp;nbsp; When it is deployed, the variables can be updated to reflect the deployed environment by opening&amp;nbsp;the config file in a text editor, making the changes and saving it.&amp;nbsp; Obviously these variables will need to be read into the job at runtime.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've read a bit about contexts, but those seem to be defined within the project itself and therefore somebody wouldn't be able to edit the info in there at any time.&amp;nbsp; If they need to change, I would have to make the changes to the context in Talend Studio, build and redeploy.&amp;nbsp; Rather than just opening a text file, making some changes and saving it again.&amp;nbsp;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I assume this is possible.&amp;nbsp; Any pointers in the&amp;nbsp;right direction would be appreciated.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:28:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Specifying-filepath-in-a-config-file-that-is-deployed-with-the/m-p/2255791#M38384</guid>
      <dc:creator>kdv</dc:creator>
      <dc:date>2024-11-16T07:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying filepath in a config file that is deployed with the project</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Specifying-filepath-in-a-config-file-that-is-deployed-with-the/m-p/2255792#M38385</link>
      <description>You can change value of context variables at any time by editing the properties file associated to the desired context.
&lt;BR /&gt;You can also choose to store the context variables into a specific file (outside from the standard context folder) or into a database.
&lt;BR /&gt;Thank's to the "--context_param" parameter, you may also pass the value on the command line.
&lt;BR /&gt;As you can see, you have the choice with context variables and don't have to return into the Studio to change their value.
&lt;BR /&gt;Just refer to the documentation.</description>
      <pubDate>Thu, 11 Oct 2018 23:22:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Specifying-filepath-in-a-config-file-that-is-deployed-with-the/m-p/2255792#M38385</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2018-10-11T23:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Specifying filepath in a config file that is deployed with the project</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Specifying-filepath-in-a-config-file-that-is-deployed-with-the/m-p/2255793#M38386</link>
      <description>&lt;P&gt;yes! it is very much possible. You can place&amp;nbsp;a files in the unix box and store the content as key-value pair&amp;nbsp;with a field&amp;nbsp;delimiter. The key should exactly same as that of your context variable defined in the job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Content of the file:&lt;/P&gt; 
&lt;P&gt;DataFilePath=/home/talend/data/&lt;/P&gt; 
&lt;P&gt;FileName=customer.csv&lt;/P&gt; 
&lt;P&gt;LogFilePath=&lt;SPAN&gt;home/talend/log&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In the Job,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;1. Use tInputFileDelimiter component.&amp;nbsp; Provide the absolute file path and file name. Give "=" as the field delimiter and define the schema as string for both key and value fields.&lt;/P&gt; 
&lt;P&gt;2. Use tContextLoad to load the key value pair.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;By this way the value form a file is assigned to context variable during run time.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If you dont want to follow this approach, please follow the&amp;nbsp;suggestions given by TRF. The context variables defined in any talend job is embedded in a property file.&amp;nbsp;when you build the job, along with the wrapper .sh and jar files,&amp;nbsp;&amp;nbsp;there will be a folder named similar to your project name. Under that folder there will be .property files ( by default it would be Default.property) with context variables and its defined values.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope this helps!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;Ragu&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 03:09:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Specifying-filepath-in-a-config-file-that-is-deployed-with-the/m-p/2255793#M38386</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-12T03:09:09Z</dc:date>
    </item>
  </channel>
</rss>

