Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Leveraging the Unified User Profile

Leveraging the Unified User Profile

In this article, I'll show you how to use the Unified User Profile in BEA WebLogic Portal. I look at the programming and configuration steps necessary to use the portal's built-in rules engine together with the external user profile data to provide a personalized portal presentation.

BEA WebLogic Portal runs on top of WebLogic Server and has a number of features and services that enable you to build an interactive and adaptive portal site. One of its great strengths is that it provides tools to configure the site based on the user's profile. For example, you can grant access to certain portal pages or even portlets only if the user's profile meets certain requirements. Or you can tailor the content presented within a portal page or a portlet based on the user profile. For example, a user may need to be a member of a certain division or to hold a certain position in the company to be able to access different content items or portlets. This is accomplished using rules that are interactively defined in BEA's E-Business Control Center (EBCC). Using this tool, it's easy to target content or marketing campaigns to certain users, without in-depth programming knowledge. On the other hand, as a software developer you enjoy the benefit of being able to access and modify the user profile using a convenient Java API and Taglib.

Unfortunately, data is rarely stored in only one place in the enterprise, nor is it usually in the precise format needed by BEA WebLogic Portal. In fact, profile data can be distributed between a lot of different systems. Often part of the data is stored in ERP systems like SAP, CRM systems like Siebel, LDAP Directory Services, different relational databases like Oracle or Sybase, and various other places. Luckily, BEA Portal doesn't only provide user profile storage in its native database schema. It defines a mechanism called the Unified User Profile (UUP) that enables you to create software modules that snap into the overall user profile of the portal application. You can then create content selection rules or user entitlements leveraging data that is already available and safely stored in your enterprise legacy or core systems.

Building a Unified User Profile
In this article I'll show you how to build and use a UUP that relies on external data. Let's consider an employee portal for a large multinational corporation. For simplicity, let's consider one portal page that contains a portlet showing corporate news and a portlet showing sales figures for the company's international divisions. The latter is available only to users working in the sales division. The news portlet presents corporate news based on the division an employee works in, their country, and thier function in the company. Some news will only be relevant and thus only be shown to software developers while others are only available to management. Of course, any information is presented in the preferred language of the employee. The corporation already stores most data about their employees in various data sources. Fortunately, this particular corporation has committed to a service-oriented software architecture, so all the relevant employee data is accessible as a SOAP Web service as defined in Listing 1 (Listings 1-3 are online at www.sys-con.com/weblogic/sourcec.cfm).

To use the data from the Web service in the portal, you must first define the user profile and the relevant rules using the EBCC. User profiles are created in the site infrastructure tab. As a general rule of thumb, for each data source that you access you should create at least one user profile. For the requirements, you'll want to define two user profiles. The first one, corporateProfile, is shown in Figure 1. This profile will later be mapped to the data obtained from the Web service. If you examine the WSDL for the Web service, note that it does not define the preferred language of the employee. Therefore, you need to create another profile called preferencesData that will be stored in the default portal database schema.

Next, you need to set up the rules that will be applied to the user profile later on. First, define the rule that selects the appropriate news content for the user. You need to create a new content selector in the presentation tab of the EBCC. Now, define the content selection rule. When defining these rules, the EBCC connects to your portal application to obtain the available content types and their metadata. The metadata that is actually available of course depends on the content loaded into your portal schema. For demonstration purposes, BEA provides a tool called bulk loader. This tool can be used to index and load content from specially annotated HTML files. Once you retrieve the metadata, you can build a content search using the available menus.

Figure 2 shows the rule that makes up the content search. It selects only the content items of type news that match the country, division, function, and language preferences of the user. Save the rule as "ShowNews" to access it later in the news portlet. In a similar fashion, you can create an entitlement segment that contains all users who work in the sales department and call it MemberOfSales. Upon synchronization, the rules are available for usage in the portal application.

Develop the UUP
Now for the actual software development work. For the rules to have the expected result, you need to provide the component that connects the user profile data from the Web service to the portal application. The general structure of access to the user profile is shown in Figure 3. In BEA WebLogic Portal, all access to the user profile is performed using a stateless session bean UserManager. Based on a user's profile type, it delegates access to an appropriate ProfileManager EJB. The ProfileManager Bean in turn delegates access based on the requested user profile to a stateless session bean of type com.bea.p13n.property.EntityPropertyManager. This performs the actual access to the user profile (see Figure 3). The framework exposes two hooks where you can insert your own profile access. In rare cases you will need to write a custom ProfileManager for a specific profile type. This is an option if you need to provide an implementation that provides behavior that is fundamentally different from the default implementation. In most cases you'd want to provide a custom EntityPropertyManager and register it for a particular user profile defined in the EBCC. For the remainder of this article I'll focus on the latter scenario.

User Profile Definied in EBCC
You need to create an EJB where the remote interface is of type EntityPropertyManager, deploy it in the same EAR as BEA WebLogic Portal, and register it with the portal's user management. Listing 3 shows the classes that make up the CorporateProfileManager EJB. In our example, the user's data is read-only and cannot be changed using the portal's profile management. This is not an unusual condition in corporate environments, where such data may only be edited by authorized personnel. Under these circumstances, the only methods of EntityPropertyManager that must have a nonempty implementation are:

public Object getProperty(PropertyLocator propertyLocator,
String pSet, String pName) throws EntityNotFoundException;

public EntityPropertyCache getProperties(PropertyLocator propertyLocator)
throws EntityNotFoundException;

For all other methods you should throw an UnsupportedOperation exception as shown in the code. Note that it is good practice to cache the results of retrieving the user profile for a sensible amount of time. Likewise, the getProperty() method usually delegates to the getProperties() method. This retrieves all user profile data for a particular user at once and puts it in the cache for subsequent use. The Web service that provides the data for the user profile has been created using BEA WebLogic Workshop. The CorporateProfileManager uses the stubs that have been created by WebLogic Workshop to access the service hiding any implementation details.

The EJB is packaged in its own jar and deployed in the same enterprise application the portal resides in. Finally you need to tell the ProfileManager EJB that it should serve any request for user profile "corporateProfile" by delegating to the newly deployed CorporateProfileManager EJB. Mapping the user profile to the EJB in the ProfileManager's deployment descriptors does this. The ProfileManager is located in usermgt.jar. You can edit the deployment descriptor using the WebLogic console or by extracting the files from the jar file, modifying them, and repacking the jar. As shown below you need to add a new env-entry that maps the profile to the CorporateProfileManager. The name of this entry must match the pattern PropertyMapping/<profileName> , where <profileName> is the user profile name as defined in the EBCC. Also, you need to create an ejb-ref that references the CorporateProfileManager ejb you just created (see Listing 4).

Finally, you need to edit weblogic-ejb-jar.xml to map the ejb-ref-name created in web.xml to the actual JNDI name of the deployed EJB as shown below.

<weblogic-enterprise-bean>
<ejb-name>UserProfileManager</ejb-name>
<reference-descriptor>

<ejb-reference-description>
<ejb-ref-name>ejb/CorporateProfileManager</ejb-ref-name>
<jndiname>
${APPNAME}.BEA_personalization.CorporateProfileManager
</jndi-name>
</ejb-reference-description>
</reference-descriptor>

</weblogic-enterprise-bean>

After you apply these changes all you need to do is redeploy the enterprise application. Your user profile is now ready for use.

UUP in Action
Now let's see the new user profile in action. Consider two employees: Sima, who works as a manager in the development division in Frankfurt, Germany; and Teresa, who works as a clerk for the sales division in London, UK. Sima's preferred language is German, while Teresa's preferred language is English.

To check whether the profile is actually accessed in the way you intended, you can use WebLogic Portal's management WebApp. Select user management->users and select one of the users. Choose corporateProfile as the property set to view for the user. If everything works correctly, you should see the actual values that have been retrieved from the Web service (see Figure 4). Now create and deploy your portlets using the EBCC portlet creation wizards. Use the content selector you defined in the EBCC to select the appropriate news content to display to the users. A simple example of the news portlet is shown in Listing 3. The code that actually executes the content selector is in the following:

<pz:contentSelector rule="ShowNews"
contentHome="<%=ContentHelper.DEF_DOCUMENT_MANAGER_HOME %>"
id="news"/>

Note that the actual rule that we use accesses both the preferencesData and the corporateProfile to obtain the data. In effect, we can mix profile data from different sources to select content or to create user access rights. In the portalTools Web application, you need to make the portlets available and visible. Similarly, you need to apply the management entitlement segment on the sales portlet (see Figure 5).

Figures 6a and 6b show the portal display for users Teresa and Sima, respectively. As expected, Teresa sees the sales figure portlet since she works in the sales division. All her news items are in English according to her profile settings. Sima doesn't see the sales figures since she isn't a member of the sales division and is thus not entitled to see the portlet. Her news items are all in German. Also, she gets to see a number of different news items because she is in the development division.

Summary
By now you have mastered and understood the basic mechanism of building a UUP in BEA WebLogic Portal. You can create a user profile by aggregating any number of legacy data sources by deploying and registering appropriate EntityPropertyManager EJBs. And you can - among other things - provide personalized content and fine-grained access control within your portal application.

Of course, in a real-world project there are several other important considerations for the actual design of these EJBs. For example, your back-end data sources are not as available and reliable as you need them to be to satisfy your requirements. In this case, you might create a local persistent cache. This cache may be rather short lived and may only serve as a fallback data store in case the actual systems that provide your data are off line. You may also use the BEA caching library to provide better control for the cached data in your EntityPropertyManager.

Considering future developments, you should also have a look at another tool from BEA. WebLogic Liquid Data (see article in WLDJ, Vol. 2, issue 4) is specifically designed to aggregate data from diverse data sources. Plugged into WebLogic Portal it will make the process of implementing user profiles significantly easier and a lot faster.

References

  • BEA WebLogic Portal Documentation: Implementing User Profiles: http://edocs.bea.com/wlp/docs70/dev/ usrgrp.htm#998993
  • BEA WebLogic Portal Documentation: Portal Content Management: http://edocs.bea.com/wlp/docs70/dev/ conmgmt.htm#1018613
  • More Stories By Karl Banke

    Karl F. Banke is principal consultant and general manager of iternum GmbH, Frankfurt, Germany. His working areas include J2EE and EJB architectures, Web Services and project management.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    @ThingsExpo Stories
    Announcing Poland #DigitalTransformation Pavilion
    Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
    CloudEXPO | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
    DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
    The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering CloudEXPO | DXWorldEXPO will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at CloudEXPO. Product announcements during our show provide your company with the most reach through our targeted audienc...
    @DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world.
    Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.
    DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
    22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
    In his keynote at 19th Cloud Expo, Sheng Liang, co-founder and CEO of Rancher Labs, discussed the technological advances and new business opportunities created by the rapid adoption of containers. With the success of Amazon Web Services (AWS) and various open source technologies used to build private clouds, cloud computing has become an essential component of IT strategy. However, users continue to face challenges in implementing clouds, as older technologies evolve and newer ones like Docker c...
    "MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    JETRO showcased Japan Digital Transformation Pavilion at SYS-CON's 21st International Cloud Expo® at the Santa Clara Convention Center in Santa Clara, CA. The Japan External Trade Organization (JETRO) is a non-profit organization that provides business support services to companies expanding to Japan. With the support of JETRO's dedicated staff, clients can incorporate their business; receive visa, immigration, and HR support; find dedicated office space; identify local government subsidies; get...
    Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
    Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
    In past @ThingsExpo presentations, Joseph di Paolantonio has explored how various Internet of Things (IoT) and data management and analytics (DMA) solution spaces will come together as sensor analytics ecosystems. This year, in his session at @ThingsExpo, Joseph di Paolantonio from DataArchon, added the numerous Transportation areas, from autonomous vehicles to “Uber for containers.” While IoT data in any one area of Transportation will have a huge impact in that area, combining sensor analytic...
    Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
    Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
    Michael Maximilien, better known as max or Dr. Max, is a computer scientist with IBM. At IBM Research Triangle Park, he was a principal engineer for the worldwide industry point-of-sale standard: JavaPOS. At IBM Research, some highlights include pioneering research on semantic Web services, mashups, and cloud computing, and platform-as-a-service. He joined the IBM Cloud Labs in 2014 and works closely with Pivotal Inc., to help make the Cloud Found the best PaaS.
    It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
    I think DevOps is now a rambunctious teenager - it's starting to get a mind of its own, wanting to get its own things but it still needs some adult supervision," explained Thomas Hooker, VP of marketing at CollabNet, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.