Skip to content

Commit

Permalink
complete build system, package that require only one web application
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitaeverywhere committed Apr 21, 2015
1 parent 37ec372 commit 73955a2
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 14 deletions.
112 changes: 101 additions & 11 deletions cache/projectTemplate.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2015.2 (Build 540)" ts="2015-04-12 16:26:04">

<CSP name="CacheUMLExplorer.css" application="">
<![CDATA[{{replace:css}}]]>
</CSP>

<CSP name="CacheUMLExplorer.js" application="">
<![CDATA[{{replace:js}}]]>
</CSP>

<Class name="UMLExplorer.ClassView">
<Description>
Class contains methods that return structured class data.</Description>
<TimeChanged>63654,59126.207802</TimeChanged>
<TimeChanged>63663,69939</TimeChanged>
<TimeCreated>63653,67019.989197</TimeCreated>

<Method name="getClassData">
Expand Down Expand Up @@ -93,6 +85,7 @@ Class contains methods that return structured class data.</Description>
<Items>
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
<ProjectItem name="UMLExplorer.StaticContent" type="CLS"></ProjectItem>
</Items>
</Project>

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

<XData name="UrlMap">
<Data><![CDATA[
<Routes>
<Route Url="/" Method="GET" Call="Index"/>
<Route Url="/index" Method="GET" Call="Index"/>
<Route Url="/css/CacheUMLExplorer.css" Method="GET" Call="GetCss"/>
<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"/>
Expand Down Expand Up @@ -187,17 +182,112 @@ Method to test accessibility of REST interface.</Description>
]]></Implementation>
</Method>

<Method name="GetCss">
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set %response.CharSet = "utf-8"
set %response.ContentType = "text/css"
do ##class(UMLExplorer.StaticContent).WriteCSS()
return $$$OK
]]></Implementation>
</Method>

<Method name="GetJs">
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
set %response.CharSet = "utf-8"
set %response.ContentType = "text/javascript"
do ##class(UMLExplorer.StaticContent).WriteJS()
return $$$OK
]]></Implementation>
</Method>

<Method name="Index">
<Description>
Method returns user application.</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
&html<
{{replace:HTML}}
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Cache UML explorer</title>
<link rel="stylesheet" href="css/CacheUMLExplorer.css">
<script src="js/CacheUMLExplorer.js"></script>
</head>
<body onload="var cue = new CacheUMLExplorer(document.getElementById('treeView'), document.getElementById('classView'))">
<div class="ui-body">
<div class="ui-sideBlock">
<div id="treeView">
</div>
</div>
<div class="ui-mainBlock">
<div class="ui-ClassInfo">
<span id="className"></span>
</div>
<div id="classView">
</div>
</div>
</div>
</body>
</html>
>
return $$$OK
]]></Implementation>
</Method>
</Class>


<Class name="UMLExplorer.StaticContent">
<TimeChanged>63663,76108.945861</TimeChanged>
<TimeCreated>63663,71456.865723</TimeCreated>

<Method name="WriteCSS">
<Description>
Outputs css code for UMLExplorer application</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||CSS").Data
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
return $$$OK
]]></Implementation>
</Method>

<Method name="WriteJS">
<Description>
Outputs js code for UMLExplorer application</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
Set xdata = ##class(%Dictionary.CompiledXData).%OpenId("UMLExplorer.StaticContent||JS").Data
set status=##class(%XML.TextReader).ParseStream(xdata, .textreader)
while textreader.Read() { if (textreader.NodeType="chars") { w textreader.Value } }
return $$$OK
]]></Implementation>
</Method>

<XData name="CSS">
<Data><![CDATA[
<data>
{{replace:css}}
</data>
]]></Data>
</XData>

<XData name="JS">
<Data><![CDATA[
<data><![CDATA[
{{replace:js}}
]]]]><![CDATA[></data>
]]></Data>
</XData>
</Class>
</Export>
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
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.1.1",
"version": "0.2",
"description": "An UML Class explorer for InterSystems Caché",
"directories": {
"test": "test"
Expand Down

0 comments on commit 73955a2

Please sign in to comment.