One Purpose Servlets

Abishek, tri
Content to Base64

This servlet was supposed to encode the content on binary fields to Base64. The GET request would take two parameters - recordId and fieldName - and the response would have the encoded content. Pretty useful for integrations.


Decode Base64 and Attach to Document

Decodes Base64 content, gets document recordId, uploads decoded content to document record. Reverse of the previous servlet, sort of.


SQL Runner

Runs SQL selects right from the browser or an API client and responds with the result, with the right exceptions and also returns a header with the result count.


Log out all users

The idea for this was to emulate the Log Out Users button from the Admin console. However, I couldn't do it the way the platform did it. So, I tried to workaround it by using the database. There is a table that holds active users - in which I just delete all rows!

I had no idea if it was safe (probably not) but it worked. Took a couple of seconds and if you were an active user, you would get the logged out popup.


Check if user is Admin

Pretty straight forward. The servlet will check whether the user running it is an admin or not.

Uses the database to do this, which isn't efficient. Wouldn't recommend.

This can instead be performed by simply making an API call to a UX datasource of type CURRENT_USER and reading it's response. Way easier to implement and no code required this way.


Lock and Unlock

Locks and unlocks TRIRIGA, without the admin console. That's all it does.