Jump to content

Output to Folder on Server


Recommended Posts

Mac 0S 10.14.4

FusionPro 10.1.9

 

I have a job that I would like to be composed as individual files and named from a data column then put on the Server in a specific folder.

 

Everything seems to work except the files do not go into the "ABOTA" folder on the server. I do have a folder created on the Server named ABOTA.

 

Please review my following rule set up as a Callback - On Record Start rule.

 

 

FusionPro.Composition.outputFileFullPathName = ("/Volumes/smb/192.168.200.72/Jobs/ABOTA/")

 

if (FieldChanged("Member No"))

FusionPro.Composition.OpenNewOutputFile(Field("Member No") +

"." + FusionPro.Composition.outputFormatExtension);

 

 

 

 

Added note: (There is not a space between "Mem ber" the post keeps putting it there)

Edited by LyndaEngelage
Link to comment
Share on other sites

Couple of things. First when making a post with code use the advanced editor, or use this:

[code] --- Code goes here --- [/code]

 

Second, does that path "/Volumes/smb/192.168.200.72/Jobs/ABOTA/" even exist? If you open Finder and from the menu bar choose Go > Go to Folder... and then paste that in does it take you to the folder you're expecting?

Link to comment
Share on other sites

Yes the path does exist. The files drop to:

 

 

/Volumes/smb://192.168.200.72/Jobs/

 

 

but I have a specific folder on the server named ABOTA.

 

 

How do I tell FusionPro to write to a specific folder on the server.

 

 

I thought adding "/ABOTA" would do it.

 

 

 

ScreenShot2019-06-05at2_32_23PM.png.fc26a34efaf65fd1ba4c534094e5c435.png

Link to comment
Share on other sites

Looks like the actual path you need is /Volumes/Jobs/ABOTA/

 

The smb://... is just the server address and not it's location in relation to the filesystem.

 

FusionPro.Composition.outputFileFullPathName expects a full path and file name.

 

And FusionPro.Composition.OpenNewOutputFile will output a file in the destination folder from the composition settings. I'm not too sure if these can be mixed. Dan Korn might be able to give more information.

 

Unless you're specifically trying to move different PDFs to different folders I'm not sure why you're trying this method though. Couldn't you just do the OpenNewOutputFile and point your composition output to the folder you want?

 

Edit:

 

Looks like you could just do:

if (FieldChanged("Member No")){
FusionPro.Composition.OpenNewOutputFile("/Volumes/Jobs/ABOTA/" + Field("Member No") + "." + FusionPro.Composition.outputFormatExtension);
}

Edited by ScottHillock
Link to comment
Share on other sites

Looks like the actual path you need is /Volumes/Jobs/ABOTA/

 

The smb://... is just the server address and not it's location in relation to the filesystem.

The easiest way that I know of to get the full path to a file on Mac is to open up TextEdit, go into the menu and select Format -> Make Plain Text, then drag the file from the Finder into the TextEdit window.

FusionPro.Composition.outputFileFullPathName expects a full path and file name.

 

And FusionPro.Composition.OpenNewOutputFile will output a file in the destination folder from the composition settings. I'm not too sure if these can be mixed. Dan Korn might be able to give more information.

<Obi-Wan voice> Hello there!

 

You're correct, those do different things, in two different modes of what we call chunking, and they can't really be mixed.

 

The FusionPro.Composition.outputFileName and FusionPro.Composition.outputFileFullPathName properties can be set in the OnNewOutputFile rule, which is invoked for every output file (chunk) when the "Output to multiple files" box is checked on the Output tab of the Composition Settings. That's for what we call "static chunking," where every output file (chunk) contains the same number of records (unless you specify a different number for the very first record). This used to be the only way to compose to multiple output files. As the names of these two properties suggest, one is for specifying just a file name, in which case the file will be created in the same folder as the nominal output file (specified in the Composition Settings), and the other is for specifying a full path to the file.

 

The FusionPro.Composition.OpenNewOutputFile() function can be called in OnRecordStart, either unconditionally, to put each record into its own output file (chunk), or conditionally, based on any (arbitrary) condition the template designer wants, though usually it's triggered by something like a field value changing (like in this case). This is called "dynamic chunking" or "arbitrary chunking", where you can have any arbitrary number of records in each output file (chunk). This is a newer feature, which mostly supersedes the older static chunking. Note that you can specify either just a file name or a full path and file name in the call to FusionPro.Composition.OpenNewOutputFile(); if it's just a file name, then the file will be created in the same folder as the nominal output file (specified in the Composition Settings).

 

In this case, you're doing arbitrary chunking, where there's no set number of records per output file, so you need to use the latter approach.

Unless you're specifically trying to move different PDFs to different folders I'm not sure why you're trying this method though. Couldn't you just do the OpenNewOutputFile and point your composition output to the folder you want?

Well, yes, you do need to call FusionPro.Composition.OpenNewOutputFile(). But as noted above, you can decide whether to just give it a file name, in which case the file will be created in the same folder as the nominal output file specified in the Composition Settings, OR you can give it a full path, and the file will be created at that path (and you could also specify different folders for different output files if you want).

Edit:

 

Looks like you could just do:

if (FieldChanged("Member No")){
FusionPro.Composition.OpenNewOutputFile("/Volumes/Jobs/ABOTA/" + Field("Member No") + "." + FusionPro.Composition.outputFormatExtension);
}

That seems right to me, if you want to hard-code the output path in the rule. Or, you could set specify a file with that same path as the Output file for the job in the Composition Settings, then the rule can be just this:

if (FieldChanged("Member No"))
   FusionPro.Composition.OpenNewOutputFile(Field("Member No") + "." + FusionPro.Composition.outputFormatExtension);

I recommend the latter, especially since, if you forget to actually mount the SMB drive from the remote file server, you'll get an error message before you start composing. Also, if you want to change where the output goes, it's easier to change it in the Composition Settings than to find it in a rule. It's also more obvious for whomever might come along later and run this job and wonder why the output isn't going into the folder they're specifying in the Composition Settings.

Link to comment
Share on other sites

I don't have any experience with Producer. I assumed we were talking about Creator.

 

The path name is going to be different than if it were on a Mac. I believe you'll need to have the share mapped to a drive and use "Z:\\ABOTA\\"

 

I'm sure there's some other way with string replacement to always get the jobs to go to your intended folder, but I don't have access to the documentation. This might be a case where you need to contact support.

Link to comment
Share on other sites

On our system, no matter what we put in the composition settings, the files always go to the FusionPro Server. Is there a way to change this? We are using Producer Direct 10.

I'm confused a bit by your terminology, and I'm not sure I understand your workflow. Are you saying that you always submit the job to FusionPro Producer?

 

Anyway, yes, if you're composing via Producer, then things are a little different.

 

As mentioned before, if you specify a full path to the output file in a rule, that completely overrides whatever output file path you have specified in the Composition Settings. However, if you're composing to FusionPro Producer, that path in the Composition Settings gets overridden by the working folder path on the Producer Scheduler machine by default. This is by design, so that Producer can keep track of the output file and delete it when the rest of the job is deleted.

 

Long story short, when composing via Producer, unless you override the output path in a rule, your output file is always going to be made on the Producer machine.

Link to comment
Share on other sites

Also, as Scott notes, when you're composing via Producer, the composition is happening on a Windows machine, so the path specification to a network drive folder will almost certainly be different than it is from your Mac. However, I think Scott is mistaken about using a mapped drive, because those are specific to logged-on users, while Producer jobs are composed in a Service context. So you'll need to figure out a valid UNC path to the file server for the Windows-based composition. UNC paths generally start with two backslashes, and since backslashes need to be escaped in JavaScript, you need four in a rule. Also, you'll need to consult with your own IT people to determine the correct UNC path, and they will have to make sure that the account under which the Producer jobs are running has write access to that path. (Our Support people can't manage your network settings.)

 

I can tell you that you can use the properties FusionPro.isMac and FusionPro.isWindows to do things conditionally in a rule based on the platform. (You can also switch off of FusionPro.Composition.isBatch to determine whether you're in a Server or Producer composition versus a Creator composition.) So, while, again, I can't tell you exactly what the UNC path on your network is, your rule probably needs to do something like this:

if (FieldChanged("Member No"))
{
   var fileName = Field("Member No") + "." + FusionPro.Composition.outputFormatExtension;

   var filePath = "/Volumes/Jobs/ABOTA/" + fileName; // Mac; volume must be mounted
   if (FusionPro.isWindows)
       filePath = "\\\\192.168.200.72\\Jobs\\ABOTA\\" + fileName; // Windows; UNC path must be available and writable by Producer

   FusionPro.Composition.OpenNewOutputFile(filePath);
}

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...