Skip to content

Commit 033b148

Browse files
simplified installation - just import & use!
1 parent 682eff7 commit 033b148

File tree

4 files changed

+92
-18
lines changed

4 files changed

+92
-18
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,25 @@ An UML Class explorer for InterSystems Caché.
1515

1616
## Installation
1717

18-
To install Caché UML Explorer, you need to import UMLExplorer package to Caché and then set up a WEB-application.
18+
To install latests Caché UML Explorer, you just need to import UMLExplorer package. Download the
19+
archive from [latest releases](https://github.com/ZitRos/CacheUMLExplorer/releases), and then import
20+
<code>Cache/CacheUMLExplorer-vX.X.X.xml</code> file.
1921

20-
###### Import classes to Caché
21-
To install Caché UML class explorer, download the [latest release](https://github.com/ZitRos/CacheUMLExplorer/releases) or build project by yourself. Then import XML file inside <code>Cache</code> directory of archive or directory.
22+
###### Web application
23+
Note that importing UMLExplorer.WebAppInstaller class will also create a /UMLExplorer application.
24+
If you want to create WEB application manually, please, do not import this class. Anyway, <b>
25+
importing this class requires %SYS permission.</b>
2226

23-
###### Set up WEB application
24-
When you have imported and compiled <b>UMLExplorer package</b> in Caché, make sure the namespace is the same you have imported classes to. Then go to <code>system management portal -> administering -> security -> applications -> web applications</code> and create there a new web application. Fill the <code>name</code> field of it with <code>/UMLExplorer</code> (slash is required) and set the value of <code>dispatch class</code> to <code>UMLExplorer.Router</code>. Click save. Now your WEB application is ready.
25-
26-
###### Use it
27-
Visit <code>[server domain and port]/UMLExplorer/</code> (with slash at end) to enter application.
27+
## Usage
28+
Visit <code>[server domain and port]/UMLExplorer/</code> (slash at end required) to enter
29+
application.
2830

2931
## Build
3032

31-
To build project, you need [NodeJS](https://nodejs.org) platform to be installed. Then, clone source code and run <code>npm install</code> from the root of the project. This will install all necessary modules from NPM. Also run <code>npm install -g gulp</code> if you have no gulp builder in your modules.
33+
To build project, you need [NodeJS](https://nodejs.org) platform to be installed. Then, clone source
34+
code and run <code>npm install</code> from the root of the project. This will install all necessary
35+
modules from NPM. Also run <code>npm install -g gulp</code> if you have no gulp builder in your
36+
modules.
3237

33-
After that and each next time just run <code>gulp</code> command from the project root. This will generate <code>build</code> directory, where you will found all what you need.
38+
After that and each next time just run <code>gulp</code> command from the project root. This will
39+
generate <code>build</code> directory, where you will found all what you need.

cache/projectTemplate.xml

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-28 19:50:48">
33
<Class name="UMLExplorer.ClassView">
44
<Description>
5+
Cache UML Explorer vX.X.X/*build.replace:pkg.version*/
56
Class contains methods that return structured classes/packages data.</Description>
6-
<TimeChanged>63686,85630.818189</TimeChanged>
7+
<TimeChanged>63690,48954.853237</TimeChanged>
78
<TimeCreated>63653,67019.989197</TimeCreated>
89

910
<Method name="getClassTree">
@@ -302,11 +303,74 @@ Returns structured package data</Description>
302303
</Class>
303304

304305

305-
<Project name="UMLExplorer" LastModified="2015-05-15 00:57:01.855062">
306+
<Class name="UMLExplorer.WebAppInstaller">
307+
<Super>%Projection.AbstractProjection</Super>
308+
<TimeChanged>63696,65168.289869</TimeChanged>
309+
<TimeCreated>63696,64041.85537</TimeCreated>
310+
311+
<Projection name="Reference">
312+
<Type>WebAppInstaller</Type>
313+
</Projection>
314+
315+
<Method name="CreateProjection">
316+
<Description>
317+
This method is invoked when a class is compiled.</Description>
318+
<ClassMethod>1</ClassMethod>
319+
<FormalSpec><![CDATA[cls:%String,&params]]></FormalSpec>
320+
<ReturnType>%Status</ReturnType>
321+
<Implementation><![CDATA[
322+
set ns = $NAMESPACE
323+
zn:ns'="%SYS" "%SYS"
324+
do ##class(Security.System).GetInstallationSecuritySetting(.security)
325+
if (security="None") {
326+
set cspProperties("AutheEnabled") = 64 // Unauthenticated
327+
} else {
328+
set cspProperties("AutheEnabled") = 32 // Password
329+
}
330+
set cspProperties("NameSpace") = ns
331+
set cspProperties("Description") = "A WEB application for Cache UML Explorer."
332+
set cspProperties("IsNameSpaceDefault") = 1
333+
set cspProperties("DispatchClass") = "UMLExplorer.Router"
334+
if ('##class(Security.Applications).Exists("/UMLExplorer")) {
335+
w !, "Creating WEB application ""/UMLExplorer""..."
336+
set tSC = ##class(Security.Applications).Create("/UMLExplorer", .cspProperties)
337+
if $$$ISERR(tSC) throw ##class(%Installer.Exception).CreateFromStatus(tSC)
338+
w !, "WEB application ""/UMLExplorer"" created."
339+
} else {
340+
w !, "WEB application ""/UMLExplorer"" already exists, so it is ready to use."
341+
}
342+
zn:ns'="%SYS" ns
343+
quit $$$OK
344+
]]></Implementation>
345+
</Method>
346+
347+
<Method name="RemoveProjection">
348+
<Description>
349+
This method is invoked when a class is 'uncompiled'.</Description>
350+
<ClassMethod>1</ClassMethod>
351+
<FormalSpec><![CDATA[cls:%String,&params,recompile:%Boolean]]></FormalSpec>
352+
<ReturnType>%Status</ReturnType>
353+
<Implementation><![CDATA[
354+
set ns = $NAMESPACE
355+
zn:ns'="%SYS" "%SYS"
356+
if (##class(Security.Applications).Exists("/UMLExplorer")) {
357+
w !, "Deleting WEB application ""/UMLExplorer""..."
358+
do ##class(Security.Applications).Delete("/UMLExplorer")
359+
w !, "WEB application ""/UMLExplorer"" was successfully removed."
360+
}
361+
zn:ns'="%SYS" ns
362+
QUIT $$$OK
363+
]]></Implementation>
364+
</Method>
365+
</Class>
366+
367+
368+
<Project name="UMLExplorer" LastModified="2015-05-24 18:07:22.008232">
306369
<Items>
307370
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
308371
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>
309372
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"></ProjectItem>
373+
<ProjectItem name="UMLExplorer.WebAppInstaller" type="CLS"></ProjectItem>
310374
</Items>
311375
</Project>
312376

gulpfile.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ var banner = [
2828
""
2929
].join("\n");
3030

31+
var specialReplace = function () {
32+
return replace(/[^\s]+\/\*build\.replace:(.*)\*\//g, function (part, match) {
33+
var s = match.toString();
34+
return s.replace(/pkg\.([a-zA-Z]+)/g, function (p,a) { return pkg[a]; });
35+
});
36+
};
37+
3138
gulp.task("clean", function () {
3239
return gulp.src("build", {read: false})
3340
.pipe(clean());
@@ -60,10 +67,7 @@ gulp.task("gatherLibs", ["clean"], function () {
6067
gulp.task("gatherScripts", ["clean", "gatherLibs"], function () {
6168
return gulp.src("web/js/*.js")
6269
.pipe(concat("CacheUMLExplorer.js"))
63-
.pipe(replace(/[^\s]+\/\*build\.replace:(.*)\*\//g, function (part, match) {
64-
var s = match.toString();
65-
return s.replace(/pkg\.([a-zA-Z]+)/g, function (p,a) { return pkg[a]; });
66-
}))
70+
.pipe(specialReplace())
6771
.pipe(wrap("CacheUMLExplorer = (function(){<%= contents %> return CacheUMLExplorer;}());"))
6872
.pipe(uglify({
6973
output: {
@@ -111,7 +115,7 @@ gulp.task("exportCacheXML", [
111115
"clean", "gatherCSS", "gatherScripts", "addHTMLFile", "copyLICENSE", "copyREADME"
112116
], function () {
113117
return gulp.src("cache/projectTemplate.xml")
114-
.pipe(replace(/\{\{replace:HTML}}/, fs.readFileSync("build/web/index.html", "utf-8")))
118+
.pipe(specialReplace())
115119
.pipe(replace(
116120
/\{\{replace:css}}/,
117121
function () { return fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8"); }

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheUMLExplorer",
3-
"version": "0.9.3",
3+
"version": "0.9.4",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

0 commit comments

Comments
 (0)