Velocity context objects
EduBrite environment provides customisation using Velocity ( Velocity is a Java-based template engine.)
The Site Page Template, "Imported" (with #import) Site Page Include, and any widgets velocity files (.vm files, for UI rendering) are run through velocity engine. There are few common objects which are by default available in velocity context. In addition depending on each widgets business logic there will be contextual objects with relevant data available in velocity context.
In velocity variables are accessed by "$" prefix
Here are common object available in context and their usage
UI / UIContext
Most widely used context object is UI accessed in velocity $UI ( aka UIContext)
$UI.isGuest() | boolean | Return true, If is anonyomous user. It returns falses in case of user is logged in. |
$UI.isL2AdminSiteAdmin() | boolean | Returns true if logged in user in Site Admin or EduBrite's support admin |
$UI.getCurrentUser().getFirstName() | String | FirstName |
$UI.getCurrentUser().getLastName() | String | LastName |
$UI.getCurrentUser().getEmail() | String | |
$UI.getCurrentUser().getStatus() | String | Value could be ACTIVE / INACTIVE |
$UI.getUrl() | String | Current URL |
$UI.getQueryString() | String | Query String |
$UI.getSite().getName() | String | Current Site's name |
$UI.getUserAgent() | String | Http user agent string |
$UI.getReferrer() | String | Referrer url |
$UI.getCurrentTimezone() | String | Returns current site timezone code exmaple : GMT / PST |
$UI.getCaption(String Key) | String - Key defined in site placements custom label | Returns i18N string value of as defined in site |
Common helper Classes / Objects
Other commonly used utilities (objects and classes) available are
- $numberTool => Velocity's NumberTool object ( Read more )
-
$math => Velocity's MathTool object ( Read more)
-
$escTool => Velocity's EscapeTool object ( Read more)
-
$JsonHelper => class reference of EduBrite's Json Helper with following static helper methods for json handling
$JsonHelper.safePutObj(String key, Object val, JSONObject obj) | Puts object "val" in JSONObject obj with key "key" |
$JsonHelper.safeGetObj(String key, JSONObject obj) | Gets object from JSONObject obj with key "key" |
$JsonHelper.safePutInArr(JSONArray arr, Object val) | Puts object "val" in JSONArray arr |
$JsonHelper.safeGetArray(String key, JSONObject obj) | Gets JSONArray from JSONObject obj with key "key" |
$JsonHelper.safeGetStr(String key, JSONObject obj) | Gets String from JSONObject obj with key "key" |
$JsonHelper.safeGetFloat(String key, JSONObject obj) | Gets Float from JSONObject obj with key "key" |
$JsonHelper.safeGetInteger(String key, JSONObject obj) | Gets Integer from JSONObject obj with key "key" |
$JsonHelper.fullySafeGetBoolean(String key, JSONObject obj) | Gets Boolean from JSONObject obj with key "key" |
$JsonHelper.createJSONObject(String objStr) | Create Json object from a valid json string |
$JsonHelper.deepMerge(JSONObject source, JSONObject target) | Merge "source" into "target". If fields have equal name, merge them recursively. |
Related Pages
Group Management
Javascript
- Customization On Payment Page
- Validate IP Address while accessing the course
- UI Customization JavaScript Functions
- Verify Custom properties during Test Taking
- Verifying User Properties During Test
- JS Example
- example_custom_scripts
- Test Taking - Customization using callback mechanism
- Cms Calendar Example
Reports
Enrollment Management
- API - Update Event Subscription
- API - Create ExamTestInstance
- Update Program Member - via Program Session Id
- Update Program Member
- API - Self Enroll in Course Session
- Update Course Session Member
- API - Self Enroll in Program Session
- API - Self Enroll in Event
- API - Enroll Users in Course Session
- API - Enroll Users in Program Session
- API - Enroll Users in Event
- API - Enroll Users in Program
Other
Introduction
Report
- Get Sites Metadata
- Get Open Learning Items List
- API - Program Enrollment Summary
- API - Course Enrollment Summary
- Get Catalog Items List
- API - Course Session Members list
- API - Program Members List
- Event participants list
- Api - Test Attempts (Test Instances) List
- Test instance details list
- Api - Non Subscribed Event List
- Api - Subscribed Event List
- API - List All Report Schedules
- API - Get Latest Report Content For A Given Schedule ID
- API - Get Report Content For A Given Report ID
- API - List Reports For A Given Schedule
User Management
- API - User list
- API - Get user details
- Api - User Creation
- API - Create User (With Custom Properties)
- API - Update User
- API - Rename User
- API - Add user to group(s)
- API - Remove user from group(s)
- Merge User Accounts
- API - Activate User
- API - Deactivate User
- API - Change User's Origin Site
- Api - User Login (Creating User Session)
eCommerce
Quick Links
- Home
- Knowledgebase
- Video Tutorials
- Google Apps Integration
- Gilly (Plugin for Atlassian Confluence)
- EduBrite Mobile App for iPad
Gilly - EduBrite plugin for Confluence
Demo Url: http://gillydemo..edubrite.com
User: demo1, demo2
Password: password
EduBrite Mobile app for iPad
Download the app from app store
Demo Microsite: ipaddemo.edubrite.com
Signup from the app by selecting any username, and entering above demo url as training site url
EduBrite Business Edition
Demo Url: http://learnzone.edubrite.com
Signup as a user (trainee) and see the whole experience of enrolling and running the courses and tests
Group Management
Javascript
- Customization On Payment Page
- Validate IP Address while accessing the course
- UI Customization JavaScript Functions
- Verify Custom properties during Test Taking
- Verifying User Properties During Test
- JS Example
- example_custom_scripts
- Test Taking - Customization using callback mechanism
- Cms Calendar Example
Reports
Enrollment Management
- API - Update Event Subscription
- API - Create ExamTestInstance
- Update Program Member - via Program Session Id
- Update Program Member
- API - Self Enroll in Course Session
- Update Course Session Member
- API - Self Enroll in Program Session
- API - Self Enroll in Event
- API - Enroll Users in Course Session
- API - Enroll Users in Program Session
- API - Enroll Users in Event
- API - Enroll Users in Program
Other
Introduction
Report
- Get Sites Metadata
- Get Open Learning Items List
- API - Program Enrollment Summary
- API - Course Enrollment Summary
- Get Catalog Items List
- API - Course Session Members list
- API - Program Members List
- Event participants list
- Api - Test Attempts (Test Instances) List
- Test instance details list
- Api - Non Subscribed Event List
- Api - Subscribed Event List
- API - List All Report Schedules
- API - Get Latest Report Content For A Given Schedule ID
- API - Get Report Content For A Given Report ID
- API - List Reports For A Given Schedule
User Management
- API - User list
- API - Get user details
- Api - User Creation
- API - Create User (With Custom Properties)
- API - Update User
- API - Rename User
- API - Add user to group(s)
- API - Remove user from group(s)
- Merge User Accounts
- API - Activate User
- API - Deactivate User
- API - Change User's Origin Site
- Api - User Login (Creating User Session)
eCommerce
Quick Links
- Home
- Knowledgebase
- Video Tutorials
- Google Apps Integration
- Gilly (Plugin for Atlassian Confluence)
- EduBrite Mobile App for iPad
Gilly - EduBrite plugin for Confluence
Demo Url: http://gillydemo..edubrite.com
User: demo1, demo2
Password: password
EduBrite Mobile app for iPad
Download the app from app store
Demo Microsite: ipaddemo.edubrite.com
Signup from the app by selecting any username, and entering above demo url as training site url
EduBrite Business Edition
Demo Url: http://learnzone.edubrite.com
Signup as a user (trainee) and see the whole experience of enrolling and running the courses and tests