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)
regexes
Ottawa_IWOV
can validation regexes be used to validate against browse instanaces in a DCT (i.e. if a user browses for a picture, then tries to delete a directory off the path created from the browse instance)...
Thanks.
Lucas Cochrane
lcochrane@dc.com
Find more posts tagged with
Comments
Adam Stoller
validation-regex's are string-pattern-matching validations - thus, unless you can completely describe the pattern that this browse-filled field should have, you cannot do more than verify that it is non-empty (you can do a bit more than that, but ..)
You would not be able to verify, on-the-fly, that the path information in that field is a valid file system or area-relative path.
However, with FormAPI - you *might* be able to do that (I'm not a JavaScript wiz - so I'm not entirely sure what you can / cannot do with it) - but you run into at least a little complexity in that I believe the JavaScript code runs on the client-side and the path that you would be trying to validate is on the server-side. Again, I'm not saying it can't be done - but I don't think it's "trivial".
This kind of thing is much better to be handled as post-processing - like in an externaltask of a workflow, which could then send email notification back to the contributor and transition back to their task to have them correct information and re-process it.
--fish
(Interwoven Senior Technical Consultant)
Ottawa_IWOV
might you have an example of the sintax for the regex on a browse element. the dtd is not clear....it only shows a good example for the textarea element...
thanks again,
Lucas Cochrane
lcochrane@dc.com
Adam Stoller
I stand corrected - I hadn't really thought about the DTD when you posted your initial question, taking it on faith that there *was* a validation-regex associated with the browser element, as there is with text and textarea fields.
Apparently there is not.
What you can do is set initial-dir and ceiling-dir attributes to help constrain the directory traversals during browsing.
FormAPI may still be an option (again, taking into consideration the fact that I believe it runs on the client end whereas the directory will be on the server side).
Post-processing with a workflow's externaltask is certainly the *easiest* way of doing this though.
--fish
(Interwoven Senior Technical Consultant)