Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Controller and Task Commands

0 views
Skip to first unread message

dhar...@rediffmail.com

unread,
Apr 7, 2006, 12:28:15 PM4/7/06
to
Hello
In addition to my earlier post, A more proper description to the problem is like this.

I have a Controller Command (FirstCmd) which is inturn calling a Task Command(SecondCmd). Now as per the WCS info center, all the task commands should extend the com.ibm.commerce.commands.TaskCommand and com.ibm.commerce.commands.TaskCommandImpl for the interface and the implementation resp. But in my case my SecondCmd is extending a Controller Command.
My question here is that can a Controller Command call another Controller command?.. if yes then how to handle access policies ? ..


regards
Dharmesh

Robert Brown

unread,
Apr 7, 2006, 8:27:11 PM4/7/06
to

1) Never call a controller command within a controller command, just
invoke task commands.
2) Each controller command is assigned its own policies for access
control (regardless of how it is invoked)
3) Each controller command should accept the URL parameter in the
request for redirection purposes (this URL can be another controller
command or a view command or another type of redirection)
4) You can assign access control policies on task commands (resource
level) but you rarely need to.

My recommendation is to pay attention to 3) since you are trying to run
two controller commands in the same request. Best to let the first
controller command return true and redirect to the second with URL as a
NVP argument.

R

john....@roche.com

unread,
Apr 20, 2006, 2:31:20 PM4/20/06
to
In agreement with the first replier you shouldn't directly call another ControllerCommand from within another controller command. Once the initial ControllerCommand has processed etc, simply use the URL (ECConstants.EC_URL I think???) and pass the name of the URLREG entry for the specified ControllerCommand. Each ControllerCommand should encapsulate related functional tasks defined by one or more TaskCommands... If you adhere to the design pattern you'll realize before long how great it really is. At first it may seem verbose, but as (or if) your custom command set grows you'll really appreciate the separation. Makes it very easy to troubleshoot, update, etc.
0 new messages