customizing user profiles

25
Customizing User Profiles Andy Keller Director of Engineering Dave Shepperton Senior Software Engineer

Upload: traction-software-inc

Post on 15-Jan-2015

1.132 views

Category:

Technology


1 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Customizing User Profiles

Customizing User Profiles

Andy KellerDirector of Engineering

Dave SheppertonSenior Software Engineer

Page 2: Customizing User Profiles

2

Overview

• User Profile Architecture

• Customizations

• Adding new fields

• Modifying profile display

• Custom data sources

Page 3: Customizing User Profiles

3

User Profile Architecture

• Schema

• User Profile Display

• Form Rendering

Page 4: Customizing User Profiles

4

User Profile Schema

• Configuration

• config/data/forms/profile.properties

• Schema XML

• config/data/forms/profile.sdl

Page 5: Customizing User Profiles

5

config/data/forms/profile.properties

# special form factory for profilesclass=tsi.sdk.data.ProfileFormFactory

# located in the current directoryxml=config.data.forms.profile

# user must be last, because it will store the entry fqidsources=entry,ldap,user

# make these entries profilesentry_custom_type=profile

Page 6: Customizing User Profiles

6

config/data/forms/profile.sdl

Page 7: Customizing User Profiles

7

config/data/forms/profile.sdl

• This is XML

<?xml version="1.0"?>

• Three XML tags

<form>

<group>

<field>

Page 8: Customizing User Profiles

8

profile.sdl: <form>

• The class attribute can be used for css styling

• Other attributes can be used when the form

appears in a dialog

• title, width

<form class=”userprofile-form”>

Page 9: Customizing User Profiles

9

profile.sdl: <group>

• Currently, the only group type is fieldset. There may be more

in the future.

• The label attribute specifies the label for the group.

<group type=”fieldset” label=”Basic Information”>

Page 10: Customizing User Profiles

10

profile.sdl: <field>

• Attributes

• type - the type of the form control

• source - the source of the data for read/write

• name - the name of the property

• label - the text label for the form field

• description - a description of the form field

• (other) - Depending on the field type, additional attributes may be used

<field type=”text” name=”property_twitter” label=”Twitter ID”>

Page 11: Customizing User Profiles

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

usersUser pillbox, completes against all users in the system

membersUser 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!

Page 12: Customizing User Profiles

12

User Profiles in Proteus

• Automatically included in any Proteus view that is in

the userprofile tabs family.

• com/traction/sdl/gwtrpc/userprofile_details.sdl,

broken into groups per column:

• basic, contact, other

• Modify by overriding individual functions in your

plug-in, e.g.,

plugins/com.example.customprofile/com/traction/sdl

/gwtrpc/userprofile_details.sdl

Page 13: Customizing User Profiles

13

User Profile Entry Tokens

• profile_title and profile_body use SDL functions in

com/traction/sdl/token/profile.sdl

Page 14: Customizing User Profiles

14

Customizing the User Profile Form

For Example: Add a field for the user’s LinkedIn

public profile URL

In a new plug-in:

1. Create a custom version of the schema

2. Override some SDL functions to display the

property in the profile header

3. Override some SDL functions to include the

property in full text renderings (for search results)

Page 15: Customizing User Profiles

15

Customizing the User Profile Form (cont’d)• Create a plug-in, e.g.

plugins/com.traction.profilelinkedin

• Copy config/data/forms/profile.sdl used to generate XML schema to

plugins/com.traction.profilelinkedin/config/data/forms

• Add the field where you want it in the form:

Page 16: Customizing User Profiles

16

Customizing the User Profile Form (cont’d)

The structure of the schema is used to automatically

generate the form:

Page 17: Customizing User Profiles

17

Customizing the Display of User Profile Information

plugins/com.traction.profilelinkedin/com/traction/

sdl/gwtrpc/userprofile_details.sdl, start by copying

just these two functions:

•display-secure-contact function

•fill-custom-entry-props function

Page 18: Customizing User Profiles

18

Customizing the Display of User Profile Information (cont’d)

Profile data are loaded from the User and profile

Entry in SDL (com.traction.sdl.token.profile#fill)

fill-custom-entry-props Function Names the

Same Property Given in the Schema:

Page 19: Customizing User Profiles

19

Customizing the Display of User Profile Information (cont’d)

Modify the custom version of display-secure-contact to display the LinkedIn URL:

Page 20: Customizing User Profiles

20

Customizing the Display of User Profile Information (cont’d)

A separate modification is required to make the

property searchable.

•plugins/com.traction.profilelinkedin/com/traction/

sdl/token/profile.sdl, start by copying just these two

functions:

•fulltextbody-custom function

•fill-custom-entry-props function

Page 21: Customizing User Profiles

21

Customizing the Display of User Profile Information (cont’d)

Profile data are loaded from the User and profile

Entry in SDL (com.traction.sdl.token.profile#fill)

fill-custom-entry-props Function Names the

Same Property Given in the Schema:

Page 22: Customizing User Profiles

22

Customizing the Display of User Profile Information (cont’d)

The fulltextbody-custom function can be used

to include the property in the full-text rendering so

that it appears in search results:

Page 23: Customizing User Profiles

23

Profile information from Active Directory / LDAP

Active Directory Properties Viewed using JXplorer

Page 24: Customizing User Profiles

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

Page 25: Customizing User Profiles

25

Custom DataSources

• Currently have user, entry, and ldap

• user is for user preferences

• entry is for entry properties and is used for

settings not traditionally in user preferenes

• ldap is for properties store in ldap

• It’s possible to create new sources to pull content

from a database, web service, etc.