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

java.lang.Object
  extended by com.sage.orion.sdata.servlet.accpac.ViewHelper

public final class ViewHelper
extends java.lang.Object

This class is designed to contain helper routines for the Accpac view Resource Kinds.

See Also:
SDataView

Field Summary
static java.lang.String VIEW_PATTERN
          The regular expression for a view roto id
 
Method Summary
static void composeViews(java.util.Collection<SDataView> viewList)
          Attempt to inter-compose all the views in the collection.
static com.sage.orion.sdata.servlet.accpac.ResponseEntry.KeyStack getSDataViewKeys(java.util.List<SDataView> viewList, boolean isCurrent)
          returns a KeyStack corresponding to the view list
static java.util.List<SDataView> getViews(Resource first, java.util.List<ResourceElement> path, SDataViewSet views)
          return a list of SDataView elements corresponding to the resource path presented
static java.lang.String valueAsString(com.sage.accpac.sm.view.IViewField field)
          Return the value of a ViewField as a string, until such times as the SAJava does it for us
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_PATTERN

public static final java.lang.String VIEW_PATTERN
The regular expression for a view roto id

See Also:
Constant Field Values
Method Detail

valueAsString

public static java.lang.String valueAsString(com.sage.accpac.sm.view.IViewField field)
Return the value of a ViewField as a string, until such times as the SAJava does it for us

Parameters:
field - the field whose value is to be returned
Returns:
a String containing the result

composeViews

public static void composeViews(java.util.Collection<SDataView> viewList)
Attempt to inter-compose all the views in the collection.

If the view composition list indicates that a particular view should be composed more than once, only the first instance of the view will be composed.

Parameters:
viewList - the collection of views to be composed

getViews

public static java.util.List<SDataView> getViews(Resource first,
                                                 java.util.List<ResourceElement> path,
                                                 SDataViewSet views)
return a list of SDataView elements corresponding to the resource path presented

Parameters:
first - the first resource (corresponding to the first element in the path)
path - the resource path to follow (which may include special elements)
views - the mapping of resources to SDataViews set up by composition
Returns:
a non-null list of the elements

getSDataViewKeys

public static com.sage.orion.sdata.servlet.accpac.ResponseEntry.KeyStack getSDataViewKeys(java.util.List<SDataView> viewList,
                                                                                          boolean isCurrent)
returns a KeyStack corresponding to the view list

Parameters:
viewList - the list of views whose keys must be included. This is a list of views in the order of composition from parent to child (e.g. batch/header/detail/sub-detail)
isCurrent - set true for stateful operations so that 'current' keys will be used rather than the actual values
Returns:
a non-null KeyStack of the keys of the views


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