diff --git a/README.md b/README.md index 8c854e6..45090ee 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,23 @@ # CacheUMLExplorer -An UML Class explorer for InterSystems Caché. +An UML Class explorer for InterSystems Caché. It can build UML class diagram for any class in Caché. + +## Screenshots + +![2015-04-21_214058](https://cloud.githubusercontent.com/assets/4989256/7260103/6c1e2a20-e870-11e4-8bf0-9832885be9ab.png) + +## Installation + +###### 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 Cache directory of archive or directory. + +###### Set up WEB application +When you have imported and compiled UMLExplorer package in Caché, make sure the namespace is the same you have imported classes to. Then go to system management portal -> administering -> security -> applications -> web applications and create there a new web application. Fill the name field of it with /UMLExplorer (slash is required) and set the value of dispatch class to UMLExplorer.Router. Click save. Now your WEB application is ready. + +###### Use it +Visit [server domain and port]/UMLExplorer/ (with slash at end) to enter application. + +## Build + +To build project, you need [NodeJS](https://nodejs.org) platform to be installed. Then, clone source code and run npm install from the root of the project. This will install all necessary modules from NPM. Also run npm install -g gulp if you have no gulp builder in your modules. + +After that and each next time just run gulp command from the project root. This will generate build directory, where you will found all what you need. diff --git a/cache/projectTemplate.xml b/cache/projectTemplate.xml index 1ed822b..2906f58 100644 --- a/cache/projectTemplate.xml +++ b/cache/projectTemplate.xml @@ -1,9 +1,10 @@ + Class contains methods that return structured class data. -63654,59126.207802 +63663,69939 63653,67019.989197 @@ -84,6 +85,7 @@ Class contains methods that return structured class data. + @@ -92,7 +94,7 @@ Class contains methods that return structured class data. REST interface for UMLExplorer %CSP.REST -63654,68682.349536 +63663,76166.562046 63648,30450.187229 @@ -100,6 +102,8 @@ REST interface for UMLExplorer + + @@ -178,15 +182,112 @@ Method to test accessibility of REST interface. ]]> + +1 +%Status + + + + +1 +%Status + + + Method returns user application. 1 %Status + &html< + + + + + Cache UML explorer + + + + +
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+ + + > + return $$$OK +]]>
+
+
+ + + +63663,76108.945861 +63663,71456.865723 + + + +Outputs css code for UMLExplorer application +1 +%Status + + + + + +Outputs js code for UMLExplorer application +1 +%Status + + + + +{{replace:css}} + +]]> + + + + +]]> +
\ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index c1b3537..6ae71fa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,6 +4,7 @@ var gulp = require("gulp"), concat = require("gulp-concat"), uglify = require("gulp-uglify"), wrap = require("gulp-wrap"), + addsrc = require('gulp-add-src'), minifyCSS = require("gulp-minify-css"), htmlReplace = require("gulp-html-replace"), header = require("gulp-header"), @@ -29,15 +30,10 @@ gulp.task("clean", function () { }); gulp.task("gatherScripts", ["clean"], function () { - return gulp.src([ - "web/jsLib/joint.min.js", - "web/jsLib/joint.shapes.uml.js", - "web/jsLib/joint.layout.DirectedGraph.min.js", - "web/js/*.js" - ]) + return gulp.src("web/js/*.js") .pipe(concat("CacheUMLExplorer.js")) .pipe(replace(/\/\*\{\{replace:version}}\*\//, "\"" + pkg["version"] + "\"")) - //.pipe(wrap("CacheUMLExplorer = (function(){<%= contents %> return CacheUMLExplorer;}());")) + .pipe(wrap("CacheUMLExplorer = (function(){<%= contents %> return CacheUMLExplorer;}());")) .pipe(uglify({ output: { ascii_only: true, @@ -46,24 +42,19 @@ gulp.task("gatherScripts", ["clean"], function () { } })) .pipe(header(banner, { pkg: pkg })) + .pipe(addsrc.prepend([ + "web/jsLib/joint.min.js", + "web/jsLib/joint.shapes.uml.js", + "web/jsLib/joint.layout.DirectedGraph.min.js" + ])) + .pipe(concat("CacheUMLExplorer.js")) .pipe(gulp.dest("build/web/js/")); }); -//gulp.task("concatScripts", ["gatherScripts"], function () { -// return gulp.src([ -// "web/jsLib/joint.min.js", -// "web/jsLib/joint.layout.DirectedGraph.min.js", -// "web/jsLib/joint.shapes.uml.js", -// "build/web/js/CacheUMLExplorer.js" -// ]) -// .pipe(concat("CacheUMLExplorer.js")) -// .pipe(gulp.dest("build/web/js/")); -//}); - gulp.task("gatherCSS", ["clean"], function () { return gulp.src("web/css/*.css") .pipe(concat("CacheUMLExplorer.css")) - .pipe(minifyCSS()) + .pipe(minifyCSS({ keepSpecialComments: 0 })) .pipe(gulp.dest("build/web/css/")); }); @@ -76,16 +67,6 @@ gulp.task("addHTMLFile", ["clean"], function () { .pipe(gulp.dest("build/web/")); }); -gulp.task("addHTMLZIPFile", ["clean", "gatherScripts", "gatherCSS"], function () { - var jsRepl = "", - cssRepl = ""; - return gulp.src("web/index.html") - .pipe(concat("ZIPindex.html")) - .pipe(replace(/(.|\r|\n)*/, function () { return jsRepl; })) - .pipe(replace(/(.|\r|\n)*/, function () { return cssRepl; })) - .pipe(gulp.dest("build/web")); -}); - gulp.task("copyLICENSE", ["clean"], function (){ return gulp.src("LICENSE") .pipe(gulp.dest("build/")); @@ -97,13 +78,18 @@ gulp.task("copyREADME", ["clean"], function (){ }); gulp.task("exportCacheXML", [ - "clean", "gatherCSS", "addHTMLFile", "addHTMLZIPFile", "copyLICENSE", "copyREADME" + "clean", "gatherCSS", "gatherScripts", "addHTMLFile", "copyLICENSE", "copyREADME" ], function () { return gulp.src("cache/projectTemplate.xml") - .pipe( - replace(/\{\{replace:HTML}}/, - fs.readFileSync("build/web/ZIPindex.html", "utf-8")) - ) + .pipe(replace(/\{\{replace:HTML}}/, fs.readFileSync("build/web/index.html", "utf-8"))) + .pipe(replace( + /\{\{replace:css}}/, + function () { return fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8"); } + )) + .pipe(replace( + /\{\{replace:js}}/, + function () { return fs.readFileSync("build/web/js/CacheUMLExplorer.js", "utf-8"); } + )) .pipe(rename(function (path) { path.basename += "-v" + pkg["version"]; })) .pipe(gulp.dest("build/Cache")); }); diff --git a/package.json b/package.json index 3a87683..213f0b0 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,18 @@ { "name": "CacheUMLExplorer", - "version": "0.1.1", + "version": "0.2", "description": "An UML Class explorer for InterSystems Caché", "directories": { "test": "test" }, - "dependencies": { - - }, + "dependencies": {}, "devDependencies": { "express": "^5.0.0-alpha.1", "gulp": "^3.8.11", - "gulp-header": "^1.2.2", + "gulp-add-src": "^0.2.0", "gulp-clean": "^0.3.1", "gulp-concat": "^2.4.1", + "gulp-header": "^1.2.2", "gulp-html-replace": "^1.4.1", "gulp-minify-css": "^0.3.11", "gulp-rename": "^1.2.0",