se.portfolio.scam.http.command
Class AbstractProcessModel

java.lang.Object
  extended byse.portfolio.scam.http.command.AbstractProcessModel
All Implemented Interfaces:
Command
Direct Known Subclasses:
CreateDefaultModel, UpdateLiveProperties

public abstract class AbstractProcessModel
extends Object
implements Command

Adds properties to a resource with values deduced from the context. Theese properties is only added if the resource does not exist in the repository. The resource is identified by the request attribute "uri" and the model containing the model for the resource is contained in a ModelBean.

Version:
$Revision: 1.5 $
Author:
Jöran
Created:
den 28 februari 2003

Constructor Summary
AbstractProcessModel()
           
 
Method Summary
abstract  CommandResponse execute(HttpServletRequest request, HttpServletResponse response)
          Execute the command.
 void init(Map args)
          Initialize the command with arguments.
protected  Model setCreatedDate(Resource resource, Model model)
          Set created date to today in a model for a resource.
protected  Model setModifiedDate(Resource resource, Model model)
          Set modified date for a resource, in a model, to today.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractProcessModel

public AbstractProcessModel()
Method Detail

execute

public abstract CommandResponse execute(HttpServletRequest request,
                                        HttpServletResponse response)
                                 throws HttpException
Execute the command.

Specified by:
execute in interface Command
Parameters:
request - holds information from the client.
response - holds response information sent to the client.
Returns:
Returns an CommandResponse object.
Throws:
HttpException - thrown in case of an exception during execution of the command.

init

public void init(Map args)
Initialize the command with arguments.
Override this method if initialization is reqired

Specified by:
init in interface Command
Parameters:
args - command arguments.

setCreatedDate

protected Model setCreatedDate(Resource resource,
                               Model model)
Set created date to today in a model for a resource.
The date is set if the property is missing or contains an empty value.

Parameters:
resource - Associate the date to this reosurce
model - Set the date in this model
Returns:
an updated model

setModifiedDate

protected Model setModifiedDate(Resource resource,
                                Model model)
Set modified date for a resource, in a model, to today.

Parameters:
resource - associate the date to this resource
model - set date in this model
Returns:
an updated model


Copyright © 2003 SCAM. All Rights Reserved.