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

java.lang.Object
  extended by com.sage.orion.sdata.servlet.accpac.BaseResourceKind
      extended by com.sage.orion.sdata.servlet.accpac.ViewResourceKind
          extended by com.sage.orion.sdata.servlet.accpac.ServiceResourceKind
All Implemented Interfaces:
ResourceKind

Deprecated. Use ViewResourceKind instead

@Deprecated
public class ServiceResourceKind
extends ViewResourceKind

This class extends ViewResourceKind and handles the $service requests.


Constructor Summary
ServiceResourceKind(ApplicationContext applicationContext, ResourceContext resourceContext)
          Deprecated. Constructor
 
Method Summary
protected  void addFieldCalculation(ResourceField field, CalculatesFieldProperty calculation)
          Specify an alternate method for calculating the value of this field.
protected  SDataViewSet createSDataViewSet(com.sage.accpac.sm.Program program, Resource resource)
          creates an instance of the SDataViewSet that will be used by the resource kind to access the underlying views.
protected static int getDefaultFeedCount()
          Gets the default number of entries to be returned by the resource kind.
protected static int getMaxFeedCount()
          Gets the maximum number of entries to be returned by the resource kind.
protected  SDataView getView(java.lang.String id)
          Gets the View with the given viewID from the list of all views within the resource.
 SDataViewSet getViewSet()
          gets the viewSet that holds the views that this resource kind uses.
protected  void removeFieldCalculation(ResourceField field)
          Removes the given calculated field from the calculated field map.
protected  void setFilter(SDataView view, java.lang.String theFilter, boolean ascending, int order)
          set the filter, direction and index for the given view
protected  Resource subresourceOfResourceElement(Resource parentResource, ResourceElement re)
          Return the resource corresponding to the resource element, or null if there is none.
 
Methods inherited from class com.sage.orion.sdata.servlet.accpac.ViewResourceKind
handleRequest, shutdown
 
Methods inherited from class com.sage.orion.sdata.servlet.accpac.BaseResourceKind
getApplicationContext, getInstance, getName, getResource, getResourceContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceResourceKind

public ServiceResourceKind(ApplicationContext applicationContext,
                           ResourceContext resourceContext)
Deprecated. 
Constructor

Parameters:
applicationContext - the application context in which the resource kind will live
resourceContext - the resource context in which the resource kind will live
Method Detail

getViewSet

public final SDataViewSet getViewSet()
gets the viewSet that holds the views that this resource kind uses.

This returns the same view set as is returned by createSDataViewSet(Program, Resource).

Do not call this method during construction of the kind.

Returns:
the viewSet
See Also:
createSDataViewSet(Program, Resource)

createSDataViewSet

protected SDataViewSet createSDataViewSet(com.sage.accpac.sm.Program program,
                                          Resource resource)
creates an instance of the SDataViewSet that will be used by the resource kind to access the underlying views. Override this method to create an application-specific subclass of the SDataViewSet class.

This implementation does not call this method during construction of the instance. This means that the subclass can use instance variables safely, without worrying if they have been initialized yet.

Parameters:
program - the Program for the views in the set
resource - the Resource corresponding to the top of the view set (the main resource).
Returns:
an SDataViewSet. Do not return null; throw an exception if something goes wrong.
See Also:
getViewSet()

addFieldCalculation

protected void addFieldCalculation(ResourceField field,
                                   CalculatesFieldProperty calculation)
Specify an alternate method for calculating the value of this field. If one is not specified, then the field's default calculation method will be used: for view fields, the value specified in the field will be used;

Parameters:
field - a ResourceField defining the name of the field that this is a calculation for
calculation - the calculation to be applied for the given field

removeFieldCalculation

protected void removeFieldCalculation(ResourceField field)
Removes the given calculated field from the calculated field map.

Parameters:
field - a ResourceField defining the name of the field that was specified in an earlier call to addFieldCalculation(ResourceField, CalculatesFieldProperty) .

subresourceOfResourceElement

protected Resource subresourceOfResourceElement(Resource parentResource,
                                                ResourceElement re)
Return the resource corresponding to the resource element, or null if there is none.

Parameters:
parentResource - the parent resource of which this is a sub-resource. This must be null if the resource element is the top resource element of the request
re - the resource element whose resource we want
Returns:
the resource corresponding to the resource element or null if there is none

getView

protected SDataView getView(java.lang.String id)
Gets the View with the given viewID from the list of all views within the resource.

Parameters:
id - the rotoid of the view
Returns:
the View.

setFilter

protected void setFilter(SDataView view,
                         java.lang.String theFilter,
                         boolean ascending,
                         int order)
set the filter, direction and index for the given view

Parameters:
view - the view whose properties are to be set
theFilter - the filter to be set, as an Accpac filter string
ascending - true if an only if the results are to be presented in ascending order according to the index
order - the number of the index or key that defines the order
Throws:
com.sage.accpac.sm.InvalidCharacterException - if the filter contains a character that cannot be mapped to the underlying code page

getDefaultFeedCount

protected static int getDefaultFeedCount()
Gets the default number of entries to be returned by the resource kind.

Returns:
the default number of entries to be returned by the resource kind.

getMaxFeedCount

protected static int getMaxFeedCount()
Gets the maximum number of entries to be returned by the resource kind.

Returns:
the maximum number of entries to be returned by the resource kind.


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