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
    DX World EXPO, LLC, a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
    "Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    SYS-CON Events announced today that Conference Guru has been named “Media Sponsor” of the 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. A valuable conference experience generates new contacts, sales leads, potential strategic partners and potential investors; helps gather competitive intelligence and even provides inspiration for new products and services. Conference Guru works with conference organizers to pass great deals to gre...
    The Internet of Things will challenge the status quo of how IT and development organizations operate. Or will it? Certainly the fog layer of IoT requires special insights about data ontology, security and transactional integrity. But the developmental challenges are the same: People, Process and Platform. In his session at @ThingsExpo, Craig Sproule, CEO of Metavine, demonstrated how to move beyond today's coding paradigm and shared the must-have mindsets for removing complexity from the develop...
    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...
    "Evatronix provides design services to companies that need to integrate the IoT technology in their products but they don't necessarily have the expertise, knowledge and design team to do so," explained Adam Morawiec, VP of Business Development at Evatronix, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    Large industrial manufacturing organizations are adopting the agile principles of cloud software companies. The industrial manufacturing development process has not scaled over time. Now that design CAD teams are geographically distributed, centralizing their work is key. With large multi-gigabyte projects, outdated tools have stifled industrial team agility, time-to-market milestones, and impacted P&L stakeholders.
    "Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, 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.
    "IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
    In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
    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 ...
    "Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
    Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
    "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.
    Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
    "There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, 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.
    SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
    SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.