Benutzer:MovGP0/70-489/Profiles

aus Wikipedia, der freien Enzyklopädie
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      


Implement Implement User Profiles and Customize Social Workload

Manage User Profile Properties

Create and Update User Profile Properties

  • Requires SSOM:
    • Create User Profile
    • Delete User Profile
    • Create User Profile Property
    • Delete User Profile Property
SSOM Namespaces
Microsoft.Office.Server.UserProfiles
Important Classes
Class Description
ProfilePropertyManager manages type property schemas in the user profile database, which are composed from core properties (ie. PostalAddress, FullName, etc.)
CorePropertyManager manages core properties that compose a user property (ie. Street, HouseNumber, PostalCode, City, FirstName, LastName, MiddleName, etc.)
Example
using(var site = new SPSite("http://server/site"))
{
   var serviceContext = SPServiceContext.GetContext(site);
   var profilePropertyManager = new UserProfileConfigManager(serviceContxt).ProfilePropertyManager;
   var corePropertyManager = profilePropertyManager.GetCoreProperties();

   // create a new core property
   var coreProperty = corePropertyManger.Create(false);
   coreProperty.Name = "MyProperty";
   coreProperty.DisplayName = "My Property";
   coreProperty.Description = "This is a custom property.";
   coreProperty.Type = PropertyDataType.String;
   coreProperty.Length = 100;
   corePropertyManager.Add(coreProperty);

   // create a new type property
   var typePropertyManager = ProfilePropertyManager.GetProfileTypeProperties(ProfileType.User);
   var typeProperty = typePropertyManager.Create(coreProperty);
   typeProperty.IsVisibleOnViewer = true;
   typePropertyManager.Add(typeProperty);

   // create a new subtype property
   var profileSubtypeManager = ProfileSubtypeManager.Get(sericeContext);
   var profileSubtype = profileSubtypeManager.GetProfileSubtype(ProfileSubtypeManager.GetDefaultProfileName(ProfileType.User));
   var profileSubtypePropertyManager = profilePropertyManager.GetProfileSubtypeProperties(profileSubtype.Name);
   var profileSubtypeProperty = subtypePropertyManager.Create(typeProperty);

   profileSubtypeProperty.IsUserEditable = false;
   profileSubtypeProperty.DefaultPrivacy = Privacy.Public;
   profileSubtypeProperty.UserOverridePrivacy = true;
   profileSubtypePropertyManager.Add(profileSubtypeProperty);
}

Update Privacy Filters

Map Properties to External Data

Use Managed Metadata Term Sets

Update Profile Picture

Manage Feeds

Use CSOM to follow documents, people and sites

Get Feeds

Create Pots

Manage Like, Reply, Mention, Tag, Link, and Add Pictures

Access User Profile Data

Use CSOM

Use SSOM

Use REST

Use Web Services

References