Add getName() method to Role to support localized role label

Description

This issue is related to SAK-25889.
Since it seems no way to make KNL issue as a sub-task of SAK issue, I have to create this issue directly.

The detail can be found in SAK-25889.

Refer to org.sakaiproject.tool.impl.ToolImpl.getDescription(), I will use the same way to support localized role label.
So a getName() function is added to Role to get the localized label.
Besides, a getLocalizedDescription() function is added.
The existed getDescription() function remains.

Some properties file should be added first. These changes can be found in SAK-25890.

IMPORTANT:
When a site is created, the role description will be automatically set in DB table sakai_realm_role_desc.
And the getLocalizedDescription first get the getDescription value to handle customized value.
So, to get the localized description, update.sql should be executed.
To prevent new created site to use this feature, the patch sql.diff should be applied.

kernel.diff contains the patch to add the 2 new methods.
sql.diff contains the patch to prevent default description be set when a new site is created.
update.sql contains SQL to update the sakai_realm_role_desc table.

The patch is based on 1.3.x branch

Attachments

4

Activity

Show:

Matthew Jones April 24, 2018 at 10:34 AM

Bulk closing issues that have not been updated since 2015 and earlier. Please reopen if this is still an issue and you have new information or if this is a feature you'd like to still have consideration for.

Gao Jun July 14, 2014 at 12:54 AM

In most cases, use one getDescription() will be fine except editing the role description. May be additional check should be made to identify whether the 'default' description is changed.
So, if this can be accepted, one method is enough.

Aaron Zeckoski July 11, 2014 at 7:49 AM

We discussed on the call that just changing getDescription is the right way to do this (along with a couple other changes). We won't merge the patch with a getLocalizedDescription method.

Matthew Buckett July 11, 2014 at 7:44 AM

Great. Is there a reason we can't just have getDescription() and not add the getLocalizedDescription()?

Gao Jun July 10, 2014 at 10:07 AM

To Matthew Buckett,
Just the opposite, while the function getLocalizedDescription() invoked, it first try to fetch the m_description (if the description is customized, it will be return first), if m_description remain empty, then return the localized description. see kernel.diff
I know the name of the function is not good.

Also, to get the make the default m_description to empty, some SQL should be executed, see update.sql

See the screenshots in SAK-25889, different-role1.png, the description of 'maintain' is override by admin, and show the customized value.

So, in short, if the description is override by admin, this function just return the customized value.

Won't Fix

Details

Priority

Affects versions

Components

Assignee

Reporter

Labels

Created March 19, 2014 at 9:48 PM
Updated April 25, 2018 at 3:39 PM
Resolved April 24, 2018 at 10:34 AM