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
    The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
    Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
    Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
    No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
    With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
    In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
    In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
    Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, discussed how they built...
    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 ...
    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 ...
    DevOps at Cloud Expo – being held June 5-7, 2018, at the Javits Center in New York, NY – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real results. Among the proven benefits,...
    @DevOpsSummit at Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, is co-located with 22nd Cloud Expo | 1st DXWorld Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait...
    Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
    SYS-CON Events announced today that T-Mobile exhibited at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on qua...
    SYS-CON Events announced today that Cedexis will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Cedexis is the leader in data-driven enterprise global traffic management. Whether optimizing traffic through datacenters, clouds, CDNs, or any combination, Cedexis solutions drive quality and cost-effectiveness. For more information, please visit https://www.cedexis.com.
    SYS-CON Events announced today that Google Cloud has been named “Keynote Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Companies come to Google Cloud to transform their businesses. Google Cloud’s comprehensive portfolio – from infrastructure to apps to devices – helps enterprises innovate faster, scale smarter, stay secure, and do more with data than ever before.
    SYS-CON Events announced today that Vivint to exhibit at SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California. As a leading smart home technology provider, Vivint offers home security, energy management, home automation, local cloud storage, and high-speed Internet solutions to more than one million customers throughout the United States and Canada. The end result is a smart home solution that sav...
    SYS-CON Events announced today that Opsani will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Opsani is the leading provider of deployment automation systems for running and scaling traditional enterprise applications on container infrastructure.
    SYS-CON Events announced today that Nirmata will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nirmata provides a comprehensive platform, for deploying, operating, and optimizing containerized applications across clouds, powered by Kubernetes. Nirmata empowers enterprise DevOps teams by fully automating the complex operations and management of application containers and its underlying ...
    SYS-CON Events announced today that Opsani to exhibit at SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California. Opsani is creating the next generation of automated continuous deployment tools designed specifically for containers. How is continuous deployment different from continuous integration and continuous delivery? CI/CD tools provide build and test. Continuous Deployment is the means by which...