SpacesModule

From Dreamtsoft Wiki
Jump to: navigation, search
  • Methods to manipulate spaces
  • Required by using require('ds.base/Spaces')

Examples

Create a company/space pair

var spaceUtil = require('ds.base/Spaces');
var su = new spaceUtil();
su.createCompanySpacePair('ExampleCompany')

Create a subspace with only names

var spaceUtil = require('ds.base/Spaces')
var su = new spaceUtil();
su.createSubSpace('newSubSpace','theParentSpace', false) //last arg is wether the second arg is an ID or a name

Create a subspace with name and ID

var spaceUtil = require('ds.base/Spaces')
var su = new spaceUtil();
su.createSubSpace('newSubSpace','3dabb734dfd24b57bc162ca94e6c7d27', true) //last arg is wether the second arg is an ID or a name

Methods

Details Returns


doesSpaceExist((str)spaceName)
Check to see if a space/subspaces (relative to current space) exists.
(bool) true if a space was found; false if a space was not found
doesCompanyExist((str)companyName)
Check to see if a company exists.
(bool) true if a company was found; false if a company was not found
createCompany((str)companyName)
Creates a company record in current space company bucket.
(bool) true if a company was created; false if a company was not created
createSubSpace((str)subSpaceName,(str) parentSpaceName, (bool) isParentSpaceNameID)
Creates a subspace to specified parent space.
(bool) true if a subspace was created; false if a subspace was not created
attachSpaceToCompany((str)spaceName,(str) companyName)
Attaches space to a company record.
(bool) true if a space was attached; false if a space was not attached
createCompanySpacePair((str)companyName)
Creates a subspace to current space and company with name of companyName, then attaches the space to company record.
(bool) true if a pair was created; false if a pair was not created
getTopSpace()
Returns JSON of top space record
JSON of top space record, undefined if multiple top spaces or none
getTopSpaces()
Returns JSON array of top spaces records
JSON array of top space records (should only be one)
getSpacesRowCanMoveTo()
Returns array list of spaces a record could be moved to, depending if the space has the needed bucket and bundle to store the record.
Array list of compatible spaces for record
getCompanyDataForSpace((str)spaceId (bool)exactOnly)
Returns map of company name and ID attached to a specific space.
Map of company name and ID
getSpaceDataForCompany((str)companyId)
Returns map of space ID attached to a specific company.
Map of spaceID
createSpace((str)name,(str)parentSpaceId)
Creates a new subspace to given parentSpaceID
(bool) True or false depending on if space was created.
removeSpace((str)spaceId)
Removes a space specified by given spaceId
(bool) True or false depending on if space was removed.
getTrustByFromAndTo((str)fromId,(str)toId)
Returns JSON of trust record
Returns JSON of trust record, undefined if trust record cannot be found
getGroupsInTrust((str)id)
Searches for trust by id in group to trust bucket, returns JSON array of group records
Returns JSON array of group records
getSpaceById((str)id)
Searches for a space with corresponding id
Returns JSON of space record
getSpaceByName((str)name)
Searches for a space with corresponding name
Returns JSON of space record
getSpacesByName((str)name)
Searches for spaces with corresponding name
Returns JSON array of space records
runScriptInSpace(bundle,space,code,vars,resultVar,codeTitle)
in progress...
in progress...
getSpaceChain()
in progress...
(String) Array list of space chain
getSpacesInChainThatHaveBucket(bucketID, fromServiceProvider)
in progress...
in progress...
getClosestAccessibleServiceProviderSpace()
in progress...
in progress...
getFRecordServiceProvider((str)bucketName)
in progress...
FRecord of service provider space
getFRecordFromHomeSpace((str)bucketId, (bool)searchHomeSubSpaces )
in progress...
in progress...
getFRecordWithSubSpaceSearchIfNecessary((str)choiceBucketName, (str)widgetManagerBucketName,(str)recordValues )
in progress...
If parent bucket isn't defined, returns FRecord of bucket on current space. If you are in a MSP space, it will return either a FRecord of bucket on current space or a FRecord of the bucket on current space and subspace(s). If you are in a home space, returns FRecord of bucket on current space. If none of these, returns a FRecord of current space and any subspace(s).
_findSubspaceToSearch((str)bucketId, (bool)searchHomeSubSpaces )
in progress...
(str) space id
_findCompanySyncSlot(slots, fallbackToCompany)
in progress...
in progress...
getFRecordWithSubSpaceSearch((str)bucketName, (bool)forceSubSearch)
Makes a FRecord of specified bucket. Searches current space and all subspaces beneath it.
FRecord of bucket (with all subspaces included)
getFRecordProviderSearch((str)bucketName)
in progress...
(in progress...) FRecord
getSubspaces((bool) recursive)
in progress...
(in progress...) List<Map<String, String>> space ids
getSubspacesThatPassSecurityCheckToBucket((str) operationType, (str) bucketID)
in progress...
(in progress...) List<Map<String, String>> space ids