TS 6.7.2 SP2Win2K3I am working on customizing the OOTB import functionality. The requirement is to limit types of files and file sizes. I plan to do this through customizing the menus, calling the import link and using the done_page parameter to run a perl script to do my customizations. I have read in the customization user guide and on these forums that this is an approach that should work and be supported. Before I build my own ipl file, I thought I would check the forum to see if anybody has done something similar and wouldn't mind sharing code/put me on the right track.I did find one post that had some code related to this and have contacted that poster but wanted to put this question to the forum.Thanks
Thanks for replying to the post. I'm a bit stuck.I have a perl script working (just a test script getting called and writing to a log for now and displaying a message) from the done page parameter.I basically want to pass what file is imported as a parameter to my perl script and then run validation on it to check file type and size and reject the import if it's too big/unallowed format. I'm not sure passing the imported page as a variable is possible. Page 93 of the User Interface Customization Guide states "A CGI located in iw-home/httpd/iw-bin can be accessed by custom menu items.When invoked, all files that the user has currently selected in the invoking GUI will, bydefault, be passed as TeamSite vpath parameters to the CGI in an array.If the user has selected no files and the script is being invoked from ContentCenterProfessional, then the user’s current directory is passed as a vpath parameter."I'm not sure this is working in my scenario. Any advice greatly appreciated!Here is the link from my ui_custom.xmllabel="Import CGI 3"description="Import CGI"url="/iw-cc/import?vpath=/default/main/Development/Dev_Test/WORKAREA/work/sites/dev_test_eng/images&done_page=/iw-bin/simple_testing.ipl?param1=param1¶m2=param2"addPropertiesToUrl="false">The vpath is hardcoded for now. I will need to eventually put a variable for that as well.
I basically want to pass what file is imported as a parameter to my perl script and then run validation on it to check file type and size and reject the import if it's too big/unallowed format.
To Boris:Since this is import, there will never be a file checked prior to importing. That is not part of my idea. I was referring to passing the imported page as a variable to my perl script once the import is done. Perhaps it can't be done. I don't really want to create my own custom import page (I just want a script to clean up what was already imported) but maybe that's what I will have to do.I will definitely look into your suggestions, thanks for those. I really like the idea of scanning the directory and deleting the files that don't meet my criteria and then notifying the user. This might solve my problem.To taalgaard:Thanks for the suggestion. I'm not keen on using the File Server Resource Manager because I think it will have to be installed on the server(s) and to install something on servers in my environment, I need to go jump over many large hurdles. Also, notifying the user is a key part of this requirement.
So I can successfully scan the directory after import and delete large files (I will share my full solution later), however my vpath is currently hard coded. I need to be able to dynamically get the vpath and pass it, something like:url="/iw-cc/import?vpath=dynamicvpath&done_page=/iw-bin/my_script.ipl?vpath=dynamicvpathPreviously we have determined vpath from inside a workflow object or when using DCRs. However there is neither here. Any advice?Thanks
Thanks...I have been playing with that however can't seem to get anything I can use. All the environment variables:key: COMSPEC: C:\WINDOWS\system32\cmd.exekey: DOCUMENT_ROOT: E:/iw-home/iw-webd/htdocskey: GATEWAY_INTERFACE: CGI/1.1key: HTTP_ACCEPT: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*key: HTTP_ACCEPT_LANGUAGE: en-cakey: HTTP_CONNECTION: Keep-Alivekey: HTTP_COOKIE: iw_user=data; iw_which_ui=; iw_domain=data; IWAUTH=datakey: HTTP_HOST: datakey: HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)key: IWUSER: datakey: PATH: C:\Program Files\Support Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Interwoven\lib;E:\iw-home\bin;E:\iw-home\sqljdbc.jar;C:\Program Files\Windows Imaging\key: PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSHkey: QUERY_STRING: file=vpathkey: REMOTE_ADDR: datakey: REMOTE_PORT: datakey: REQUEST_METHOD: GETkey: REQUEST_URI: /iw-bin/simple_testing.ipl?file=vpathkey: SCRIPT_FILENAME: E:/iw-home/httpd/iw-bin/simple_testing.iplkey: SCRIPT_NAME: /iw-bin/simple_testing.iplkey: SCRIPT_URI: data/iw-bin/simple_testing.iplkey: SCRIPT_URL: /iw-bin/simple_testing.iplkey: SERVER_ADDR: datakey: SERVER_ADMIN: you@yourdomain.comkey: SERVER_NAME: datakey: SERVER_PORT: datakey: SERVER_PROTOCOL: HTTP/1.1key: SERVER_SIGNATURE: datakey: SERVER_SOFTWARE: Apache/2.0.63 (Win32) mod_ssl/2.0.63 OpenSSL/0.9.8ekey: SYSTEMROOT: C:\WINDOWSkey: WINDIR: C:\WINDOWSAnd when I try to get the form data, all I can get at is the passed parameter, which of course is still empty (unless I hard code it).I think I may run into a problem generating that dynamic vpath for the initial import vpath parameter. Still troubleshooting.
I said I would update when working. I got it to work by:- Custom import link in ui_custom.xml that links to a perl script. This perl script basically serves to just record the vpath and pass it along to the teamsite import command and done page parameter- use the done page parameter of the import url command to call another perl script that scans the vpath directory and removes the file (and notifies user) based on business requirements (file size).However, the requirement just changed so I have to change it. Of course, isn't that always the case!Also I should note that it works differently in ccstd (more OOTB steps) but it still works (and of course additional customizations in ui_custom). Visual Preview Toolbar also has import, I've yet to test through that method.