Class: FatFractal

FatFractal

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
ffUrl String the referenced object's ffUrl
refName String the name we are giving to this reference relationship
obj Object 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
obj Object The object to be created.
collectionUri String The collection name or relative URI in which the object is to be created
successCallback Function Function with two arguments - the actual data returned, and the accompanying statusMessage
errorCallback Function 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
obj Object The object to be deleted.
successCallback Function Function with one argument - the statusMessage
errorCallback Function 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
obj Object 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
extensionUri String The name of the server extension
successCallback Function Function with one argument - the response object
errorCallback Function 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
collectionUri String URI of collection
successCallback Function Function with one argument - the response object
errorCallback Function 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
ffUrl String 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
extensionUri String The name of the server extension
successCallback Function Function with one argument - the response object
errorCallback Function 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
collectionUri String URI of collection
successCallback Function Function with one argument - the response object
errorCallback Function 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
item Object The item which is to be added
parentObj Object The object whose grab bag is going to be updated
gbName String The grab bag name
successCallback Function
errorCallback Function 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
parentObj Object The object from whose grab bag we are retrieving
gbName String The grab bag name
successCallback Function Function with one argument - an array of the objects in this grab bag
errorCallback Function 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
parentObj Object The object from whose grab bag we are retrieving
gbName String The grab bag name
query String The query string in FatFractal Query Language format
successCallback Function Function with one argument - an array of the objects in this grab bag which matched the query
errorCallback Function 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
item Object The item which is to be removed
parentObj Object The object whose grab bag is going to be updated
gbName String The grab bag name
successCallback Function
errorCallback Function 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.
Source:
  • FatFractal.js, line 263
See:
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.
Source:
  • FatFractal.js, line 285
See:
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
username String the user name - can be anything, doesn't have to be meaningful
password String password
successCallback Function Function with one argument - the registered FFUser
errorCallback Function 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
successCallback Function Function with one argument - the response object
errorCallback Function 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
obj Object The object to be serialized and POSTed to your server extension
extensionUri String The name of the server extension
successCallback Function Function with one argument - the response object
errorCallback Function 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
registerRequest RegisterRequest Register request object
successCallback Function Function with one argument - the registered FFUser
errorCallback Function 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.
Source:
  • FatFractal.js, line 307
See:
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
base String 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
tf Boolean 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
obj Object the object for which we are setting permissions
successCallback Function
errorCallback Function 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
obj String the object for which we are setting permissions
readUsers Array must be an array of FFUser each of which is to be given read access to the object
writeUsers Array must be an array of FFUser each of which is to be given write access to the object
readGroups Array must be an array of FFUserGroup each of which is to be given read access to the object
writeGroups Array must be an array of FFUserGroup each of which is to be given write access to the object
successCallback Function
errorCallback Function 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
base String 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
obj Object The object to be created.
successCallback Function Function with two arguments - the actual data returned, and the accompanying statusMessage
errorCallback Function Function with two arguments - Number statusCode and String statusMessage
Source:
  • FatFractal.js, line 720

<inner> getReferredObject

Get a referred object
Parameters:
Name Type Description
refName String the name of the reference relationship
obj Object the referring object
Source:
  • FatFractal.js, line 985