|
Home > Archive > WebSphere Commerce suite > April 2006 > Controller and Task Commands
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Controller and Task Commands
|
|
|
| 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 i
nterface 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 2006-04-11, 10:18 am |
| > 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 ? ..
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
| |
|
| 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 o
f 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.
|
|
|
|
|