機械翻訳について

インサイトをメッセージとともに表示するための公開アクション

recordContextを現在のブラウザ・タブ・アクティブ・レコードとみなして、インサイトを表示するTypescriptの例を次に示します:

const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID','V1');
const tabContext: ITabContext = await frameworkProvider.getCurrentBrowserTabContext();
let recordContext: IRecordContext = await tabContext.getActiveRecord();         
let insightContext: IInsightsContext = await recordContext.getInsightsContext();
const payload: IShowInsightsRequest = frameworkProvider.requestHelper.createPublishRequest('ShowInsights') as IShowInsightsRequest;
payload.setId('insightsId1');
payload.setTitle('Custom title');
payload.setMessage('Custom message to show details about the suggestion');
insightContext.publish(payload).then((response: IOperationResponse) => {
    const insightsOperationResponse = response as IInsightsOperationResponse;
    console.log((insightsOperationResponse.getResponseData() as IInsightsOperationResponseData).getInsightsId());
});

recordContextを現在のブラウザ・タブ・アクティブ・レコードとみなして、インサイトを表示するJavaScriptの例を次に示します:

const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID','V1');
const tabContext: ITabContext = await frameworkProvider.getCurrentBrowserTabContext();
let recordContext: IRecordContext = await tabContext.getActiveRecord();         
let insightContext: IInsightsContext = await recordContext.getInsightsContext();
const payload: IShowInsightsRequest = frameworkProvider.requestHelper.createPublishRequest('ShowInsights') as IShowInsightsRequest;
payload.setId('insightsId1');
payload.setTitle('Custom title');
payload.setHeader('Custom category');
insightContext.publish(payload).then((response: IOperationResponse) => {
    const insightsOperationResponse = response as IInsightsOperationResponse;
    console.log((insightsOperationResponse.getResponseData() as IInsightsOperationResponseData).getInsightsId());
});