it should be possible to manipulate properties stored in the OS_PROPERTYENTRY table in the database.
Get a string property associated with a content entity object, or null if that property is not set. String properties can not be longer than 255 characters
entity | the entity the property is associated with |
---|---|
key | the key with which to look up the property |
The 'entity_name' is stored like 'USERPROPS-userKey'
image2016-8-23 9:53:59.png
String userSiteHome = contentPropertyManager.getStringProperty((ContentEntityObject) user, "confluence.user.site.homepage");
I get the error message:
"com.atlassian.confluence.user.ConfluenceUserImpl cannot be cast to com.atlassian.confluence.core.ContentEntityObject"
Is there 'another' user object I should pass?
Or should I be using UserDetailsManager instead?
String userSiteHome = userDetailsManager.getStringProperty(user, "confluence.user.site.homepage");
This returns 'null'.
Is there a trick on how to use/initialize the UserDetailsManager?
Community moderators have prevented the ability to post new answers.
Hi @Thomas Berger,
we use the UserAccessor to get and manipulate a users homepage, where user is of type ConfluenceUser.
userAccessor.getPropertySet(user).setString(UserPreferencesKeys.PROPERTY_USER_SITE_HOMEPAGE, MY_SPACE_KEY);
Best regards,
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.