Skip to content

Commit

Permalink
conflict merge
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed May 24, 2015
2 parents 911f450 + 033b148 commit 50a1769
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 29 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,23 @@ 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/intersystems-ru/UMLExplorer/releases) or build project by yourself. Then import XML file inside <code>Cache</code> directory of archive or directory.

###### 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.
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>
## 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.
83 changes: 74 additions & 9 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-14 01:35:59.888696">
<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 All @@ -315,7 +379,7 @@ Returns structured package data</Description>
<Description>
REST interface for UMLExplorer</Description>
<Super>%CSP.REST</Super>
<TimeChanged>63685,85586.177035</TimeChanged>
<TimeChanged>63687,39024.811955</TimeChanged>
<TimeCreated>63648,30450.187229</TimeCreated>

<XData name="UrlMap">
Expand All @@ -327,9 +391,9 @@ REST interface for UMLExplorer</Description>
<Route Url="/js/CacheUMLExplorer.js" Method="GET" Call="GetJs"/>
<Route Url="/Test" Method="GET" Call="Test"/>
<Route Url="/GetClassTree" Method="GET" Call="GetClassTree"/>
<Route Url="/GetClassView/:ClassName" Method="GET" Call="GetClassView"/>
<Route Url="/GetPackageView/:PackageName" Method="GET" Call="GetPackageView"/>
<Route Url="/GetMethod/:ClassName/:MethodName" Method="GET" Call="GetMethod"/>
<Route Url="/GetClassView" Method="GET" Call="GetClassView"/>
<Route Url="/GetPackageView" Method="GET" Call="GetPackageView"/>
<Route Url="/GetMethod" Method="GET" Call="GetMethod"/>
</Routes>
]]></Data>
</XData>
Expand All @@ -349,9 +413,9 @@ Method returns whole class tree visible in the current namespace.</Description>
<Description>
Returns classTree by given class name</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>className:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set className = %request.Get("name")
set classData = ##class(UMLExplorer.ClassView).getClassView(className)
do classData.%ToJSON(, "ou")
return $$$OK
Expand All @@ -362,9 +426,9 @@ Returns classTree by given class name</Description>
<Description>
Returns all package class trees by given package name</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>packageName:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set packageName = %request.Get("name")
set classData = ##class(UMLExplorer.ClassView).getPackageView(packageName)
do classData.%ToJSON(, "ou")
return $$$OK
Expand All @@ -375,9 +439,10 @@ Returns all package class trees by given package name</Description>
<Description>
Returns method description and code</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>className:%String,methodName:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set className = %request.Get("className")
set methodName = %request.Get("methodName")
set methodData = ##class(ClassView).getMethod(className, methodName)
do methodData.%ToJSON(, "ou")
return $$$OK
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.2",
"version": "0.9.4",
"description": "An UML Class explorer for InterSystems Caché",
"directories": {
"test": "test"
Expand Down
6 changes: 3 additions & 3 deletions web/js/Source.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Source.prototype.getClassTree = function (callback) {
Source.prototype.getMethod = function (className, methodName, callback) {

lib.load(
this.URL + "/GetMethod/" + encodeURIComponent(className) + "/"
this.URL + "/GetMethod?className=" + encodeURIComponent(className) + "&methodName="
+ encodeURIComponent(methodName),
null,
callback);
Expand All @@ -38,7 +38,7 @@ Source.prototype.getMethod = function (className, methodName, callback) {
*/
Source.prototype.getClassView = function (className, callback) {

lib.load(this.URL + "/GetClassView/" + encodeURIComponent(className), null, callback);
lib.load(this.URL + "/GetClassView?name=" + encodeURIComponent(className), null, callback);

};

Expand All @@ -49,7 +49,7 @@ Source.prototype.getClassView = function (className, callback) {
*/
Source.prototype.getPackageView = function (packageName, callback) {

lib.load(this.URL + "/GetPackageView/" + encodeURIComponent(packageName), null, callback);
lib.load(this.URL + "/GetPackageView?name=" + encodeURIComponent(packageName), null, callback);

};

Expand Down

0 comments on commit 50a1769

Please sign in to comment.