Global Directory
Global Directory
EXPLORE OUR SITES
London Stock Exchange Group
LSEG Data & Analytics
MyAccount
LSEG Perspectives
London Stock Exchange
FTSE Russell
LCH
Contact Us
Home
TR Internal
getting at user preferences from Search module
Benjamin Anderson
I have a story for a feature project (Napa) which requires work in the Search module. I'm adding event data to the event payload. I'm not sure where to get a few of the values from, though:
- User Market Segment
- Whether password is internal or external
- Email address tied to the user's account (same as used for any delivery)
Another dev on our team suggested:
> If you're in static content you can
> simply say
> Cobalt.User.Preference.Get("vertical","preference").
> If you are in another module then you
> would call out to an endpoint on
> Website GET
> V2/Preference?verticalName=vertical&perferenceName=preference
> ... if you have the Website code, you
> can go to a file called
> PreferencesKey.cs and it will have an
> enum of all available preferences
I can't seem to find an equivalent in the Search code. Does anyone know if code to call this endpoint exists already in Search? Or whether that's the right endpoint I need for the values I listed above?
Thanks,
Ben
Find more posts tagged with
search
refinitiv-internal
Accepted answers
shaggyalien
I am not sure if there needs to be a specific implementation for Preferences in every module. `Cobalt.Alerts.UserPreferences.js` or `UserPreferences.js` files in StaticContent is an example that is being used by Alerts. I can confirm that the url is right though.
You can run this simple javascript while you are inside WLN which will inturn call an endpoint, it will fail as the preference name in the code is wrong. You will get to see the endpoint none the less.
`Cobalt.User.Preference.Get("Search","MarketSegment")`
All comments
Susheel Yadav
I don't know WLN inside out, but from the little I know, I think that Search module is one level below the level where security and user preferences are available. It is more like an API layer, with no regard for user related details. Again, I don't claim to know the correct answer or be an expert in Search module, just wanted to give my 2 cents...
mark.maruska
Are you saying that Search should be designed to not need user preferences? ...and any user specific capabilities should be handled elsewhere?
shaggyalien
I am not sure if there needs to be a specific implementation for Preferences in every module. `Cobalt.Alerts.UserPreferences.js` or `UserPreferences.js` files in StaticContent is an example that is being used by Alerts. I can confirm that the url is right though.
You can run this simple javascript while you are inside WLN which will inturn call an endpoint, it will fail as the preference name in the code is wrong. You will get to see the endpoint none the less.
`Cobalt.User.Preference.Get("Search","MarketSegment")`
Quick Links
All Forums
Recent Questions
Terms of use
Privacy & Cookie Statement
Cookies settings
Do not sell my info
Whistleblowing
UK Bribery Act
Modern Slavery Act