Skip to content

Prefix Support for Addons and Themes #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions MDX2JSON/REST.cls
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,20 @@ ClassMethod WritePivotVariablesForCube(Cube As %String) As %Status
ClassMethod WriteAddons() As %Status
{
#dim sc As %Status = $$$OK

set app = "/dsw"

set currentApp = $ZConvert($Get(%request.CgiEnvs("SCRIPT_NAME"), ""), "L")
set prefix = $piece(currentApp, "/mdx2json", 1)
set app = prefix _ "/dsw"
set path = $system.CSP.GetFileName(app _ "/")
set path = ##class(%File).NormalizeDirectory(path)
set path = ##class(%File).SubDirectoryName(path, "addons", $$$YES)
set url = app _ "/addons/"

// Check if path exists
if '##class(%File).Exists(path) {
set sc = $$$ERROR($$$GeneralError, "Addons directory does not exist: "_path_". Probably different prefixes for MDX2JSON and DSW applications.")
quit sc
}

#dim rs As %SQL.ClassQueryResultSet = ##class(%File).FileSetFunc(path, "*.js")

Expand All @@ -447,12 +455,20 @@ ClassMethod WriteThemes() As %Status
{
#dim sc As %Status = $$$OK

set app = "/dsw"
set currentApp = $ZConvert($Get(%request.CgiEnvs("SCRIPT_NAME"), ""), "L")
set prefix = $piece(currentApp, "/mdx2json", 1)
set app = prefix _ "/dsw"
set path = $system.CSP.GetFileName(app _ "/")
set path = ##class(%File).NormalizeDirectory(path)
set path = ##class(%File).SubDirectoryName(path, "themes", $$$YES)
set url = app _ "/themes/"

// Check if path exists
if '##class(%File).Exists(path) {
set sc = $$$ERROR($$$GeneralError, "Themes directory does not exist: "_path_". Probably different prefixes for MDX2JSON and DSW applications.")
quit sc
}

#dim rs As %SQL.ClassQueryResultSet = ##class(%File).FileSetFunc(path, "*.css")

set list = $$$NewDynDTList
Expand All @@ -474,4 +490,4 @@ ClassMethod WriteJSONfromKPI() As %Status [ CodeMode = objectgenerator ]
do %code.Write(base)
}

}
}
Loading