GetAdHocResult GetAdHoc(AdHocId tAdHocId, GetAdHocMdArg tArg)
tAdHocId. Моникёр открытого экземпляра аналитической панели.
tArg. Параметры выполнения операции.
Операция GetAdHoc извлекает метаданные аналитической панели.
Операция позволяет получить информацию о структуре аналитической панели, источниках данных для блоков, параметры синхронизации различных измерений. Также с помощью операции GetAdHoc можно экспортировать аналитическую панель в необходимый формат. Для выполнения операции укажите в поле tAdHocId моникёр экземпляра аналитической панели, а в поле tArg.pattern шаблон, в соответствии с которым будут извлекаться метаданные. Моникёр может быть получен при выполнении операции OpenAdhoc. Результатом работы операции будут запрошенные метаданные.
Пример получения информации об источниках данных и регламентных отчетах, которые выступают в качестве источников данных для блоков аналитической панели. Также будет получена информация об активном слайде аналитической панели. В теле запроса передается моникёр аналитической панели и шаблон, определяющий необходимость получить указанную информацию. В ответе приходят запрошенные метаданные.
{ "GetAdHoc" : { "tAdHocId" : { "id" : "S1!M!S!AdHoc1" }, "tArg" : { "pattern" : { "obInst" : "true", "dsoPattern" : { "objects" : "Get" }, "dsoLinkedPattern" : { "objects" : "Get" }, "dataSourceObjects" : "Get", "dataSourceLinkedObjects" : "Get", "layout" : { "activeSlideKey" : "true", "activeSlideId" : "true", "slides" : "Get", "allSlidesPattern" : { "animation" : "false", "viewModeImages" : "false", "mainPanel" : "false" }, "activeSlidePattern" : { "animation" : "false", "viewModeImages" : "false", "mainPanel" : "true" } } } } } }
{ "GetAdHocResult" : { "id" : { "id" : "S1!M!S!AdHoc1" }, "meta" : { "obInst" : { "obDesc" : { "@fullUrl" : "\/", "@isShortcut" : "0", "@isLink" : "0", "@ver" : "1", "@hf" : "0", "i" : "ADHOC_SAMPLE", "n" : "Аналитическая панель", "k" : "87502", "c" : "8448", "p" : "6714", "h" : "0", "hasPrv" : "0", "ic" : "0", "isPermanent" : "1", "isTemp" : "0" } }, "dirty" : "0", "dataSourceObjects" : { "its" : { "it" : [ { "id" : "SE3R70CE6FP6L2GL", "linked" : "0", "dsoObject" : { "k" : "87504", "id" : "OBJ87504", "n" : "Экспресс-отчет", "vis" : "1" }, "changeCounter" : "0", "undoRedoChangeCounter" : "0", "slideKey" : "2" }, { "id" : "S6TXGOGDW3YQXKP1", "linked" : "0", "dsoObject" : { "k" : "87505", "id" : "OBJ87505", "n" : "Экспресс-отчет", "vis" : "1" }, "changeCounter" : "0", "undoRedoChangeCounter" : "0", "slideKey" : "1" } ] }, "autoSyncNewDso" : "0", "autoUpdateSources" : "1" }, "dataSourceLinkedObjects" : { "its" : "", "autoSyncNewDso" : "0", "autoUpdateSources" : "1" }, "Md8" : { "activeSlideKey" : "1", "slides" : { "its" : { "it" : [ { "key" : "1", "id" : "1C069D65-46D1-471D-A1ED-DAB36359DE9B", "visible" : "1", "name" : "Слайд1", "index" : "0", "mainPanel" : { "block" : { "@type" : "Slide", "@key" : "1C069D65-46D1-471D-A1ED-DAB36359DE9B", "prop" : [ { "@isArrFlg" : "1", "@tag" : "background", "prop" : [ { "@val" : "#ffffff", "@isArrFlg" : "1", "@tag" : "backgroundColor" }, { "@val" : "#c9c9c9", "@tag" : "gradientColor" }, { "@val" : "270", "@tag" : "gradientAngle" } ] }, { "@tag" : "decor", "prop" : { "@tag" : "paddings", "prop" : [ { "@val" : "1", "@isArrFlg" : "1", "@tag" : "usePaddings" }, { "@val" : "10", "@tag" : "left" }, { "@val" : "10", "@tag" : "right" }, { "@val" : "10", "@tag" : "top" }, { "@val" : "10", "@tag" : "bottom" } ] } }, { "@val" : "1", "@tag" : "autoLayout" }, { "@tag" : "layouts", "area" : { "@key" : "S577W4BTBFEE9Z9W", "block" : { "@type" : "Grid", "@key" : "S577W4BTBFEE9Z9W", "prop" : [ { "@val" : "Блок 7", "@isArrFlg" : "1", "@tag" : "name" }, { "@tag" : "background", "prop" : [ { "@val" : "1", "@isArrFlg" : "1", "@tag" : "useBackground" }, { "@val" : "#ffffff", "@tag" : "backgroundColor" }, { "@val" : "0", "@tag" : "useGradient" }, { "@val" : "#c9c9c9", "@tag" : "gradientColor" }, { "@val" : "270", "@tag" : "gradientAngle" } ] }, { "@tag" : "layout", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "left" }, { "@val" : "0", "@tag" : "right" }, { "@val" : "0", "@tag" : "top" }, { "@val" : "0", "@tag" : "bottom" }, { "@val" : "%", "@tag" : "leftUnit" }, { "@val" : "%", "@tag" : "rightUnit" }, { "@val" : "%", "@tag" : "topUnit" }, { "@val" : "%", "@tag" : "bottomUnit" }, { "@val" : "1", "@tag" : "anchorTop" }, { "@val" : "1", "@tag" : "anchorBottom" }, { "@val" : "1", "@tag" : "anchorLeft" }, { "@val" : "1", "@tag" : "anchorRight" } ] }, { "@tag" : "margins", "prop" : { "@val" : "1", "@tag" : "useMargins" } }, { "@tag" : "decor", "prop" : [ { "@val" : "5", "@isArrFlg" : "1", "@tag" : "cornerRadius" }, { "@val" : "0", "@tag" : "useBorderRadius" }, { "@val" : "0", "@tag" : "useBorder" }, { "@val" : "#c9c9c9", "@tag" : "borderColor" }, { "@val" : "1", "@tag" : "borderWidth" }, { "@val" : "0", "@tag" : "useShadow" }, { "@val" : "#000000", "@tag" : "shadowColor" }, { "@val" : "8", "@tag" : "shadowWidth" }, { "@val" : "10", "@tag" : "shadowOpacity" }, { "@tag" : "paddings", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "usePaddings" }, { "@val" : "10", "@tag" : "left" }, { "@val" : "10", "@tag" : "right" }, { "@val" : "10", "@tag" : "top" }, { "@val" : "10", "@tag" : "bottom" } ] } ] }, { "@tag" : "title", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "show" }, { "@tag" : "font", "prop" : [ { "@val" : "#ababab", "@isArrFlg" : "1", "@tag" : "color" }, { "@val" : "Calibri", "@tag" : "family" }, { "@val" : "10", "@tag" : "size" } ] }, { "@val" : "Left", "@tag" : "align" } ] }, { "@tag" : "divider", "prop" : [ { "@val" : "1", "@isArrFlg" : "1", "@tag" : "show" }, { "@val" : "#c9c9c9", "@tag" : "color" }, { "@val" : "1", "@tag" : "height" }, { "@val" : "25", "@tag" : "blurSize" }, { "@val" : "1", "@tag" : "useBlur" } ] }, { "@tag" : "cols", "item" : { "@isArrFlg" : "1" } }, { "@tag" : "rows", "item" : { "@isArrFlg" : "1" } }, { "@tag" : "cells", "area" : { "@key" : "S59DM848RIUH64Q4", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "row" }, { "@val" : "0", "@tag" : "col" } ], "block" : { "@type" : "Panel", "@key" : "S59DM848RIUH64Q4", "prop" : [ { "@isArrFlg" : "1", "@tag" : "background", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "useBackground" }, { "@val" : "#ffffff", "@tag" : "backgroundColor" }, { "@val" : "0", "@tag" : "useGradient" }, { "@val" : "#c9c9c9", "@tag" : "gradientColor" }, { "@val" : "270", "@tag" : "gradientAngle" } ] }, { "@tag" : "decor", "prop" : [ { "@val" : "5", "@isArrFlg" : "1", "@tag" : "cornerRadius" }, { "@val" : "0", "@tag" : "useBorderRadius" }, { "@val" : "0", "@tag" : "useBorder" }, { "@val" : "#c9c9c9", "@tag" : "borderColor" }, { "@val" : "1", "@tag" : "borderWidth" }, { "@val" : "0", "@tag" : "useShadow" }, { "@val" : "#000000", "@tag" : "shadowColor" }, { "@val" : "8", "@tag" : "shadowWidth" }, { "@val" : "10", "@tag" : "shadowOpacity" }, { "@tag" : "paddings", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "usePaddings" }, { "@val" : "10", "@tag" : "left" }, { "@val" : "10", "@tag" : "right" }, { "@val" : "10", "@tag" : "top" }, { "@val" : "10", "@tag" : "bottom" } ] } ] }, { "@tag" : "title", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "show" }, { "@tag" : "font", "prop" : [ { "@val" : "#ababab", "@isArrFlg" : "1", "@tag" : "color" }, { "@val" : "Calibri", "@tag" : "family" }, { "@val" : "10", "@tag" : "size" } ] }, { "@val" : "Left", "@tag" : "align" } ] }, { "@tag" : "divider", "prop" : [ { "@val" : "1", "@isArrFlg" : "1", "@tag" : "show" }, { "@val" : "#c9c9c9", "@tag" : "color" }, { "@val" : "1", "@tag" : "height" }, { "@val" : "25", "@tag" : "blurSize" }, { "@val" : "1", "@tag" : "useBlur" } ] }, { "@tag" : "layouts", "area" : { "@key" : "S6TXGOGDW3YQXKP1", "block" : { "@type" : "Table", "@key" : "S6TXGOGDW3YQXKP1", "prop" : [ { "@val" : "Блок 9", "@isArrFlg" : "1", "@tag" : "name" }, { "@tag" : "background", "prop" : [ { "@val" : "1", "@isArrFlg" : "1", "@tag" : "useBackground" }, { "@val" : "#ffffff", "@tag" : "backgroundColor" }, { "@val" : "0", "@tag" : "useGradient" }, { "@val" : "#c9c9c9", "@tag" : "gradientColor" }, { "@val" : "270", "@tag" : "gradientAngle" } ] }, { "@tag" : "layout", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "left" }, { "@val" : "0", "@tag" : "right" }, { "@val" : "0", "@tag" : "top" }, { "@val" : "0", "@tag" : "bottom" }, { "@val" : "%", "@tag" : "leftUnit" }, { "@val" : "%", "@tag" : "rightUnit" }, { "@val" : "%", "@tag" : "topUnit" }, { "@val" : "%", "@tag" : "bottomUnit" }, { "@val" : "1", "@tag" : "anchorTop" }, { "@val" : "1", "@tag" : "anchorBottom" }, { "@val" : "1", "@tag" : "anchorLeft" }, { "@val" : "1", "@tag" : "anchorRight" } ] }, { "@tag" : "margins", "prop" : { "@val" : "1", "@tag" : "useMargins" } }, { "@tag" : "decor", "prop" : [ { "@val" : "5", "@isArrFlg" : "1", "@tag" : "cornerRadius" }, { "@val" : "0", "@tag" : "useBorderRadius" }, { "@val" : "1", "@tag" : "useBorder" }, { "@val" : "#c9c9c9", "@tag" : "borderColor" }, { "@val" : "1", "@tag" : "borderWidth" }, { "@val" : "0", "@tag" : "useShadow" }, { "@val" : "#000000", "@tag" : "shadowColor" }, { "@val" : "8", "@tag" : "shadowWidth" }, { "@val" : "10", "@tag" : "shadowOpacity" }, { "@tag" : "paddings", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "usePaddings" }, { "@val" : "10", "@tag" : "left" }, { "@val" : "10", "@tag" : "right" }, { "@val" : "10", "@tag" : "top" }, { "@val" : "10", "@tag" : "bottom" } ] } ] }, { "@tag" : "title", "prop" : [ { "@val" : "0", "@isArrFlg" : "1", "@tag" : "show" }, { "@tag" : "font", "prop" : [ { "@val" : "#ababab", "@isArrFlg" : "1", "@tag" : "color" }, { "@val" : "Calibri", "@tag" : "family" }, { "@val" : "10", "@tag" : "size" } ] }, { "@val" : "Left", "@tag" : "align" } ] }, { "@tag" : "divider", "prop" : [ { "@val" : "1", "@isArrFlg" : "1", "@tag" : "show" }, { "@val" : "#c9c9c9", "@tag" : "color" }, { "@val" : "1", "@tag" : "height" }, { "@val" : "25", "@tag" : "blurSize" }, { "@val" : "1", "@tag" : "useBlur" } ] } ] } } } ] } } } ] } } } ] } } }, { "key" : "2", "id" : "SD7OZR42LYHXHA2V", "visible" : "1", "name" : "Слайд2", "index" : "1" } ] } } }, "autoUpdateSources" : "1", "calcOnChangedData" : "2" } } }
Указанная ниже функция OpenCube открывает куб. Моникёр соединения с репозиторием и идентификатор куба передаются в качестве входных параметров. В примере используется функция FindObjectById, код которой приведен в примере «Получение описания объекта по его идентификатору». Результат выполнения операции является результатом выполнения функции.
public static GetAdHocResult GetDataSourcesInfo(AdHocId moniker)
{
var somClient = new SomPortTypeClient(); //Прокси-объект для выполнения операций
//Параметры выполнения операции
var tGet = new GetAdHoc()
{
tArg = new GetAdHocMdArg()
{
pattern = new AdHocMdPattern()
{
dataSourceObjects = ListOperation.Get,
dataSourceLinkedObjects = ListOperation.Get,
dsoPattern = new DataSourcePattern()
{
objects = ListOperation.Get,
},
dsoLinkedPattern = new DataSourcePattern()
{
objects = ListOperation.Get
},
layout = new SlidesPattern()
{
activeSlideId = true,
activeSlideKey = true,
activeSlidePattern = new SlideContentPattern()
{
mainPanel = true
},
allSlidesPattern = new SlideContentPattern(),
slides = ListOperation.Get
}
}
},
tAdHocId = moniker
};
//Получение метаданных
var result = somClient.GetAdHoc(tGet);
return result;
}
См. также:
Работа с аналитической панелью