Jump to content

environment variables in fusionpro


ivdb

Recommended Posts

We use EFI's Digital storefront, with fusionpro to personalise items. In my fusionpro products, I use the load function to load flles that contain my javascript functions. At this moment, I'm using a harcoded path,but I would like to replace it by a variable.

Is it possible in FusionPro to have access to windows environment variables?

Link to comment
Share on other sites

We use EFI's Digital storefront, with fusionpro to personalise items. In my fusionpro products, I use the load function to load flles that contain my javascript functions. At this moment, I'm using a harcoded path,but I would like to replace it by a variable.

Is it possible in FusionPro to have access to windows environment variables?

Not directly. But how would that help you in the DSF environment anyway? Unless you have the ability to set environment variables on EFI's DSF servers, I don't see how accessing the environment variables in the job is going to be useful.

 

I would think that for a remote composition like this, you would want to collect and upload the .js files with the template, and then the Load function will find the .js file with the job, just like any other job-specific resource. That's the only reliable way to use external JavaScript files with a job that's not always going to be run on a single machine.

Link to comment
Share on other sites

Not directly. But how would that help you in the DSF environment anyway? Unless you have the ability to set environment variables on EFI's DSF servers, I don't see how accessing the environment variables in the job is going to be useful.

 

I would think that for a remote composition like this, you would want to collect and upload the .js files with the template, and then the Load function will find the .js file with the job, just like any other job-specific resource. That's the only reliable way to use external JavaScript files with a job that's not always going to be run on a single machine.

 

I store my javascript files on the DSF server machine in a specific directory;

Since I have a lot of fusionpro products, based on the same scripts, I only have to call a Load function in the "globals" section to load them. In case of bugs, I do not have tomake changes in all my fusionpro templates and reload them again in DSF (clients lose their saved jobs when I have to update the products ). I only have to change the javascript function file that is stored on the server and all fusionpro templates that use it, work correctly.

If I could store the path of my script files in an environment variable that can be loaded in fusionpro, I'm independent of any path change. ( if i need to move the scripts path to another directory, I only need to change the environment variable)

Link to comment
Share on other sites

So if the scripts are only in one directory on a single machine, how do you access them to design or compose jobs on different machines? I would think that you would at least put the scripts in a network folder that you could access via a UNC share. Then the UNC share could be changed to point to a different physical location.

 

At any rate, the "environment" for a FusionPro VDP job is defined in the CFG file. FusionPro is designed to be as independent of machine-specific settings as possible. So there's no direct way to access a system environment variable.

 

It is possible to write a plug-in in C, which could call a Windows API function to read an environment variable. But you would still need to know where to load the C plug-in, which is the same problem.

 

Or, you could read an External Data File which contains the path to the script file. However, you would still need to know the path of the External Data File.

 

You could always just put your script file in the System folder (usually "C:\Windows\System32", or "C:\Windows\SysWOW64" on a 64-bit OS), and the Load function should always find it there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...