Portlet Factory, Version 6.1.2


 

Profile API manipulation

The exposed API on a profile set is identical to that for getting a profile from a profile set, however the name can be either the simple profile name or the fully qualified name that contains its hierarchy. For example:

// you can still do this for profile sets containing non-qualified profile names. Profile profile = profileSet.getProfile("msmith");
// or this to specify the fully qualified name. Profile profile = profileSet.getProfile("MetLife.IBM.HR.msmith");

To add a new profile to a profile set in both naming cases you do the following:

Note: If you use the getName() method from the parent profile then you will always have the correct name to pass to the addProfile() method.

// you can still do this for profile sets containing non-qualified profile names. profileSet.addProfile(profile,"HR");
// or this to specify the fully qualified parent name. profileSet.addProfile(profile, "MetLife.IBM.HR");
// this will always do the right thing profileSet.addProfile(profile, parentProfile.getName());

When creating a new profile object both naming cases work exactly the same way, where you pass the constructor just the short profile name. This name will then be fixed if needed when it is added to the profile set.

For example:

// create a new Profile Profile profile = new Profile("msmith");
// now add it to its parent. This will also fix up the name of the profile to reflect its parent profileSet.addProfile(profile, parentProfile.getName());

Parent topic: Overview: profiling


Library | Support |