cancel
Showing results for 
Search instead for 
Did you mean: 

Encoding/storage mechanism of MX_USER_PREFS attribute

lambert-giese
Active Participant
0 Kudos

Dear experts,

I was wondering whether it's possible to programmatically set a default for users' UI task favourites, i.e. the push buttons that will be displayed in their IDM Web Dynpro UI.

When investigating the AVALUE column of attribute MX_USER_PREFS in database view IDMV_VALUE_BASIC, I expected to find the same key=values pairs in clear text that are displayed when editing this attribute from a UI task. However, that's not the case. The actual AVALUEs look very different; examples are shown below.

Questions:

  1. What encoding is used to transform the key=value pairs to their encoded form (example 1)?
  2. Where is the actual value stored when the size exceeds AVALUE's size limit and only the MD5 hash is stored in AVALUE (example 2)?

Best regards,

Lambert

Example 1

Iy0tTm8gaGVhZGVyLS0KI01vbiBTZXAgMDEgMTY6MDg6NTUgQ0VTVCAyMDE0CkVudHJ5U2Vh

cmNoQ29tcC5UYWJsZVNvcnQuMTQuc29ydENvbHVtbj1jb2x1bW5fMQpFbnRyeVNlYXJjaENv

bXAuUmVzdWx0VGFibGUuVmlzaWJsZVJvd3M9MjUKRW50cnlTZWFyY2hDb21wLkZhdm9yaXRl

LjE1LjE9MzA2MnwwfEFjdGl2ZSBEaXJlY3RvcnkgR3J1cHBlIGFubGVnZW4KRW50cnlTZWFy

Y2hDb21wLlRhYmxlU29ydC4xNC5zb3J0RGlyZWN0aW9uPVVQCkVudHJ5U2VhcmNoQ29tcC5U

YWJsZVNvcnQuMTEuc29ydERpcmVjdGlvbj1ET1dOCkVudHJ5U2VhcmNoQ29tcC5GYXZvcml0

ZS4xMS4xPTI4OTN8MHxQcm9kdWt0IGFubGVnZW4KRW50cnlTZWFyY2hDb21wLlRhYmxlU29y

dC4xMS5zb3J0Q29sdW1uPWNvbHVtbl8xCg

Example 2

!<MD5=10AF3BF3D32F656ED90DF79BF989250C SIZE=2128>

Accepted Solutions (1)

Accepted Solutions (1)

former_member2987
Active Contributor

Lambert,

I think it's Base 64 encoded.  , didn't you play with this once upon a time?

Matt

jared_kobe
Participant

Yes, it is possible to set the default favorites for a user programmatically. We do it whenever a user is added to the Identity Store. Editing existing favorites for users that have set them up on their own is pretty complicated, though, and we have not attempted that.

The MX_USER_PREFS attribute is Base64 encoded. If you run a To ASCII pass and run the attribute through a script that just outputs the results of the uFromBase64() function, you can look at the formatting of the attribute. It is my understanding that the MD5 hashing of the attribute is just used to try to shorten it to fit within the SQL column requirements. If you run it through the same Base64 decoding, it should still work.

All you need to do to set the favorites is to encode the text in Base64 and write it to the attribute. The important line of our script looks like this:

OutString = uToBase64("EntrySearchComp.Favorite.58.1=768|0|Create User\nComp.Favorite.58.2=792|-100|Edit Existing User\n");

Each favorite is separated by a line break, hence the "\n". The format is:

EntrySearchComp.Favorite.[Entry Type ID].[Button Order]=[Task ID]|[0 for Create, -100 for Edit]|[Button Text]


You can also swap out "Favorite" for "TableSort" and then everything from "Button Order" on is different, some examples there would be .sortColumn=column_5 and also .sortDirection=UP.

There is some header information in the attribute about when it was last edited by the user. In my script code, that is being ignored.

lambert-giese
Active Participant
0 Kudos

Thanks Jared and Matt,

your solution works perfectly. The data is indeed BASE64-encoded.

Just for completeness: I've had a closer look at the tables for example 2 and it seems that the full value is stored in MXI_VALUES.ALONG if the size exceeds AVALUE's limit.

Best regards,

Lambert

Answers (0)