Example of Creating the MetabaseDialogBase Component

Before executing the example, study recommendations to code writing. Make sure that repository contains an express report with the 88665 key.

To create the MetabaseDialogBase component, use HTML code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>MetabaseDialogBase</title>
    <script src="../build/PP.js" type="text/javascript"></script>
    <script src="../build/PP.Metabase.js" type="text/javascript"></script>
    <script src="../build/PP.Express.js" type="text/javascript"></script>
    <script src="../build/PP.Navigator.js" type="text/javascript"></script>
    <script type="text/javascript" src="../resources/Metabase.resources.ru.js"></script>
    <script type="text/javascript" src="../resources/Express.resources.ru.js"></script>
    <script type="text/javascript" src="../resources/Navigator.resources.ru.js"></script>
    <link href="../build/PP.css" rel="stylesheet" type="text/css" />
    <link href="../build/PP.Metabase.css" rel="stylesheet" type="text/css" />
    <link href="../build/PP.Express.css" rel="stylesheet" type="text/css" />
 
    <script type="text/javascript">
        var metabase, eaxMdService, eaxAnalyzer, metabaseDialogBase;
        // Function executed on loading html document
        function onLoad() {
            // Set path to root folder containing resource files
            PP.resourceManager.setRootResourcesFolder("../../resources/");
            // Set language settings for resources
            PP.setCurrentCulture(PP.Cultures.ru);
            // Create repository connection
            metabase = new PP.Mb.Metabase({
                // Set Url of the PP.SOM web service in the format:
                // <http://<ServerName | IP-address>[:<Port>][/<VirtualCatalog>]/axis2/services/PP.SOM.Som>
                PPServiceUrl: "http://localhost/FPBI_App_v9.2x64/axis2/services/PP.SOM.Som",
                Id: "Repository",
                UserCreds: {
                    UserName: "user",
                    Password: "password"
                }
            });
            // Open repository connection
            metabase.open();
            // Create service to work with express reports
            eaxMdService = new PP.Exp.EaxMdService({
                Metabase: metabase
            });
            // Open express report with the key 88665
            eaxAnalyzer = eaxMdService.editDocument(88665);
            // Determine filter array for dialog box
            var filters = [{
                Filters: [2561], // Display only express reports
                // Determine resource key to get filter name
                ResourceKey: "openDialogExpressReports"
            }];
            // Create dialog box to save object
            metabaseDialogBase = new PP.Navigator.MetabaseDialogBase({
                Metabase: metabase,
                FiltersSet: filters, // Filter array for dialog box
                CurrentFilter: filters[0], // Current filter
                ImagePath: "../../build/img/", // Path to dialog box images
                OpenToKey: parseInt(eaxAnalyzer.getParentKey() || 0) // Folder key in repository to be opened in dialog box
            });
            metabaseDialogBase.show(); // Show dialog box to save object
        }
    </script>
</head>
<body onload="onLoad();">
</body>
</html>

After executing the example the HTML page will contain the MetabaseDialogBase component:

According to the selected filter the dialog box will display only express reports from all repository objects.

See also:

MetabaseDialogBase