Skip to content

Commit 5f46680

Browse files
committed
reorganized project structure
added docker-compose configuration for development xml converted to udl
1 parent f63009a commit 5f46680

30 files changed

Lines changed: 7485 additions & 8573 deletions

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/.*
2+
node_modules
3+
build
4+
*.log
5+
*.md

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.cls]
13+
indent_size = 2
14+
indent_style = space
15+
insert_final_newline = false
16+
17+
[*.md]
18+
insert_final_newline = false
19+
trim_trailing_whitespace = false

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/node_modules/
2-
/dist/
1+
node_modules
2+
dist
33
/temp/
4+
build
45
.vscode
5-
cache.key

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

Blocks/BlocksInstaller.cls.xml

Lines changed: 0 additions & 75 deletions
This file was deleted.

BlocksExplorer.prj.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

cache/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
.gitignore
3+
.DS_Store
4+
.dockerignore

cache/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ARG CACHE_VERSION=2017.2
2+
FROM daimor/intersystems-cache:${CACHE_VERSION}
3+
4+
WORKDIR /opt/blocks
5+
6+
COPY ./src/ ./src
7+
8+
ARG CACHE_KEY=
9+
RUN echo -e "${CACHE_KEY}" > /opt/cache/mgr/cache.key
10+
11+
RUN ccontrol start $ISC_PACKAGE_INSTANCENAME quietly \
12+
&& echo -e "" \
13+
"do ##class(%SYSTEM.OBJ).Load(\"/opt/blocks/src/DevInstaller.cls\",\"cdk\")\n" \
14+
"set sc=##class(Blocks.DevInstaller).setupWithVars(\"/opt/blocks/\")\n" \
15+
"do:'sc \$zu(4,\$j,1)\n" \
16+
"halt\n" \
17+
| csession $ISC_PACKAGE_INSTANCENAME -UUSER \
18+
# Stop Caché instance
19+
&& ccontrol stop $ISC_PACKAGE_INSTANCENAME quietly
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Class Blocks.BlocksInstaller Extends %Projection.AbstractProjection
2+
{
3+
4+
Projection Reference As BlocksInstaller;
5+
6+
Parameter CSPAPP As %String = "/blocks";
7+
8+
Parameter CSPAPPDESCRIPTION As %String = "A WEB application for Cache Blocks Explorer.";
9+
10+
Parameter ROUTER As %String = "Blocks.Router";
11+
12+
/// This method is invoked when a class is compiled.
13+
ClassMethod CreateProjection(cls As %String, ByRef params) As %Status
14+
{
15+
set ns=$namespace
16+
new $namespace
17+
znspace "%SYS"
18+
19+
if ('##class(Security.Applications).Exists(..#CSPAPP)) {
20+
do ##class(Security.System).GetInstallationSecuritySetting(.security)
21+
set cspProperties("AutheEnabled") = $select((security="None"):64,1:32)
22+
set cspProperties("NameSpace") = ns
23+
set cspProperties("Description") = ..#CSPAPPDESCRIPTION
24+
set cspProperties("DispatchClass") = ..#ROUTER
25+
write !, "Creating WEB application """_..#CSPAPP_"""..."
26+
$$$ThrowOnError(##class(Security.Applications).Create(..#CSPAPP, .cspProperties))
27+
write !, "WEB application """_..#CSPAPP_""" created."
28+
if ##class(%Studio.General).GetWebServerPort(,,,.url) {
29+
write !, "You can now open it with a link: "_url_$p(..#CSPAPP,"/",2,*)_"/"
30+
}
31+
} else {
32+
write !, "WEB application """_..#CSPAPP_""" already exists, so it is ready to use."
33+
}
34+
Quit $$$OK
35+
}
36+
37+
/// This method is invoked when a class is 'uncompiled'.
38+
ClassMethod RemoveProjection(cls As %String, ByRef params, recompile As %Boolean) As %Status
39+
{
40+
new $namespace
41+
znspace "%SYS"
42+
43+
if (##class(Security.Applications).Exists(..#CSPAPP)) {
44+
w !, "Deleting WEB application """_..#CSPAPP_"""..."
45+
do ##class(Security.Applications).Delete(..#CSPAPP)
46+
w !, "WEB application """_..#CSPAPP_""" was successfully removed."
47+
}
48+
QUIT $$$OK
49+
}
50+
51+
}

0 commit comments

Comments
 (0)