new FatFractal
Default constructor for the FatFractal class.
- Source:
- FatFractal.js, line 52
Returns:
an instance of the FatFractal class
- Type
- FatFractal
Methods
-
addReferenceToObj
-
Explicitly add a FatFractal 'reference to another object' to this object. The example will add a reference to the 'user' object to the 'profile' object.
Parameters:
Name Type Description ffUrlString the referenced object's ffUrl refNameString the name we are giving to this reference relationship objObject the object to which we are adding the reference - Source:
- FatFractal.js, line 970
Example
addReferenceToObj(user.ffUrl, "ffUser", profile) -
createObjAtUri
-
Create an object on your FatFractal application backend. Asynchronous method with an successCallback and an errorCallback that will POST some data to a server extension.
Parameters:
Name Type Description objObject The object to be created. collectionUriString The collection name or relative URI in which the object is to be created successCallbackFunction Function with two arguments - the actual data returned, and the accompanying statusMessage errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 663
-
defaultErrorCallback
-
This method is used to create a default error handler that will report errors to the browser console.
- Source:
- FatFractal.js, line 335
Returns:
the callback function that reports the error to the browser console.- Type
- Function
-
deleteObj
-
Delete an object from your FatFractal application backend.
Parameters:
Name Type Description objObject The object to be deleted. successCallbackFunction Function with one argument - the statusMessage errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 760
-
forgetObj
-
Forget about this object - i.e. remove it from the FatFractal local cache.
Parameters:
Name Type Description objObject Object to remove - Source:
- FatFractal.js, line 1002
-
getArrayFromExtension
-
Asynchronous method with an successCallback and an errorCallback that expects an Array of objects to be returned from a server extension. Identical in behaviour to FatFractal#getArrayFromUri except will prefix the uri with /ff/ext/ instead of /ff/resources/
Parameters:
Name Type Description extensionUriString The name of the server extension successCallbackFunction Function with one argument - the response object errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 848
Returns:
does not return anything directly - response is via the successCallback function or errorCallback function. -
getArrayFromUri
-
Asynchronous method with an successCallback callback and an errorCallback that expects an Array of objects to be returned from a server extension.
Parameters:
Name Type Description collectionUriString URI of collection successCallbackFunction Function with one argument - the response object errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 896
-
getBaseUrl
-
This method is used to get the m_baseUrl for the FatFractal library.
- Source:
- FatFractal.js, line 211
Returns:
the value the m_baseUrl has been set to.- Type
- String
-
getDebug
-
This method is used to get the Debug mode for the FatFractal library.
- Source:
- FatFractal.js, line 134
Returns:
returns true if the debug mode to true, else returns false.- Type
- Boolean
-
getFromInMemCache
-
Get (from the local in-memory cache) the object with this ffUrl
Parameters:
Name Type Description ffUrlString ffUrl of object - Source:
- FatFractal.js, line 1013
-
getObjFromExtension
-
Asynchronous method with an successCallback and an errorCallback that expects a single object to be returned from a server extension. Identical in behavior to FatFractal#getObjFromUri except will prefix the uri with /ff/ext/ instead of /ff/resources/
Parameters:
Name Type Description extensionUriString The name of the server extension successCallbackFunction Function with one argument - the response object errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 823
Returns:
does not return anything directly - response is via the successCallback function or errorCallback function. -
getObjFromUri
-
This method returns a single object from a Collection URI, typically when presented with a guid or query that should return a single object.
Parameters:
Name Type Description collectionUriString URI of collection successCallbackFunction Function with one argument - the response object errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 869
-
getSSLUrl
-
This method will get the m_sslUrl for the FatFractal library.
- Source:
- FatFractal.js, line 243
Returns:
m_sslUrl the value the m_sslUrl has been set to.- Type
- String
-
grabBagAdd
-
Add an item to the object's named grab bag.
Parameters:
Name Type Description itemObject The item which is to be added parentObjObject The object whose grab bag is going to be updated gbNameString The grab bag name successCallbackFunction errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 450
Example
grabBagAdd(anOrderLine, anOrder, "OrderLines") -
grabBagGetAll
-
Get all items from the object's named grab bag
Parameters:
Name Type Description parentObjObject The object from whose grab bag we are retrieving gbNameString The grab bag name successCallbackFunction Function with one argument - an array of the objects in this grab bag errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 419
Example
grabBagGetAll(anOrder, "OrderLines") -
grabBagGetAllForQuery
-
Get items, via query, from the object's named grab bag
Parameters:
Name Type Description parentObjObject The object from whose grab bag we are retrieving gbNameString The grab bag name queryString The query string in FatFractal Query Language format successCallbackFunction Function with one argument - an array of the objects in this grab bag which matched the query errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 432
Example
grabBagGetAllForQuery(anOrder, "OrderLines", "(orderLineValue gt 1000)") -
grabBagRemove
-
Remove an item from the object's named grab bag.
Parameters:
Name Type Description itemObject The item which is to be removed parentObjObject The object whose grab bag is going to be updated gbNameString The grab bag name successCallbackFunction errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 463
Example
grabBagRemove(anOrderLine, anOrder, "OrderLines") -
loggedIn
-
This method is used to get the LoggedIn state for the FatFractal library.
Returns:
returns true if user is logged in and a valid session exists, else returns false.- Type
- Boolean
-
loggedInUser
-
This method is used to get the LoggedIn user (FFUser) for the FatFractal library.
Returns:
returns the FFUser that is logged in if a valid session exists, else returns null.- Type
- FFUser
-
login
-
login will succeed if there exists a registered FFUser with this userName and password. If you have set AllowAutoRegistration to true in your application.ffdl configuration, then login will also succeed if this userName does not exist in your app's backend.Parameters:
Name Type Description usernameString the user name - can be anything, doesn't have to be meaningful passwordString password successCallbackFunction Function with one argument - the registered FFUser errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage Additionally upon success, the values for some other properties that are accessible by your application are set:
String loggedInSessionId is set to the SessionId returned by your app's backend
String loggedInUserName is set to the UserName
BOOL this.loggedIn() will return true.- Source:
- FatFractal.js, line 567
- See:
-
logout
-
Explicit logout from your app's backend.
Parameters:
Name Type Description successCallbackFunction Function with one argument - the response object errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage
Sets #loggedInSessionId to null, #loggedInUserName to null, #loggedInUser to null, #loggedIn to false- Source:
- FatFractal.js, line 614
-
postObjToExtension
-
Asynchronous method with an successCallback and an errorCallback that will POST some data to a server extension.
Parameters:
Name Type Description objObject The object to be serialized and POSTed to your server extension extensionUriString The name of the server extension successCallbackFunction Function with one argument - the response object errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 798
Returns:
does not return anything directly - response is via the successCallback function or errorCallback function. -
register
-
Registers a new FFUSer Currently a successful registration will also log the user in.
Parameters:
Name Type Description registerRequestRegisterRequest Register request object successCallbackFunction Function with one argument - the registered FFUser errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage Additionally upon success, the values for some other properties that are accessible by your application are set:
String loggedInSessionId is set to the SessionId returned by your app's backend
String loggedInUserName is set to the UserName
BOOL loggedIn is set to true.- Source:
- FatFractal.js, line 520
-
serverStatusMessage
-
This method is used to get the last server status message from an HTTP request.
- Source:
- FatFractal.js, line 329
Returns:
returns the status message from the last HTTP request.- Type
- String
-
sessionId
-
Get the sessionId . This can only be set with login or register methods.
Returns:
Returns an String sessionId if logged in, else null. -
setBaseUrl
-
This method is used to set the m_baseUrl for the FatFractal library.
Parameters:
Name Type Description baseString the value the m_baseUrl will be set to. - Source:
- FatFractal.js, line 197
-
setDebug
-
This method is used to set the Debug mode for the FatFractal library to true, which generates console.log messages for most operations or false which will generate error messages only.
Parameters:
Name Type Description tfBoolean will set the debug mode to true or false. - Source:
- FatFractal.js, line 122
-
setDefaultPermission
-
Set the default permissions for this object. If object has a specific ACL, it is removed so that the defaults apply (PERMIT commands or, if there are no PERMIT commands, the overall system default (public can read, only creator can write)
Parameters:
Name Type Description objObject the object for which we are setting permissions successCallbackFunction errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 355
-
setPermission
-
Set an object-specific ACL. Permissions are granted to read or write an object by user and by group. Once permission is granted to read or write an object by user, that permission persists until the method is reissued. If users are added or taken out of groups, the corresponding permissions for that group obtain dynamically.
Parameters:
Name Type Description objString the object for which we are setting permissions readUsersArray must be an array of FFUser each of which is to be given read access to the object writeUsersArray must be an array of FFUser each of which is to be given write access to the object readGroupsArray must be an array of FFUserGroup each of which is to be given read access to the object writeGroupsArray must be an array of FFUserGroup each of which is to be given write access to the object successCallbackFunction errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 388
-
setSSLUrl
-
This method will set the m_sslUrl for the FatFractal library.
Parameters:
Name Type Description baseString the value the m_sslUrl will be set to. - Source:
- FatFractal.js, line 226
-
updateObj
-
Update an object on your FatFractal application backend.
Parameters:
Name Type Description objObject The object to be created. successCallbackFunction Function with two arguments - the actual data returned, and the accompanying statusMessage errorCallbackFunction Function with two arguments - Number statusCode and String statusMessage - Source:
- FatFractal.js, line 720
-
<inner> getReferredObject
-
Get a referred object
Parameters:
Name Type Description refNameString the name of the reference relationship objObject the referring object - Source:
- FatFractal.js, line 985