|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.accpac.sm.view.AbstractGettableByField
com.sage.accpac.sm.view.AbstractSettableByField
com.sage.accpac.sm.View
@NotThreadSafe public class View
Represents a ASage 300 ERPview
An object of this class can be created directly by an application (possibly
by sub-classing) or it can be obtained from the Program
or DBLink
object's openIView method.
Objects of this class are not thread-safe.
The caller must call the dispose
method when finished with
the object so that all its resources can be released. The caller must not
call any other method on the object after calling dispose.
After calling a method the application should check that the program's error
stack is still clear. The view may very well add information to the call
stack and still return success. If a method returns a SuccessLevel then if
the level is Success there should not be any errors on the program's stack
(but that is not guaranteed). If it returns Warning then the caller should
check the program's error stack.
Nested Class Summary | |
---|---|
static class |
View.FilterOrigin
Specifies the origin from where a filter should be applied |
static class |
View.OpenDirectives
Indicates the method to be used when opening a view. |
static class |
View.OpenModes
The set of values that can be used to make the mode passed when opening a view. |
static class |
View.Protocol
Protocols |
static class |
View.RecordGenerateMode
The mode passed to recordGenerate(com.sage.accpac.sm.View.RecordGenerateMode) |
static class |
View.ReferentialIntegrity
Indicates the referential integrity setting of a view |
static class |
View.RotoType
Indicates the type of a view. |
static class |
View.Security
Security values which indicate the functionality the user is permitted to access on the view. |
static class |
View.SystemAccess
Indicates the current access mode of a view |
Constructor Summary | |
---|---|
View(DBLink parent,
java.lang.String rid)
Constructs an instance of the View class for the given roto id on
the given link . |
|
View(DBLink parent,
java.lang.String rid,
int modes,
int prefetch,
int directives)
Constructs an instance of the View class for the given roto id on
the given link using the given mode, directives and
prefetch. |
|
View(Program program,
java.lang.String rid)
Simple constructor based on Program |
|
View(Program program,
java.lang.String rid,
int modes,
int prefetch,
int directives)
constructor based on Program |
Method Summary | |
---|---|
void |
addNotificationListener(NotificationListener l)
Add the given listener. |
void |
autocompose(View... views)
composes the supplied list of views against this view, passing them in the correct order. |
java.lang.Object[] |
blkGet(int... fieldIDs)
obtain the values of several fields |
void |
blkPut(boolean verify,
int[] fieldIDs,
java.lang.Object[] values)
Change the field values of multiple fields |
void |
browse(java.lang.String filter,
boolean isAscending)
Starts a query and establishes the direction for subsequent calls that fetch records from the view. |
void |
cancel()
cancels any unsaved changes in the view's revision list. |
void |
compose(View... views)
composes the supplied list of views against this view. |
protected static com.sage.accpac.sm.DBLinkImpl |
confirmNativeDBLink(DBLink parent)
check that the DBLink has enough package-private capability |
protected ViewField |
createField(int index,
int id,
java.lang.String name)
create an instance of the ViewField class corresponding to the
zero-based index of the field within this view. |
static void |
createTables(DBLink link,
java.lang.String rid)
Create the view's tables on the link's current database connection |
static void |
createTables(Program program,
java.lang.String rid)
Create the view's tables on the program's current database connections |
void |
delete()
Deletes the current record from the database |
void |
dispose()
Closes the view and releases all resources used by the object. |
protected void |
doBrowse(java.lang.String filter,
boolean ascending)
Thread-safe |
static void |
dropTables(DBLink link,
java.lang.String rid)
Drop the view's tables on the link's current database connection |
static void |
dropTables(Program program,
java.lang.String rid)
Drop the view's tables on the program's current database connections |
void |
filterDelete(java.lang.String filter)
Deletes the set of records that satisfy the supplied filter, including all children. |
void |
filterSelect(java.lang.String filter,
boolean isAscending,
int order,
View.FilterOrigin origin)
Starts a query and establishes the direction for subsequent calls that fetch records from the view. |
protected void |
finalize()
overrides the finalize method of object so that the dispose gets called if it hasn't already |
int |
getCombinedFilterCount(java.lang.String transientFilter)
Gets the number of records in the view that match a filter in combination with the current persistent browse filter |
java.util.List<java.lang.String> |
getComposites()
Gets a list of IDs of the views that the caller may explicitly compose. |
java.lang.String[] |
getDefiningKeyValues()
gets the values of the fields that define the current record relative to its header (if any). |
java.lang.String[] |
getDefiningKeyValues(int key)
Deprecated. |
java.lang.String |
getDescription()
Description of the view |
boolean |
getDirty()
Indicates whether the current record is dirty. |
java.lang.String |
getETag()
gets the Edit Tag for the record. |
boolean |
getExists()
Indicates whether the current (primary?) key field values identify an existing record in the database |
IViewField |
getField(int field)
gets the given field |
IViewField |
getField(java.lang.String field)
gets the given field |
HasFieldAttributes |
getFieldAttributes(int field)
gets the attributes of the given field |
HasFieldAttributes |
getFieldAttributes(java.lang.String field)
gets the attributes of the given field |
ViewFields |
getFields()
Deprecated. |
int |
getFilterCount(java.lang.String filter)
Gets the number of records in the view that match the filter |
protected Gettable |
getGettableByIndex(int field)
the subclass provides the requested Gettable for the given field |
protected Gettable |
getGettableByName(java.lang.String field)
the subclass provides the requested Gettable for the given field |
boolean |
getHasUnpostedRevisions()
Gets a value indicating whether there are unposted revisions in the view |
boolean |
getInstanceNoncascading()
Gets the Noncascading mode flag |
boolean |
getInstanceNonheritable()
Gets whether the composite views implicitly opened by the current view inherit the additional parameters of the current view when it was opened. |
int |
getInstancePrefetch()
Gets the number of records fetched at a time, if the view was opened read-only |
int |
getInstanceProtocol()
Gets the view's protocol |
boolean |
getInstanceRawPut()
Reserved |
boolean |
getInstanceReadOnly()
gets whether the view is opened in read-only mode |
boolean |
getInstanceUnrevisioned()
Gets whether revisioning is suppressed. |
boolean |
getInstanceUnValidated()
Gets whether validation is suppressed. |
IProgram |
getIProgram()
Gets the IProgram under which this View object is. |
IViewKey |
getKey(int index)
Gets the key with the given zero-based index. |
ViewKeys |
getKeys()
Deprecated. |
int |
getOrder()
gets the current order or key number. |
DBLink |
getParent()
gets the DBLink that this is a view under |
Program |
getProgram()
Gets the Program under which this View object is. |
View.ReferentialIntegrity |
getReferentialIntegrity()
gets the current referential integrity flag of the view |
View.Security |
getSecuritySettings()
Deprecated. |
protected Settable |
getSettableByIndex(int field)
the subclass provides the requested Settable for the given field |
protected Settable |
getSettableByName(java.lang.String field)
the subclass provides the requested Settable for the given field |
View.SystemAccess |
getSystemAccess()
gets the current system access mode of the view |
java.util.Date |
getTemplateDate()
gets the template date of the view |
java.lang.String |
getTemplateVersion()
gets the template version of the view |
View.RotoType |
getType()
Gets the view type |
IViewFields |
getViewFields()
Gets the collection of fields for
the view. |
java.lang.String |
getViewID()
Gets the view ID of the current view. |
IViewKeys |
getViewKeys()
Gets the collection of keys |
ViewSecurity |
getViewSecurity()
Gets the ViewSecurity settings that list the access rights the
current user has on the view. |
boolean |
goBottom()
goes to the bottom (last) record defined by the current query. |
boolean |
goNext()
goes to the next record defined by the current query. |
boolean |
goPrev()
goes to the previous record defined by the current query. |
boolean |
goTop()
goes to the top (first) record defined by the current query. |
boolean |
goToQueryRecord(java.lang.String filter)
Goes to the record identified by the combination of the given filter and the current persistent filter. |
void |
insert()
Inserts the current record into the database. |
boolean |
isNotification()
Returns true if and only if the view instance was created with the ability to handle notifications. |
void |
post()
Posts unsaved changes to the view. |
void |
post(ThreadEventListener listener)
Performs view-specific posting on a separate thread |
int |
process()
Performs view-specific processing |
int |
process(MeterEventListener meterListener)
Performs view-specific processing which may raise a meter, providing a listener for the meter. |
void |
process(ThreadEventListener listener)
Performs view-specific processing on a separate thread |
void |
putDefiningKeyValues(java.lang.String[] values)
sets the values of the fields that define the current record relative to its header (if any). |
void |
putDefiningKeyValues(java.lang.String[] values,
int key)
Deprecated. |
boolean |
read()
Locates and retrieves the record in the view according to the key field values of the current record. |
boolean |
read(boolean lockRecord)
Locates and retrieves the record in the view according to the key field values of the current record. |
void |
recordClear()
Blanks, zeroes or defaults the fields in the view. |
void |
recordGenerate(View.RecordGenerateMode mode)
Generate a unique nonexistent key, and blanks, zeroes or defaults the remaining fields in the view. |
void |
refreshSchema()
informs the view that the caller has reason to suppose that the schema has changed, in particular the list of fields and keys. |
void |
removeNotificationListener(NotificationListener l)
Remove the given listener. |
void |
revisionCancel(int level)
Rolls back any pending changes to the specified revision level |
boolean |
revisionExists(int level)
Checks whether the current record exists within the specified revision level |
void |
revisionPost(int level)
Commits any changes to the specified revision level |
boolean |
revisionUnposted(int level)
Checks whether the specified revision level has unposted changes |
void |
setETag(java.lang.String tag)
Sets the Edit Tag for the record. |
void |
setOrder(int order)
Sets the current selected key on the view. |
void |
setReferentialIntegrity(View.ReferentialIntegrity value)
sets the current referential integrity flag of the view |
void |
setSystemAccess(View.SystemAccess value)
sets the current system access mode of the view |
static void |
shutdownExecutor()
shut down the executor being used for calls in separate threads |
boolean |
supportsETag()
Returns whether the view supports ETags. |
void |
tableEmpty()
Deletes all records in the database table in the fastest way possible |
java.lang.String |
toString()
|
void |
unlock()
Unlocks a record previously locked by Modifiable.read(boolean) |
void |
update()
Updates the current record into the database. |
boolean |
verify()
Validates the field values of the current record |
Methods inherited from class com.sage.accpac.sm.view.AbstractSettableByField |
---|
set, set, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigDecimal, setBoolean, setBoolean, setBoolean, setBoolean, setBytes, setBytes, setBytes, setBytes, setDate, setDate, setDate, setDate, setDouble, setDouble, setDouble, setDouble, setInt, setInt, setInt, setInt, setShort, setShort, setShort, setShort, setString, setString, setString, setString, setTime, setTime, setTime, setTime |
Methods inherited from class com.sage.accpac.sm.view.AbstractGettableByField |
---|
get, get, getBigDecimal, getBigDecimal, getBoolean, getBoolean, getBytes, getBytes, getDate, getDate, getDouble, getDouble, getInt, getInt, getShort, getShort, getString, getString, getTime, getTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.sage.accpac.sm.view.SettableByField |
---|
set, set, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigDecimal, setBoolean, setBoolean, setBoolean, setBoolean, setBytes, setBytes, setBytes, setBytes, setDate, setDate, setDate, setDate, setDouble, setDouble, setDouble, setDouble, setInt, setInt, setInt, setInt, setShort, setShort, setShort, setShort, setString, setString, setString, setString, setTime, setTime, setTime, setTime |
Methods inherited from interface com.sage.accpac.sm.view.GettableByField |
---|
get, get, getBigDecimal, getBigDecimal, getBoolean, getBoolean, getBytes, getBytes, getDate, getDate, getDouble, getDouble, getInt, getInt, getShort, getShort, getString, getString, getTime, getTime |
Constructor Detail |
---|
public View(DBLink parent, java.lang.String rid, int modes, int prefetch, int directives)
View
class for the given roto id on
the given link
using the given mode, directives and
prefetch.
Call dispose()
when finished with the instance.
parent
- the DBLink on which the view is opened.rid
- the rotoid (e.g. BK0001) of the view. This must be six
characters long once trimmed.modes
- an integer value containing a set of flags that control
behaviour. See View.OpenModes
.prefetch
- the number of records to pre-fetch when the view is opened (0 to
63)directives
- specifies how the view should be used. See
View.OpenDirectives
. dispose()
,
View.OpenDirectives
,
View.OpenModes
public View(Program program, java.lang.String rid, int modes, int prefetch, int directives)
Call dispose()
when finished with the instance.
program
- the Program on which the view is opened.rid
- the roto id (e.g. BK0001) of the view. This must be six
characters long once trimmed.modes
- an integer value containing a set of flags that control
behaviour. See View.OpenModes
.prefetch
- the number of records to pre-fetch when the view is opened (0 to
63)directives
- specifies how the view should be used. See
View.OpenDirectives
.dispose()
,
View.OpenDirectives
,
View.OpenModes
public View(DBLink parent, java.lang.String rid)
View
class for the given roto id on
the given link
.
The instance is constructed with default modes, directives and prefetch count.
Call dispose()
when finished with the instance.
parent
- the link
on which the view is opened.rid
- the roto id (e.g. BK0001) of the view. This must be six
characters long once trimmed.dispose()
public View(Program program, java.lang.String rid)
Call dispose()
when finished with the instance.
program
- the Program on which the view is opened.rid
- the roto id (e.g. BK0001) of the view. This must be six
characters long once trimmed.dispose()
Method Detail |
---|
protected static com.sage.accpac.sm.DBLinkImpl confirmNativeDBLink(DBLink parent)
DBLink
has enough package-private capability
parent
- a {DBLink} that we need to check is actually a native one
public void dispose()
dispose
in interface HasDispose
dispose
in interface IView
public java.lang.String toString()
toString
in class java.lang.Object
public void addNotificationListener(NotificationListener l)
InstanceNotify
directive specified (e.g. using the
extended
constructor).
addNotificationListener
in interface IView
l
- the NotificationListener
to be addedIView.removeNotificationListener(com.sage.accpac.sm.NotificationListener)
,
NotificationListener
public void autocompose(View... views)
compose
function. OE0520 has a compositeNames list of OE0500, OE0680, OE0180, OE0740, OE0526 and OE0522.
View oe0520 = s.getView("OE0520"); Views[] va = new Views[2]; va[0] = s.getView("OE0180"); va[2] = s.getView("OE0500"); oe0520.compose(va);
View oe0520 = s.getView("OE0520"); View oe0500 = s.getView("OE0500"); View oe0180 = s.getView("OE0180"); oe0520.compose(oe180, oe0500);
autocompose
in interface Composable
views
- var-args list of or array of Views to be composed against this
view. It is permissible to provide more views than are needed;
the excess will be ignored.getComposites
public java.lang.Object[] blkGet(int... fieldIDs)
This behaves equivalently to multiple calls to AbstractGettableByField.get(int)
.
blkGet
in interface GettableByField
fieldIDs
- variable length list or array of the ids of the fields to be
fetched
java.lang.NullPointerException
- if dispose()
has been called on the view.get by numeric id
,
get by field name
public void blkPut(boolean verify, int[] fieldIDs, java.lang.Object[] values)
blkPut
in interface SettableByField
verify
- specifies whether the values should be verified at this stagefieldIDs
- the ids of the fieldsvalues
- the values. There must be at least as many as there are fieldIDs
java.lang.NullPointerException
- if dispose()
has been called on the view.
java.lang.IllegalArgumentException
- if there are fewer values than fieldIDs
UncheckedCharacterCodingException
- if there is a conversion error. It will be a
InvalidCharacterException
if one of the inputs is a
string that contains a character that cannot map to the
character set of the session. It will be a
DamagedStringException
if one of the inputs is a string
that is actually not a valid string (for example contains a
trailing character without its leading character)
StringTooLongException
- if one of the objects passed in will not fit in the number of
bytes specified by its typeAbstractSettableByField.set(int, Object)
public void browse(java.lang.String filter, boolean isAscending)
browse
in interface HasOrder
filter
- string containing the filter expression that restricts the
records that will be retrieved.isAscending
- boolean value indicating whether subsequent records will be
fetched in ascending or descending order. Calling browse does
not change the ordering of records being fetched from the view.
To control the ordering, use the setOrder() method to select a
key.HasOrder.filterSelect(java.lang.String, boolean, int, com.sage.accpac.sm.View.FilterOrigin)
,
Navigable.goNext()
,
Navigable.goPrev()
public void cancel()
cancel
in interface HasRevisionListSupport
public void compose(View... views)
OE0520 has a compositeNames list of OE0500, OE0680, OE0180, OE0740, OE0526 and OE0522.
View oe0520 = s.getView("OE0520"); Views[] va = new Views[3]; va[0] = s.getView("OE0500"); va[1] = null; va[2] = s.getView("OE0180"); oe0520.compose(va);
View oe0520 = s.getView("OE0520"); View oe0500 = s.getView("OE0500"); View oe0180 = s.getView("OE0180"); oe0520.compose(oe0500, null, oe0180);
DO NOT DO THIS; the second argument should be a third argument.
View oe0520 = s.getView("OE0520"); View oe0500 = s.getView("OE0500"); View oe0180 = s.getView("OE0180"); oe0520.compose(oe0500, oe0180);
compose
in interface Composable
views
- var-args list of or array of Views to be composed against this
view. The views in the list/array must be in the same order as
the list returned by Composable.getComposites()
with null references
used as place-holders for those views that are not being
provided. The trailing null references may be excluded. It is
permissible to provide more views than are needed; the excess
will be ignored.getComposites
public static void createTables(DBLink link, java.lang.String rid)
link
- the link on which to create the tablesrid
- the Roto Id of the view whose tables are to be createdpublic static void createTables(Program program, java.lang.String rid)
program
- the program on which to create the tables. If the view is not
one of the standard Sage 300 ERP views and is a view on the
system database then use the
link-based overload
.rid
- the Roto Id of the view whose tables are to be createdpublic void delete()
delete
in interface Modifiable
public static void dropTables(DBLink link, java.lang.String rid)
link
- the link on which to drop the tablesrid
- the Roto Id of the view whose tables are to be droppedpublic static void dropTables(Program program, java.lang.String rid)
program
- the program on which to drop the tables. If the view is not one
of the standard Sage 300 ERP views and is a view on the system
database then use the
link-based overload
.rid
- the Roto Id of the view whose tables are to be droppedpublic void filterDelete(java.lang.String filter)
filterDelete
in interface IView
filter
- the filter to be applied. If the filter is a null reference or
an empty or blank string this corresponds to matching all
records.public void filterSelect(java.lang.String filter, boolean isAscending, int order, View.FilterOrigin origin)
filterSelect
in interface HasOrder
filter
- A filter that restricts the records that will be retrieved.isAscending
- Indicates whether subsequent records will be fetched in
ascending or descending order.order
- The key index to select on the view.origin
- The range of records the filter would affect.public java.util.List<java.lang.String> getComposites()
getComposites
in interface Composable
compose
.Composable.compose(View...)
public java.lang.String getDescription()
getDescription
in interface HasViewAttributes
public boolean getDirty()
getDirty
in interface IView
true
if, and only if, the current record is dirtypublic boolean supportsETag()
IView.getETag()
or IView.setETag(java.lang.String)
will result in an
UnsupportedOperationException
.
supportsETag
in interface IView
true
if the view supports the ETag calls and false
otherwise.IView.getETag()
,
IView.setETag(String)
public java.lang.String getETag()
getETag
in interface IView
String
IView.supportsETag()
,
IView.setETag(String)
public boolean getExists()
getExists
in interface Readable
true
if, and only if, the record identified by the
(primary?) key exists in the database@Deprecated public ViewFields getFields()
ViewFields
of fields
for the view.
Note that the returned reference will become obsolete if
refreshSchema()
is called.
Deprecated - use getViewFields()
ViewFields
of the viewrefreshSchema()
public int getFilterCount(java.lang.String filter)
getFilterCount
in interface IView
filter
- the filter that defines which records to count
public int getCombinedFilterCount(java.lang.String transientFilter)
getCombinedFilterCount
in interface IView
transientFilter
- the filter to be combined with the persistent browse filter
public boolean goToQueryRecord(java.lang.String filter)
goToQueryRecord
in interface IView
filter
- the filter to apply (in combination with the persistent filter}
true
if a record was found.public boolean getHasUnpostedRevisions()
getHasUnpostedRevisions
in interface HasRevisionListSupport
true
if, and only if, the view has unposted revisionspublic java.lang.String[] getDefiningKeyValues()
A view can have a header view, a view that is a parent to this view. For example the header of a batch entry is the batch itself, and the header of an order detail line is the order itself. When putting data to the key fields there is generally no need to put to those fields that are references to the parent and indeed for some protocols doing so might result in an error.
Normally the header/detail relationship is defined by the primary key (key 0) but on some occasions there may be more than one header/detail relationship.
getDefiningKeyValues
in interface IView
IView.putDefiningKeyValues(java.lang.String[])
,
HasOrder.getOrder()
@Deprecated public java.lang.String[] getDefiningKeyValues(int key)
This method is deprecated. Use the IView.getDefiningKeyValues()
form
instead. If you truly have a use case for getting the defining values for
some order other than the current order please contact us and we can
consider undoing the deprecation of this method.
A view can have a header view, a view that is a parent to this view. For example the header of a batch entry is the batch itself, and the header of an order detail line is the order itself. When putting data to the key fields there is generally no need to put to those fields that are references to the parent and indeed for some protocols doing so might result in an error.
Normally the header/detail relationship is defined by the primary key (key 0) but on some occasions there may be more than one header/detail relationship.
getDefiningKeyValues
in interface IView
key
- the key that defines the header/detail relationship.
IView.putDefiningKeyValues(java.lang.String[])
public void putDefiningKeyValues(java.lang.String[] values)
A view can have a header view, a view that is a parent to this view. For example the header of a batch entry is the batch itself, and the header of an order detail line is the order itself. When putting data to the key fields there is generally no need to put to those fields that are references to the parent and indeed for some protocols doing so might result in an error.
Normally the header/detail relationship is defined by the primary key (key
0) but on some occasions there may be more than one header/detail
relationship. This method assumes that the current order (see
HasOrder.getOrder()
is the one that defines the relationship.
putDefiningKeyValues
in interface IView
values
- an array of Strings containing all the fields in the
order they appear in the key. The leading ones may be checked
against the header but will not be set. The defining ones will
be set.IView.getDefiningKeyValues()
@Deprecated public void putDefiningKeyValues(java.lang.String[] values, int key)
This method is deprecated. Use the IView.putDefiningKeyValues(String[])
form instead. If you truly have a use case for getting the defining values
for some order other than the current order please contact us and we can
consider undoing the deprecation of this method.
A view can have a header view, a view that is a parent to this view. For example the header of a batch entry is the batch itself, and the header of an order detail line is the order itself. When putting data to the key fields there is generally no need to put to those fields that are references to the parent and indeed for some protocols doing so might result in an error.
Normally the header/detail relationship is defined by the primary key (key 0) but on some occasions there may be more than one header/detail relationship.
putDefiningKeyValues
in interface IView
values
- an array of Strings containing all the fields in the
order they appear in the key. The leading ones may be checked
against the header but will not be set. The defining ones will
be set.key
- the key that defines the header/detail relationship.IView.getDefiningKeyValues()
public boolean getInstanceNoncascading()
getInstanceNoncascading
in interface HasViewAttributes
true
if this view instance is non-cascadingpublic boolean getInstanceNonheritable()
getInstanceNonheritable
in interface HasViewAttributes
true
if this view instance is non-inheritablepublic int getInstancePrefetch()
getInstancePrefetch
in interface HasViewAttributes
public int getInstanceProtocol()
getInstanceProtocol
in interface HasViewAttributes
View.Protocol
.public boolean getInstanceRawPut()
getInstanceRawPut
in interface HasViewAttributes
public boolean getInstanceReadOnly()
getInstanceReadOnly
in interface HasViewAttributes
public boolean getInstanceUnrevisioned()
getInstanceUnrevisioned
in interface HasRevisionListSupport
public boolean getInstanceUnValidated()
getInstanceUnValidated
in interface HasViewAttributes
@Deprecated public ViewKeys getKeys()
collection
of keys
Note that the returned reference will become obsolete if
refreshSchema()
is called.
This method is deprecated; use getViewKeys()
or
getKey(int)
refreshSchema()
,
getViewKeys()
public int getOrder()
getOrder
in interface HasOrder
HasOrder.setOrder(int)
,
HasOrder.filterSelect(java.lang.String, boolean, int, com.sage.accpac.sm.View.FilterOrigin)
public DBLink getParent()
DBLink
that this is a view under
getParent
in interface IView
DBLink
that this is a view underpublic Program getProgram()
getProgram
in interface IView
public View.ReferentialIntegrity getReferentialIntegrity()
getReferentialIntegrity
in interface HasViewAttributes
View.ReferentialIntegrity
for the view@Deprecated public View.Security getSecuritySettings()
View.Security
settings that list the access rights the current
user has on the view.
This version is deprecated; use getViewSecurity()
instead.
View.Security
value that is the combination of the access
rights the user has on the view.
java.lang.NullPointerException
- if dispose()
has been called on the view.public ViewSecurity getViewSecurity()
ViewSecurity
settings that list the access rights the
current user has on the view.
getViewSecurity
in interface HasViewAttributes
ViewSecurity
value that is the combination of the access
rights the user has on the view.public View.SystemAccess getSystemAccess()
getSystemAccess
in interface HasViewAttributes
public java.util.Date getTemplateDate()
getTemplateDate
in interface HasViewAttributes
public java.lang.String getTemplateVersion()
getTemplateVersion
in interface HasViewAttributes
public View.RotoType getType()
getType
in interface HasViewAttributes
View.RotoType
of this viewpublic IViewFields getViewFields()
collection
of fields
for
the view.
Note that the returned reference will become obsolete if
IView.refreshSchema()
is called.
getViewFields
in interface IView
IViewFields
of the viewIView.refreshSchema()
public java.lang.String getViewID()
getViewID
in interface HasViewAttributes
public IProgram getIProgram()
getIProgram
in interface IView
public IViewKey getKey(int index)
getKey
in interface HasOrder
index
- the zero-based index of the key desired.
to get the collection if you need it to check the
count or to search for a specific key
public IViewKeys getViewKeys()
getViewKeys
in interface HasOrder
public boolean goBottom()
Navigable.goNext()
for more
details.
goBottom
in interface Navigable
true
if a record was found.public boolean goNext()
The caller will have set up the query by a call to
HasOrder.filterSelect(java.lang.String, boolean, int, com.sage.accpac.sm.View.FilterOrigin)
or HasOrder.browse(java.lang.String, boolean)
, possibly
combined with HasOrder.setOrder(int)
. The query expresses:
filter
argumentorder
and
ascending
arguments. Currently the system only supports the
records being sorted all-ascending or all-descending.browse
or
filterSelect(...FilterOrigin.FromOrigin)
a call to this
method will return the record identified by the current primary key fields
if it exists, or the next record if there is no record identified by the
current primary key fields, or will return false if there is no such next
record.
Immediately, in this context, means before any call to one of the navigation methods:
fetch
filterFetch
goNext
goPrev
goTop
goBottom
If there has been a call to one of the navigation methods then a call to this method will return the next record from the one identified by the current primary key values.
Note that this means although it is legal to jump around the set of
records the results will not be quite what was expected unless a call to
browse
occurs at each jump, to signal that the current record
is to be included.
For example:
view.filterSelect(myFilter, true, 0, FilterOrigin.FromStart); while (view.goNext()) { processRecord(view); }
goNext
in interface Navigable
public boolean goPrev()
Navigable.goNext()
for more details.
goPrev
in interface Navigable
public boolean goTop()
Navigable.goNext()
for more
details.
goTop
in interface Navigable
public void insert()
insert
in interface Modifiable
public boolean isNotification()
View.OpenDirectives.InstanceNotify
directive
was specified in the constructor.
isNotification
in interface HasViewAttributes
public void post()
post
in interface IView
public void post(ThreadEventListener listener)
post
in interface IView
listener
- the ThreadEventListener
to which thread events are to be
sentpublic int process()
process
in interface Processable
java.lang.NullPointerException
- if dispose()
has been called on the view.public void process(ThreadEventListener listener)
process
in interface Processable
listener
- the ThreadEventListener
to which thread events are to be
sentpublic int process(MeterEventListener meterListener)
process
in interface Processable
meterListener
- the MeterEventListener
to which meter events will be
sent
public boolean read()
This is equivalent to Modifiable.read(boolean)
with an argument of
false
.
If necessary call HasOrder.setOrder(int)
on the same object to
specify which key is to be used.
read
in interface Readable
public boolean read(boolean lockRecord)
This overloads Readable.read()
, allowing specifying that the
record should be locked.
read
in interface Modifiable
lockRecord
- boolean value indicating if the record should be locked after it
is retrieved.
Modifiable.unlock()
public void recordClear()
This appears to be the preferred method to set up for a forward
navigation, rather than calling Navigable.goTop()
.
recordClear
in interface Navigable
public void recordGenerate(View.RecordGenerateMode mode)
recordGenerate
in interface Modifiable
mode
- a View.RecordGenerateMode
indicating
how to generate the recordpublic void removeNotificationListener(NotificationListener l)
removeNotificationListener
in interface IView
l
- the listener
to remove.IView.addNotificationListener(com.sage.accpac.sm.NotificationListener)
,
NotificationListener
public void refreshSchema()
The view will refresh its information. Any outstanding references to fields etc. are the concern of the caller.
refreshSchema
in interface IView
HasOrder.getViewKeys()
,
IView.getViewFields()
public void revisionCancel(int level)
revisionCancel
in interface HasRevisionListSupport
level
- Revision levelpublic boolean revisionExists(int level)
revisionExists
in interface HasRevisionListSupport
level
- Revision level
public void revisionPost(int level)
revisionPost
in interface HasRevisionListSupport
level
- Revision levelpublic boolean revisionUnposted(int level)
revisionUnposted
in interface HasRevisionListSupport
level
- Revision level
public void setETag(java.lang.String tag)
Typically the Edit Tag is a representation of the Audit Stamp of the
record and so this operation attempts to set the Audit Stamp. Since it
sets it to a value returned by IView.getETag()
it is equivalent to
setting the Edit Tag to a previous state. The normal behavior is that if
the provided Edit Tag is the same as the record's current one nothing
happens but if it is different then it is altered and any subsequent
attempt to perform Modifiable.update()
will fail, indicating a record
conflict.
Note that setting the Edit Tag will not prevent a Modifiable.delete()
operation if the Edit Tag is different.
A suggested alternative to setting the Edit Tag is to use
IView.getETag()
to get the current Edit tag of the record and only
perform the Modifiable.update()
or Modifiable.delete()
if the Edit Tag is not
as expected.
setETag
in interface IView
tag
- the Edit Tag. This should be a value returned by a previous call
to IView.getETag()
. The caller should not attempt to create
Edit Tags for themselves.public void setOrder(int order)
setOrder
in interface HasOrder
order
- the key to selectHasOrder.getOrder()
,
HasOrder.filterSelect(java.lang.String, boolean, int, com.sage.accpac.sm.View.FilterOrigin)
public void setReferentialIntegrity(View.ReferentialIntegrity value)
setReferentialIntegrity
in interface IView
value
- the View.ReferentialIntegrity
value to setpublic void setSystemAccess(View.SystemAccess value)
setSystemAccess
in interface IView
value
- the View.SystemAccess
to setpublic void tableEmpty()
tableEmpty
in interface IView
public void unlock()
Modifiable.read(boolean)
unlock
in interface Modifiable
public void update()
update
in interface Modifiable
public boolean verify()
verify
in interface Modifiable
protected ViewField createField(int index, int id, java.lang.String name)
ViewField
class corresponding to the
zero-based index of the field within this view. This is called by the
ViewFields
class returned by getFields()
. Override this
method if you need to be able to create application-specific subclasses of
the ViewField
class.
index
- the zero-based index of the field in the view's set of fields.name
- the name of the fieldid
- the id (or index)
public static void shutdownExecutor()
protected void doBrowse(java.lang.String filter, boolean ascending)
Performs the actual viewBrowse on the underlying Sage 300 ERP view.
No other methods within the View
will invoke a viewBrowse on the
underlying Sage 300 ERP view so this method can be overridden as a funnel
to catch all cases where a viewBrowse would occur and perform the
necessary customizations that the Sage 300 ERP view requires of an
external caller.
filter
- string containing the filter expression that restricts the
records that will be retrieved.ascending
- boolean value indicating whether subsequent records will be
fetched in ascending or descending order.
UncheckedCharacterCodingException
- if there is a conversion error (see StringEncoder.toA4wFormat).
java.lang.NullPointerException
- if dispose()
has been called on the view.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected Gettable getGettableByIndex(int field)
getGettableByIndex
in class AbstractGettableByField
field
- the field index whose Gettable is desired
protected Gettable getGettableByName(java.lang.String field)
getGettableByName
in class AbstractGettableByField
field
- the field name whose Gettable is desired
protected Settable getSettableByIndex(int field)
getSettableByIndex
in class AbstractSettableByField
field
- the field index whose Settable is desired
protected Settable getSettableByName(java.lang.String field)
getSettableByName
in class AbstractSettableByField
field
- the field name whose Settable is desired
public HasFieldAttributes getFieldAttributes(java.lang.String field)
getFieldAttributes
in interface HasFieldAttributesByField
field
- the field name of the field
HasFieldAttributes
representing the fieldpublic HasFieldAttributes getFieldAttributes(int field)
getFieldAttributes
in interface HasFieldAttributesByField
field
- the field index of the field
HasFieldAttributes
representing the fieldpublic IViewField getField(java.lang.String field)
getField
in interface HasViewFieldByField
field
- the field name of the field
IViewField
representing the fieldpublic IViewField getField(int field)
getField
in interface HasViewFieldByField
field
- the field index of the field
IViewField
representing the field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |