Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Saving DCR into data subdirectory
RobH
Hello all,
I searched the devnet yesterday but I was unsuccessful at finding the answer to my query. Hopefully one of you can help. Here's the issue:
When a user saves a DCT, a script automatically takes the content of a field item (Filename) and uses it to name the file (it also adds a _e or _f depending on the language chosen). The file is automatically saved into the data folder. However, the client has several folders below the data folder (to help them organize their DCRs).
Is it possible to prompt the user as to which sub-folder to save within, or even better, if they launch the DCT from a subfolder, it would just save it there?
Thanks for looking!
Rob
Find more posts tagged with
Comments
chuckles
I suggest you read up on FormAPI. You can add a JavaScript listener to the onSaveDone event that will pop-up a CGI script that can do whatever you want. The IWDCRInfo object has a getDCRName() method that will tell the DCR name and your CGI can figure out what needs to be done or present the user with options. You can use a callServer if you want it to be transparent.
Adam Stoller
Actually - I don't think it's getDCRName() that is wanted - it's setDCRName()
There was no mention of which version of the product was being used - but if you're using 6.5 there's good coverage of what you probably need starting around page 22 of the FormAPI Developers Guide.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
RobH
Thanks for your help!
Yes, it is setDCRName. The only issue I'm facing now is how to get them to save into a subdirectory without me hard coding the directory in. I'd like for them to launch the DCT from the subdirectory they wish to save in, but I need to figure out how to find that subdirectory's name...
Any help would be appreciated.
TS 6.1
Adam Stoller
My standard answer these days - require that DCRs be created *through* a workflow process - and use the workflow process to determine the name and location of the DCR and handle page generation as well -- disable all such functionality in terms of standard OOTB menu functions so that the only way to do it is through the workflow.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
RobH
Thanks for the prompt response fish... I hacked around a bit more and found that you can do a the following to find the parent URL (TeamSite URL)
var parentURL = parent.location.href;
From that, you can get a massive URL that can be substringed to death until one can figure out if it's just the data folder, or if their is something after it.
And from that, I can take the folder (if it exists) and stick a "/" and the new DCR name into the setDCRName function.
After that, all is well.
Thanks everyone!
shanon
um, isn't there a function in FormAPI that will give you the vpath of the current DCR? Or at least the category and type? That would probably be easier than parent.opener.location or whatever you said above. Check out the formapi API listing..
Shanon Levenherz
Mercer eBusiness Team
shanon.levenherz@mercer.com
http://www.mercerhr.com
Adam Stoller
>> um, isn't there a function in FormAPI that will give you the vpath of the current DCR? Or at least the category and type?
There's a hack for 5.5.2.
There's a different hack for 6.1.
There's a supported function for 6.5
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Edited by ghoti on 02/28/05 01:20 PM (server time).
Migrateduser
Seriously, what about what fish suggested? It's much cleaner and the method you mention is a hack (don't get me wrong, I LOVE hacks) and is unsupported. Even though it works in your current version, it might not in a future release / upgrade down the road and you'd be stuck reworking this thing again.
So, why not do the work once and implement a workflow solution?
Dave
Current Environment(s):
(1) TS 6.1 SP2 on W2K3
(2) TS 6.1 SP2 on W2K
shanon
oh, i agree with fish, don't get me wrong. i was just suggesting an alternative b/c i thought it was a published api call ( and it is in 6.5 )... i am of the belief that users should only be allowed to do what we ( the people behind the green curtain ) let them do. if you have to restrict DCR names and locations using workflow is a great way to go. i honestly feel that there should be an ootb solutions workflow for this...
e.g.
(1) new data record category/type cgi/wf cfg screen
(2) ext task: creation of dcr/ea's etc
- this ext task would have a hook for custom code here... like if you needed a dcr content id or something from a db, you could add it.
(3) edit the dcr cgi task.
- custom hook here too.
(4) preview/generate cgi task.
- custom hook for pre/post generation
(5) submit ...
that's just off the top of my head, but i figure something like that would be used all over the place... the custom hooks provide the implementation-specific entry points.
Shanon Levenherz
Mercer eBusiness Team
shanon.levenherz@mercer.com
http://www.mercerhr.com