NOTE: This blog is relevant to version 1.0 of Helical Insight and will not work for any other version. You can know the version from the bottom left (above file browser) or from the admin page.
Note: This article doesn’t change any functionality or styles of normal application flow. Instead, changes are made in such a way that it affects only desired page of the application.
This article briefs about how you can white label and change the look and feel of Helical Insight application as per your own requirement. In this document, we have focused on white labeling the adhoc module which includes removal of Header and Footer from Create Report and Edit Report pages.
Also unlike other tools, we provide extensive white labeling capabilities which include header, footer, login page, context menu, file browser, repository and any other functionality as well. With Helical Insight it is even possible to have organization specific / user, specific/ role specific white labeling which means the solution will identify who has logged in and based on that every person can have their own completely customized Helical Insight.
For Adhoc module default look is like the below screenshot
From the above image, we will remove header and footer sections of the page.
We need to make 2 global changes in order to remove header and footer :
- Open ‘tiles-definitions.xml’ file. You will find this file at below location where Helical Insight is installed:
Helical Insight\apache-tomcat-7\webapps\hi\WEB-INF\tiles-definitions.xml
<put-attribute name="footer-nav" value="/WEB-INF/pages/sections/footer.jsp"/>
Below is the screenshot for your reference.
<jsp:include page="/WEB-INF/pages/sections/footer.jsp"/>
with <tiles:insertAttribute name="footer-nav" />
inside ‘base-template.jsp’
file, which is present at below location:Helical Insight\apache-tomcat-7\webapps\hi\WEB-INF\pages\templates\base-template.jsp
Below is screenshot for your reference.
Also, we need to make some extra changes depending upon which page we want to white label :
Helical Insight\apache-tomcat-7\webapps\hi\WEB-INF\tiles-definitions.xml
<definition name="report-create-embed" extends="adhoc"> <put-attribute name="rightMenu" value="/WEB-INF/pages/menu/empty.jsp"/> <put-attribute name="nav" value="/WEB-INF/pages/templates/report-edit-embed-css.jsp"/> <put-attribute name="footer-nav" value="/WEB-INF/pages/menu/empty.jsp"/> <put-attribute name="footer-content" value="/WEB-INF/pages/menu/empty.jsp"/> <put-attribute name="title" value="Report-create" type="string"/> <put-attribute name="body" value="/WEB-INF/pages/templates/adhoc/body.jsp"/> <put-attribute name="scripts" value="/WEB-INF/pages/templates/adhoc/report-create-footer.jsp" cascade="true"/> </definition>
The highlighted code will empty the content of Header and Footer sections.
Now we need to include the definition-name inside ‘spring-security.xml’ file which is present at below location:
Helical Insight\apache-tomcat-7\webapps\hi\WEB-INF\spring-security.xml
Please open the file and add below line of code inside it.
<intercept-url pattern="/adhoc/report-create-embed.html" access="hasAnyRole('ROLE_USER','ROLE_ADMIN')"/>
Note: The name given to .html should be same as that of definition name given inside ‘tiles-definitions.xml’ file.
Once header and footer get removed we need to resize the left side content which is metadata-container. In order to resize that please create one .css file with appropriate name. Put this file inside below location:
Helical Insight\apache-tomcat-7\webapps\hi\css
Here we have created ‘whitelabelling.css’
file and added the below lines of code inside it.
.metadata-container { top: 0 !important; } .metadata-container.adhoc-report { margin-bottom: 0 !important; } .hi-adhoc-body { padding-top: 0 !important; }
In order to apply this styles, we need to include this .css file inside a .jsp page such that the whitelabeling styles doesn’t affect HI application’s base CSS styles. So, create a .jsp page with appropriate name. Here we have created ‘report-edit-embed-css.jsp’ file and has put this file at below location:
Helical Insight\apache-tomcat-7\webapps\hi\WEB-INF\pages\templates
Please add below line of code into ‘report-edit-embed-css.jsp’ file.
<link data-clone="true" rel="stylesheet" href="${baseURL}/css/whitelabelling.css"/>
Now we need to include ‘report-edit-embed-css.jsp’ file inside ‘tiles-definitions.xml’ file which is present at below location:
Helical Insight\apache-tomcat-7\webapps\hi\WEB-INF\tiles-definitions.xml
Search for definition name with report-create-embed. Inside that definition tag, add the following highlighted code:
<definition name="report-create-embed" extends="adhoc"> <put-attribute name="rightMenu" value="/WEB-INF/pages/menu/empty.jsp"/> <put-attribute name="nav" value="/WEB-INF/pages/templates/report-edit-embed-css.jsp"/> <put-attribute name="footer-nav" value="/WEB-INF/pages/menu/empty.jsp"/> <put-attribute name="footer-content" value="/WEB-INF/pages/menu/empty.jsp"/> <put-attribute name="title" value="Report-create" type="string"/> <put-attribute name="body" value="/WEB-INF/pages/templates/adhoc/body.jsp"/> <put-attribute name="scripts" value="/WEB-INF/pages/templates/adhoc/report-create-footer.jsp" cascade="true"/> </definition>
Note: Now the url for the white labelled page is as below:
baseURL../hi/adhoc/report-create-embed.html
and not baseURL../hi/adhoc/report-create.html
as here we have given the name of .html as report-create-embed.html
.
Also you need to restart the application from services.msc(by stopping it and then again starting it) in order to reflect the changes that has been made.
After following all above steps the look of our page is as below: