Customizing User Profiles

1,357 views

Published on

Andy Keller and Dave Shepperton, Traction Software. Traction User Group, Oct 14 2010, Newport RI. TUG 2010 Newport slides, agenda and more see www.TractionSoftware.com

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,357
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Customizing User Profiles

  1. 1. Customizing User Profiles <ul><li>Andy Keller Director of Engineering </li></ul>Dave Shepperton Senior Software Engineer
  2. 2. Overview <ul><li>User Profile Architecture </li></ul><ul><li>Customizations </li></ul><ul><ul><li>Adding new fields </li></ul></ul><ul><ul><li>Modifying profile display </li></ul></ul><ul><ul><li>Custom data sources </li></ul></ul>
  3. 3. User Profile Architecture <ul><li>Schema </li></ul><ul><li>User Profile Display </li></ul><ul><li>Form Rendering </li></ul>
  4. 4. User Profile Schema <ul><li>Configuration </li></ul><ul><ul><li>config/data/forms/profile.properties </li></ul></ul><ul><li>Schema XML </li></ul><ul><ul><li>config/data/forms/profile.sdl </li></ul></ul>
  5. 5. config/data/forms/profile.properties <ul><li># special form factory for profiles </li></ul><ul><li>class=tsi.sdk.data.ProfileFormFactory </li></ul><ul><li># located in the current directory </li></ul><ul><li>xml=config.data.forms.profile </li></ul><ul><li># user must be last, because it will store the entry fqid </li></ul><ul><li>sources=entry,ldap,user </li></ul><ul><li># make these entries profiles </li></ul><ul><li>entry_custom_type=profile </li></ul>
  6. 6. config/data/forms/profile.sdl
  7. 7. config/data/forms/profile.sdl <ul><li>This is XML </li></ul><ul><ul><ul><ul><ul><li><?xml version=&quot;1.0&quot;?> </li></ul></ul></ul></ul></ul><ul><li>Three XML tags </li></ul><ul><ul><ul><li><form> </li></ul></ul></ul><ul><ul><ul><ul><ul><li><group> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><field> </li></ul></ul></ul></ul></ul>
  8. 8. profile.sdl: <form> <ul><ul><li>The class attribute can be used for css styling </li></ul></ul><ul><ul><li>Other attributes can be used when the form appears in a dialog </li></ul></ul><ul><ul><ul><li>title, width </li></ul></ul></ul><ul><ul><li><form class=”userprofile-form”> </li></ul></ul>
  9. 9. profile.sdl: <group> <ul><li>Currently, the only group type is fieldset. There may be more in the future. </li></ul><ul><li>The label attribute specifies the label for the group. </li></ul><group type=”fieldset” label=”Basic Information”>
  10. 10. profile.sdl: <field> <ul><li>Attributes </li></ul><ul><ul><li>type - the type of the form control </li></ul></ul><ul><ul><li>source - the source of the data for read/write </li></ul></ul><ul><ul><li>name - the name of the property </li></ul></ul><ul><ul><li>label - the text label for the form field </li></ul></ul><ul><ul><li>description - a description of the form field </li></ul></ul><ul><ul><li>(other) - Depending on the field type, additional attributes may be used </li></ul></ul><field type=”text” name=”property_twitter” label=”Twitter ID”>
  11. 11. profile.sdl: <field> types text Text input or text area if rows attribute is specified select Pulldown with option elements or special name=project date Date selector that allows choosing a day using a calendar html HTML block that can be used for adding fixed content readonly Displays as non-editable text, often used with source=ldap projectselect Link, click to show select with project list label Label pillbox labelselect Label select input with options or project and prefix users User pillbox, completes against all users in the system members User pillbox, completes against space members, then all goalselector Allows selection of a goal, called a project in the interface milestoneselector Allows selection of a milestone richtext Coming soon! attachments Coming soon!
  12. 12. User Profiles in Proteus <ul><li>Automatically included in any Proteus view that is in the userprofile tabs family. </li></ul><ul><li>com/traction/sdl/gwtrpc/userprofile_details.sdl, broken into groups per column: </li></ul><ul><ul><li>basic, contact, other </li></ul></ul><ul><li>Modify by overriding individual functions in your plug-in, e.g., plugins/com.example.customprofile/com/traction/sdl/gwtrpc/userprofile_details.sdl </li></ul>
  13. 13. User Profile Entry Tokens <ul><li>profile_title and profile_body use SDL functions in com/traction/sdl/token/profile.sdl </li></ul>
  14. 14. Customizing the User Profile Form <ul><li>For Example: Add a field for the user’s LinkedIn public profile URL </li></ul><ul><li>In a new plug-in: </li></ul><ul><li>Create a custom version of the schema </li></ul><ul><li>Override some SDL functions to display the property in the profile header </li></ul><ul><li>Override some SDL functions to include the property in full text renderings (for search results) </li></ul>
  15. 15. Customizing the User Profile Form (cont’d) <ul><li>Create a plug-in, e.g. plugins/com.traction.profilelinkedin </li></ul><ul><li>Copy config/data/forms/profile.sdl used to generate XML schema to plugins/com.traction.profilelinkedin/config/data/forms </li></ul><ul><li>Add the field where you want it in the form: </li></ul>
  16. 16. Customizing the User Profile Form (cont’d) <ul><li>The structure of the schema is used to automatically generate the form: </li></ul>
  17. 17. Customizing the Display of User Profile Information <ul><li>plugins/com.traction.profilelinkedin/com/traction/sdl/gwtrpc/userprofile_details.sdl, start by copying just these two functions: </li></ul><ul><li>display-secure-contact function </li></ul><ul><li>fill-custom-entry-props function </li></ul>
  18. 18. Customizing the Display of User Profile Information (cont’d) <ul><li>Profile data are loaded from the User and profile Entry in SDL (com.traction.sdl.token.profile#fill) </li></ul><ul><li>fill-custom-entry-props Function Names the Same Property Given in the Schema: </li></ul>
  19. 19. Customizing the Display of User Profile Information (cont’d) <ul><li>Modify the custom version of display-secure-contact to display the LinkedIn URL: </li></ul>
  20. 20. Customizing the Display of User Profile Information (cont’d) <ul><li>A separate modification is required to make the property searchable. </li></ul><ul><li>plugins/com.traction.profilelinkedin/com/traction/sdl/token/profile.sdl, start by copying just these two functions: </li></ul><ul><li>fulltextbody-custom function </li></ul><ul><li>fill-custom-entry-props function </li></ul>
  21. 21. Customizing the Display of User Profile Information (cont’d) <ul><li>Profile data are loaded from the User and profile Entry in SDL (com.traction.sdl.token.profile#fill) </li></ul><ul><li>fill-custom-entry-props Function Names the Same Property Given in the Schema: </li></ul>
  22. 22. Customizing the Display of User Profile Information (cont’d) <ul><li>The fulltextbody-custom function can be used to include the property in the full-text rendering so that it appears in search results: </li></ul>
  23. 23. Profile information from Active Directory / LDAP Active Directory Properties Viewed using JXplorer
  24. 24. Profile information from Active Directory / LDAP Add it to the Profile Schema in config/data/forms/userprofile.sdl Render it using user.profile and property.value
  25. 25. Custom DataSources <ul><li>Currently have user, entry, and ldap </li></ul><ul><ul><li>user is for user preferences </li></ul></ul><ul><ul><li>entry is for entry properties and is used for settings not traditionally in user preferenes </li></ul></ul><ul><ul><li>ldap is for properties store in ldap </li></ul></ul><ul><li>It’s possible to create new sources to pull content from a database, web service, etc. </li></ul>

×