Skip to content

Commit

Permalink
simplified installation - just import & use!
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed May 24, 2015
1 parent 682eff7 commit 033b148
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 18 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@ An UML Class explorer for InterSystems Caché.

## Installation

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

###### Import classes to Caché
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.
###### Web application
Note that importing UMLExplorer.WebAppInstaller class will also create a /UMLExplorer application.
If you want to create WEB application manually, please, do not import this class. Anyway, <b>
importing this class requires %SYS permission.</b>

###### Set up WEB application
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.

###### Use it
Visit <code>[server domain and port]/UMLExplorer/</code> (with slash at end) to enter application.
## Usage
Visit <code>[server domain and port]/UMLExplorer/</code> (slash at end required) to enter
application.

## Build

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.
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.

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.
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.
68 changes: 66 additions & 2 deletions cache/projectTemplate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-28 19:50:48">
<Class name="UMLExplorer.ClassView">
<Description>
Cache UML Explorer vX.X.X/*build.replace:pkg.version*/
Class contains methods that return structured classes/packages data.</Description>
<TimeChanged>63686,85630.818189</TimeChanged>
<TimeChanged>63690,48954.853237</TimeChanged>
<TimeCreated>63653,67019.989197</TimeCreated>

<Method name="getClassTree">
Expand Down Expand Up @@ -302,11 +303,74 @@ Returns structured package data</Description>
</Class>


<Project name="UMLExplorer" LastModified="2015-05-15 00:57:01.855062">
<Class name="UMLExplorer.WebAppInstaller">
<Super>%Projection.AbstractProjection</Super>
<TimeChanged>63696,65168.289869</TimeChanged>
<TimeCreated>63696,64041.85537</TimeCreated>

<Projection name="Reference">
<Type>WebAppInstaller</Type>
</Projection>

<Method name="CreateProjection">
<Description>
This method is invoked when a class is compiled.</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[cls:%String,&params]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set ns = $NAMESPACE
zn:ns'="%SYS" "%SYS"
do ##class(Security.System).GetInstallationSecuritySetting(.security)
if (security="None") {
set cspProperties("AutheEnabled") = 64 // Unauthenticated
} else {
set cspProperties("AutheEnabled") = 32 // Password
}
set cspProperties("NameSpace") = ns
set cspProperties("Description") = "A WEB application for Cache UML Explorer."
set cspProperties("IsNameSpaceDefault") = 1
set cspProperties("DispatchClass") = "UMLExplorer.Router"
if ('##class(Security.Applications).Exists("/UMLExplorer")) {
w !, "Creating WEB application ""/UMLExplorer""..."
set tSC = ##class(Security.Applications).Create("/UMLExplorer", .cspProperties)
if $$$ISERR(tSC) throw ##class(%Installer.Exception).CreateFromStatus(tSC)
w !, "WEB application ""/UMLExplorer"" created."
} else {
w !, "WEB application ""/UMLExplorer"" already exists, so it is ready to use."
}
zn:ns'="%SYS" ns
quit $$$OK
]]></Implementation>
</Method>

<Method name="RemoveProjection">
<Description>
This method is invoked when a class is 'uncompiled'.</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[cls:%String,&params,recompile:%Boolean]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set ns = $NAMESPACE
zn:ns'="%SYS" "%SYS"
if (##class(Security.Applications).Exists("/UMLExplorer")) {
w !, "Deleting WEB application ""/UMLExplorer""..."
do ##class(Security.Applications).Delete("/UMLExplorer")
w !, "WEB application ""/UMLExplorer"" was successfully removed."
}
zn:ns'="%SYS" ns
QUIT $$$OK
]]></Implementation>
</Method>
</Class>


<Project name="UMLExplorer" LastModified="2015-05-24 18:07:22.008232">
<Items>
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"></ProjectItem>
<ProjectItem name="UMLExplorer.WebAppInstaller" type="CLS"></ProjectItem>
</Items>
</Project>

Expand Down
14 changes: 9 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ var banner = [
""
].join("\n");

var specialReplace = function () {
return replace(/[^\s]+\/\*build\.replace:(.*)\*\//g, function (part, match) {
var s = match.toString();
return s.replace(/pkg\.([a-zA-Z]+)/g, function (p,a) { return pkg[a]; });
});
};

gulp.task("clean", function () {
return gulp.src("build", {read: false})
.pipe(clean());
Expand Down Expand Up @@ -60,10 +67,7 @@ gulp.task("gatherLibs", ["clean"], function () {
gulp.task("gatherScripts", ["clean", "gatherLibs"], function () {
return gulp.src("web/js/*.js")
.pipe(concat("CacheUMLExplorer.js"))
.pipe(replace(/[^\s]+\/\*build\.replace:(.*)\*\//g, function (part, match) {
var s = match.toString();
return s.replace(/pkg\.([a-zA-Z]+)/g, function (p,a) { return pkg[a]; });
}))
.pipe(specialReplace())
.pipe(wrap("CacheUMLExplorer = (function(){<%= contents %> return CacheUMLExplorer;}());"))
.pipe(uglify({
output: {
Expand Down Expand Up @@ -111,7 +115,7 @@ gulp.task("exportCacheXML", [
"clean", "gatherCSS", "gatherScripts", "addHTMLFile", "copyLICENSE", "copyREADME"
], function () {
return gulp.src("cache/projectTemplate.xml")
.pipe(replace(/\{\{replace:HTML}}/, fs.readFileSync("build/web/index.html", "utf-8")))
.pipe(specialReplace())
.pipe(replace(
/\{\{replace:css}}/,
function () { return fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8"); }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CacheUMLExplorer",
"version": "0.9.3",
"version": "0.9.4",
"description": "An UML Class explorer for InterSystems Caché",
"directories": {
"test": "test"
Expand Down

0 comments on commit 033b148

Please sign in to comment.