Skip to content

Commit

Permalink
Rename RESTful page template to RESTfulPage
Browse files Browse the repository at this point in the history
Documentation updates
Move index page data to IndexData folder
  • Loading branch information
bpbecker committed Oct 10, 2016
1 parent 8ffa107 commit 48071c6
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Core/Boot.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
:EndFor

'Pages'#.⎕NS'' Container Space for loaded classes
#.Pages.(MiPage RESTful)#.(MiPage RESTful)
#.Pages.(MiPage RESTfulPage)#.(MiPage RESTfulPage)

'CachedPages'#.⎕NS'' Container for cached pages

Expand Down
7 changes: 3 additions & 4 deletions Core/MiServer.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@

file HandleMSP REQ;⎕TRAP;inst;class;z;props;lcp;args;i;ts;date;n;expired;data;m;oldinst;names;html;sessioned;page;root;MS3;token;mask;resp;t;RESTful;APLJax;flag;path;name;ext;list;fn
Handle a "MiServer Page" request

path name ext#.Files.SplitFilename file
RETRY:

Expand Down Expand Up @@ -516,8 +515,8 @@
:If 9=⎕NC'#.HtmlPage'
:If MS3/(⎕CLASS inst)#.HtmlPage inst._RequestREQ :EndIf
:EndIf
:If 9=⎕NC'#.RESTful'
:If /(⎕CLASS inst)#.RESTful
:If 9=⎕NC'#.RESTfulPage'
:If RESTful/(⎕CLASS inst)#.RESTfulPage
inst._RequestREQ
:EndIf
:EndIf
Expand All @@ -535,7 +534,7 @@
MS3RESTful0
:If 9=⎕NC'#.HtmlPage'
:If MS3/(⎕CLASS inst)#.HtmlPage
:OrIf RESTful/(⎕CLASS inst)#.RESTful
:OrIf RESTful/(⎕CLASS inst)#.RESTfulPage
inst.(_Request _PageRef)REQ inst
:If 0REQ.RESTfulReq
REQ.RESTfulReq''
Expand Down
2 changes: 1 addition & 1 deletion Core/RESTful.dyalog → Core/RESTfulPage.dyalog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:Class RESTful
:Class RESTfulPage

Base class for RESTful web service pages

Expand Down
Binary file removed Documentation Sources/Configuration.docx
Binary file not shown.
Binary file removed Documentation Sources/Configuring MiServer.pdf
Binary file not shown.
Binary file removed Documentation Sources/Installing MiServer.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Documentation Sources/RESTful Web Services.docx
Binary file not shown.
Binary file removed Documentation Sources/~$ent Handling.docx
Binary file not shown.
2 changes: 1 addition & 1 deletion SampleMiSites/MS3/Code/MS3SiteUtils.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
C.relevant''
C.reldocs''
C.doclinks''
infoFromCSV Read'Examples/Data/info.csv'
infoFromCSV Read'IndexData/info.csv'
:For control ref src :InEach C.controls refs srcs
iinfo[;1]control
:If iinfo
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions SampleMiSites/MS3/Examples/Data/intro.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<p>MiServer is a free, open-source web server implemented in Dyalog APL. It enables the APL user to build sophisticated websites with little to no knowledge of the web technologies like HTML, JavaScript, etc. We hope that you will enjoy MiServer; join the <a class="external" target="_blank" data-dyalog-tip="External link" href="http://www.dyalog.com/forum/viewforum.php?f=34">forums&#128279;</a>, and contribute via <a class="external" target="_blank" data-dyalog-tip="External link" href="https://github.com/dyalog/miserver/">GitHub&#128279;</a>.</p>
<p>This website serves as guide to MiServer 3.0 &ndash; providing documentation, samples, and advice. At the same time, it showcases many of MiServer's capabilities. If you are just getting started with MiServer 3.0, go through the foundational documentation in the reading order of the right-hand tree.</p>
<p>Explore the tabs for documentation, the broad selection of available controls, and the vast collection of sample pages and mini-apps. See the source of any page by clicking the MS3 logo in the top left corner and access other resources by clicking the Dyalog logo in the top right corner.</p>
<p>This website serves as guide to MiServer 3.0 &ndash; providing documentation, samples, and advice. At the same time, it showcases many of MiServer's capabilities. If you are just getting started with MiServer 3.0, look through the examples to get an idea of of the variety of web content that MiServer can generate.</p>
<p>Explore the tabs for documentation, the broad selection of available controls, and the vast collection of sample pages and mini-apps. See the source of any page by clicking the MS3 logo in the top left corner and access other resources by clicking the Resources link in the top right corner.</p>
28 changes: 28 additions & 0 deletions SampleMiSites/MS3/Examples/RESTful/mortgagews.mipage
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:Class mortgagews : RESTfulPage

⍝ calculate payment
calcpmt←{0::'Error' ⋄ p r n←⍵÷1 1200 (÷12) ⋄ .01×⌈100×p×r÷1-(1+r)*-n}

⍝ calculate principle
calcprin←{0::'Error' ⋄ r n m←⍵÷1200 (÷12) 1 ⋄ .01×⌈100×m÷r÷1-(1+r)*-n}

∇ r←Respond;mask
:Access Public

r←⎕NS ''
r.msg←'Please provide either (prin rate term) or (rate term pmt)'

:if 1=+/mask←⍬∘≡¨r.(prin rate term pmt)←⍬ Get 'prin rate term pmt'

:if mask[1] ⍝ principle missing
r.(msg prin)←'' (calcprin r.(rate term pmt))

:elseif mask[4] ⍝ payment missing
r.(msg pmt)←'' (calcpmt r.(prin rate term))

:endif
:endif


:EndClass
File renamed without changes.
3 changes: 3 additions & 0 deletions SampleMiSites/MS3/IndexData/intro.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<p>MiServer is a free, open-source web server implemented in Dyalog APL. It enables the APL user to build sophisticated websites with little to no knowledge of the web technologies like HTML, JavaScript, etc. We hope that you will enjoy MiServer; join the <a class="external" target="_blank" data-dyalog-tip="External link" href="http://www.dyalog.com/forum/viewforum.php?f=34">forums&#128279;</a>, and contribute via <a class="external" target="_blank" data-dyalog-tip="External link" href="https://github.com/dyalog/miserver/">GitHub&#128279;</a>.</p>
<p>This website serves as guide to MiServer 3.0 &ndash; providing documentation, samples, and advice. At the same time, it showcases many of MiServer's capabilities. If you are just getting started with MiServer 3.0, look through the examples to get an idea of of the variety of web content that MiServer can generate.</p>
<p>Explore the tabs for documentation, the broad selection of available controls, and the vast collection of sample pages and mini-apps. See the source of any page by clicking the MS3 logo in the top left corner and access other resources by clicking the Resources link in the top right corner.</p>
File renamed without changes.
File renamed without changes.
12 changes: 7 additions & 5 deletions SampleMiSites/MS3/index.mipage
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


∇ Compose;cols;tabs;rows
∇ Compose;cols;tabs;rows;div
:Access Public

⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
Expand All @@ -22,9 +22,9 @@
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
tabs.Titles,←'Introduction'Over'getting started/recommendations'
cols←1 0⍴⍬
cols,←'about'New _.div(Read'/Examples/Data/intro.txt')
cols,←'slideshow'New _.div(Shuffle Read'Examples/Data/slideshow.txt')
cols,←'reading'New _.List(ReadingTree Read'Examples/Data/reading.txt')
cols,←'about'New _.div(Read'IndexData/intro.txt')
cols,←'slideshow'New _.div(Shuffle Read'IndexData/slideshow.txt')
cols,←'reading'New _.List(ReadingTree Read'IndexData/reading.txt')
tabs.Sections,←'intro'New _.Table cols

⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
Expand All @@ -33,7 +33,9 @@
cols,←⊂(⊂'Task demonstrated'),C.tasks
cols,←⊂(⊂'Type'),C.type
cols,←⊂(⊂'Main controls used'Over'documentation links'),C.used
tabs.Sections,←'eg'New _.DataTable(⍉↑cols)
div←New _.div _.br (_.A 'Browse Examples Directory' '/Examples/') _.br
div.Add 'eg' New _.DataTable(⍉↑cols)
tabs.Sections,←div

⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
tabs.Titles,←'Controls'Over'list of all supported controls/links to samples using them'
Expand Down
4 changes: 2 additions & 2 deletions Utils/HTTPCommand.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@
getchunklen{¯1=len¯1+(NL)/:¯1 ¯1 chunklenh2d len ()<len+chunklen+4:¯1 ¯1 len chunklen}
eis{1 ,((=|))} enclose if simple
toNum{0: 12⎕VFI }
getHeader{([;2],'')(lc ¨[;1])eis lc }
addHeader{''⍺⍺ getHeader :⍺⍺ ⍺⍺} add a header unless it's already defined
getHeader{([;2],'')(lc ¨[;1])eis lc }
addHeader{''⍺⍺ getHeader :⍺⍺ ⍺⍺} add a header unless it's already defined
makeHeaders{⎕ML1 0:0 2'' 2=⍴⍴: 2 eis }
fmtHeaders{⎕ML1 0:'' {02:'' NL,(firstCaps 1),': ',2}¨}
firstCaps{1{(¯10,'-'=) (819)¨ }'-',}
Expand Down

0 comments on commit 48071c6

Please sign in to comment.