Page 1 of 1

Simplify folders if diferents users

Posted: Thu Oct 11, 2012 5:37 pm
by mcolmenero
hi,

I want to know to make a flow like this:

For example, I have thirty users and they leave a pdf and the flow convert the pdf in low quality, but when finish convert i want to leave the file in their user's folder.

Now i have made like one submit point, then converter pdf and then i made thirty folders (one for user) and i check the user to know in which folder leave it. I think that is possible simplification the flow, but i don't know how.

Thanks, best regards.

Miguel

Simplify folders if diferents users

Posted: Fri Oct 12, 2012 4:35 pm
by dkelly
With the exception of FTP Receive, Switch always moves the source files to the next flow element. They can not remain in the user's directory. To get this to work as you describe, Switch would have to track every file to insure it doesn't process the same file multiple times. In addition, since you created a low-res PDF and placed it back in the user's directory, Switch will see that as either a modified file or a new file and reprocess it.



You could create a subdirectory in each user's directory that either contains the original files or the created low-res. Then configure Switch's Submit hierarchy to scan only these sub-folders.



Dwight Kelly

Apago, Inc.

dkelly@apago.com

Simplify folders if diferents users

Posted: Mon Oct 22, 2012 11:42 am
by mcolmenero
hi,

Thanks, but I want after switch proccesed, i want to leave the file in user folder (i have 20 users). Now i have 20 folders and check the user and leave there.

Best Regards

Miguel

Simplify folders if diferents users

Posted: Mon Oct 22, 2012 9:04 pm
by Evan
Hi mcolmenero,



If I assume all your user folders are in the same folder you should use "Set hierarchy path" and "Archive hierarchy at the end of your flow.



For "Set hierarchy", choose replace in "Action" and use a variable for "Path segment 1" like "[Connection.FullUserName or [Connection.UserName]".



For "Archive hierarchy", choose for path the path of the folder containing all user folders and put a value of 5 for subfolder level.



if

path of the folder containing all user folders = /Volume/YourServer/Users

and

[Connection.FullUserName] = Joe Smith



Then your PDF will be put in:

/Volume/YourServer/Users/Joe Smith



If the folder of the "Path segment 1" do not exist, swith will create it.



--

Evan

Simplify folders if diferents users

Posted: Wed Oct 24, 2012 8:48 am
by mcolmenero
Hi,

Finally I have made a script where copy the file in respective folder.

This is the script

If somebody need it here you are.

Thanks for you help

Best regards

Miguel



This is the script:

function jobArrived( s : Switch, job : Job )

{

var rutaini

var rutafin

var folderPath = s.getPropertyValue("Ruta" );

var nombre = job.getName();//get file's name

rutaini=job.getPath();//original path;

var userotz=job.getUserName();

switch (userotz) {

case "user1": folderPath=folderPath+"/user1"; break;

case "user2": folderPath=folderPath+"/user2"; break;

case "user3": folderPath=folderPath+"/user3"; break;

case "user4": folderPath=folderPath+"/user4"; break;

case "user5": folderPath=folderPath+"/user5"; break;

case "user6": folderPath=folderPath+"/user6"; break;

case "user7": folderPath=folderPath+"/user7"; break;

...

case "userN": folderPath=folderPath+"/userN"; break;

}

rutafin=folderPath+nombre;//ruta fin

s.copy(rutaini,rutafin );

job.sendToNull(job.getPath());

}