Skip to content

Instantly share code, notes, and snippets.

View floverfelt's full-sized avatar
😀

floverfelt

😀
View GitHub Profile
@floverfelt
floverfelt / main.java
Created February 14, 2021 01:39
Fetching a cube reportInstance
WebReportSource reportSource = adminSession.getFactory().getReportSource();
WebReportExecutionSettings webReportExecutionSettings = reportSource.newExecutionSettings();
webReportExecutionSettings.setSource("your-cube-id-here",
EnumWebReportSourceType.WebReportSourceTypeCube);
WebReportInstance webReportInstance = reportSource.getNewInstance(webReportExecutionSettings);
webReportInstance.setAsync(false);
webReportInstance.pollStatus();
@floverfelt
floverfelt / Utils.java
Created January 12, 2021 19:15
Fetch a specific default user group from MSTR using the MSTR Web SDK.
webIServerSession.getFactory().getObjectSource().getUserServicesSource().getNamedUser(EnumWebNamedUsers.Everyone);
@floverfelt
floverfelt / Utils.java
Created January 12, 2021 19:13
Find specific default folders using the MSTR Web SDK.
webIServerSession.getFactory().getObjectSource().getFolderID(EnumDSSXMLFolderNames.DssXmlFolderNamePublicReports);
@floverfelt
floverfelt / Utils.java
Created January 8, 2021 14:54
How to find all components of a given object in mstr web sdk
/**
* Find all components of a given object
*
* @return a folder containing the search results
*/
public WebFolder searchForComponentObjects(WebObjectSource webObjectSource, WebObjectInfo objectToFindComponentsOf)
throws WebObjectsException {
// Spawn a search
WebSearch webSearch = webObjectSource.getNewSearchObject();
// Search in the project
/**
* Finds all objects of a certain type.
*
* @return a folder containing the search results
*/
public WebFolder searchForObjectTypes(WebObjectSource webObjectSource, int objectType)
throws WebObjectsException {
// Spawn a search
WebSearch webSearch = webObjectSource.getNewSearchObject();
// Search in the project
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>local-war-parent</artifactId>
<groupId>local.mstr.war</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
# Used to dynamically replace the <web:resource type="custom-style" /> custom tag with itself and custom JSP
<web\:resource\ type\="custom-style"\ />=<web:resource type="custom-style" />\n<% System.out.println("Hello world!"); %>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>local-war-parent</artifactId>
<groupId>local.mstr.war</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<%--
This custom tag automatically includes the "global.css" and "{PAGENAME}Page.css" files found insite the "/style" subfolder of a
plugin folder.
It can be used to customize the look and feel of the application without modifying any configuration file or jsp.
--%>
<web:resource type="custom-style" />
password="ohNoAPlainTextPassword!"