fferpcore.VirtualDataObjectglobal with sharing class VirtualDataObject The Virtual Data Object represents a business object, for example the Virtual Master Order Object. This business object can be backed by any form of underlying object through a Provider. This allows the system administrator to choose how objects such as Orders are formed. The shape of a virtual object is defined in terms of the keys that are used to access its data. For example a Master Order may have a Document Date, Lines, an AccountId, Products. The Provider translates these names into the names used by its underlying data source. fferpcore.VirtualDataObject.Consumerglobal interface Consumer Capable of preparing a Provider before getting Records, and processing the resulting Records. Methods
preparevoid prepare(fferpcore.VirtualDataObject.Provider provider) Prepare the given Provider for future processing. Input Parameters
consumevoid consume(fferpcore.VirtualDataObject.RecordList recordList) Process the given RecordList. Input Parameters
fferpcore.VirtualDataObject.WorkScopeglobal interface WorkScope extends Disposable Collection of work that can be committed. This class extends fferpcore.Disposable MethodscommitPendingWorkMap<String, VirtualDataObject.CommitResult> commitPendingWork(Atomicity atomicity) Commit any pending work. Atomicity has to be REQUIRE_ALL in Foundations version 4.2. Input Parameters
Return ValueMap of CommitResults keyed by the corresponding Record ID. fferpcore.VirtualDataObject.CommitResultglobal interface CommitResult The result of committing a Record. Returned when comitting a WorkScope, keyed by the Record ID. Methodsfferpcore.VirtualDataObject.ProviderKeyglobal inherited sharing class ProviderKey implements ObjectIO.ActivatableObject2 The Provider Key identifies a Virtual Data Object Provider. The key consists of the Virtual Data Object Name and name of the provider that backs the data. For example a "Master Order Object" may be backed by "Salesforce Order via FinancialForce Foundations". Methods
ProviderKeyglobal ProviderKey(String virtualDataObjectName, String providerName) Construct a ProviderKey with the given virtual object and provider. Input Parameters
getVirtualDataObjectNameglobal String getVirtualDataObjectName() Return ValueThe name of the virtual object. fferpcore.VirtualDataObject.ProviderFactoryglobal interface ProviderFactory Capable of creating a Provider and validating record IDs. Methods
initvoid init(fferpcore.VirtualDataObject.ProviderKey key, String initData) Initialise the factory with the given ProviderKey and data. Input Parameters
ownsRecordBoolean ownsRecord(String recordId) Determine if the given record ID is valid for the provider. Input Parameters
Return ValueTrue if the provider supports the given record ID. createProviderVirtualDataObject.Provider createProvider(Set<String> recordIds, SharingModel sharingModel) Create a provider using the given record IDs, and sharing model. Input Parameters
Return ValueThe created Provider instance. fferpcore.VirtualDataObject.Providerglobal interface Provider extends PreparableSource Capable of providing Records and a WorkScope to commit any changes to them. Extends PreparableSource so can also require data. This class extends fferpcore.VirtualDataObject.PreparableSource Methods
createWorkScopeVirtualDataObject.WorkScope createWorkScope() Return ValueA WorkScope capable of committing changes to the Records. getRecordsVirtualDataObject.RecordList getRecords() Return ValueA list of Records which will be populated with all required fields. addSourceErrorListenervoid addSourceErrorListener(fferpcore.VirtualDataObject.ErrorListener listener) Add a listener to be notified when an error is added to a source Record. Input Parameters
addErrorListenervoid addErrorListener(fferpcore.VirtualDataObject.ErrorListener listener) Add a listener to be notified when an error is added to a Record. Input Parameters
addErrorvoid addError(String errorMessage) Add an error to the Provider. Input Parameters
fferpcore.VirtualDataObject.ErrorListenerglobal interface ErrorListener Capable of handling errors added to Records. Methods
onErrorvoid onError(fferpcore.VirtualDataObject.ErrorEvent e) Handle the specified error message added to the record. Input Parameters
hashCodeInteger hashCode() Listeners must support Set operations to allow prevention of repeat additions. equalsBoolean equals(Object other) Listeners must support Set operations to allow prevention of repeat additions. fferpcore.VirtualDataObject.ErrorEventglobal interface ErrorEvent Information about an error. Methods
getErrorRecordRecord getErrorRecord() Return ValueThe record on which the error was raised. Example: Line 10 getErrorKeyString getErrorKey() Return ValueThe key of the field, lookup or child relationship on the record. Example: 'Product' getRootRecordRecord getRootRecord() Return ValueThe record that the listener is registered with. if the listener is registered with a Provider or RecordList return the record within that list. getErrorPathTargetTypePath2.TargetType getErrorPathTargetType() Return ValueThe type of thing that the error applies to. getPathPath2.Element getPath() Return ValueThe start of the path from the object that the listener was registered on to the error. If the error is on a field on the observed object then the path will point to the field. If the error applies to the observed object itself then the path will be null. fferpcore.VirtualDataObject.PreparableSourceglobal interface PreparableSource Capable of being prepared by requiring keys. Can also be described to determine associated fields. Methods
describeVirtualDataObject.ObjectDescribe describe() Return ValueThe description of the PreparableSource. This includes associated fields, lookups, and child relationships. requireFieldvoid requireField(String key, Intent intent) Require any data associated with the specified key. Input Parameters
requireLookupVirtualDataObject.PreparableSource requireLookup(String key, Intent intent) Require any lookup data associated with the specified key. Input Parameters
Return ValueA PreparableSource representing the lookup object. requireChildrenVirtualDataObject.PreparableSource requireChildren(String key, Intent intent) Require any child data associated with the specified key. Input Parameters
Return ValueA PreparableSource representing the child object. fferpcore.VirtualDataObject.RecordListglobal interface RecordList extends Iterable<Record> An iterable collection of Records. Methods
getVirtualDataObject.Record get(Integer index) Input Parameters
Return ValueRecord at the given position in the list. createVirtualDataObject.Record create() Create a new Record and add it to the list. Return ValueThe created Record. destroyAllvoid destroyAll() Remove all Records from the list. All remove records will be deleted from the database on commit. addErrorListenervoid addErrorListener(fferpcore.VirtualDataObject.ErrorListener errorListener) Add a listener to be notified when an error is added to the RecordList. Input Parameters
addErrorvoid addError(String errorMessage) Add an error to the RecordList. Input Parameters
fferpcore.VirtualDataObject.Recordglobal interface Record A collection of mutable data containing an ID, and multiple fields, each with a single value. Methods
getObject get(String key) Input Parameters
Return ValueThe data with the specified key. getOptionalOptionalValue getOptional(String key) Input Parameters
Return ValueNull if the key was not found, otherwise an OptionValue containing the corresponding data. getLookupRecordVirtualDataObject.Record getLookupRecord(String key) Input Parameters
Return ValueThe lookup data with the specified key. getLookupRecordOptionalOptionalValue getLookupRecordOptional(String key) Input Parameters
Return ValueNull if the lookup data was not found, otherwise an OptionalValue containing the lookup data. getChildRecordsVirtualDataObject.RecordList getChildRecords(String key) Input Parameters
Return ValueThe children data with the specified key. putvoid put(String key, Object value) Set the data associated with the specified key. Input Parameters
addErrorListenervoid addErrorListener(fferpcore.VirtualDataObject.ErrorListener errorListener) Add a listener to be notified when an error is added to the Record. Input Parameters
addErrorvoid addError(String key, String errorMessage) Add an error to the record. Input Parameters
fferpcore.VirtualDataObject.SObjectRecordglobal interface SObjectRecord extends Record A record backed by an SObject. This class extends fferpcore.VirtualDataObject.Record Methodsfferpcore.VirtualDataObject.ObjectDescribeglobal interface ObjectDescribe extends Accessible Description of an object including available fields, lookups and child relationships. This extends Accessible so also includes the associated permissions. This class extends fferpcore.VirtualDataObject.Accessible Methods
getFieldsMap<String, VirtualDataObject.FieldDescribe> getFields() Return ValueA map of available field descriptions by key. Where a field is a lookup the description here refers to the foreign key itself, not the result of traversing it. getLookupsMap<String, VirtualDataObject.LookupDescribe> getLookups() Return ValueA map of available lookup descriptions by key. getChildRelationshipsMap<String, VirtualDataObject.ChildRelationshipDescribe> getChildRelationships() Return ValueA map of available child relationship descriptions by key. fferpcore.VirtualDataObject.FieldDescribeglobal interface FieldDescribe extends DescribeBase Description of a field including the associated permissions. Methodsfferpcore.VirtualDataObject.LookupDescribeglobal interface LookupDescribe extends DescribeBase Description of a lookup including the associated permissions. The Accessibility of the lookup itself refers to the foreign key field on the source object. MethodsgetTargetVirtualDataObject.ObjectDescribe getTarget() Return ValueDescription of the object this lookup points to. fferpcore.VirtualDataObject.ChildRelationshipDescribeglobal interface ChildRelationshipDescribe extends DescribeBase Description of a child relationship including the associated permissions. MethodsgetTargetVirtualDataObject.ObjectDescribe getTarget() Return ValueDescription of the child object. fferpcore.VirtualDataObject.Accessibleglobal interface Accessible Capable of reporting what access is available based on current permissions. Methods
supportsWriteBoolean supportsWrite() Return ValueTrue if it possible to write to this object regardless of permissions. Derived values, autonumbers, and some keys, are never writable. |