From 37ec372becf63962bbf2e54e161df10fa8d5e2e3 Mon Sep 17 00:00:00 2001 From: ZitRo Date: Tue, 21 Apr 2015 19:27:28 +0300 Subject: [PATCH 1/3] normalized export task for building project --- cache/projectTemplate.xml | 13 +++++++++- gulpfile.js | 54 +++++++++++++++------------------------ package.json | 7 +++-- 3 files changed, 35 insertions(+), 39 deletions(-) diff --git a/cache/projectTemplate.xml b/cache/projectTemplate.xml index 1ed822b..8017fe5 100644 --- a/cache/projectTemplate.xml +++ b/cache/projectTemplate.xml @@ -1,5 +1,14 @@ + + + + + + + + + Class contains methods that return structured class data. @@ -184,7 +193,9 @@ Method returns user application. 1 %Status + &html< + {{replace:HTML}} + > return $$$OK ]]> diff --git a/gulpfile.js b/gulpfile.js index c1b3537..698a712 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}}/, + fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8") + )) + .pipe(replace( + /\{\{replace:js}}/, + 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..730dbde 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,14 @@ "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", From 73955a2d89a93b0cb23ebf8a2d89791f9407c515 Mon Sep 17 00:00:00 2001 From: ZitRo Date: Tue, 21 Apr 2015 21:42:46 +0300 Subject: [PATCH 2/3] complete build system, package that require only one web application --- cache/projectTemplate.xml | 112 ++++++++++++++++++++++++++++++++++---- gulpfile.js | 4 +- package.json | 2 +- 3 files changed, 104 insertions(+), 14 deletions(-) diff --git a/cache/projectTemplate.xml b/cache/projectTemplate.xml index 8017fe5..2906f58 100644 --- a/cache/projectTemplate.xml +++ b/cache/projectTemplate.xml @@ -1,18 +1,10 @@ - - - - - - - - Class contains methods that return structured class data. -63654,59126.207802 +63663,69939 63653,67019.989197 @@ -93,6 +85,7 @@ Class contains methods that return structured class data. + @@ -101,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 @@ -109,6 +102,8 @@ REST interface for UMLExplorer + + @@ -187,6 +182,28 @@ Method to test accessibility of REST interface. ]]> + +1 +%Status + + + + +1 +%Status + + + Method returns user application. @@ -194,10 +211,83 @@ Method returns user application. %Status + + + + 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 698a712..6ae71fa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -84,11 +84,11 @@ gulp.task("exportCacheXML", [ .pipe(replace(/\{\{replace:HTML}}/, fs.readFileSync("build/web/index.html", "utf-8"))) .pipe(replace( /\{\{replace:css}}/, - fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8") + function () { return fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8"); } )) .pipe(replace( /\{\{replace:js}}/, - fs.readFileSync("build/web/js/CacheUMLExplorer.js", "utf-8") + 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 730dbde..213f0b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CacheUMLExplorer", - "version": "0.1.1", + "version": "0.2", "description": "An UML Class explorer for InterSystems Caché", "directories": { "test": "test" From 367a7be87ce49fdba3963c37a1e9149373af398f Mon Sep 17 00:00:00 2001 From: Nikita Date: Tue, 21 Apr 2015 22:15:50 +0300 Subject: [PATCH 3/3] description enhance --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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.