Skip to content

Commit b5012e7

Browse files
Init script add, title change when drilling down, first alpha release
1 parent 111bcd5 commit b5012e7

File tree

8 files changed

+43
-8
lines changed

8 files changed

+43
-8
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
# Caché Visual Editor
1+
# Caché Visual Editor (alpha)
22

33
A Web-based user interface for InterSystems Caché which allows to create and manage classes
44
literally without touching any code.
55

6+
### Preview
7+
8+
![Screenshot 1](https://cloud.githubusercontent.com/assets/4989256/13725979/c9e3a45e-e8bb-11e5-874f-28cff147f2e1.png)
9+
10+
![Screenshot 2](https://cloud.githubusercontent.com/assets/4989256/13725996/18c163cc-e8bc-11e5-88a0-5030e934162d.png)
11+
612
### Installation
713

8-
Find the latest release [nowhere for now] and import XML file into Caché by one of the next ways:
14+
Find the latest release [here](https://github.com/ZitRos/cache-visual-editor/releases) and import
15+
XML file into Caché by one of the next ways:
916

1017
1. Just drag XML file over Studio window;
1118
2. Go to the Management Portal -> System Explorer -> Classes -> Import and select the XML file;

import.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
:: CHANGE THIS PATH TO YOUR CACHÉ INSTALLATION PATH ON WINDOWS
55
set CACHE_DIR=C:\Program Files\InterSystems\Cache20162
66

7-
gulp & echo w "OK:"_$system.OBJ.ImportDir("%~dp0build\cache",,"ck") halt | "%CACHE_DIR%\bin\cache.exe" -s "%CACHE_DIR%\mgr" -U USER
7+
gulp & echo w "OK:"_$system.OBJ.ImportDir("%~dp0build\cache",,"ck") halt | "%CACHE_DIR%\bin\cache.exe" -s "%CACHE_DIR%\mgr" -U SAMPLES

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cache-visual-editor",
33
"printableName": "Cache Visual Editor",
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"description": "Visual class editor for InterSystems Caché",
66
"main": "index.js",
77
"keywords": [

source/cache/VisualEditor.REST.Informer.cls

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@ XData UrlMap
66
{
77
<Routes>
88
<Route Url="/list" Method="GET" Call="List"/>
9+
<Route Url="/init" Method="GET" Call="Init"/>
910
</Routes>
1011
}
1112

13+
ClassMethod Init() As %Status
14+
{
15+
set data = ##class(%ZEN.proxyObject).%New()
16+
set data.namespace = $Namespace
17+
do data.%ToJSON(, "o")
18+
quit $$$OK
19+
}
20+
21+
/// This method returns all available data about the class.
1222
ClassMethod GetClassData(className As %String) As %ZEN.proxyObject
1323
{
1424
set class = ##class(%Dictionary.ClassDefinition).%OpenId(className)
@@ -119,6 +129,7 @@ ClassMethod GetClassData(className As %String) As %ZEN.proxyObject
119129
return oClass
120130
}
121131

132+
/// This method lists all the classes on the current level.
122133
ClassMethod List() As %Status
123134
{
124135
set baseLevel = $case(%request.Get("level"), "":"", :%request.Get("level") _ ".")

source/client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="header">
1919
<div class="medium menu icon"></div>
2020
<div class="medium back icon" id="backButton"></div>
21-
<span class="title">Class Editor</span>
21+
<span class="title" id="topTitle">Class Editor</span>
2222
</div>
2323
<div class="body" id="classBuilderBody">
2424

source/client/js/classEditor/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { AutoGrid } from "../autoGrid";
33
import { getCardElement } from "./card";
44

55
var PATH = "",
6-
INITIALIZED = false;
6+
INITIALIZED = false,
7+
NAMESPACE = "";
78

89
let initCallbacks = [];
910

@@ -42,15 +43,21 @@ function orderData (data) {
4243
return sorted;
4344
}
4445

46+
function setTitle (text) {
47+
document.querySelector("#topTitle").textContent = text;
48+
}
49+
4550
export function loadLevel (level) {
4651

4752
PATH = level;
4853
grid.clear();
4954

5055
if (PATH === "")
5156
backButton.style.display = "none";
57+
setTitle(`${ NAMESPACE }${ PATH ? "." : "" }${ PATH }`);
5258

5359
getList("SAMPLES", PATH, (data) => {
60+
grid.clear();
5461
if (PATH !== "")
5562
backButton.style.display = "";
5663
data = orderData(data);
@@ -70,8 +77,9 @@ export function onInit (callback) {
7077
return "Duck";
7178
}
7279

73-
export function init () {
80+
export function init (data) {
7481

82+
NAMESPACE = data["namespace"] || "";
7583
INITIALIZED = true;
7684
initCallbacks.forEach(cb => cb());
7785
initCallbacks = [];

source/client/js/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { init } from "./classEditor";
2+
import { init as serverInit } from "./server";
23

34
window.addEventListener("load", () => {
45

5-
init();
6+
serverInit(data => init(data));
67

78
});

source/client/js/server.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ export function getList (namespace, level, callback) {
6161
);
6262
}
6363

64+
/**
65+
* Retrieves the basic configuration.
66+
* @param {server~dataCallback} callback
67+
*/
68+
export function init (callback) {
69+
load(`${ BASE_URL }/Informer/init`, null, callback);
70+
}
71+
6472
/**
6573
* @callback server~dataCallback
6674
* @param {*} data - Object that contains server data.

0 commit comments

Comments
 (0)