Changing InfoView withoutChanging InfoView Matthias Nott, Business Objects
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 3
Who I amMatthias Nott,
Business Objects Service Line Leader for Products, EMEA
What is this all aboutChanging InfoView without Changing InfoView?
What I want you to doIf you are not a Technical Person:Understand what Technical Persons can do for you easily
If you are a Technical Person: Understand everything
If you don‘t know... Choose a side
What I want you not to do Take Notes
Answer your Phone
Introduction
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 4
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 5
SDK library that greatly simplifies using the SDKYou do not have to worry about document types
Most common SDK tasks 1 line of code
Does not limit you, it helps you
Helps you to employ best practices on your projectsBased on 5 years of development
More than 35,000 lines of code behind the scenes
Actively used by customers worldwide
Consulting solutionAsk your account manager
Ask local professional services contact
Ask me [email protected]
What Is BOInterface?
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 6
What Is BOInterface?
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 7
What Is BOInterface?
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 8
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 9
What is a Servlet Filter?
Java Code sitting between the Client and the End Point
Can filter multiple End Points
Multiple Filters can be stacked
Registered through web.xml
No Code Change required!
Can modify:
Request variables
Header variables
Cookies
Page/Session/Application Beans
Initialisation Parameters
...and the entire Response!
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 10
<filter>
<filter-name>Name of the Filter</filter-name>
<filter-class>com.bo....</filter-class>
<init-param>
<param-name>debug</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Name of the Filter</filter-name>
<url-pattern>/InfoView/main/headerPlus.do</url-pattern>
</filter-mapping>
What is a Servlet Filter?Sample Servlet Filter Declaration for web.xml
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 11
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 12
Find out with a Servlet Filter!<filter>
<filter-name>RequestAnalyzer</filter-name>
<filter-class>com.bo.bointerface.tools.http.HttpRequestAnalyzer</filter-class>
<init-param>
<param-name>init</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>RequestAnalyzer</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
What is going on in InfoView?
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 13
------------------------------------------[http://linux:9090/businessobjects/enterprise115/desktoplaunch/InfoView/main/navWork.do]------------------------------------------Header Data: Fri Apr 13 22:23:02 CEST 2007------------------------------------------par: temp [java.lang.String]=1176495784473------------------------------------------hdr: accept [java.lang.String]=text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5hdr: host [java.lang.String]=linux:9090hdr: user-agent [java.lang.String]=Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.3) Gecko/20061201 Firefox/2.0.0.3 (Ubuntu-feisty)------------------------------------------coo: CE_LastAps [java.lang.String]=linux:6400coo: CE_LastAuthType [java.lang.String]=secEnterprisecoo: CE_LastUser [java.lang.String]=Administratorcoo: CE_LogonToken [java.lang.String]=LINUX@25378JBCl8HYL8NgXIpeb25376JFUZkV8pIHsLKLCxcoo: JSESSIONID [java.lang.String]=AAC57380EC0701D7DE5BD2821EEA22D9------------------------------------------ses: CE_ENTERPRISESESSION [com.crystaldecisions.sdk.framework.internal.b]=(EnterpriseSession:logon=(SecuritySession:userInfo=(UserInfo: username=Administrator,userID=12,userDesc=AdministratorKonto,auth=token), apsName=LINUX,userURI=osca:iiop://LINUX;SI_SESSIONID=25402JLaVCPses: javax.servlet.jsp.jstl.fmt.request.charset [java.lang.String]=utf-8ses: org.apache.struts.action.LOCALE [java.util.Locale]=en_USses: schema [com.crystaldecisions.ePortfolio.framework.common.SchemaBean]=com.crystaldecisions.ePortfolio.framework.SchemaBean@8140ed------------------------------------------app: javax.servlet.context.tempdir [java.io.File]=/opt/bo/xir2/tomcat/work/Catalina/linux/businessobjects_enterprise115_desktoplaunchapp: objUtils [com.businessobjects.adv_ivcdzview.Utils]=com.businessobjects.adv_ivcdzview.Utils@a1b4e7app: org.apache.catalina.WELCOME_FILES [[Ljava.lang.String;]=[Ljava.lang.String;@8698faapp: org.apache.catalina.jsp_classpath [java.lang.String]=/opt/bo/xir2/bobje/webapps/businessobjects/enterprise115/desktoplaunch/WEB- INF/classes/:/opt/bo/xir2/bobje/webapps/businessobjects/enterprise115/desktoplaunch/WEB-INF/lib/BOInterface.jar:/opt/bo/xir2/app: org.apache.catalina.resources [org.apache.naming.resources.ProxyDirContext]=org.apache.naming.resources.ProxyDirContext@37165fapp: org.apache.struts.action.FORM_BEANS [org.apache.struts.action.ActionFormBeans]=org.apache.struts.action.ActionFormBeans@f5d030app: org.apache.struts.action.FORWARDS [org.apache.struts.action.ActionForwards]=org.apache.struts.action.ActionForwards@9dd6e2app: org.apache.struts.action.MAPPINGS [org.apache.struts.action.ActionMappings]=org.apache.struts.action.ActionMappings@a09e41app: org.apache.struts.action.MESSAGE [org.apache.struts.util.PropertyMessageResources]=org.apache.struts.util.PropertyMessageResources@14ed577app: org.apache.struts.action.SERVLET_MAPPING [java.lang.String]=*.object------------------------------------------
What is going on in InfoView?
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 14
Recap:What is going on in InfoView?
Find out with BOInterface:
Use HttpRequestAnalyzer Servlet Filter
Get the complete Call Sequence
See all Parameters
See all Headers
See all Cookies
See all Beans
Understand exactly how InfoView works!
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 15
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 16
What is a Regular Expression ( 正規表現 )?
Descriptive Pattern of a Text Fragment
READ FROM LEFT TO RIGHT!
Has special Characters:
^ = Beginning of Line$ = End of Line. = Any Character\ = Escaping Character* = Any number of character, including 0+ = Like *, but at least 1? = Shortest (non greedy) Match{1,4} = Min/Max Quantities; also {3}[a-z] = Character Class[^>] = Not a >( ) = Referenceable Group $1 = Reference to Group Number 1(?sm) = Match cross line boundaries
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 17
Assume, you have some HTML Code like
// "Send" Menu var btnSend = toolbarCtrl.add (newIconMenuWidget ... var myInfoViewIcon = ...
If we want to suppress „var btnSend...“, we write this as (?sm)var btnSend.*?(var myInfoViewIcon)
Match accross multiple lines and search a „v“, followed by an „a“, followed by an „r“, then a blank, then a „b“, then a „t“, then an „n“, then an „S“, then an „e“, then an „n“, then a „d“then any character („.“) of which we allow any number („*“)but only until we first match („?“)a Group „(“ of „var my ....
And we replace this by referring to the group as „$1“
What is a Regular Expression ( 正規表現 )?Sample 1: Suppress some HTML Code
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 18
Assume, you have some HTML Code like <frameset id="navWorkFrameSet" cols="200,*,0" framespacing="2"
frameborder="1" border="2" bordercolor="#F6F6FB"> <frame name="navigationFrame" id="navigationFrame"
src="../../InfoView/main/navigation.do" marginheight="0" marginwidth="0" frameborder="0" >
<frame name="workspaceFrame" id="workspaceFrame" src="workspace.do?url=..%2F..%2FInfoView%2Fmain%2Fhome.do" frameborder="0" marginheight="0" marginwidth="0">
<frame name="rightFrame" id="rightFrame" src='../../applications/index.bouitoolkit?token=LINUX@25382JnI1UvALCd0XYrsz25380JaRE7qtgzancz2tQONEOFF&LOCALE=en_US' frameborder="0" marginheight="0" marginwidth="0" scrolling="no" noResize="true">
</frameset>
To put „navigationFrame“ after „rightFrame“, we match
(?sm)(200,\*,0)(.*?)(<frame [^>]*?>)(.*?)(</frameset>)
And we replace this by replacing $1 and reordering $3 and $4: *,0,200 $2 $4 $3 $5
What is a Regular Expression ( 正規表現 )?Sample 2: Swap some HTML Code
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 19
Recap:What is a Regular Expression ( 正規表現 )?
A way to write a Pattern for Text Fragments
Always read from Left to Right
Allows Wildcards
Allows Quantifiers
Allows Grouping
Helps to replace Text
正規表現 is Japanese for
„Regular Expression...“
(not to mix with 性器表現 ...)
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 20
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 21
Change Colors and Fonts
Mission: Change the List Font Using Style Sheets
Remove Buttons and Menus
Mission: Remove the „Send“ Menu.? Changing InfoView Code Using BOInterface and NOT Changing InfoView Code
Move Frames around
Mission: Move the „Navigation“ Frame to the Right Using BOInterface and NOT Changing InfoView Code
Add Menu Items to the Viewer
Mission: Add an Export Context Menu Item to the DHTML Viewer
Using BOInterface and NOT Changing InfoView Code
Visual Modifications to InfoView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 22
Change the List FontComing from here...
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 23
Change the List Font...we want to go here
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 24
Find out where the StyleSheet isFrame Source says, it is in /InfoView/res/schema.blue/default.cssFrame Source refers to the style „.list“ by
<td class='list' ... <a class='list' ...
We locate it in the css File and change it to .list { font-family: Arial; font-size: 14pt; font-weight:bold; color:navy; }...and reload the Frame.
Change the List Font
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 25
Recap:Change the List Font (Style Sheets)
Simple Modifications can be done easily
Not very flexible:
Styles are reused across elements (td, a)
Changes affect more than intended
Many elements not styled
Difficult to “drop” things
Difficult to include “Logic”
Graphics can be changed in the File System
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 26
Change Colors and Fonts
Mission: Change the List Font Using Style Sheets
Remove Buttons and Menus
Mission: Remove the „Send“ Menu. Changing InfoView Code Using BOInterface and NOT Changing InfoView Code
Move Frames around
Mission: Move the „Navigation“ Frame to the Right Using BOInterface and NOT Changing InfoView Code
Add Menu Items to the Viewer
Mission: Add an Export Context Menu Item to the DHTML Viewer
Using BOInterface and NOT Changing InfoView Code
Visual Modifications to InfoView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 27
Remove the „Send“ Menu
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 28
Find out where the Send Menu is created
Frame Information says, it is in/InfoView/main/headerPlus.do
This refers to a Struts Class. Yet,
/WEB-INF/struts-InfoView.xml
redirects us to
<forward
name="default"
path="/InfoView/main/headerPlusButtons.jsp"
redirect="false"/>
This file contains no button definitions.
Remove the „Send“ MenuMethod 1: Attempting to Reverse Engineer
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 29
Being creative, we look at
/InfoView/main/headerPlus.jsp
Searching for „button“, we find a reference to/InfoView/headerPlus/buttons.do
Looking at its code, and searching further we find a file
/WEB-INF/classes/META-INF/buttons/headerplus/default.xml
Which is basically an empty file:
<?xml version="1.0"?>
<button-config>
<buttons>
</buttons>
Remove the „Send“ MenuMethod 1, continued: Fighting with the Code...
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 30
Taking another approach, we analyze the HTML Source:
// "Send" Menu
var btnSend = toolbarCtrl.add (newIconMenuWidget
...
var myInfoViewIcon = ...
Searching the entire Web App for „btnSend“, we get
/InfoView/main/headerPlus.jsp
We earlier overlooked that it contains the above code.
Other things (particularly for the Viewer) are much more difficult to find.
Remove the „Send“ MenuMethod 1, continued: Pattern Searching...
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 31
Changing the InfoView Code is a bad idea!
Changes may go into all sorts of places, including
JSP Files
XML Files
JS Files
Struts Java Classes of which you may not even have the Source
...
With any update of InfoView the logic may have changed, so you would have create a new patch
Putting your InfoView back in a supported state involves setting back changes in may be a number of files.
Remove the „Send“ MenuMethod 1, Summary
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 32
A five step process:
Analysis:
Find the URL
Find the Pattern
Synthesis:
Create a Regular Expression for that Pattern
Create a Search/Replace Servlet Filter in web.xml
Test:
Restart the Container, and Test.
Remove the „Send“ MenuMethod 2: Use BOInterface
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 33
A five step process:
1. Find the URL for the Frame by using Frame Information:/InfoView/main/headerPlus.do
2. Open the Frame Source and Locate the Pattern:
// "Send" Menu
var btnSend = toolbarCtrl.add (newIconMenuWidget
...
var myInfoViewIcon = ...
3. Create a Regular Expression for that Pattern:(?sm)var btnSend.*?(var myInfoViewIcon)
4. Create a Search/Replace Servlet Filter in web.xml
(see next slide)
5. Restart the Container, and Test.
Remove the „Send“ MenuMethod 2: Use BOInterface
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 34
<filter> <filter-name>No Search Button</filter-name> <filter-class>com.bo.bointerface.tools.http.HttpResponseAnalyzer</filter-class> <init-param>
<param-name>debug</param-name> <param-value>false</param-value>
</init-param> <init-param> <param-name>search</param-name> <param-value><![CDATA[(?ms)var btnSend.*?(var myInfoViewIcon)]]></param-value> </init-param> <init-param> <param-name>replace</param-name> <param-value><![CDATA[$1]]></param-value> </init-param></filter><filter-mapping> <filter-name>No Search Button</filter-name> <url-pattern>/InfoView/main/headerPlus.do</url-pattern></filter-mapping>
Remove the „Send“ Menu4. Create a Search/Replace Filter in web.xml:
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 35
Remove the „Send“ Menu
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 36
Code Changes are BAD
BOInterface makes it EASY
1. Find the URL
2. Find the Pattern
3. Create a Regular Expression
4. Create a Search/Replace Filter
5. Restart Container, Test.
Changes can easily be removed to make the System supported
Multiple Expressions per Endpoint can be done like
<search01/>..<replace01/>, <search02/>..<replace02/>, etc.
Much more complex examples can be achieved implementing
AbstractServletFilter.HtmlProcessor
Recap:Remove the „Send” Menu
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 37
Change Colors and Fonts
Mission: Change the List Font Using Style Sheets
Remove Buttons and Menus
Mission: Remove the „Send“ Menu. Changing InfoView Code Using BOInterface and NOT Changing InfoView Code
Move Frames around
Mission: Move the „Navigation“ Frame to the Right Using BOInterface and NOT Changing InfoView Code
Add Menu Items to the Viewer
Mission: Add an Export Context Menu Item to the DHTML Viewer
Using BOInterface and NOT Changing InfoView Code
Visual Modifications to InfoView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 38
Move the „Navigation“ Frame to the RightComing from here...
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 39
Move the „Navigation“ Frame to the Right...we want to go here
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 40
1. Find the URL
HttpRequestAnalyzer tells us, the FrameSet is generated by
/InfoView/main/navWork.do
2. Find the Pattern
<frameset id="navWorkFrameSet" cols="200,*,0" framespacing="2" frameborder="1" border="2" bordercolor="#F6F6FB">
<frame name="navigationFrame" id="navigationFrame" src="../../InfoView/main/navigation.do" marginheight="0" marginwidth="0" frameborder="0" >
<frame name="workspaceFrame" id="workspaceFrame" src="workspace.do?url=..%2F..%2FInfoView%2Fmain%2Fhome.do" frameborder="0" marginheight="0" marginwidth="0">
<frame name="rightFrame" id="rightFrame" src='../../applications/index.bouitoolkit?token=LINUX@25382JnI1UvALCd0XYrsz25380JaRE7qtgzancz2tQONEOFF&LOCALE=en_US' frameborder="0" marginheight="0" marginwidth="0" scrolling="no" noResize="true">
</frameset>
Move the „Navigation“ Frame to the RightAnalysis:
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 41
3. Create a Regular Expression for that Pattern
(?sm)(200,\*,0)(.*?)(<frame [^>]*?>)(.*?)(</frameset>)
*,0,200 $2 $4 $3 $5
4. Create a Search/Replace Servlet Filter in web.xml
(see next slide)
5. Restart the Container, and Test.
Move the „Navigation“ Frame to the RightSynthesis:
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 42
<filter> <filter-name>Navigation Frame Right</filter-name> <filter-class>com.bo.bointerface.tools.http.HttpResponseAnalyzer</filter-class> <init-param>
<param-name>debug</param-name> <param-value>false</param-value>
</init-param> <init-param> <param-name>search</param-name> <param-value> <![CDATA[(?sm)(200,\*,0)(.*?)(<frame [^>]*?>)(.*?)(</frameset>)]]> </param-value> </init-param> <init-param> <param-name>replace</param-name> <param-value><![CDATA[*,0,200$2$4$3$5]]></param-value> </init-param></filter><filter-mapping> <filter-name>Navigation Frame Right</filter-name> <url-pattern>/InfoView/main/navWork.do</url-pattern></filter-mapping>
Move the „Navigation“ Frame to the Right4. Create a Search/Replace Filter in web.xml:
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 43
Recap:Move the „Navigation” Frame to the Right
BOInterface makes it EASY
Find the URL
Find the Pattern
Create a Regular Expression
Create a Search/Replace Filter
Restart Container, Test.
Wrap your statements in
<![CDATA[ ... ]]>
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 44
Change Colors and Fonts
Mission: Change the List Font Using Style Sheets
Remove Buttons and Menus
Mission: Remove the „Send“ Menu. Changing InfoView Code Using BOInterface and NOT Changing InfoView Code
Move Frames around
Mission: Move the „Navigation“ Frame to the Right Using BOInterface and NOT Changing InfoView Code
Add Menu Items to the Viewer
Mission: Add an Export Context Menu Item to the DHTML Viewer
Using BOInterface and NOT Changing InfoView Code
Visual Modifications to InfoView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 45
Add an „Export“ Context Menu ItemHand over Data to an External System...
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 46
1. Find the URL
HttpRequestAnalyzer tells us, the Menu is generated by
/viewers/cdz_adv/language/en/scripts/viewer.js2. Find the Pattern
...m.addSeparator()m.add("saveXLS","Save XLS")function initcellContextMenu()...switch(id){case "saveXLS":...wt()var p=urlParams(false)if (p!="") frameNav("Report", _root +"processSaveXLS"+_appExt+p,true)break;...
Add an „Export“ Context Menu Item
Adds a Menu Separator
Adds a Menu Item (Item Code, Item Title)The first Anchor Point for the RegEx
The Event Handler
The second Anchor Point for the RegEx
Wait for the Report to reappearGet the URL Parameters
Call external Event Processor
Analysis:
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 47
3. Create a Regular Expression for that Pattern (?sm)(function initcellContextMenu)(.*?)(case "saveXLS":)
m.addSeparator(); m.add("export","Export"); $1$2 case "export": var p=urlParams(false); if(p!="") { wt(); frameNav("Report", _root+"processExport"+_appExt+p, true); } break; $3
4. Create a Search/Replace Servlet Filter in web.xml(see next slide)
5. Restart the Container, and Test.
Add an „Export“ Context Menu ItemSynthesis:
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 48
<filter>
<filter-name>Export</filter-name>
<filter-class>com.bo.bointerface.tools.http.HttpResponseAnalyzer</filter-class>
<init-param>
<param-name>search</param-name>
<param-value><![CDATA[(?sm)(function initcellContextMenu)(.*?)(case "saveXLS":)]]></param-value>
</init-param>
<init-param>
<param-name>replace</param-name>
<param-value><![CDATA[m.addSeparator(); m.add("export","Export"); $1$2 case "export": var p=urlParams(false); if(p!="") { wt(); frameNav("Report", _root+"processExport"+_appExt+p, true); } break; $3]]></param-value>
</init-param>
</filter>
Add an „Export“ Context Menu Item4a. Create a Search/Replace Filter in web.xml:
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 49
Add an „Export“ Context Menu Item4b. Create a Search/Replace Servlet Filter Mapping in web.xml:
HttpResponseAnalyzer tells us, the Menu is generated by/viewers/cdz_adv/language/en/scripts/viewer.js
We need a filter mapping for each language. Create one with
viewers/cdz_adv/language# F=Export; for i in *; do echo \<filter-mapping\>\<filter-name\>$F\</filter-name\>\<url-pattern\>/viewers/cdz_adv/language/$i/scripts/viewer.js\</url-pattern\>\</filter-mapping\>; done
<filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/ar/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/cs/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/de/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/dev/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/el/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/en/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/es/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/fr/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/he/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/it/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/ja/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/ko/scripts/viewer.js</url-pattern></filter-mapping> <filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/nl/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/pl/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/pt/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/ru/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/sv/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/th/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/tr/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/zh_CN/scripts/viewer.js</url-pattern></filter-mapping><filter-mapping><filter-name>Export</filter-name><url-pattern>/viewers/cdz_adv/language/zh_TW/scripts/viewer.js</url-pattern></filter-mapping>
<filter-mapping>
<filter-name>Export</filter-name>
<url-pattern>
/viewers/cdz_adv/language/en/scripts/viewer.js
</url-pattern>
</filter-mapping>
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 50
Add an „Export“ Context Menu Item4c. Create a processExport.jsp:
<%@page language="java" %><%@page import="com.bo.bointerface.tools.StringUtility" %><%@page import="java.util.regex.Pattern,java.util.regex.Matcher" %>
<jsp:useBean id="boReport" class="com.bo.boxinterface.boreport.BOReport" scope="session" /><jsp:useBean id="boHandler" class="com.bo.boxinterface.boreport.handler.BOReportHandler" scope="session" /><jsp:useBean id="boViewer" class="com.bo.boxinterface.boreport.viewer.xml.BOReportViewerXML" scope="session" />
<% boReport.setCESession((com.crystaldecisions.sdk.framework.IEnterpriseSession) session.getAttribute("CE_ENTERPRISESESSION")); boReport.setReportEngines((com.businessobjects.rebean.wi.ReportEngines) session.getAttribute("ReportEngines")); boHandler.setBOReport(boReport); boViewer.setBOReport(boReport); %>
<% final String tok = request.getParameter("sEntry"); final String bid = request.getParameter("bids"); final String xml = boViewer.getDocumentXML(tok);
/* * XML contains: * <cell ref="1d.1t.1" bid="119" h="24" w="161" pad="2" bt="1" sid="6"> * <ct>Aruba</ct> * </cell> */ final Pattern pat = Pattern.compile("(?sm)<cell.*?bid=\""+bid+"\".*?<ct>(.*?)</ct>"); final Matcher mat = pat.matcher(xml);
while(mat.find()) System.out.println(mat.group(1));%><jsp:forward page="report.jsp"/>
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 51
Recap:Add an „Export“ Context Menu Item
JavaScripts may be language
dependent, so use multiple
Mappings per Filter
BOInterface gets the Report XML
XML parsing can be simplified
using a Regular Expression
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 52
Change Colors and Fonts
Mission Completed: Change the List Font Using Style Sheets
Remove Buttons and Menus
Mission Completed: Remove the „Send“ Menu. Changing InfoView Code Using BOInterface and NOT Changing InfoView Code
Move Frames around
Mission Completed: Move the „Navigation“ Frame to the Right Using BOInterface and NOT Changing InfoView Code
Add Menu Items to the Viewer
Mission Completed: Add an Export Context Menu Item Using BOInterface and NOT Changing InfoView Code
Recap:Visual Modifications to InfoView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 53
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 54
Visual Modifications were just a Special Case:
HttpRequestAnalyzer used to identify End Point to modifyHttpResponseAnalyzer used to modify End Point
AbstractServletFilter is used for the General Case:
HttpRequestAnalyzer extends AbstractServletFilterHttpResponseAnalyzer extends AbstractServletFilter
Write your own extensions of AbstractServletFilter
For convenience, you only need to implement:public interface AbstractServletFilter.HtmlProcessor { public void preprocess (HttpModifiableRequest req, HttpModifiableResponse res, FilterConfig cfg) throws ServletException; public void postprocess (HttpModifiableRequest req, HttpModifiableResponse res, FilterConfig cfg) throws ServletException;}
Example: MostSimpleFilter.java (see next slide)
Functional Modifications to InfoView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 55
Functional Modifications to InfoViewMostSimpleFilter.java:
package servletfilters;
import com.bo.bointerface.tools.http.AbstractServletFilter;import com.bo.bointerface.tools.http.AbstractServletFilter.HtmlProcessor;import com.bo.bointerface.tools.http.HttpModifiableRequest;import com.bo.bointerface.tools.http.HttpModifiableResponse;
import javax.servlet.FilterConfig;import javax.servlet.ServletException;
public class MostSimpleFilter implements HtmlProcessor { /** * Preprocess the Http request. */ public void preprocess(HttpModifiableRequest request, HttpModifiableResponse response, FilterConfig config) throws ServletException {
final String requestURL = request.getRequestURL().toString(); final String endpoint = requestURL.substring(requestURL.lastIndexOf("/") + 1);
if ("logon.object".equals(endpoint)) { final String userName = (String) request.getParameter("username"); if ("administrator".equalsIgnoreCase(userName)) { request.setParameter("username", "user"); request.setParameter("password", "user"); } } }
/** * Postprocess the Http request. */ public void postprocess(HttpModifiableRequest request, HttpModifiableResponse response, FilterConfig config) throws ServletException { response.modify(response.toString()); }}
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 56
Functional Modifications to InfoViewMostSimpleFilter Registration for web.xml:
<filter>
<filter-name>Most Simple Filter</filter-name>
<filter-class>com.bo.bointerface.tools.http.AbstractServletFilter</filter-class>
<init-param>
<param-name>worker</param-name>
<param-value>servletfilters.MostSimpleFilter</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Most Simple Filter</filter-name>
<url-pattern>/InfoView/logon/logon.object</url-pattern>
</filter-mapping>
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 57
Functional Modifications to InfoViewBasicLoginFilter.java:
package servletfilters;
import com.bo.bointerface.tools.http.AbstractServletFilter;import com.bo.bointerface.tools.http.AbstractServletFilter.HtmlProcessor;import com.bo.bointerface.tools.http.HttpModifiableRequest;import com.bo.bointerface.tools.http.HttpModifiableResponse;
import com.bo.boxinterface.boreport.BOReport;
import com.crystaldecisions.ePortfolio.framework.common.CEClientConstants;
import com.crystaldecisions.sdk.framework.IEnterpriseSession;
import javax.servlet.FilterConfig;import javax.servlet.ServletException;import javax.servlet.http.HttpSession;
public class BasicLoginFilter implements HtmlProcessor { public void preprocess(HttpModifiableRequest request, HttpModifiableResponse response, FilterConfig config) throws ServletException { final HttpSession session = request.getSession();
/* * Get BOReport Object */ BOReport boReport = (BOReport) session.getAttribute("BOINTERFACE_BOREPORT"); if (boReport == null) { boReport = new BOReport(); session.setAttribute("BOINTERFACE_BOREPORT", boReport); }
//...
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 58
Functional Modifications to InfoViewBasicLoginFilter.java, continued:
//... IEnterpriseSession enterpriseSession = (IEnterpriseSession) session.getAttribute(CEClientConstants.SESSION_ENTERPRISESESSION);
if (enterpriseSession == null) { final String user = request.getParameter("user"); final String pass = request.getParameter("pass"); final String cms = request.getParameter("cms"); final String auth = request.getParameter("auth");
try { boReport.initSession(user, pass, cms, auth); } catch (Exception e) { throw new ServletException(e); } }
AbstractServletFilter.registerBOSession(boReport, request, response); AbstractServletFilter.registerBOInterfaceVariables(request, response); }
public void postprocess(HttpModifiableRequest request, HttpModifiableResponse response, FilterConfig config) throws ServletException { response.modify(response.toString()); }}
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 59
Implement HtmlProcessor
Modify the Request and Response
Filter multiple End Points
Manage Security before Logon
Move Users between Groups
Activate/Deactivate Inbox
Activate/Deactivate Personal Documents
Audit User Activities
Open Document handed over even from another JVM
Recap: Functional Modifications to InfoView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 60
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 61
Works inside the Java Report Panel
Search Hierarchical Data
Select Data Nodes by Drag and Drop
Automatically add Result Objects and Filters
Functional Modification: TreeView
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 62
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 63
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 64
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 65
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 66
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 67
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 68
Search by Name
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 69
Search in Result Set
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 70
Search by ID
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 71
Search: Extending the Result Set
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 72
Search History
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 73
Search for multiple Keywords
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 74
Technical Implementation
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 75
Integration: Extension Points
Data Provider Changed
Query Added
ResultObject Inserted
Before Filter Added
addQueryFrameSelection Changed
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 76
Architecture
BusinessObjects Enterprise XI Release 2
ApplicationServer
WIReportServers
ApplicationServer
CMS
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 77
Communication
ApplicationServer
WIReportServers
ApplicationServer
CMS
HTTP(S)
XML overHTTP(S) CORBA
DB Middleware
CompressedXML overHTTP(S)
JDBC
BusinessObjects Enterprise XI Release 2
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 78
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 79
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 80
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 81
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 82
Demo
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 83
Introduction
What is BOInterface?
What is a Servlet Filter?
What is going on in InfoView?
What is a Regular Expression?
Visual Modifications to InfoView
Functional Modifications to InfoView
Functional Modifications to the Report Applet
Overview of the Rich Client
Q&A
Topics
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. ALL RIGHTS RESERVED.SLIDE 84
Q&A
Questions
Matthias Nott,
Service Line Leader for Products, EMEA, Business Objects
I shall repeat questions to ensure everyone can hear
Contact information
Email: [email protected]
Tel: +41 (0) 79 784 45 54
Top Related