Administrative functions


Function

Description

Workspace createDomain(string name, string description)Creates new domain with given name and description
Workspace createDomainFromTemplate(string domain, string name, string description)Creates new domain as copy of another domain given by name
void sendEmail(string recepient, string subject, string templateContent, map templateParams, string locale, MessageHolder messagesHolder)Sends email to one recepient. Content of email is in templateContent. templateParams can be used for variables in your email
void editDoman(Workspace workspaceObj, string name, string description)Edits name and description of provided domain
void deactivateDomain(Workspace workspaceObj)Disables provided domain
void addAdminToDomain(Workspace workspaceObj, userObj user)Assign user to domain and grant him administrator roles
User[] listUsersInDomain(Workspace workspaceObj)Return list of users in provided domain
User[] listUsersByRoleInDomain(role, workspaceObj)Return list of users with specified role in provided domain
User[] listUsersByGroupInDomain(group, workspaceObj)Return list of users from specified group in provided domain. Domain can be filtered using % to act as like
User[] listUsersById(ids[])Return list of users from specified list of ids
User[] listUsersInGroup(groupName, workspaceObj)Return list of users from specified group in provided domain.
User[] listUsersWithoutGroup()Returns list of users from current domain that are not assigned to any group
User[] listUsersWithoutGroup(workspaceObj)Returns list of users from specified domain that are not assigned to any group
User[] listUsersWithoutGroup(workspaceObj, excludeAdmins)Returns list of users from specified domain that are not assigned to any group and exludes admins if true is provided
User getCurrentUser()Returns current user
User getUserById(id)Return user by provided id
UserGroup findGroupByName(groupName, workspaceObj)Returns usergroup from specified workspace searched by name
UserGroup[] listCurrentUsersGroups()Returns list of all groups for current user
UserGroup[] listCurrentUsersGroupsInDomain()Returns list of all groups in current domain for current user
Workspace domainByName(name)Return domain by provided name
Workspace domainBySchema(schema)Return domain by its schema name
Workspace currentDomain()Return current domain
removeUserFromGroups(userIds[], groupObj)Removes users provided by lists of id from specific group
addUsersToGroup(userIds[], groupObj)Add users provided by lists of ids to specific group
addUserToGroups(userObj, groupObj[])Add user to multiple groups
UserGroup[] getGroupsByName(name, workspaceObj)Returns list of group from provided workspace with name, that is under LIKE condition
refreshUsersDomains()Refreshes current users domain user is assgined to
removeUsersFromAllGroups(userIds[])Remove users provide by array of ids from all groups
int countDataset(code, filterObj)Return count of records in from specified dataset. It can also be filtered
toString(LocalDateTime)Format datetime to string
AttributeMember[] listHierarchicalChildMembersForAttribute(dataSetCode, filterObj, attributeId, parentAttributeId)Lists hierarchically stored data in a dataset, where parentAttributeId points to parent record attributeId.
This method lists all rows according to the filter and adds all children rows of these rows.
AttributeMember[] listHierarchicalParentMembersForAttribute(dataSetCode, filterObj, attributeId, parentAttributeId)Lists hierarchically stored data in a dataset, where parentAttributeId points to parent record attributeId.
This method lists all rows according to the filter and adds all parent rows of these rows.
Collection<String> getCurrentUserRoles()Returns collection of string of current user roles
translate(['':'Name','ja':'名前'])Returns either label in given language based on selected localization or default value

loadGeoPoint(mapperName,pointName)

Loads GeoPoint from geo definition given by name. GeoPoint has attributes like name, latitude and longitude.
createUser(json)Creates new user from provided json
updateUser(id,json)Edit specific user selected by id with provided json
listUsersInGroups(String filter, Collection<String> groupNames, PartData partData)Lists all users whose username, name or surname matches filter and users belong to groups by given name. Returns paged data source.
User getUserByUsername(String username)Get user by provided username
Pageable readDataset Part readDataset(dataSetCode, PartData partData, Filter filter)Pageable read dataset
setUserParameter(User user, key, value)Sets specific user's parameters
assignDashboardToUser(User user, dashboardAlias)Shares dashboard to user
createUserGroup(name, description)Creates new usergroup in current domain
editUserGroup(id, name, description)Edit usergroup provided by it's id
deleteUserGroup(id)Deletes usergroup provided by it's id
void deleteUser(User user)Delete user provided by it's object
addRoleToUser(User user, String roleName)Adds role to user
URLEncoder.encodeEncode value for URL
URLDecoder.decodeDecode value from URL
List<DataSource> loadDatasourcesForDataset(Integer dataSetId)Returns list of all datasources when provided ID of dataset
List<DataSource> loadDatasourcesForDataset(String code)Returns list of all datasources when provided ID of dataset
ImportTable loadImport(Integer dataSourceId)Returns import template for given datasource
executeImport(DataSource ds)Executes import of provided datasource.
e.g.
def ds = loadDatasourcesForDataset('TEST_IMPORT')
def i = ds[0]
i.template.source.username = 'username@admin'
i.template.source.password = 'secretpassword'
executeImport(i) 
domainBySchema(String code).appVersion Returns app version of provided domain
File createPdf(final String templateName, final Map<String, Object> templateParams, final String locale, final MessagesHolder messagesHolder, PageSize pageSize, PageOrientation pageOrientation) New function createPdf quite similar to sendEmail has been added to ML. It accepts name of a Freemarker template as the first parameter:

Available Groovy functions

tostring, size, length, split, encode, replace, replaceAll, decode, compareto, equals, isempty, each, groupby, sum, avg, plus, contains, get, join, add, put, getvalues, collect, putall, sort, findall, find

Javascript functions


Function

Description

openBdPopup(url, optional title, optional width, optional height, optional bool buttons)If called within window scope using AJAX it opens system popup
  • No labels