new Manager(logger, dbMgr, queryMgr, transactionMgr, syncMgr, fileService)
Parameters:
| Name | Type | Description |
|---|---|---|
logger |
olympe.logging.Channel | |
dbMgr |
olympe.dc.db.DatabaseManager | |
queryMgr |
olympe.dc.query.QueryManager | |
transactionMgr |
olympe.dc.transaction.TransactionManager | |
syncMgr |
olympe.dc.syncs.SyncManager | |
fileService |
olympe.dc.FileServiceManager |
Methods
-
createFile(tag, data, mimeType, onSuccess [, onFailure] [, transaction])
-
Creates an entry in the file service with the given tag.
Parameters:
Name Type Argument Description tagstring The tag of the file.
dataolympe.df.OString | string | Blob Initial content for the file.
mimeTypestring The MIME type for this file.
onSuccessfunction Callback to invoke with the file's path if the creation was successful.
onFailurefunction <optional>
Callback to invoke with the error code if the creation failed.
transactionolympe.dc.Transaction <optional>
Transaction to update in case of success.
- Deprecated:
-
- use
olympe.dm.File#createFileinstead
- use
-
createSync(tag)
-
Creates a sync instance from the specified tag.
Parameters:
Name Type Description tagstring The tag for the new
Sync.- Deprecated:
-
- use
Sync.getInstanceinstead
- use
Returns:
The created
Sync. -
deleteFile(file, onSuccess [, onFailure])
-
Deletes a
File.Parameters:
Name Type Argument Description fileolympe.dm.File The file to delete.
onSuccessfunction Callback to invoke if the operation is successful.
onFailurefunction <optional>
Callback to invoke if the operation failed.
-
deleteSync(tag [, callback])
-
Delete the sync instance with the specified tag. Once the operation is executed, the provided callback will be called to notify success or failure.
Parameters:
Name Type Argument Description tagolympe.dc.InstanceTag The tag of the instance to delete.
callbackolympe.dc.Manager.TransactionCallback <optional>
The response callback.
- Deprecated:
-
- use
deleteInstanceinstead
- use
-
downloadFile(file, onSuccess [, onFailure])
-
Downloads the content of a
File.Parameters:
Name Type Argument Description fileolympe.dm.File The file to download.
onSuccessfunction Callback to invoke if the operation is successful.
onFailurefunction <optional>
Callback to invoke if the operation failed.
-
executeTransaction(transaction [, callback])
-
Executes the specified transaction. The provided callback, if present, will be called to notify of success or failure.
Parameters:
Name Type Argument Description transactionolympe.dc.Transaction The transaction.
callbackolympe.dc.Manager.TransactionCallback <optional>
The transaction callback.
- Deprecated:
-
- use
executeon the transaction itself instead
- use
-
getSync(tag [, type])
-
Gets a specific sync.
Parameters:
Name Type Argument Description tagolympe.df.POString | string Instance tag.
typefunction <optional>
Optional sync constructor to cast the returned proxy.
- Deprecated:
-
- use new olympe.dc.ListDef(tag).getFirst() or
Sync.getInstanceinstead
- use new olympe.dc.ListDef(tag).getFirst() or
Returns:
The
Sync. -
getSyncEntry(tag)
-
Gets the "resolved" sync entry for the specified tag, that is the tag's entry if available or the first parent entry
Parameters:
Name Type Description tagstring The tag of the entry.
Returns:
The
Syncentry. -
getSyncs(tagOrConstructor)
-
Gets all instances of the specified model tag.
Parameters:
Name Type Description tagOrConstructorolympe.df.POString | string | function Model tag or sync constructor
- Deprecated:
-
- use
Sync.getInstancesOfinstead
- use
Returns:
- Type
- olympe.dc.ListDef
-
uploadFile(file, data, onSuccess [, onFailure])
-
Updates the content of file with new data.
Parameters:
Name Type Argument Description fileolympe.dm.File The file to update.
dataolympe.df.OString | string | Blob New content for that file.
onSuccessfunction Callback to invoke if the operation is successful.
onFailurefunction <optional>
Callback to invoke if the operation failed.
Type Definitions
-
TransactionCallback(success, message)
-
Parameters:
Name Type Argument Description successboolean messagestring <nullable>
-
TransformationCallback(added, tag, index, deferredRank)
-
Parameters:
Name Type Description addedboolean trueif the item has been added.tagstring The tag of the item.
indexstring The index, in the list, of the item.
deferredRankolympe.dc.ranking.Deferred
Olympe SDK