SAP iViews: Portal Components in Java

SAP iViews: Portal Components in Java

he Enterprise Portal (EP) is SAP’s corporate portal application that runs primarily on its own J2EE-certified Web application server. Java iViews, the portal components (or portlets) in SAP, deliver business content to the portal user via integrated views of backend systems. Figure 1 depicts the SAP EP populated with a collection of business content.

Figure 1: The SAP Enterprise Portal with Java iViews

Obviously, the EP supports access to SAP’s own enterprise applications, but iViews can also deliver content from other, third-party systems and remote databases. This article introduces the development platform for SAP’s Java iViews and demonstrates some of the key technologies to render data from both SAP and non-SAP systems.Key Technologies in SAP Portal Component Development
DynPage Framework
The portal components for the SAP EP are enterprise applications built on the J2EE platform. SAP’s Portal Component API includes a custom framework called DynPage, which supports J2EE application development for the EP. DynPage provides a collection of interfaces and abstract classes to structure the application architecture of portal components that require dynamic page processing. Essentially an implementation of the Service to Worker pattern, the DynPage framework organizes the Controller and Dispatcher classes and subsequently manages their interaction with JavaBeans and JavaServer Pages (see Figure 2).

Figure 2: The SAP DynPage Framework

The Portal Component API also contains a number of portal platform services that enhance SAP portal components with additional functionality, such as user personalization and access to remote data sources.

The iView Runtime for Java
SAP portal components are deployed as enterprise archives to the iView Runtime for Java (IRJ), the EP’s Java runtime environment. You can develop and build a portal component archive (PAR) file with any commercial IDE you can even use Apache Ant, the open source build tool. For the Eclipse Platform, SAP provides a custom plug-in that supports portal component development projects with wizards and templates based on the DynPage framework. The Eclipse plug-in also enables the hot deployment of portal archives directly to the IRJ.

(An add-on for Borland’s JBuilder is also available and offers similar support, but SAP plans to discontinue its development with the next release of the EP.)

Portal Development Kit
SAP also offers the Portal Development Kit (PDK) as an offline deployment environment. The PDK, which runs as a Web application in an Apache Tomcat servlet container, is built on top of the same IRJ infrastructure as the SAP EP. (Future versions of the PDK will run inside SAP’s J2EE server.) Since it also renders iViews with the look and feel of the EP, you can employ the PDK to develop and test portal components locally. In conjunction with the Eclipse Platform and the SAP plug-in, the PDK provides everything you need to begin working with portal components.

The PDK and Eclipse are both available for download, free of cost under their respective licensing agreements. You can get Eclipse at www.eclipse.org. The PDK, as well as its installation guide and the plug-in for Eclipse, is available at the SAP iViewStudio, where you can register to receive download access.

Your iViewStudio ID also allows you to participate in the PDK developers’ forum and gives you access to a series of technical white papers. Within the installed PDK environment, the Documentation and Examples links from the top-level navigation bar provide a rich source of documentation, tutorials, and example components.Rendering Data from an SAP Data Source
Portal components can access and query an SAP system with the SAP Java Connector (JCo) and the JCo Client portal platform service. You maintain the generic connection parameters of the SAP data source (for example, host name and IP address, client and system number) in the portal landscape via XML files. At runtime, the Dispatcher can use the JCo and JCo Client APIs to access these parameters and connect to the SAP system with them.

You can enable basic single sign-on (SSO) to the SAP system via a nonpersistent cookie, called the SAP Logon Ticket, which contains the digital certificate of the portal server and the user ID of the portal user. You must register the digital certificate and then import it to the SAP system. When using SAP Logon Tickets, the user IDs in the EP and SAP system must be the same, unless you also implement user mapping (which I describe in the next section).

Once a portal user is authenticated in the remote SAP system, the Dispatcher can execute an SAP BAPI (Business-API) or RFC (remote-enabled function call) directly in the backend system. BAPIs and RFCs expose the business processes and transactional functionality of SAP’s enterprise applications, and a large number of functions are available via standard interfaces. In SAP, BAPIs are realized within function groups, and individual methods in the interface are implemented as RFCs. Both BAPIs and RFCs are written in SAP’s proprietary ABAP programming language, and they can be executed by “remote” applications (i.e., applications external to the SAP system).

The standard BAPI I chose (BAPI_COMPANYCODE_GETLIST) is the traditional “Hello, World” example for Web-enabling SAP. The jcoClient object in the Dispatcher executes it via the jcoFunction object:

IFunctionTemplate jcoFunctionTemplate =   jcoRepository.getFunctionTemplate("BAPI_COMPANYCODE_GETLIST");JCO.Function jcoFunction = new JCO.Function(jcoFunctionTemplate);jcoClient.execute(jcoFunction);

The Dispatcher class then sets the return parameters of the function (here, a BAPI table parameter called COMPANYCODE_LIST) to the jcoTable object. Within the DynPage framework, you can maintain the BAPI table parameter as a JCOTableViewModel data model before setting it to a JavaBeans component (here, valueBean). The putValue() method binds valueBean to the “AppBean” name in an SAP-customized scope for portal components (Not shown here, of course, are the bean’s getter and setter methods for the model property):

JCO.Table jcoTable =    jcoFunction.getTableParameterList().getTable("COMPANYCODE_LIST");JCOTableViewModel jcoModel = new JCOTableViewModel(jcoTable);valueBean.setModel(jcoModel);putValue("AppBean", valueBean);

Finally, the Dispatcher determines the next JSP page and delegates processing control to it:

this.setJspName("SapView.jsp");

From the JSP page (here, SapView.jsp), you can access the bean and render the data model via SAP’s HTML-Business for Java (HTMLB) tag library. The model attribute of the tableView element serves to access the JavaBeans component (here, AppBean) and get the data from the bean property (model). The HTMLB tag library descriptor (htmlb.tld) defines the other attributes of the tableView element (You can find complete documentation for HTMLB within the PDK platform.):

<%@ taglib uri="/SERVICE/htmlb/taglib/htmlb.tld" prefix="htmlb" %>

As I mentioned in the previous section, you can build the PAR and deploy it to the PDK from Eclipse. Figure 3 shows the portal component as rendered in the ComponentInspector test environment of the PDK.

Figure 3: The “Hello, World” iView for SAP Access

Rendering Data from a Non-SAP Data Source
To demonstrate access to a non-SAP system, I use the open source MySQL database as the external data source. However, the programming constructs from this example are valid for all JDBC-compliant databases. As with an SAP data source, you must maintain the connection parameters for third-party systems and remote databases in the portal landscape XML files.

Instead of managing a special data model and using HTMLB to output on a JSP page, this example employs the Portal Data Viewer (PDV) service of the SAP API. The PDV also provides an implementation of HTMLB, but it can render tabular data directly in the EP without JSP programming.

While you can access non-SAP systems with SAP Logon Tickets, another method to enable remote authentication from the EP is via user mapping. In this process, the portal administrator can correlate (or map) a portal user to the ID and password for a remote system. A custom table in the EP’s LDAP directory server stores the mapped credentials. At runtime, the Dispatcher class can access this table via the SAP Portal Component API and retrieve the logon credentials. In the following code snippet, KEY is the destination system (here, the MySQL database) that is registered in the portal landscape:

bConn = new backend(KEY);broker.enrich(bConn);un = bConn.getUser();pw = bConn.getPassword();

Once the Dispatcher class determines the mapped user name (un) and password (pw) for the portal user, you can access the database and query it via the standard connection of the DriverManager:

Connection con =    DriverManager.getConnection("jdbc:mysql:///my_db",un,pw);Statement std = con.createStatement();ResultSet res = std.executeQuery("select * from my_table");

Finally, you set the result from the query (here, res) as the data source for the PDV service, which automatically renders the output in the EP:

ISource pdvSource = portalDV.createSource(request, res);portalDV.setSource(pdvSource);

Figure 4 depicts the PDV output of the MySQL database iView. In addition to its automated rendering mechanism, the PDV service supplies a number of standard features, including column sorting, tabulation, and user personalization.

Figure 4: The Database iView via the Portal Data Viewer

SAP for Web-enabled, Enterprise Java Apps?Who Knew?
The two examples in this article provide the simplest of introductions to portal component development for the SAP EP, but they are enough to get you started with SAP’s Portal Component API and the available development tools. While SAP may not be the first name you consider when it comes to Web-enabled, enterprise applications in Java, you might be surprised what you can learn.

devx-admin

devx-admin

Share the Post:
Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India,

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with

Software Development

Top Software Development Companies

Looking for the best in software development? Our list of Top Software Development Companies is your gateway to finding the right tech partner. Dive in and explore the leaders in

India Web Development

Top Web Development Companies in India

In the digital race, the right web development partner is your winning edge. Dive into our curated list of top web development companies in India, and kickstart your journey to

USA Web Development

Top Web Development Companies in USA

Looking for the best web development companies in the USA? We’ve got you covered! Check out our top 10 picks to find the right partner for your online project. Your

Clean Energy Adoption

Inside Michigan’s Clean Energy Revolution

Democratic state legislators in Michigan continue to discuss and debate clean energy legislation in the hopes of establishing a comprehensive clean energy strategy for the state. A Senate committee meeting

Chips Act Revolution

European Chips Act: What is it?

In response to the intensifying worldwide technology competition, Europe has unveiled the long-awaited European Chips Act. This daring legislative proposal aims to fortify Europe’s semiconductor supply chain and enhance its

Revolutionized Low-Code

You Should Use Low-Code Platforms for Apps

As the demand for rapid software development increases, low-code platforms have emerged as a popular choice among developers for their ability to build applications with minimal coding. These platforms not

Cybersecurity Strategy

Five Powerful Strategies to Bolster Your Cybersecurity

In today’s increasingly digital landscape, businesses of all sizes must prioritize cyber security measures to defend against potential dangers. Cyber security professionals suggest five simple technological strategies to help companies

Global Layoffs

Tech Layoffs Are Getting Worse Globally

Since the start of 2023, the global technology sector has experienced a significant rise in layoffs, with over 236,000 workers being let go by 1,019 tech firms, as per data

Huawei Electric Dazzle

Huawei Dazzles with Electric Vehicles and Wireless Earbuds

During a prominent unveiling event, Huawei, the Chinese telecommunications powerhouse, kept quiet about its enigmatic new 5G phone and alleged cutting-edge chip development. Instead, Huawei astounded the audience by presenting

Cybersecurity Banking Revolution

Digital Banking Needs Cybersecurity

The banking, financial, and insurance (BFSI) sectors are pioneers in digital transformation, using web applications and application programming interfaces (APIs) to provide seamless services to customers around the world. Rising

FinTech Leadership

Terry Clune’s Fintech Empire

Over the past 30 years, Terry Clune has built a remarkable business empire, with CluneTech at the helm. The CEO and Founder has successfully created eight fintech firms, attracting renowned

The Role Of AI Within A Web Design Agency?

In the digital age, the role of Artificial Intelligence (AI) in web design is rapidly evolving, transitioning from a futuristic concept to practical tools used in design, coding, content writing

Generative AI Revolution

Is Generative AI the Next Internet?

The increasing demand for Generative AI models has led to a surge in its adoption across diverse sectors, with healthcare, automotive, and financial services being among the top beneficiaries. These

Microsoft Laptop

The New Surface Laptop Studio 2 Is Nuts

The Surface Laptop Studio 2 is a dynamic and robust all-in-one laptop designed for creators and professionals alike. It features a 14.4″ touchscreen and a cutting-edge design that is over

5G Innovations

GPU-Accelerated 5G in Japan

NTT DOCOMO, a global telecommunications giant, is set to break new ground in the industry as it prepares to launch a GPU-accelerated 5G network in Japan. This innovative approach will

AI Ethics

AI Journalism: Balancing Integrity and Innovation

An op-ed, produced using Microsoft’s Bing Chat AI software, recently appeared in the St. Louis Post-Dispatch, discussing the potential concerns surrounding the employment of artificial intelligence (AI) in journalism. These

Savings Extravaganza

Big Deal Days Extravaganza

The highly awaited Big Deal Days event for October 2023 is nearly here, scheduled for the 10th and 11th. Similar to the previous year, this autumn sale has already created

Cisco Splunk Deal

Cisco Splunk Deal Sparks Tech Acquisition Frenzy

Cisco’s recent massive purchase of Splunk, an AI-powered cybersecurity firm, for $28 billion signals a potential boost in tech deals after a year of subdued mergers and acquisitions in the

Iran Drone Expansion

Iran’s Jet-Propelled Drone Reshapes Power Balance

Iran has recently unveiled a jet-propelled variant of its Shahed series drone, marking a significant advancement in the nation’s drone technology. The new drone is poised to reshape the regional

Solar Geoengineering

Did the Overshoot Commission Shoot Down Geoengineering?

The Overshoot Commission has recently released a comprehensive report that discusses the controversial topic of Solar Geoengineering, also known as Solar Radiation Modification (SRM). The Commission’s primary objective is to

Remote Learning

Revolutionizing Remote Learning for Success

School districts are preparing to reveal a substantial technological upgrade designed to significantly improve remote learning experiences for both educators and students amid the ongoing pandemic. This major investment, which

Revolutionary SABERS Transforming

SABERS Batteries Transforming Industries

Scientists John Connell and Yi Lin from NASA’s Solid-state Architecture Batteries for Enhanced Rechargeability and Safety (SABERS) project are working on experimental solid-state battery packs that could dramatically change the

Build a Website

How Much Does It Cost to Build a Website?

Are you wondering how much it costs to build a website? The approximated cost is based on several factors, including which add-ons and platforms you choose. For example, a self-hosted

Battery Investments

Battery Startups Attract Billion-Dollar Investments

In recent times, battery startups have experienced a significant boost in investments, with three businesses obtaining over $1 billion in funding within the last month. French company Verkor amassed $2.1