Friday 23 March 2012

[JasperServer] Homepage Role Based

Hi,
If you want user to be redirected to certain page right after his login, you can change this file:
\WEB-INF\jasperserver-servlet.xml
Find bean name "homePageByRole" and change it accordingly.
In my case, I have change it to:

<bean id="homePageByRole" class="java.util.ArrayList">
    <constructor-arg>
      <list>
        <value>ROLE_ADMINISTRATOR|redirect:/flow.html?_flowId=repositoryExplorerFlow</value>
        <value>ROLE_USER|redirect:/flow.html?_flowId=listReportsFlow</value>
      </list>
    </constructor-arg>
  </bean>

Hope it helps.

Wednesday 14 March 2012

[JasperServer] Limitation on Domain Query Text Area

Hi All,
This week I encountered the problem when I want to create query in Domain Designer with derived table using query. I found out that maximum character can be entered there was 5000 character. So I went around and read the configuration to change that to the value that I want since my query is big.
You can try to open this file:
\WEB-INF\classes\esapi\security.properties
Find this row:
createdQuerySql=Alpha,NoTag,5000,true,createdQuerySql-Run_Report_context
sqlDomainDesigner=ValidSQL,ValidSQLSelectStart,5000,true,SQL_Domain_Designer_context

Change value 5000 for this row to the value that you want and there you go.

In my case, I changed it to 20000 and it suite my requirement straight away.
Don't forget to delete all your temp and work folder (if exist) since this file is being cached.
Hope it helps.



Monday 5 March 2012

[JasperServer] Latest dashboard.runtime.js v 4.5.0

Hi All,
Here are the latest dashboard.runtime which have been updated to avoid error using demo dashboard.runtime old version.

Just add this into your last line without the need to replace the file:

// GA : Controls frames btw reports in dashboard
function replaceFrameURL(TargetReport,TargetParameterString,TargetFrameNumber) { 
  if (TargetParameterString=='') {
    var url = "/jasperserver-pro/flow.html?_flowId=viewReportFlow&viewAsDashboardFrame=true&reportUnit="+TargetReport;
  } else {
    var url = "/jasperserver-pro/flow.html?_flowId=viewReportFlow&viewAsDashboardFrame=true&reportUnit="+TargetReport+"&"+TargetParameterString;
  }
               
    var FrameBaseName="contentFrame_frame_"+TargetFrameNumber;
    var Frame = document.getElementById(FrameBaseName);
    Frame.src = url;         
}

// GA : This is a loop to call many reports in differents frames in a single call
// The call is made like this : replaceManyFrames('/reports/report1@@/reports/report2','Country=France@@StoreID=4','2@@3')
// The inputs have to be consitent
function replaceManyFrames(TargetReports,TargetParameterStrings,TargetFrames) { 
  if (TargetReports.indexOf('@@') > -1) {
    var XTargetReport = "";
    var XTargetParameterString ="";
    var XFrame = "";
    var valueArrayReports = TargetReports.split('@@');
    var valueArrayParameters = TargetParameterStrings.split('@@');
    var valueArrayTFrames = TargetFrames.split('@@');

    for (var i = 0; i < valueArrayReports.length; i++) {
      // decode each and send to replaceFrameURL
      XTargetReport = valueArrayReports[i];
      XTargetParameterString =valueArrayParameters[i];
      XFrame = valueArrayTFrames[i];
      replaceFrameURL(XTargetReport,XTargetParameterString,XFrame);
    }
    }
}

[JasperServer] Customizing Default Folder and Themes during installation

Hi All,

Probably during
creating default installation for jasper server, we may want to customize default organization that was created as "organization_1" as well as creating default themes that by default is being set to "default" theme. It is very annoying if we have few installation and we have to keep changing the themes. So here are the steps that you need to take:
1.   Make sure all replaced file have been changed inside jasperserver-pro.war
2.   Inside "buildomatic\install_resources\export" folder, there is 1 file called "js-catalog-sqlserver-minimal-pro.zip". This is the file that will be installed as a basic installation on your database
3.  Copy this file into temporary folder and extract it
4.  You will have your structures for default installation, do not remove anything.
5.  Your default organization xml will be inside "organizations" folder, change file name into any name you want and open that file, rename anything that contains "organization_1" into the name that you prefer, for example abc
6.  "resources" folder contains all your default resources, so you should edit resources under "organizations\organization_1" into "abc" as well as change anything inside ".folder.xml"
7.  Go into that abc folder and rename every folder and every xml file that contains "organization_1" into abc
8.  Create your own folder and use the same structure as any other folder. Do not forget the XML file.
9.  Under "resources\themes", you can create your own theme and upload all necessary file that you want to override inside there. Just follow default folder structure and rename ll your resource to include ".data".
10. Do not forget to register your resource into ".folder.xml"
11. Change your tag from "<theme>Default</theme>" into "<theme>abc</theme>" inside "organizations\organizations.xml"
12. Do minimal installation and there you go!