JSAPI dashboard in edit mode

Hi


 


I have a dashboard, which is integrated in my single page application with JSAPI, and I would like to make it editable (to give users ability to construct adhoc reports based on provided data objects). I didn't find any appropriate methods in actuate.Dashboard class.


 


Is it possible with JSAPI or should I use iframe for this?


Thanks in advance!


Comments

  • Yes, with JSAPI, you can set dashboard.setIsDesigner(true); to edit mode.  Otherwise, set dashboard.setIsDesigner(false); to read-only.



    <script type="text/javascript" src="http://ihub:8700/iportal/jsapi"></script>
    ...

    <body onload="acload()">
    <div id="dashboardContainer">

    <script defer="defer" type="text/javascript" language="JavaScript">
    var dashboard;
    function acload() {
    actuate.load("dashboard");
    var reqOps = new actuate.RequestOptions( );
    reqOps.setRepositoryType(actuate.RequestOptions.REPOSITORY_ENCYCLOPEDIA);
    reqOps.setVolume( "Default Volume" );
    actuate.initialize("http://ihub:8700/iportal/",reqOps,null,null, afterInit );
    }

    function afterInit(){
    var containerID = "dashboardContainer";
    dashboard = new actuate.Dashboard(containerID);
    dashboard.setIsDesigner(true);
    dashboard.setDashboardName("/dashboards/foo.dashboard");
    dashboard.submit();
    }

    </script>

    ...


    </body>
    </html>

    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

  • Cool, that works!


     


    However I got the following in browser console:



    Access to Font at 'http://127.0.0.1:8700/iportal/dashboard/fonts/yggdrasil/yggdrasil.ttf'
    from origin 'http://localhost:1841' has been blocked by CORS policy:
    No 'Access-Control-Allow-Origin' header is present on the requested resource.
    Origin 'http://localhost:1841' is therefore not allowed access.

    Is there a way to configure CORS for ihub resources?


     


    Thank you very much


  • You can change the setting in WEB-INF/web.xml (of Information Console):



    <filter>
    <filter-name>CorsFilter</filter-name>
    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>CorsFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>


    A restart is needed.


    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

  • What would be the JSAPI to view a data object, using the Data Analyzer? 


  • Example to using Interactive Crosstabs with a materialized Data Object (.DATA):




    <!DOCTYPE html>

    <head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>Interactive Crosstab JSAPI Page</title>
    <script type="text/javascript" src="http://iHub:8700/iportal/jsapi"></script>
    </head>

    <body onload="acload()">


    <div id="xtabContainer">

    <script defer="defer" type="text/javascript" language="JavaScript">

    var dataAnalyzer;

    function acload() {
    actuate.load("xtabAnalyzer");
    var reqOps = new actuate.RequestOptions();
    reqOps.setRepositoryType(actuate.RequestOptions.REPOSITORY_ENCYCLOPEDIA);
    reqOps.setVolume( "Default Volume" );
    actuate.initialize("http://iHub:8700/iportal/",reqOps, null, null, loadAnalyzer );
    }

    function loadAnalyzer(){
    var pathName = "/Resources/Data Objects/MyDataObject.data";

    dataAnalyzer = new actuate.XTabAnalyzer('xtabContainer');
    dataAnalyzer.setWidth(1000);
    dataAnalyzer.setHeight(700);
    dataAnalyzer.setDatamartFile(pathName);
    dataAnalyzer.submit();
    }
    </script>

    </body>
    </html>

    Clement Wong
    Principal Analytics Architect

    OpenText Corporation
    http://www.actuate.com | http://www.opentext.com

Sign In or Register to comment.