|
||||||||||
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
com.sage.orion.sdata.servlet.accpac.SDataView
public class SDataView
provides the SData appearance of a View, adding SData semantics
The vision is that this will be enhanced, overriding View functions as required. If you feel the need to export the Resource with a getter then STOP and think why you are exporting it. Almost certainly you would do better to override one of the View methods. For example at some point we need to override the ability to get a field by name so that the fields are known by their SData names, not their View names
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.sage.accpac.sm.View |
---|
com.sage.accpac.sm.View.FilterOrigin, com.sage.accpac.sm.View.OpenDirectives, com.sage.accpac.sm.View.OpenModes, com.sage.accpac.sm.View.Protocol, com.sage.accpac.sm.View.RecordGenerateMode, com.sage.accpac.sm.View.ReferentialIntegrity, com.sage.accpac.sm.View.RotoType, com.sage.accpac.sm.View.Security, com.sage.accpac.sm.View.SystemAccess |
Constructor Summary | |
---|---|
|
SDataView(com.sage.accpac.sm.Program program,
java.lang.String rotoid,
Resource resource)
Constructs an SDataView object for a Program |
protected |
SDataView(SDataViewSet set,
java.lang.String rotoid,
Resource resource)
Constructs an SDataView object for a Set. |
Method Summary | |
---|---|
protected SDataViewField |
createField(int index,
int id,
java.lang.String name)
|
protected VirtualField |
createVirtualField(ResourceVirtualField resourceField)
creates an instance of the VirtualField class corresponding to the
given ResourceField . |
void |
delete()
|
void |
dispose()
|
void |
emptyKeyFieldsForNavigation()
Empties the key field(s) according to the current key order, in preparation for subsequent navigation. |
java.lang.Object |
getBySDataPropertyName(java.lang.String name)
gets the value of the given field. |
java.lang.String |
getDefiningKey()
Get the non-header keys of the view as a single String according to the Accpac method of splitting multi-segment keys and encoding them |
java.lang.String |
getDescriptor()
returns a description of the record that can be used as an SData record descriptor |
java.util.Set<java.lang.String> |
getFieldNamesOfFieldIDs(java.util.Set<java.lang.Integer> deltaFields)
returns the names of the fields whose IDs are provided |
java.lang.String |
getKey()
Get the primary key of the view as a single String according to the Accpac method of splitting multi-segment keys and encoding them |
boolean |
getMaintainRecordNumbers()
Indicates whether this view instance maintains record number. |
java.lang.String |
getName()
returns the name by which the resource is being known |
boolean |
getOptionalFieldsAreCurrentlyReadOnly()
specifies whether or not the custom (i.e. |
int |
getRecordNumber()
Returns the record number of the current record, if this view instance maintains record numbers. |
RecordNumberResourceField |
getRecordNumberResourceField()
Returns the resource of the record number field. |
java.lang.String |
getRecordTitle()
returns a description of the record that can be used as an SData item title |
Resource |
getResource()
Returns the Resource corresponding to the View |
SDataViewSet |
getSet()
gets the SDataViewSet to which this SDataView belongs. |
SDataViewField |
getViewFieldByName(java.lang.String name)
returns the SDataViewField identified by the given SData property
name |
VirtualField |
getVirtualField(java.lang.String name)
gets the named VirtualField . |
boolean |
goBottom()
|
boolean |
goNext()
|
boolean |
goPrev()
|
boolean |
goTop()
|
boolean |
goToRecordNumber(int targetRecordNumber)
Move to the record identified by the record number. |
protected boolean |
hasNonOptionalField(java.lang.String sdataName)
returns whether or not the view has a field or child resource with the given name, other than an optional field |
void |
insert()
|
boolean |
putBySDataPropertyName(java.lang.String name,
java.lang.Object value,
boolean verify)
put the given value, including taking care of checking results , converting types, allowing for some exceptions etc. |
boolean |
putBySDataPropertyName(java.lang.String name,
java.lang.Object value,
boolean verify,
boolean viewFields,
boolean optionalFields,
SDataDiagnoses diagnoses,
com.sage.orion.sdata.servlet.accpac.ViewSetReturnDeltaChanges deltaChanges)
put the value specified to the field specified by the sdata field name, possibly verifying and possibly only if it is the correct implementation of field. |
void |
putDefiningKey(java.lang.String key)
Put the defining key to the corresponding view fields. |
boolean |
putKey(int key,
java.lang.String[] segments,
boolean verify)
puts the given values into the key fields. |
boolean |
read(boolean lockRecord)
|
boolean |
readKeyedRecord(java.lang.Object[] values)
reads the record specified by the given key values. |
void |
recordClear()
|
void |
recordGenerate(com.sage.accpac.sm.View.RecordGenerateMode mode)
|
java.lang.String |
toString()
|
void |
update()
|
Methods inherited from class com.sage.accpac.sm.View |
---|
addNotificationListener, autocompose, blkGet, blkPut, browse, cancel, compose, confirmNativeDBLink, createTables, createTables, doBrowse, dropTables, dropTables, filterDelete, filterSelect, finalize, getCombinedFilterCount, getComposites, getDefiningKeyValues, getDefiningKeyValues, getDescription, getDirty, getETag, getExists, getField, getField, getFieldAttributes, getFieldAttributes, getFields, getFilterCount, getGettableByIndex, getGettableByName, getHasUnpostedRevisions, getInstanceNoncascading, getInstanceNonheritable, getInstancePrefetch, getInstanceProtocol, getInstanceRawPut, getInstanceReadOnly, getInstanceUnrevisioned, getInstanceUnValidated, getIProgram, getKey, getKeys, getOrder, getParent, getProgram, getReferentialIntegrity, getSecuritySettings, getSettableByIndex, getSettableByName, getSystemAccess, getTemplateDate, getTemplateVersion, getType, getViewFields, getViewID, getViewKeys, getViewSecurity, goToQueryRecord, isNotification, post, post, process, process, process, putDefiningKeyValues, putDefiningKeyValues, read, refreshSchema, removeNotificationListener, revisionCancel, revisionExists, revisionPost, revisionUnposted, setETag, setOrder, setReferentialIntegrity, setSystemAccess, shutdownExecutor, supportsETag, tableEmpty, unlock, verify |
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 SDataView(com.sage.accpac.sm.Program program, java.lang.String rotoid, Resource resource)
program
- the Program for which the View is openedrotoid
- the roto ID of the View to be openedresource
- the Resource that corresponds to the Viewprotected SDataView(SDataViewSet set, java.lang.String rotoid, Resource resource)
set
- the SDataViewSet
for which the View is openedrotoid
- the roto ID of the View to be openedresource
- the Resource that corresponds to the ViewMethod Detail |
---|
public SDataViewSet getSet()
SDataViewSet
to which this SDataView
belongs.
Each SDataView
belongs to one and only one
SDataViewSet
, which is fixed for the whole time it exists.
public final Resource getResource()
Hopefully we will be able to make this obsolete
public java.lang.String getRecordTitle()
public java.lang.String getDescriptor()
public void dispose()
dispose
in interface com.sage.accpac.sm.HasDispose
dispose
in interface com.sage.accpac.sm.view.IView
dispose
in class com.sage.accpac.sm.View
public java.lang.String getDefiningKey()
public java.lang.String getKey()
public void putDefiningKey(java.lang.String key)
key
- a single String representation of the entire keypublic java.lang.String getName()
public boolean getOptionalFieldsAreCurrentlyReadOnly()
Override this to modify behavior for your view.
This will be called when building a schema during a stateful single resource request, including:
If the request specifies that a schema change is to be returned (as opposed to a full schema) this may be called once before the changes and once afterwards. Alternatively the system may remember the value from the last operation. Do not assume either pattern.
This is not called during stateless schema requests
true
if the custom fields are currently read-only.public boolean putKey(int key, java.lang.String[] segments, boolean verify)
The values are put into the key fields according to the specified key, which need not be the primary or even a defining key.
key
- the index/order/key to usesegments
- the values to put, all in string formverify
- whether or not to perform verify when putting. Remember that
even if you specify false the code is permitted to ignore you.
protected SDataViewField createField(int index, int id, java.lang.String name)
This version returns an SDataViewField
subclass. If you override
this method the ViewField you return should also subclass
SDataViewField
.
createField
in class com.sage.accpac.sm.View
protected VirtualField createVirtualField(ResourceVirtualField resourceField)
VirtualField
class corresponding to the
given ResourceField
. This is called to create the value that will
be returned by getVirtualField(String)
. Override this method to
create your application-specific implementation.
resourceField
- the ResourceVirtualField
that the created instance
implements
VirtualField
that implements the given
ResourceField
public VirtualField getVirtualField(java.lang.String name)
VirtualField
.
name
- the name of the field
VirtualField
that implements the named virtual
field
java.lang.IllegalArgumentException
- if there is no virtual field with that namepublic java.lang.Object getBySDataPropertyName(java.lang.String name)
The field may be a field in the underlying view, an optional field, or a virtual field.
name
- the SData name of the field
MalformedPayloadException
- if the name is not a valid field name for this SDataViewAbstractGettableByField.get(String)
public boolean putBySDataPropertyName(java.lang.String name, java.lang.Object value, boolean verify)
name
- the SData property name of the fieldvalue
- the value to put in the fieldverify
- whether or not to perform verify when putting. Remember that
even if you specify false the code is permitted to ignore you.
public boolean putBySDataPropertyName(java.lang.String name, java.lang.Object value, boolean verify, boolean viewFields, boolean optionalFields, SDataDiagnoses diagnoses, com.sage.orion.sdata.servlet.accpac.ViewSetReturnDeltaChanges deltaChanges)
If the field is not of the correct type then the method returns true indicating that there was not actually a problem.
The viewFields and optionalFields specification allows for putting optional fields after generating the default values
name
- the sdata name of the fieldvalue
- the value to put in the fieldverify
- whether or not to verify the fieldviewFields
- if true then if this is an accpac view field then put itoptionalFields
- if true then if this is an optional field then put itdiagnoses
- a list of diagnoses to which this method can add warnings and
informationdeltaChanges
- the ViewSetReturnDeltaChanges
that is listening during
the operation. Since the trigger field does not get a
notification we need to do that ourselves. This should be null
if there is none listening.
public boolean readKeyedRecord(java.lang.Object[] values)
This returns with the current order unchanged. However it may temporarily change the order if the current order is not that of the identifying index, and it is not clear what the consequences will be.
If an exception is thrown the resulting order is ill-defined.
values
- the values of the key fields
java.lang.NullPointerException
- if a null Resource
was provided to the constructor.
java.lang.IllegalArgumentException
- if the number of values does not match the expected number.@NonNull public java.util.Set<java.lang.String> getFieldNamesOfFieldIDs(@NonNull java.util.Set<java.lang.Integer> deltaFields)
deltaFields
- the field IDs of the fields
public SDataViewField getViewFieldByName(java.lang.String name)
SDataViewField
identified by the given SData property
name
name
- the name of the property
SDataViewField
identified by the property name
java.lang.IndexOutOfBoundsException
- if the name does not correspond to an
SDataViewField
of this viewprotected final boolean hasNonOptionalField(java.lang.String sdataName)
sdataName
- the SData name to check for
true
if the view has a non-custom field or child
resource with this SData namepublic java.lang.String toString()
toString
in class com.sage.accpac.sm.View
public boolean getMaintainRecordNumbers()
public int getRecordNumber()
getMaintainRecordNumbers()
.
Otherwise, this method always returns 0.
public RecordNumberResourceField getRecordNumberResourceField()
public boolean goToRecordNumber(int targetRecordNumber)
targetRecordNumber
- The record number to position to.
public boolean goTop()
goTop
in interface com.sage.accpac.sm.view.Navigable
goTop
in class com.sage.accpac.sm.View
public boolean goBottom()
goBottom
in interface com.sage.accpac.sm.view.Navigable
goBottom
in class com.sage.accpac.sm.View
public boolean goNext()
goNext
in interface com.sage.accpac.sm.view.Navigable
goNext
in class com.sage.accpac.sm.View
public boolean goPrev()
goPrev
in interface com.sage.accpac.sm.view.Navigable
goPrev
in class com.sage.accpac.sm.View
public boolean read(boolean lockRecord)
read
in interface com.sage.accpac.sm.view.Modifiable
read
in class com.sage.accpac.sm.View
public void insert()
insert
in interface com.sage.accpac.sm.view.Modifiable
insert
in class com.sage.accpac.sm.View
public void update()
update
in interface com.sage.accpac.sm.view.Modifiable
update
in class com.sage.accpac.sm.View
public void delete()
delete
in interface com.sage.accpac.sm.view.Modifiable
delete
in class com.sage.accpac.sm.View
public void recordClear()
recordClear
in interface com.sage.accpac.sm.view.Navigable
recordClear
in class com.sage.accpac.sm.View
public void recordGenerate(com.sage.accpac.sm.View.RecordGenerateMode mode)
recordGenerate
in interface com.sage.accpac.sm.view.Modifiable
recordGenerate
in class com.sage.accpac.sm.View
public void emptyKeyFieldsForNavigation()
ViewField.setToMin()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |