Tag Archives: iis

Enabling HTTP Compression

Hello there!

There is a nice way to increase performance on Mstr Web using HTTP Compression.

You can set that on IIS or Tomcat. Below is the link that explains the steps to do that:

http://community.microstrategy.com/t5/Web/TN31501-Network-for-Dashboard-Performance-Optimizations-in/ta-p/182412

Hope it helps.
God bless you

PHP Function for get a session using TASK API with IIS

Hello there!

I’ve created a PHP function to help you create a session using TASK API for PHP with IIS.

Here is the code:

<?php

function authenticationMSTR($server, $project, $user, $pass, $documentId, $dashboardMode) {
$projectUrl = str_replace(" ","%20",$project);
$projectTask = str_replace(" ","+",$project);
$username = 'username';
$password = 'password';

$context = stream_context_create(array(
'http' => array(
'header' => "Authorization: Basic " . base64_encode("$username:$password")
)
));

$url = file_get_contents("http://$server/MicroStrategy/asp/TaskAdmin.aspx?
taskId=getSessionState&taskEnv=xml&taskContentType=xml&server=$server&project=$
projectTask&uid=$user&pwd=$pass");

$data=simplexml_load_string($url);

foreach($data->children() as $child) {
foreach($child->children() as $child1) {
$sessionmstr = $child1;
break;
}
}

echo "http://$server/MicroStrategy/asp/Main.aspx?evt=2048001&src=Main.aspx.2048001&visMode=0&currentViewMedia=$dashboardMode&documentID=$documentId&server=$server&Project=$projectUrl&port=0&share=1&hiddensections=header,path,dockTop,dockLeft,footer&usrSmgr=$sessionmstr";
}
}
?>

Where:

$server: is your server ip/dns
$project: Name of the project
$user: MicroStrategy Username
$pass: MicroStrategy Username Password 
$documentId: Document ID
$dashboardMode: View media. Example: Use 8 for flash and 2 for DHTML.
$username = Put the Username for login in your TaskAdmin page. 
$password = Put the password for the Username used to login in TaskAdmin page.

Just save this in a file as Authentication.php. Now create another file like this:

<?php
include "Authentication.php";
?>
<html>
<head>
<title>Title</title>
<?php header("Content-Type: text/html; charset=ISO-8859-1",true);?>
</head>

</html>

Just use your own info in those above parameters.

Save this file as test.php in the same folder that you saved your Authentication.php.
Those files must be saved inside your Apache PHP folder. If you use Xampp, is must be saved inside the htdocs folder.

Open test.php in your browser and you will see your dashboard!

 

Hope it helps!

God bless you!

Using Task API getSessionState with PHP in IIS

Hello there!

Today let’s talk about how to create a session using PHP with IIS.

First, enable Basic Authentication on MicroStrategy Virtual Site in IIS.

You just have to use this code:

<?php
$username = 'username';
$password = 'password';
$context = stream_context_create(array(
 'http' => array(
 'header' => "Authorization: Basic " . base64_encode("$username:$password")
 )
));
$url = file_get_contents("http://localhost/MicroStrategy/asp/TaskAdmin.aspx? 
taskId=getSessionState&taskEnv=xml&taskContentType=xml&server=localhost&project=MicroStrategy 
+Tutorial&uid=administrator&pwd=", false, $context);
$data=simplexml_load_string($url);


foreach($data->children() as $child) {
foreach($child->children() as $child1) {
$sessionmstr = $child1;
break;
}
}
header(“Location: http://server/Microstrategy/asp/Main.aspx?evt=2048001&src=Main.aspx.2048001&visMode=0&currentViewMedia=2&documentID=IDOFTHEDOCUMENT1&server=server&Project=NAMEOFTHEPROJECT&port=0&share=1&usrSmgr=$sessionmstr“);
?>

Remember to change the username and password to use your username and password for login in TASK API page. And in file_get_contents and header(“Location…, change the url to use your own urls.

Hope it helps!
God bless you!