-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathInstaller.cls
62 lines (53 loc) · 2.56 KB
/
Installer.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Include %occInclude
Class ENSDEMO.Installer
{
Parameter NAMESPACE As STRING = "ENSDEMO";
XData Install [ XMLNamespace = INSTALLER ]
{
<Manifest>
<Log Text="Creating ${NAMESPACE} namespace and DB..." Level="0"/>
<Default Name="RESOURCE" Value="%DB_${NAMESPACE}" />
<Namespace Name="${NAMESPACE}" Code="${NAMESPACE}" Data="${NAMESPACE}" Create="yes" Ensemble="0">
<Configuration>
<Database Name="${NAMESPACE}" Dir="${MGRDIR}${DBNAME}" Create="yes" MountAtStartup="true"/>
</Configuration>
<Log Text="Enable interoperability to ${NAMESPACE}..." Level="0"/>
<Invoke Class="%Library.EnsembleMgr" Method="EnableNamespace" CheckStatus="true">
<Arg name="pTargetNS" Value="${NAMESPACE}"/>
<Arg name="pVerbose" Value="1"/>
</Invoke>
<IfDef Var="SOURCE">
<Log Text="SOURCE defined - offline install from ${SOURCE}" Level="0"/>
<Import File="${SOURCE}" Recurse="true"/>
</IfDef>
</Namespace>
</Manifest>
}
/// This is a method generator whose code is generated by XGL.
ClassMethod Installer(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
{
return ##class(%Installer.Manifest).%Generate(%compiledclass,%code,"Install")
}
ClassMethod Install(path As %String) As %Status
{
set sc = $$$OK
try {
set args("NAMESPACE") = ..#NAMESPACE
set args("DBNAME") = $zconvert(..#NAMESPACE,"L")
set args("SOURCE") = path
#; install manifest
set sc = $$$ADDSC(sc,..Installer(.args))
set csp = ##class(Security.Applications).%OpenId("/csp/healthshare/ensdemo")
set csp.AutoCompile = 1
set sc = $$$ADDSC(sc,csp.%Save())
set $namespace = "%SYS"
kill p do ##class(Security.Users).Get("Admin",.p) set (p("PasswordNeverExpires"),p("AccountNeverExpires"))=1 do ##class(Security.Users).Modify("Admin",.p)
kill p do ##class(Security.Users).Get("irisowner",.p) set (p("PasswordNeverExpires"),p("AccountNeverExpires"))=1 do ##class(Security.Users).Modify("irisowner",.p)
kill p do ##class(Security.Users).Get("SuperUser",.p) set (p("PasswordNeverExpires"),p("AccountNeverExpires"))=1 do ##class(Security.Users).Modify("SuperUser",.p)
kill p do ##class(Security.Users).Get("_SYSTEM",.p) set (p("PasswordNeverExpires"),p("AccountNeverExpires"))=1 do ##class(Security.Users).Modify("_SYSTEM",.p)
} catch (err) {
set sc = $$$ADDSC(sc,err.AsStatus())
}
return sc
}
}