- 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)
|
(bool) true if a space was found; false if a space was not found |
doesCompanyExist((str)companyName)
|
(bool) true if a company was found; false if a company was not found |
createCompany((str)companyName)
|
(bool) true if a company was created; false if a company was not created |
createSubSpace((str)subSpaceName,(str) parentSpaceName, (bool) isParentSpaceNameID)
|
(bool) true if a subspace was created; false if a subspace was not created |
attachSpaceToCompany((str)spaceName,(str) companyName)
|
(bool) true if a space was attached; false if a space was not attached |
createCompanySpacePair((str)companyName)
|
(bool) true if a pair was created; false if a pair was not created |
getTopSpace()
|
JSON of top space record, undefined if multiple top spaces or none |
getTopSpaces()
|
JSON array of top space records (should only be one) |
getSpacesRowCanMoveTo()
|
Array list of compatible spaces for record |
getCompanyDataForSpace((str)spaceId (bool)exactOnly)
|
Map of company name and ID |
getSpaceDataForCompany((str)companyId)
|
Map of spaceID |
createSpace((str)name,(str)parentSpaceId)
|
(bool) True or false depending on if space was created. |
removeSpace((str)spaceId)
|
(bool) True or false depending on if space was removed. |
getTrustByFromAndTo((str)fromId,(str)toId)
|
Returns JSON of trust record, undefined if trust record cannot be found |
getGroupsInTrust((str)id)
|
Returns JSON array of group records |
getSpaceById((str)id)
|
Returns JSON of space record |
getSpaceByName((str)name)
|
Returns JSON of space record |
getSpacesByName((str)name)
|
Returns JSON array of space records |
runScriptInSpace(bundle,space,code,vars,resultVar,codeTitle)
|
in progress... |
getSpaceChain()
|
(String) Array list of space chain |
getSpacesInChainThatHaveBucket(bucketID, fromServiceProvider)
|
in progress... |
getClosestAccessibleServiceProviderSpace()
|
in progress... |
getFRecordServiceProvider((str)bucketName)
|
FRecord of service provider space |
getFRecordFromHomeSpace((str)bucketId, (bool)searchHomeSubSpaces )
|
in progress... |
getFRecordWithSubSpaceSearchIfNecessary((str)choiceBucketName, (str)widgetManagerBucketName,(str)recordValues )
|
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 )
|
(str) space id |
_findCompanySyncSlot(slots, fallbackToCompany)
|
in progress... |
getFRecordWithSubSpaceSearch((str)bucketName, (bool)forceSubSearch)
|
FRecord of bucket (with all subspaces included) |
getFRecordProviderSearch((str)bucketName)
|
(in progress...) FRecord |
getSubspaces((bool) recursive)
|
(in progress...) List<Map<String, String>> space ids |
getSubspacesThatPassSecurityCheckToBucket((str) operationType, (str) bucketID)
|
(in progress...) List<Map<String, String>> space ids |
