Skip to content

Commit 73955a2

Browse files
complete build system, package that require only one web application
1 parent 37ec372 commit 73955a2

File tree

3 files changed

+104
-14
lines changed

3 files changed

+104
-14
lines changed

cache/projectTemplate.xml

Lines changed: 101 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-12 16:26:04">
33

4-
<CSP name="CacheUMLExplorer.css" application="">
5-
<![CDATA[{{replace:css}}]]>
6-
</CSP>
7-
8-
<CSP name="CacheUMLExplorer.js" application="">
9-
<![CDATA[{{replace:js}}]]>
10-
</CSP>
11-
124
<Class name="UMLExplorer.ClassView">
135
<Description>
146
Class contains methods that return structured class data.</Description>
15-
<TimeChanged>63654,59126.207802</TimeChanged>
7+
<TimeChanged>63663,69939</TimeChanged>
168
<TimeCreated>63653,67019.989197</TimeCreated>
179

1810
<Method name="getClassData">
@@ -93,6 +85,7 @@ Class contains methods that return structured class data.</Description>
9385
<Items>
9486
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>
9587
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
88+
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"></ProjectItem>
9689
</Items>
9790
</Project>
9891

@@ -101,14 +94,16 @@ Class contains methods that return structured class data.</Description>
10194
<Description>
10295
REST interface for UMLExplorer</Description>
10396
<Super>%CSP.REST</Super>
104-
<TimeChanged>63654,68682.349536</TimeChanged>
97+
<TimeChanged>63663,76166.562046</TimeChanged>
10598
<TimeCreated>63648,30450.187229</TimeCreated>
10699

107100
<XData name="UrlMap">
108101
<Data><![CDATA[
109102
<Routes>
110103
<Route Url="/" Method="GET" Call="Index"/>
111104
<Route Url="/index" Method="GET" Call="Index"/>
105+
<Route Url="/css/CacheUMLExplorer.css" Method="GET" Call="GetCss"/>
106+
<Route Url="/js/CacheUMLExplorer.js" Method="GET" Call="GetJs"/>
112107
<Route Url="/Test" Method="GET" Call="Test"/>
113108
<Route Url="/GetClassTree" Method="GET" Call="GetClassTree"/>
114109
<Route Url="/GetClassView/:ClassName" Method="GET" Call="GetClassView"/>
@@ -187,17 +182,112 @@ Method to test accessibility of REST interface.</Description>
187182
]]></Implementation>
188183
</Method>
189184

185+
<Method name="GetCss">
186+
<ClassMethod>1</ClassMethod>
187+
<ReturnType>%Status</ReturnType>
188+
<Implementation><![CDATA[
189+
set %response.CharSet = "utf-8"
190+
set %response.ContentType = "text/css"
191+
do ##class(UMLExplorer.StaticContent).WriteCSS()
192+
return $$$OK
193+
]]></Implementation>
194+
</Method>
195+
196+
<Method name="GetJs">
197+
<ClassMethod>1</ClassMethod>
198+
<ReturnType>%Status</ReturnType>
199+
<Implementation><![CDATA[
200+
set %response.CharSet = "utf-8"
201+
set %response.ContentType = "text/javascript"
202+
do ##class(UMLExplorer.StaticContent).WriteJS()
203+
return $$$OK
204+
]]></Implementation>
205+
</Method>
206+
190207
<Method name="Index">
191208
<Description>
192209
Method returns user application.</Description>
193210
<ClassMethod>1</ClassMethod>
194211
<ReturnType>%Status</ReturnType>
195212
<Implementation><![CDATA[
196213
&html<
197-
{{replace:HTML}}
214+
<!DOCTYPE html>
215+
<html>
216+
<head lang="en">
217+
<meta charset="UTF-8">
218+
<title>Cache UML explorer</title>
219+
<link rel="stylesheet" href="css/CacheUMLExplorer.css">
220+
<script src="js/CacheUMLExplorer.js"></script>
221+
</head>
222+
<body onload="var cue = new CacheUMLExplorer(document.getElementById('treeView'), document.getElementById('classView'))">
223+
<div class="ui-body">
224+
<div class="ui-sideBlock">
225+
<div id="treeView">
226+
227+
</div>
228+
</div>
229+
<div class="ui-mainBlock">
230+
<div class="ui-ClassInfo">
231+
<span id="className"></span>
232+
</div>
233+
<div id="classView">
234+
235+
</div>
236+
</div>
237+
</div>
238+
</body>
239+
</html>
198240
>
199241
return $$$OK
200242
]]></Implementation>
201243
</Method>
202244
</Class>
245+
246+
247+
<Class name="UMLExplorer.StaticContent">
248+
<TimeChanged>63663,76108.945861</TimeChanged>
249+
<TimeCreated>63663,71456.865723</TimeCreated>
250+
251+
<Method name="WriteCSS">
252+
<Description>
253+
Outputs css code for UMLExplorer application</Description>
254+
<ClassMethod>1</ClassMethod>
255+
<ReturnType>%Status</ReturnType>
256+
<Implementation><![CDATA[
257+
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||CSS").Data
258+
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
259+
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
260+
return $$$OK
261+
]]></Implementation>
262+
</Method>
263+
264+
<Method name="WriteJS">
265+
<Description>
266+
Outputs js code for UMLExplorer application</Description>
267+
<ClassMethod>1</ClassMethod>
268+
<ReturnType>%Status</ReturnType>
269+
<Implementation><![CDATA[
270+
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||JS").Data
271+
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
272+
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
273+
return $$$OK
274+
]]></Implementation>
275+
</Method>
276+
277+
<XData name="CSS">
278+
<Data><![CDATA[
279+
<data>
280+
{{replace:css}}
281+
</data>
282+
]]></Data>
283+
</XData>
284+
285+
<XData name="JS">
286+
<Data><![CDATA[
287+
<data><![CDATA[
288+
{{replace:js}}
289+
]]]]><![CDATA[></data>
290+
]]></Data>
291+
</XData>
292+
</Class>
203293
</Export>

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ gulp.task("exportCacheXML", [
8484
.pipe(replace(/\{\{replace:HTML}}/, fs.readFileSync("build/web/index.html", "utf-8")))
8585
.pipe(replace(
8686
/\{\{replace:css}}/,
87-
fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8")
87+
function () { return fs.readFileSync("build/web/css/CacheUMLExplorer.css", "utf-8"); }
8888
))
8989
.pipe(replace(
9090
/\{\{replace:js}}/,
91-
fs.readFileSync("build/web/js/CacheUMLExplorer.js", "utf-8")
91+
function () { return fs.readFileSync("build/web/js/CacheUMLExplorer.js", "utf-8"); }
9292
))
9393
.pipe(rename(function (path) { path.basename += "-v" + pkg["version"]; }))
9494
.pipe(gulp.dest("build/Cache"));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheUMLExplorer",
3-
"version": "0.1.1",
3+
"version": "0.2",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

0 commit comments

Comments
 (0)