Pistop Cli Variables

Post Reply
ace27rsm
Newbie
Posts: 11
Joined: Sat Aug 18, 2018 11:06 pm

Pistop Cli Variables

Post by ace27rsm »

Hi, I need to ask another question about cli that i don't find explained on docs.

I usually pass different variables to a pitstop server action by switch adding a variable set to PSS connector. but....how can i add a variable value using cli? As i told you i don't find a section explained on cli docs. Is it possible?
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Pistop Cli Variables

Post by Padawan »

You won't be to replicate the exact Switch behavior.

Instead of a variable set of type Switch you will need a variable set of type job ticket (XML file). You can setup these in PitStop Server standalone. You will have to create an XML structure which can contain all the variables you need. Then you need to create the variable set which uses the information in the xml job ticket.

Using the cli you can tell PitStop Server to process a PDF with preflight profile/action list along with a variable set and the xml job ticket containing all variables.

When you use PItStop Server in Switch all of this is automatically done for you :)
ace27rsm
Newbie
Posts: 11
Joined: Sat Aug 18, 2018 11:06 pm

Re: Pistop Cli Variables

Post by ace27rsm »

thank you padawan for the reply.

i see on the complete xml config file, in cli documentations, this section:
<cf:SmartPreflight>
<cf:VariableSet>C:\Documents and Settings\user\Desktop\My Action Variable Set Collection\SQUARE COLOR.evs</cf:VariableSet>
<cf:JobTicket>C:\Documents and Settings\user\Desktop\Temp\JobTicket.xml</cf:JobTicket>
</cf:SmartPreflight>

but jobTicket.xml must always be a static file?

let assume i want to create a square inside the pdf, and there is a variable called 'color' inside the variable set "SQUARE COLOR" of this example, can i set the color dynamically by cli options, or have always to create a jobTicket.xml every time?
if sometimes i want it red, sometimes blue, sometimes green.....have i to create 3 jobTicket.xml files?

why can't I pass a variable like -color "red" by cli options? or something like this...

anyway....is there a complete documentation about the correct syntax of the jobTicket.xml to build dynamically by script?

thank you again
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Pistop Cli Variables

Post by Padawan »

jobTicket.xml doesn"t need to be a static file. It can be any xml file having any name on any location accessible by PitStop Server. You just need to provide the path to the job ticket xml file in the cli config file.

There is no specific syntax to jobTicket.xml that you need to know. The idea is that PitStop Server is able to work with any XML file. This is possible because you have to create a variable set file in which you setup rules to extract the variables from the xml files (using xpath expressions) and map them to variables.

It works this way because the variables system is built around the idea that you get XML files from a Web2Print system or an MIS system or ... who all have their own fixed xml formats. Using the variable set system you can let PitStop Server adapt to all these different kinds of xml formats. It was designed this way because in 90% of all situations customers have an xml file with the info and they don't have control over the structure of the incoming xml ticket. Your situation is a bit different because you seem to have control over how the information comes in.

My suggestion would be to first check all information about how to setup smart preflight or dynamic processing in PitStop Server using hotfolders. This will make you familiar with the concept of Variable Sets. Once you understand that, then you try to do the same using the cli. You'll see that it works the same, except that you don't provide the info via hotfolders, but via the cli.

Some information which I think you might want to check:
https://www.enfocus.com/manuals/Referen ... intro.html

https://www.enfocus.com/en/support/know ... 000jffxIAA (The PitStop Server standalone section)
ace27rsm
Newbie
Posts: 11
Joined: Sat Aug 18, 2018 11:06 pm

Re: Pistop Cli Variables

Post by ace27rsm »

Yes, I'm using Node JS to start a CLI, because pistop server have not a http server to send a request. (I hope Enfocus will add this feature in the future)

Anyway i want to create standard actions, and pass variable dynamically by script. I found a way to do it....it works...but there are some things that can only be set by a xml file...(ticketJob, multiple mutators, etc...). As i told you before. I hope Enfocus we'll integrate a http server to send post request with all variables in the body.
So to for now i need to make a lot of operations (like save file in a temp folder, call the cli, save the output in another temp folder, read it and returning it) that i'm not very happy to do... :lol: ....so i think that every time i'll even have to generate a xml ticket job to pass to the cli....and as you can understand it is a lot of code that should be inside Pitstop app, it shouldn't be a task of my app
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Pistop Cli Variables

Post by Padawan »

As far as I can tell PitStop Server variables are built for the usecase of being able to process XML files from web2print systems, MIS systems, ... without any programming knowledge required and I personally think it did a good job in doing so.

Unfortunately this means it means that for other usecases such as yours it doesn't behave in the way it would be best to fit your needs, which results in extra work. Having a REST API in PitStop Server would be a really awesome solution for your usecase. Unfortunately we don't have one yet :)
Post Reply