EP: Using iView Parameters to Open Applications in Separate Window

EP: Using iView Parameters to
Open Applications in Separate
Window
Applies to:
NetWeaver Portal 7.x – release independent
Summary
Complex web applications usually eat up a lot of valuable browser space. When it is integrated into
NetWeaver Portal it’s often required to display this kind of content on a separate Window. Fortunately there
is a standard iView parameter that performs the same as <target=’_blank/_new’> for links. Wouldn’t it be
great if there was a way to control how the new window displays? There is hope, I will show how easy it is to
use standard iView features to help you display applications on a new Browser Window.
Author:
Ivan Mirisola
Company: SAP Consulting Brazil
Created on: 21 August 2010
Author Bio
Ivan has worked as a NetWeaver Consultant and Developer since 2004 for SAP Brazil and is
now acting as a NetWeaver Technical Solution Architect. He majored on System Analysis and
has extensive knowledge on Internet technologies. Specialized in NetWeaver Portal and Java
Custom Developments and now focused on SOA Methodology and NetWeaver BPM
implementations.
SAP COMMUNITY NETWORK
© 2009 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
1
EP: Using iView Parameters to Open Applications in Separate Window
Table of Contents
Overview ............................................................................................................................................................. 3
Solution ............................................................................................................................................................... 3
Result .............................................................................................................................................................. 4
Generated Code .............................................................................................................................................. 5
Navigation API ................................................................................................................................................ 6
Related Content .................................................................................................................................................. 7
Copyright............................................................................................................................................................. 8
SAP COMMUNITY NETWORK
© 2010 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
2
EP: Using iView Parameters to Open Applications in Separate Window
Overview
Complex web applications such as Biller Direct, SRM, CRM WebUI usually eat up a lot of valuable browser
space. This usually happens because they provide their own navigation throughout all available transactions.
This mini how-to will show you how easy it is to use standard iView features to help you display applications
on a new Browser Window. This will avoid the space clogging of the Portal Content Area while providing user
productivity with better navigation.
You can set an iView’s display area by means of the parameter “Launch in New Window”
(com.sap.portal.navigation.ShowType). When you set this option to “Display in a separate Headerless
Portal Window”, the Portal runtime will open the navigation link in a new Browser Window.
This is no big news to the average Portal Content Administrator. The problem is that you cannot assure how
the Window will be displayed, because size, position and toolbars are set by the user itself.
Usually web developers overcome this by setting a JavaScript function and set the new window features
there. Fortunately, Portal has a not-so-known iView parameter called “Window Features”
(com.sapportals.portal.navigation.WinFeatures). This parameter controls how PRT will generate the
EPCM.doNavigate calls.
Solution
Here is how we can overcome this limitation.
Open the object in the Portal Content Studio Editor and select the property category “Navigation”.
Set the object’s property “Launch in New Window” to “Display in Separate Headerless Portal Window”.
Set the object’s property “Window Features” to:
toolbar=no,resizable=yes,width='+screen.width*0.96+'px,height='+screen.height*0.85+'p
x,top=0,left=0
This is how the iView should be configured:
SAP COMMUNITY NETWORK
© 2010 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
3
EP: Using iView Parameters to Open Applications in Separate Window
Result
The result after you place it in any Portal Role is that a new Browser Window based on the User’s Screen
Size will be opening at the top most position of the screen with no tool bar buttons in nice resizable window
having 96% in width and 85% in height.
NetWeaver Portal uses the very same technique for opening the links as Web Developers – that is, by
means of JavaScript coding. The Window Features parameters are inserted directly on the generated
JavaScript, so any Window Feature will be supported.
This is the actual resulting window:
SAP COMMUNITY NETWORK
© 2010 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
4
EP: Using iView Parameters to Open Applications in Separate Window
Generated Code
This is the actual JavaScript that is generated by PRT
<li class="urLicItem">
<span class="urFontStd">
<span onClick="if (typeof EPCM != 'undefined') {
EPCM.doNavigate('ROLES://portal_content/Teste/WKS1/FL1/TranslationWorklist',3,'toolba
r=no,resizable=yes,width='+screen.width*0.96+'px,height='+screen.height*0.85+'px,top=
0,left=0','DefaultExternal',null,null,null); } else {
window.open('/irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.contentarea.li
ght?NavigationTarget=ROLES://portal_content/Tests/WKS1/FL1/TranslationWorklist&Histor
yMode=2','_blank','toolbar=no,resizable=yes,width='+screen.width*0.96+'px,height='+sc
reen.height*0.85+'px,top=0,left=0'); }return false;">
<a class="urLnkFunction" id="Link27e81d" ct="LN" st="" href="javascript:return true"
target="">
<span ct="TV" class="urTxtStd">Translation Worklist</span>
</a>
</span>
</span>
</ul>
SAP COMMUNITY NETWORK
© 2010 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
5
EP: Using iView Parameters to Open Applications in Separate Window
Navigation API
EPCM API is used throughout all PRT generated code. The method doNavigate is responsible for all links
presented to the end-user.
Take a look at the supported parameters for the API and its co-relation to iView Parameters:
Parameter
Type
Description
target
String
Navigation target that corresponds to the location in PCD or
another structure (see details below)
mode
int
0 or not specified:
Depending on the setting of the WorkProtect feature the target
is opened in a new window or on the current desktop.
1:
Open target in a new window, with no a portal header and
navigation bar.
2:
Open target in a new window, with a portal header and
navigation bar.
String
Window feature string when the target is to be opened in the
new window. This is a comma separated list of features with
no blanks that has the same syntax as the JavaScript method
window.open.
Example: "width=400,height=500".
String
Window title for when the target is opened in a new window.
int
history mode
0: Track history entries and allow duplicates.
1: Track history entries and do not allow duplicates.
2: Do not track history entries.
targetTitle
String
Title for the page title bar. In case the navigation target is sent
through an integrator, the title will be the integrator title. You
can specify a specific title for this navigation and optional for
the history entry.
Context
String
Navigation context URL.
(optional)
winFeat
(optional)
winName
(optional)
history
(optional)
Please notice the winFeat is exactly where the iView parameter will be inserted. Therefore once must be
careful enough not to put invalid parameters there to avoid Javascript errors during runtime.
SAP COMMUNITY NETWORK
© 2010 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
6
EP: Using iView Parameters to Open Applications in Separate Window
Related Content
EPCM API on help.sap.com
SAP COMMUNITY NETWORK
© 2010 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
7
EP: Using iView Parameters to Open Applications in Separate Window
Copyright
© Copyright 2010 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.
IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9,
iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server,
PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes,
BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX,
Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems
Incorporated in the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of
Citrix Systems, Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts
Institute of Technology.
Java is a registered trademark of Sun Microsystems, Inc.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by
Netscape.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned
herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.
Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and
other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.
All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document
serves informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP
Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the
express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an
additional warranty.
SAP COMMUNITY NETWORK
© 2010 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com
8