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

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.ExportService
All Implemented Interfaces:
ServiceOperation

public abstract class ExportService
extends BaseService

This is an abstract class to be used to create an service to Export files. By default the service will contain no request fields and 2 response fields - the responseURL and the sessionID. It is left up to the implementer to add any further request or response fields as desired.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sage.orion.sdata.servlet.BaseServiceOperation
BaseServiceOperation.FieldData, BaseServiceOperation.FieldNames
 
Field Summary
protected static java.lang.String EXPORT_RESPONSE_URL
          The response url where the exported file can be downloaded from.
protected static java.lang.String SESSIONID
          The caller needs to set the session ID as a cookie in before calling the export URL.
 
Constructor Summary
ExportService(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)
          Execute this service operation and then set the value for the response fields, if any.
protected abstract  java.io.InputStream getExportDataStream()
          Gets the data stream to be exported.
protected abstract  java.lang.String getFilename()
          Gets the filename to be displayed in the download dialog box on the client.
 
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, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPORT_RESPONSE_URL

protected static final java.lang.String EXPORT_RESPONSE_URL
The response url where the exported file can be downloaded from.

See Also:
Constant Field Values

SESSIONID

protected static final java.lang.String SESSIONID
The caller needs to set the session ID as a cookie in before calling the export URL. This will prevent the signon screen from appearing.

See Also:
Constant Field Values
Constructor Detail

ExportService

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

Parameters:
applicationContext -
resourceContext -
resource -
service -
viewSet - can be null
Method Detail

createRequestFields

protected java.util.List<ServiceField> createRequestFields(SDataRequest request)
Description copied from class: BaseServiceOperation
Create a list of input fields for Request.

Note that value for each field may not be initialized.

Specified by:
createRequestFields in class BaseServiceOperation
Parameters:
request - the SDataRequest, or null
Returns:
a list of service fields for Request, or return null or an empty list if no input fields are required.

createResponseFields

protected java.util.List<ServiceField> createResponseFields(SDataRequest request)
Description copied from class: BaseServiceOperation
Create a list of output fields for Response.

Note that value for each field may not be initialized.

Specified by:
createResponseFields in class BaseServiceOperation
Parameters:
request - the SDataRequest, or null
Returns:
a list of service fields for Response, or return null or an empty list if there are no output fields.

createTemplateFields

protected java.util.List<ServiceField> createTemplateFields(SDataRequest request)
Description copied from class: BaseServiceOperation
Create a list of fields for Template.

The list must be the same as (or a subset of) request fields and each field has been initialized with default value

Specified by:
createTemplateFields in class BaseServiceOperation
Parameters:
request - the SDataRequest
Returns:
a list of service fields for Template, or return null or an empty list if there are no such fields.

execute

protected java.util.List<ServiceField> execute(SDataResourceElement payload,
                                               SDataRequest request,
                                               AsyncStatusListener listener)
Description copied from class: BaseServiceOperation
Execute this service operation and then set the value for the response fields, if any.

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, or return null or an empty list if there are no output fields.

getExportDataStream

protected abstract java.io.InputStream getExportDataStream()
Gets the data stream to be exported.

Returns:
the InputStream to be exported.

getFilename

protected abstract java.lang.String getFilename()
Gets the filename to be displayed in the download dialog box on the client.



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