On Wed, 01 May 2013 09:27:20 -0700, Singh, Gurbeer <[email protected]> wrote:
> Hmm , I am planning to write one validation, before I take User request. > > Like below file or password protected word file, of file with track > changes. I know all these get fail while processing. > > My validation method will just check, it will fail or pass. If fail we > will ask user there itself "please upload correct file" > > > But at the same time, I think it from performance side, calling pipeline > twice ,first for validation then for actual submission will slow > submission process. > > Any other suggestion. I would say to optimize for the normal case of success, so that only the ones that fail actually pay the price. When you say pipeline, do you mean a CPF pipeline, or something more generic? If you are doing this in CPF, the what you can do is add an error-handling pipeline that has actions bound to the error states; it can check the error (which will be in the cpf:error property) and acts accordingly, presumably by sending some kind of message. If you mean this in a more general sense, I would still take the same approach: run as if you expect it to succeed, and return the error back only if it fails, possibly doing an extra check to determine why it failed first. //Mary _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
