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() {
// Specify path to root folder with resources files
PP.resourceManager.setRootResourcesFolder("../../resources/");
// Determine language settings for resources
PP.setCurrentCulture(PP.Cultures.ru);
// Create a repository connection
metabase = new PP.Mb.Metabase({
// Set PP.SOM web service URL 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 a service for working with express reports
eaxMdService = new PP.Exp.EaxMdService({
Metabase: metabase
});
// Open express report with the 88665 key
eaxAnalyzer = eaxMdService.editDocument(88665);
// Determine filters array for dialog box
var filters = [{
Filters: [2561], // Display only express reports
// Specify resources key to get filter name
ResourceKey: "openDialogExpressReports"
}];
// Create an object save dialog box
metabaseDialogBase = new PP.Navigator.MetabaseDialogBase({
Metabase: metabase,
FiltersSet: filters, // Filters array for dialog box
CurrentFilter: filters[0], // Current filter
ImagePath: "../../build/img/", // Path to dialog box icons
OpenToKey: parseInt(eaxAnalyzer.getParentKey() || 0) // Key of repository folder that should be opened in dialog box
});
metabaseDialogBase.show(); // Display object save dialog box
}
</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: