Skip to content

Commit 648e2ec

Browse files
committed
new combined object types
Signed-off-by: David Weik <[email protected]>
1 parent 5329071 commit 648e2ec

File tree

10 files changed

+284
-1
lines changed

10 files changed

+284
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## SAS Portal Framework for SAS Viya v1.4.0
4+
5+
Deprication Warning: The Portal Builder Object will be deprecated in an upcoming release. With the avaialbility of JSON file editing in SAS Studio (since the 2025.06 release) that is the new preferred version and since updating the Portal Builder object is very complex, this object will be deprecated. Note with the next version a warning text will also appear at the top of the object - no new features will be added.
6+
7+
- Add: SAS Content VA Report Object
8+
- Add: SAS Content Job Object
9+
310
## SAS Portal Framework for SAS Viya v1.3.0
411

512
- Add: RAG Builder object

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@
134134
<script src="./js/objects//add-data-product-marketplace-object.js"></script>
135135
<script src="./js/objects/add-prompt-builder.js"></script>
136136
<script src="./js/objects/add-rag-builder-object.js"></script>
137+
<script src="./js/objects/add-sasContent-vaReport-object.js"></script>
138+
<script src="./js/objects/add-sasContent-job-object.js"></script>
137139

138140
<!-- Import Page Builing -->
139141
<script src="./js/generate-tabs.js"></script>

js/generate-pages.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,20 @@ async function generatePages(VIYAHOST, layout, paneContainer, interfaceText) {
163163
interfaceText?.ragBuilder
164164
);
165165
break;
166+
case 'sasContentVAReport':
167+
content = await addSASContentVAReportObject(
168+
currentObjectDefinition,
169+
layout?.general?.shorthand,
170+
interfaceText?.sasContentVAReport
171+
);
172+
break;
173+
case 'sasContentJob':
174+
content = await addSASContentJobObject(
175+
currentObjectDefinition,
176+
layout?.general?.shorthand,
177+
interfaceText?.sasContentJob
178+
);
179+
break;
166180
default:
167181
content = document.createElement('p');
168182
content.innerText = interfaceText?.undefinedObjectText;
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/**
2+
* Copyright © 2024, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Creates a SAS Content Job Object
6+
*
7+
* @param {Object} sasContentJobObject - Contains the definition of the SAS Content Job Object
8+
* @param {String} paneID - The shorthand of the page which will contain the object
9+
* @param {Object} scjInterfaceText - Contains all of the static language interface for the SAS Content Job Object
10+
* @returns a SAS Content Job object
11+
*/
12+
async function addSASContentJobObject(sasContentJobObject, paneID, scjInterfaceText) {
13+
let sasContentJobContainer = document.createElement('div');
14+
sasContentJobContainer.setAttribute('id', `${paneID}-obj-${sasContentJobObject?.id}`);
15+
16+
let sasContentGroup = document.createElement('sas-content-group');
17+
sasContentGroup.id = `${paneID}-obj-${sasContentJobObject?.id}-cg`;
18+
sasContentGroup.className = 'col-12';
19+
sasContentGroup.setAttribute('url', window.VIYA);
20+
sasContentGroup.initialFilterValue = {
21+
queryModeFilter: "or(eq(contentType,'jobDefinition'),eq(contentType,'folder'))"
22+
};
23+
// Check if the a folder filter has been specified
24+
if (sasContentJobObject?.folderFilter?.length > 0) {
25+
let folderFilter = {
26+
"type": "folderUri",
27+
"value": sasContentJobObject?.folderFilter
28+
};
29+
sasContentGroup.initialNavigationValue = {
30+
location: folderFilter,
31+
locationContextPath: [folderFilter],
32+
locations: [folderFilter]
33+
};
34+
} else {
35+
let sasContentIdentifier = {
36+
type: "persistentLocation",
37+
value: "root"
38+
};
39+
sasContentGroup.initialNavigationValue = {
40+
location: sasContentIdentifier,
41+
locationContextPath: [sasContentIdentifier],
42+
locations: [sasContentIdentifier]
43+
};
44+
}
45+
// Job Header
46+
let sasContentJobName = document.createElement('h3');
47+
let sasJobContainer = document.createElement('div');
48+
sasJobContainer.style.height = '75vh';
49+
let sasJob = document.createElement('iframe');
50+
51+
let sasContentArea = document.createElement('sas-content-area');
52+
sasContentArea.id = `${paneID}-obj-${sasContentJobObject?.id}-ca`;
53+
//sasContentArea.style.height = '30vh';
54+
sasContentArea.setAttribute('url', window.VIYA);
55+
sasContentArea.setAttribute('selection-mode', 'single');
56+
sasContentArea.setAttribute('initial-selection-index', 0);
57+
sasContentArea.onSelect = async (value) => {
58+
console.log(value);
59+
if (value && value.length > 0 && value[0]?.resource?.type?.sasType === 'jobDefinition') {
60+
const job = value[0];
61+
const jobExecutionUrl = await contentSdkComponents.getSASJobExecutionUrl(job.resource.id, window.VIYA);
62+
if (jobExecutionUrl) {
63+
if (sasContentJobObject?.jobName === 1) {
64+
sasContentJobName.innerText = job.name;
65+
}
66+
sasJobContainer.style.display = 'block';
67+
sasJob.src = jobExecutionUrl;
68+
} else {
69+
if (sasContentJobObject?.jobName === 1) {
70+
sasContentJobName.innerText = scjInterfaceText?.noJobSelectedText;
71+
}
72+
sasJobContainer.style.display = 'none';
73+
sasJob.src = 'about:blank';
74+
}
75+
} else {
76+
if (sasContentJobObject?.jobName === 1) {
77+
sasContentJobName.innerText = scjInterfaceText?.noJobSelectedText;
78+
}
79+
sasJobContainer.style.display = 'none';
80+
sasJob.src = 'about:blank';
81+
}
82+
}
83+
84+
sasContentGroup.appendChild(sasContentArea);
85+
86+
// Job display
87+
if (sasContentJobObject?.jobName === 1) {
88+
sasContentJobName.id = `${paneID}-obj-${sasContentJobObject?.id}-jn`;
89+
console.log(scjInterfaceText);
90+
sasContentJobName.innerText = scjInterfaceText?.noJobSelectedText;
91+
sasContentGroup.appendChild(sasContentJobName);
92+
}
93+
sasJob.id = `${paneID}-obj-${sasContentJobObject?.id}-sj`;
94+
sasJob.src = 'about:blank';
95+
sasJob.style.overflow = 'hidden';
96+
sasJob.style.border = '0';
97+
sasJob.style.height = '70vh';
98+
sasJob.style.width = '70vh';
99+
sasJobContainer.appendChild(sasJob);
100+
sasContentGroup.appendChild(sasJobContainer);
101+
102+
sasContentJobContainer.appendChild(sasContentGroup);
103+
104+
return sasContentJobContainer;
105+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/**
2+
* Copyright © 2024, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Creates a SAS Content VA Report Object
6+
*
7+
* @param {Object} sasContentVAReportObject - Contains the definition of the SAS Content VA Report Object
8+
* @param {String} paneID - The shorthand of the page which will contain the object
9+
* @param {Object} scvarInterfaceText - Contains all of the static language interface for the SAS Content VA Report Object
10+
* @returns a SAS Content VA Report object
11+
*/
12+
async function addSASContentVAReportObject(sasContentVAReportObject, paneID, scvarInterfaceText) {
13+
let sasContentVAReportContainer = document.createElement('div');
14+
sasContentVAReportContainer.setAttribute('id', `${paneID}-obj-${sasContentVAReportObject?.id}`);
15+
16+
let sasContentGroup = document.createElement('sas-content-group');
17+
sasContentGroup.id = `${paneID}-obj-${sasContentVAReportObject?.id}-cg`;
18+
sasContentGroup.className = 'col-12';
19+
sasContentGroup.setAttribute('url', window.VIYA);
20+
sasContentGroup.initialFilterValue = {
21+
queryModeFilter: "or(eq(contentType,'report'),eq(contentType,'folder'))"
22+
};
23+
// Check if the a folder filter has been specified
24+
if (sasContentVAReportObject?.folderFilter?.length > 0) {
25+
let folderFilter = {
26+
"type": "folderUri",
27+
"value": sasContentVAReportObject?.folderFilter
28+
};
29+
sasContentGroup.initialNavigationValue = {
30+
location: folderFilter,
31+
locationContextPath: [folderFilter],
32+
locations: [folderFilter]
33+
};
34+
} else {
35+
let sasContentIdentifier = {
36+
type: "persistentLocation",
37+
value: "root"
38+
};
39+
sasContentGroup.initialNavigationValue = {
40+
location: sasContentIdentifier,
41+
locationContextPath: [sasContentIdentifier],
42+
locations: [sasContentIdentifier]
43+
};
44+
}
45+
// VA Report Header
46+
let sasContentReportName = document.createElement('h3');
47+
let sasReport = document.createElement('sas-report');
48+
49+
let sasContentArea = document.createElement('sas-content-area');
50+
sasContentArea.id = `${paneID}-obj-${sasContentVAReportObject?.id}-ca`;
51+
sasContentArea.setAttribute('url', window.VIYA);
52+
sasContentArea.setAttribute('selection-mode', 'single');
53+
sasContentArea.setAttribute('initial-selection-index', 0);
54+
sasContentArea.onSelect = (value) => {
55+
let reportUri = '';
56+
if (value && value.length > 0 && value[0]?.resource?.type?.sasType === 'report') {
57+
if (sasContentVAReportObject?.reportName === 1) {
58+
sasContentReportName.innerText = value[0].name;
59+
}
60+
reportUri = value[0].resource.id;
61+
} else {
62+
if (sasContentVAReportObject?.reportName === 1) {
63+
sasContentReportName.innerText = scvarInterfaceText?.reportNotSelectedText;
64+
}
65+
}
66+
sasReport.reportUri = reportUri;
67+
}
68+
69+
sasContentGroup.appendChild(sasContentArea);
70+
71+
// VA Report display
72+
if (sasContentVAReportObject?.reportName === 1) {
73+
sasContentReportName.id = `${paneID}-obj-${sasContentVAReportObject?.id}-rn`;
74+
sasContentReportName.innerText = scvarInterfaceText?.reportNotSelectedText;
75+
sasContentGroup.appendChild(sasContentReportName);
76+
}
77+
sasReport.id = `${paneID}-obj-${sasContentVAReportObject?.id}-sr`;
78+
sasReport.setAttribute('url', window.VIYA);
79+
sasReport.setAttribute('hideNavigation', 'auto');
80+
sasReport.setAttribute('authenticationType', 'credentials');
81+
sasReport.style.height = '75vh';
82+
sasContentGroup.appendChild(sasReport);
83+
84+
sasContentVAReportContainer.appendChild(sasContentGroup);
85+
86+
return sasContentVAReportContainer;
87+
}

language/de.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,11 @@
258258
"ragBuilderChangeDefaultsAlert": "Bitte stellen Sie sicher das für die Chunking Strategy, die Vektor-DB und das Embedding Modell überall valide Werte eingegeben wurden.",
259259
"ragSetupSaveSucessResponse": "Das RAG Setup wurde erfolgreich gespeichert. Hier ist ein Link: ",
260260
"ragSetupSaveFailureResponse": "Das Rag Setup konnte nicht gespeichert werden. Bitte versichere dich, dass du Schreibrechte im SAS Model Manager hast."
261+
},
262+
"sasContentVAReport": {
263+
"reportNotSelectedText": "Kein Bericht ausgewählt"
264+
},
265+
"sasContentJob": {
266+
"noJobSelectedText": "Kein Job ausgewählt"
261267
}
262268
}

language/en.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,11 @@
258258
"ragBuilderChangeDefaultsAlert": "Please ensure that for the Chunking Strategy, the VectorDB and the Embedding Model valid values have been selected.",
259259
"ragSetupSaveSucessResponse": "The RAG Setup has been saved. Here is a link: ",
260260
"ragSetupSaveFailureResponse": "The RAG Setup couldn't be saved. Please ensure that you have write access in SAS Model Manager."
261+
},
262+
"sasContentVAReport": {
263+
"reportNotSelectedText": "No report selected"
264+
},
265+
"sasContentJob": {
266+
"noJobSelectedText": "No job selected"
261267
}
262268
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
sidebar_position: 13
3+
---
4+
5+
# SAS Content Job
6+
7+
The SAS Content Job object combines two elements:
8+
1. A SAS Content navigation object where you can click through folders and select a SAS Job Definition (a simple click loads the job below and a double click opens it in a new browser tab).
9+
2. Here the SAS Job Definition is displayed.
10+
11+
This combined object enables end administrators to provide the easy ability to provide dynamic job selection to the user.
12+
13+
In order to create a SAS Content Job object you have to set the objects type to *sasContentJob*, there are additional attributes, but the width has to be 0 - example:
14+
```json
15+
{
16+
"name": "Job Navigation",
17+
"id": "jNA",
18+
"width": 0,
19+
"height": "80vh",
20+
"type": "sasContentJob",
21+
"jobName": 1,
22+
"folderFilter": "/folders/folders/<uri>"
23+
}
24+
```
25+
26+
- **jobName**, specify if you want to see the name of the job above the job itself. Set the value to 1 if you want to see it and 0 if you don't want to see it. Optional, if not present the job name will not be displayed.
27+
- **folderFilter**, specify the URI of a folder in order to set it as the initial navigation point. If this is set the user will not be able to go outside of that initial folder. Optional, if not present the navigation defaults to working of the root of SAS Content.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
sidebar_position: 12
3+
---
4+
5+
# SAS Content Visual Analytics Report
6+
7+
The SAS Content Visual Analytics Report object combines two elements:
8+
1. A SAS Content navigation object where you can click through folders and select a SAS Visual Analytics report (a simple click loads the report below and a double click opens it in a new browser tab).
9+
2. Here the SAS Visual Analytics report is displayed.
10+
11+
This combined object enables end administrators to provide the easy ability to provide dynamic report selection to the user.
12+
13+
In order to create a SAS Content Visual Analytics Report object you have to set the objects type to *sasContentVAReport*, there are additional attributes, but the width has to be 0 - example:
14+
```json
15+
{
16+
"name": "Report Navigation",
17+
"id": "RNA",
18+
"width": 0,
19+
"height": "80vh",
20+
"type": "sasContentVAReport",
21+
"reportName": 1,
22+
"folderFilter": "/folders/folders/<uri>"
23+
}
24+
```
25+
26+
- **reportName**, specify if you want to see the name of the report above the report itself. Set the value to 1 if you want to see it and 0 if you don't want to see it. Optional, if not present the report name will not be displayed.
27+
- **folderFilter**, specify the URI of a folder in order to set it as the initial navigation point. If this is set the user will not be able to go outside of that initial folder. Optional, if not present the navigation defaults to working of the root of SAS Content.

website/docs/Objects/portal-builder-object.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
2-
sidebar_position: 12
2+
sidebar_position: 14
33
---
44

55
# Portal Builder
66

7+
**NOTE:** This object is considered deprecated starting with version 1.4.0, is no longer supported and will be removed in the future.
8+
79
The Portal Builder is a very special element that allows the user to edit the structure of the portal. This is a tool meant for developers and administrators of a portal to develop and enhance it. Please ensure that the access rights for this application are set correctly and also that the developers can write to the necessary folder in SAS Content.
810

911
In order to create a Portal Builder object you have to set the objects type to *portalBuilder*, there are no additional attributes, but the width has to be 0 - example:

0 commit comments

Comments
 (0)