com.sage.orion.sdata.servlet.accpac
Class ViewProcessService

java.lang.Object
  extended by com.sage.orion.sdata.servlet.BaseServiceOperation
      extended by com.sage.orion.sdata.servlet.accpac.BaseService
          extended by com.sage.orion.sdata.servlet.accpac.ViewProcessService
All Implemented Interfaces:
ServiceOperation

public class ViewProcessService
extends BaseService

This class implements the process operation of an Accpac view. It expects at least one view to be specified, either in the service's definition or in the resource's definition. If there are views defined for both the service and the resource, the view defined for the service will be used.

The service's request fields will include all the view's fields except those read-only and calculated fields.

The service's response fields will include all the fields of the view.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sage.orion.sdata.servlet.BaseServiceOperation
BaseServiceOperation.FieldData, BaseServiceOperation.FieldNames
 
Field Summary
protected  SDataView view
          Deprecated. use getView() instead
 
Constructor Summary
ViewProcessService(ApplicationContext applicationContext, ResourceContextImpl resourceContext, Resource resource, Service service, SDataViewSet viewSet)
          Constructor
 
Method Summary
protected  java.util.List<ServiceField> createRequestFields(SDataRequest request)
          Create a list of input fields for Request.
protected  java.util.List<ServiceField> createResponseFields(SDataRequest request)
          Create a list of output fields for Response.
protected  java.util.List<ServiceField> createTemplateFields(SDataRequest request)
          Create a list of fields for Template.
protected  java.util.List<ServiceField> execute(SDataResourceElement payload, SDataRequest request, AsyncStatusListener listener)
          process the view and then set the value for each response field.
protected  SDataView getView()
          Get the SDataView on which the service is backed
 void shutdown()
          Release any resources allocated for this service operation.
 
Methods inherited from class com.sage.orion.sdata.servlet.accpac.BaseService
getApplicationContext, getName, getOperationName, getPath, getResource, getResourceContext, getService, getViewSet, isForMetaDataInquiry
 
Methods inherited from class com.sage.orion.sdata.servlet.BaseServiceOperation
getDescription, getResponseFields, getSchema, handleRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

@Deprecated
protected final SDataView view
Deprecated. use getView() instead
The SDataView on which the service is backed

Constructor Detail

ViewProcessService

public ViewProcessService(ApplicationContext applicationContext,
                          ResourceContextImpl resourceContext,
                          Resource resource,
                          Service service,
                          SDataViewSet viewSet)
Constructor

Parameters:
applicationContext - the application context in which the service operation will be run
resourceContext - the resource context in which the service operation will be run
resource - the resource on which the service operation will be performed
service - the service operation to be performed
viewSet - the SDataViewSet associated with the resource
Method Detail

getView

protected SDataView getView()
Get the SDataView on which the service is backed

Returns:
the non-null SDataView

createRequestFields

protected java.util.List<ServiceField> createRequestFields(SDataRequest request)
Create a list of input fields for Request.

The list of request fields will include all the view's fields except those read-only and calculated fields.

If the request is not stateful each field is also initialized with corresponding viewField's value.

Specified by:
createRequestFields in class BaseServiceOperation
Parameters:
request - the SDataRequest, which may be null
Returns:
a list of service fields for Request.

createResponseFields

protected java.util.List<ServiceField> createResponseFields(SDataRequest request)
Create a list of output fields for Response.

The list of response fields will include all the fields of the view. And each field has been initialized with corresponding viewField's value

Specified by:
createResponseFields in class BaseServiceOperation
Parameters:
request - the SDataRequest, which may be null
Returns:
a list of service fields for Response

createTemplateFields

protected java.util.List<ServiceField> createTemplateFields(SDataRequest request)
Create a list of fields for Template.

The list of template fields will include all the view's fields except those read-only and calculated fields. And each field has been initialized with corresponding viewField's default value.

Specified by:
createTemplateFields in class BaseServiceOperation
Parameters:
request - the SDataRequest
Returns:
a list of service fields for for Template

execute

protected java.util.List<ServiceField> execute(SDataResourceElement payload,
                                               SDataRequest request,
                                               AsyncStatusListener listener)
process the view and then set the value for each response field.

Specified by:
execute in class BaseServiceOperation
Parameters:
payload - the request (input) portion of the payload from the original SData request
request - the SDataRequest
listener - the AsyncStatusListener
Returns:
a list of service fields for response.

shutdown

public void shutdown()
Description copied from interface: ServiceOperation
Release any resources allocated for this service operation.

Specified by:
shutdown in interface ServiceOperation
Overrides:
shutdown in class BaseServiceOperation


Copyright © 2011 Sage Software, Inc. All rights reserved.