{"id":5195,"date":"2013-05-17T01:35:04","date_gmt":"2013-05-17T08:35:04","guid":{"rendered":"http:\/\/localhost\/exoblog\/?p=5195"},"modified":"2023-06-05T16:38:00","modified_gmt":"2023-06-05T14:38:00","slug":"how-we-customized-eclipse-infocenter","status":"publish","type":"post","link":"https:\/\/www.exoplatform.com\/blog\/how-we-customized-eclipse-infocenter\/","title":{"rendered":"How we customized Eclipse Infocenter for the new eXo documentation website"},"content":{"rendered":"<p>Eclipse offers plugin developers the ability to add help documentation for their plugins locally or online. Opening that help will give you a nice window with searchable help, something like this:<\/p>\n<p><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5196\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35.png\" alt=\"docwbs-35\" width=\"100%\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35.png 1047w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-300x156.png 300w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-1024x532.png 1024w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-768x399.png 768w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-720x374.png 720w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-500x260.png 500w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-360x187.png 360w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-200x104.png 200w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-100x52.png 100w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-35-58x30.png 58w\" sizes=\"(max-width: 1047px) 100vw, 1047px\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<p>with different areas:<\/p>\n<ol style=\"list-style: decimal; margin-left: 20px;\">\n<li>Banner<\/li>\n<li>Searching area<\/li>\n<li>Table of content toolbar<\/li>\n<li>Items tree<\/li>\n<li>View tabs<\/li>\n<li>Content toolbar<\/li>\n<li>Content area<\/li>\n<li>Breadcrumbs<\/li>\n<\/ol>\n<p>Item tree displays list of documentations. When you select an item, the content and breadcrumbs of the selected item will be displayed respectively on the right area. We can find a tutorial provided on <a href=\"http:\/\/help.eclipse.org\/juno\/index.jsp\" target=\"_blank\" rel=\"noopener\">Eclipse Help<\/a> guiding you how to deploy the infocenter as a Web Archive <a href=\"http:\/\/help.eclipse.org\/helios\/topic\/org.eclipse.platform.doc.isv\/guide\/ua_help_war.htm\" target=\"_blank\" rel=\"noopener\">here<\/a>. eXo Platform has succeeded in creating an infocenter package named <em>infocenter-webapp-${version}.war<\/em> deployable to server that you can download from <a href=\"http:\/\/repository.exoplatform.org\/content\/repositories\/exo-releases\/org\/exoplatform\/doc\/infocenter-webapp\/\" target=\"_blank\" rel=\"noopener\">eXo Platform repository<\/a>. Documentations Website of eXo Platform <a href=\"http:\/\/docs.exoplatform.com\/\" class=\"broken_link\" target=\"_blank\" rel=\"noopener\">http:\/\/docs.exoplatform.com\/<\/a> uses this package to deploy documentation of Platform 4.0 and Platform 3.5. This post represents how to customize the default look and feel and behavior provided by Eclipse Help Infocenter as you desire.<\/p>\n<h2>Customize Eclipse infocenter webapp<\/h2>\n<p>By extracting <em>infocenter-webapp-${version}.war<\/em>, you will find a jar package <em>org.eclipse.help.webapp_${version}.jar<\/em> under this path <em>infocenter-webapp\/WEB-INF\/plugins<\/em> which contains a bundle of editable files and compiled java classes. All cool stuff will be done by customizing jsp, stylesheet and javascript files in <b>advanced<\/b> folder in this package.<\/p>\n<h3>Global layout<\/h3>\n<p>Infocenter uses Framesets and Frames to separate areas on whole page (searching area, reading area, tree panel, etc.). Each frame has a dedicated name. The global layout of the website page is represented in detail on the following schema:<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5200\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout.png\" alt=\"layout\" width=\"320\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout.png 579w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout-269x300.png 269w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout-424x473.png 424w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout-294x328.png 294w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout-212x236.png 212w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout-117x131.png 117w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout-81x90.png 81w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/layout-27x30.png 27w\" sizes=\"(max-width: 579px) 100vw, 579px\" \/><\/a><\/p>\n<p>which:<\/p>\n<ol style=\"list-style: decimal; margin-left: 20px;\">\n<li>BannerFrame: link to banner file. It allows you to change the banner of website with your company logo, navigation menu, etc.<\/li>\n<li>SearchFrame: here we call the searching area that includes search input, search button, link to set scope of search action, etc.<\/li>\n<li>NavFrame: It&#8217;s the left part that includes a toolbar with a series of small buttons (Print selected topic, Search topics, Collapse all, Link with contents, and Maximize), a tree of items to navigate, and a toolbar at the bottom with three tabs allowing you to display appropriate content (Contents, Index, Search Results).<\/li>\n<li>ContentFrame: It&#8217;s the right part that includes a toolbar with another series of small buttons (Go Back, Go Forward, Home, Show in TOC, Print Page, and Maximize) and an area to display breadcrumbs and content of selected topic.<\/li>\n<\/ol>\n<p>All these components can be customized directly in files in <em>org.eclipse.help.webapp_${version}.jar\/advanced<\/em> folder. We will indicate which file matches which part in the following sections, and the customization will depend on your design. From now, all files that we mention can be found in the <b>advanced<\/b> folder of <em>org.eclipse.help.webapp_${version}.jar<\/em> package.<\/p>\n<h3>The banner<\/h3>\n<p>The entry point in which a whole page is rendered is <b>index.jsp<\/b> file. It declares our three main frames, as in the schema above. Each frame has an attribute named <i>src<\/i>. Put your banner file in the advanced folder, and then you can point <i>src<\/i> attribute of BannerFrame to your banner file. E.g.: <i>src=&#8221;advanced\/banner.html&#8221;<\/i><\/p>\n<h3>Searching area<\/h3>\n<p>If you want to customize the look and feel of a search form (search input, search button, scope link, etc.), you can do it via <b>searchScoped.jsp<\/b> file.<\/p>\n<p>When you click on a search button to do a search action, js code in <b>searchScoped.jsp<\/b> file will be called (entry point is <em>doSearch()<\/em> function). Based on input text and selected scope, a query will be created and passed to java code to handle. The tree panel will be switched to view &#8220;Search Result,&#8221; and the rendering and switch tabs are managed in <b>tabs.jsp<\/b> and <b>nav.jsp<\/b>. Search results are rendered by <b>searchView.jsp<\/b> and use style sheet from <b>searchList.css<\/b>. When you click on Scope link on searching area, a small window that appears allows you to manage the scope of your search action. The default scope is &#8220;All topics.&#8221; You can customize its look and feel and behavior via <b>workingSetManager.jsp<\/b> and <b>workingSet.jsp<\/b>. Here is the result after we did some customizations of css and html of search form and search result panel:<\/p>\n<p><span style=\"text-decoration: underline;\">Before<\/span>:<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5210\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1.png\" alt=\"Searching Area 1\" width=\"320\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1.png 400w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1-230x300.png 230w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1-362x473.png 362w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1-251x328.png 251w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1-181x236.png 181w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1-100x131.png 100w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1-69x90.png 69w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-1-23x30.png 23w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<p><span style=\"text-decoration: underline;\">After<\/span>:<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5211\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Searching-Area-2.png\" alt=\"Searching Area 2\" width=\"320\" \/><\/a><\/p>\n<p><i><b>NOTE<\/b><\/i>: You can modify style sheet of components in css files (<b>searchLisht.css<\/b>, <b>breadcrumbs.css<\/b>,<b> tocTree.css<\/b>, etc.) or css embedded in header of jsp files, or you can also reorganize them to grouping all style sheets to one common place. It&#8217;s easier to maintain and improve later.<\/p>\n<h3>Toolbars<\/h3>\n<p>We have two toolbars on the left and right panels, respectively. Although they are on two different frames, they use some common files to be rendered and to behave. There are three necessary files for each toolbar: the toolbar on the left (<b>tocToolbar.jsp<\/b>, <b>toolbar.jsp<\/b> and <b>navActions.js<\/b>), the toolbar on the right (<b>contentToolbar.jsp<\/b>, <b>toolbar.jsp<\/b> and <b>contentActions.js<\/b>). <b>tocToolbar.jsp<\/b> and <b>contentToolbar.jsp<\/b> provide a list of buttons with basic information (name, icon, param, state). <b>toolbar.jsp<\/b> file is responsible to take these lists and render them. Two js files contain javascript code to handle click events on each button (Show in TOC, Print, Previous, Next, Home, Collapse All, Search Topics). Only the maximize function used to collapse frames calls the <em>toogleFrame(title)<\/em> function in <b>help.jsp<\/b>. The last item to note is that the toolbar on the left is linked from view.jsp, and the one on the right is linked from <b>content.jsp<\/b>. This is useful if you want to remove these toolbars.<\/p>\n<h3>Tree panel<\/h3>\n<p>The entry point for the items tree is <b>tocView.jsp<\/b> file, and the style sheets are in <b>tocTree.css<\/b>. The table of contents in the tree panel is constructed and updated each time the page is loaded. It&#8217;s generated top-down from root to leaf node by functions in <b>helptreechildren.js<\/b> file. All events triggered on the tree panel will be handled by <b>helptree.js<\/b> and <b>tocTree.js<\/b> files. By using these files for the Documentations Website of eXo Platform, we made some changes for the tree panel; we added a select box allowing you to choose which book to display. When a book is selected, the tree panel will be updated to display chapters and sections of that book, whereas the former behavior of the tree panel was to display all books, chapters, and sections each time a whole page was loaded.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5215\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel.png\" alt=\"Tree panel\" width=\"320\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel.png 400w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel-300x254.png 300w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel-387x328.png 387w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel-278x236.png 278w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel-155x131.png 155w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel-100x85.png 100w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Tree-panel-35x30.png 35w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/a><\/p>\n<h3>Reading area<\/h3>\n<p>The breadcrumbs and the content displayed on the reading area are rendered by java code. Even if Eclipse Help is &#8220;open-source,&#8221; it&#8217;s still hard to customize java files, recompile and package them into a new <em>org.help.eclipse.webapp.jar<\/em>. What we can do for customization is to inject javascript code into the header of <b>content.jsp<\/b> file, which is the entry point to render the reading area. For example, javascript supports calling method after a whole page was loaded so that we can manipulate elements on the reading area after the page is finished loading. We moved the default breadcrumbs from the reading area to the searching area and created a new look and feel for it via <b>breadcrumbs.css<\/b> file.<\/p>\n<p><span style=\"text-decoration: underline;\">Before<\/span>:<\/p>\n<p><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5216\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1.png\" alt=\"Reading area 1\" width=\"100%\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1.png 934w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-300x57.png 300w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-768x146.png 768w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-720x136.png 720w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-500x95.png 500w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-360x68.png 360w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-200x38.png 200w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-100x19.png 100w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-1-70x13.png 70w\" sizes=\"(max-width: 934px) 100vw, 934px\" \/><\/a><\/p>\n<p><span style=\"text-decoration: underline;\">After<\/span>:<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5217\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2.png\" alt=\"Reading area 2\" width=\"500\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2.png 722w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2-300x86.png 300w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2-720x206.png 720w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2-500x143.png 500w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2-360x103.png 360w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2-200x57.png 200w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2-100x29.png 100w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/Reading-area-2-70x20.png 70w\" sizes=\"(max-width: 722px) 100vw, 722px\" \/><\/a><\/p>\n<p>We customized Eclipse Infocenter to make a new look and feel for Documentations Website of eXo Platform, and the results are great! You are entirely able to create fantastic stuff for your website.<\/p>\n<p><a href=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5218\" src=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40.png\" alt=\"docwbs-40\" width=\"100%\" srcset=\"https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40.png 1042w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-300x157.png 300w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-1024x536.png 1024w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-768x402.png 768w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-720x377.png 720w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-500x262.png 500w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-360x188.png 360w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-200x105.png 200w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-100x52.png 100w, https:\/\/www.exoplatform.com\/blog\/wp-content\/uploads\/2013\/05\/docwbs-40-57x30.png 57w\" sizes=\"(max-width: 1042px) 100vw, 1042px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Eclipse offers plugin developers the ability to add help documentation for their plugins locally or online. Opening that help will give you a nice window with searchable help, something like this:","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[699],"tags":[],"lang":"en","translations":{"en":5195},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/posts\/5195"}],"collection":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/comments?post=5195"}],"version-history":[{"count":0,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/posts\/5195\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/media?parent=5195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/categories?post=5195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.exoplatform.com\/blog\/wp-json\/wp\/v2\/tags?post=5195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}