slide1 n.
Skip this Video
Loading SlideShow in 5 Seconds..
Changing InfoView without Changing InfoView PowerPoint Presentation
Download Presentation
Changing InfoView without Changing InfoView

Loading in 2 Seconds...

  share
play fullscreen
1 / 83
Download Presentation

Changing InfoView without Changing InfoView - PowerPoint PPT Presentation

bevis-browning
156 Views
Download Presentation

Changing InfoView without Changing InfoView

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Changing InfoView withoutChanging InfoView Matthias Nott, Business Objects

  2. Introduction • Who I am • Matthias Nott, • Business Objects Service Line Leader for Products, EMEA • What is this all about • Changing InfoView without Changing InfoView? • What I want you to do • If 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

  3. Topics • 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

  4. What Is BOInterface? • SDK library that greatly simplifies using the SDK • You 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 projects • Based on 5 years of development • More than 35,000 lines of code behind the scenes • Actively used by customers worldwide • Consulting solution • Ask your account manager • Ask local professional services contact • Ask me matthias.nott@businessobjects.com

  5. What Is BOInterface?

  6. What Is BOInterface?

  7. Topics • 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

  8. 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!

  9. What is a Servlet Filter? Sample Servlet Filter Declaration for web.xml • <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>

  10. Topics • 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

  11. What is going on in InfoView? • 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>

  12. What is going on in InfoView? • ------------------------------------------ • [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.5 • hdr: host [java.lang.String]=linux:9090 • hdr: 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:6400 • coo: CE_LastAuthType [java.lang.String]=secEnterprise • coo: CE_LastUser [java.lang.String]=Administrator • coo: CE_LogonToken [java.lang.String]=LINUX@25378JBCl8HYL8NgXIpeb25376JFUZkV8pIHsLKLCx • coo: 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=25402JLaVCP • ses: javax.servlet.jsp.jstl.fmt.request.charset [java.lang.String]=utf-8 • ses: org.apache.struts.action.LOCALE [java.util.Locale]=en_US • ses: 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_desktoplaunch • app: objUtils [com.businessobjects.adv_ivcdzview.Utils]=com.businessobjects.adv_ivcdzview.Utils@a1b4e7 • app: org.apache.catalina.WELCOME_FILES [[Ljava.lang.String;]=[Ljava.lang.String;@8698fa • app: 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@37165f • app: org.apache.struts.action.FORM_BEANS [org.apache.struts.action.ActionFormBeans]=org.apache.struts.action.ActionFormBeans@f5d030 • app: org.apache.struts.action.FORWARDS [org.apache.struts.action.ActionForwards]=org.apache.struts.action.ActionForwards@9dd6e2 • app: org.apache.struts.action.MAPPINGS [org.apache.struts.action.ActionMappings]=org.apache.struts.action.ActionMappings@a09e41 • app: org.apache.struts.action.MESSAGE • [org.apache.struts.util.PropertyMessageResources]=org.apache.struts.util.PropertyMessageResources@14ed577 • app: org.apache.struts.action.SERVLET_MAPPING [java.lang.String]=*.object • ------------------------------------------

  13. 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!

  14. Topics • 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

  15. 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

  16. What is a Regular Expression (正規表現)? Sample 1: Suppress some HTML Code • 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“

  17. What is a Regular Expression (正規表現)? Sample 2: Swap some HTML Code • 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

  18. 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 性器表現...)

  19. Topics • 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

  20. Visual Modifications to InfoView • 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

  21. Change the List Font Coming from here...

  22. Change the List Font ...we want to go here

  23. Change the List Font • Find out where the StyleSheet is Frame Source says, it is in /InfoView/res/schema.blue/default.css Frame 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.

  24. 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

  25. Visual Modifications to InfoView • 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

  26. Remove the „Send“ Menu

  27. Remove the „Send“ Menu Method 1: Attempting to Reverse Engineer • 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.

  28. Remove the „Send“ Menu Method 1, continued: Fighting with the Code... • 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>

  29. Remove the „Send“ Menu Method 1, continued: Pattern Searching... 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.

  30. Remove the „Send“ Menu Method 1, Summary • 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.

  31. Remove the „Send“ Menu Method 2: Use BOInterface • 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.

  32. Remove the „Send“ Menu Method 2: Use BOInterface • A five step process: • Find the URL for the Frame by using Frame Information: /InfoView/main/headerPlus.do • Open the Frame Source and Locate the Pattern: // "Send" Menu var btnSend = toolbarCtrl.add (newIconMenuWidget ... var myInfoViewIcon = ... • Create a Regular Expression for that Pattern: (?sm)var btnSend.*?(var myInfoViewIcon) • Create a Search/Replace Servlet Filter in web.xml (see next slide) • Restart the Container, and Test.

  33. Remove the „Send“ Menu 4. Create a Search/Replace Filter in web.xml: <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>

  34. Remove the „Send“ Menu

  35. Recap:Remove the „Send” Menu • Code Changes are BAD • BOInterface makes it EASY • Find the URL • Find the Pattern • Create a Regular Expression • Create a Search/Replace Filter • 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

  36. Visual Modifications to InfoView • 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

  37. Move the „Navigation“ Frame to the Right Coming from here...

  38. Move the „Navigation“ Frame to the Right ...we want to go here

  39. Move the „Navigation“ Frame to the Right Analysis: • Find the URL HttpRequestAnalyzer tells us, the FrameSet is generated by /InfoView/main/navWork.do • 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>

  40. Move the „Navigation“ Frame to the Right Synthesis: • Create a Regular Expression for that Pattern (?sm)(200,\*,0)(.*?)(<frame [^>]*?>)(.*?)(</frameset>) *,0,200$2 $4 $3$5 • Create a Search/Replace Servlet Filter in web.xml (see next slide) • Restart the Container, and Test.

  41. Move the „Navigation“ Frame to the Right 4. Create a Search/Replace Filter in web.xml: <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>

  42. 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[ ... ]]>

  43. Visual Modifications to InfoView • 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

  44. Add an „Export“ Context Menu Item Hand over Data to an External System...

  45. 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 reappear Get the URL Parameters Call external Event Processor Add an „Export“ Context Menu Item Analysis: • Find the URL HttpRequestAnalyzer tells us, the Menu is generated by /viewers/cdz_adv/language/en/scripts/viewer.js • 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; ...

  46. Add an „Export“ Context Menu Item Synthesis: • 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 • Create a Search/Replace Servlet Filter in web.xml (see next slide) • Restart the Container, and Test.

  47. Add an „Export“ Context Menu Item 4a. Create a Search/Replace Filter in web.xml: <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$2case "export": var p=urlParams(false); if(p!="") {wt(); frameNav("Report", _root+"processExport"+_appExt+p, true); } break; $3]]></param-value> </init-param> </filter>

  48. Add an „Export“ Context Menu Item 4b. 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>

  49. Add an „Export“ Context Menu Item 4c. 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"/>

  50. 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