From 604ab4f8ba15ad4beadc7bbaaabc3ab96c33fa9e Mon Sep 17 00:00:00 2001 From: stefanp Date: Fri, 22 Nov 2002 11:39:11 +0000 Subject: [PATCH] lots of formatting fixes, added functionindex to docapplication --- Application/head.skin | 3 +- Application/navig_active.skin | 12 +++-- DocApplication/actions.js | 73 +++++------------------------- DocApplication/functionindex.skin | 24 ++++++++++ DocApplication/functions.js | 58 ++++++++++++++++++++++++ DocApplication/indexSeparator.skin | 3 ++ DocApplication/macros.js | 51 ++++++++++++--------- DocApplication/summary.skin | 27 ++++++++++- DocFunction/asIndexItem.skin | 7 +++ DocFunction/asLargeListItem.skin | 2 - DocFunction/macros.js | 5 +- DocPrototype/asSummary.skin | 4 ++ DocPrototype/macros.js | 19 ++++++-- DocPrototype/main.skin | 18 ++++---- DocPrototype/typeproperties.skin | 9 ++++ Global/functions.js | 4 +- Global/navig.skin | 14 ++++-- Global/renderFunctions.js | 2 +- 18 files changed, 219 insertions(+), 116 deletions(-) create mode 100644 DocApplication/functionindex.skin create mode 100644 DocApplication/functions.js create mode 100644 DocApplication/indexSeparator.skin create mode 100644 DocFunction/asIndexItem.skin create mode 100644 DocPrototype/asSummary.skin create mode 100644 DocPrototype/typeproperties.skin diff --git a/Application/head.skin b/Application/head.skin index a52e6407..1a5b8604 100644 --- a/Application/head.skin +++ b/Application/head.skin @@ -2,7 +2,8 @@ <% this.description prefix="
" %>
-> - /main">AppDoc | + /main">showAPI | + /render">renderAPI | public | ?app=<% this.title %>&action=flush">flush | ?app=<% this.title %>&action=restart">restart | diff --git a/Application/navig_active.skin b/Application/navig_active.skin index 9bb568a8..c35d2472 100644 --- a/Application/navig_active.skin +++ b/Application/navig_active.skin @@ -1,13 +1,15 @@
"><% this.title %>
- <% this.countSessions singular=" Session" plural=" Sessions" %>, <% this.getRequestAvg singular=" Request" plural=" Requests" %>/5min + <% this.countSessions singular=" Session" plural=" Sessions" %>, + <% this.requestCount singular=" Request" plural=" Requests" %>/5min
- diff --git a/DocApplication/actions.js b/DocApplication/actions.js index cbc1d907..27df09dd 100644 --- a/DocApplication/actions.js +++ b/DocApplication/actions.js @@ -15,81 +15,30 @@ function summary_action () { } +function functionindex_action () { + res.data.body = this.renderSkinAsString ("functionindex"); + renderSkin ("api"); +} + function render_action () { - res.write ("renderrendering ... " + new Date () ); + res.writeln("renderrendering API ... "); var prefix = this.href (""); this.storePage (this, "main"); this.storePage (this, "prototypes"); this.storePage (this, "summary"); + this.storePage (this, "functionindex"); + var ct = 4; var arr = this.listChildren (); for (var i=0; i + + + +
- /render">render AppDoc - /main">AppDoc - ?app=<% this.title %>&action=flush">flush + + /main">showAPI | + /render">renderAPI | + public | + ?app=<% this.title %>&action=flush">flush | ?app=<% this.title %>&action=restart">restart
+ Application <% this.headline %>
+
+ +">SUMMARY | +">INDEX | +A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z| + + + <% this.functions skin="asIndexItem" + separator="" + %> +
+ +">SUMMARY | +">INDEX | +A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z| + diff --git a/DocApplication/functions.js b/DocApplication/functions.js new file mode 100644 index 00000000..16dbe089 --- /dev/null +++ b/DocApplication/functions.js @@ -0,0 +1,58 @@ + + +function getDocPrototype (obj) { + var tmp = obj; + while (tmp!=null && tmp.getType () != this.PROTOTYPE) { + tmp = tmp.getParentElement (); + } + return tmp; +} + +function getDir (dir, obj) { + dir.mkdir (); + if (obj.getType () == this.APPLICATION) { + return dir; + } else if (obj.getType () == this.PROTOTYPE) { + var protoObj = this.getDocPrototype (obj); + var dir = new File (dir, protoObj.getElementName ()); + dir.mkdir (); + return dir; + } else { + var protoObj = this.getDocPrototype (obj); + var dir = this.getDir (dir, protoObj); + dir = new File (dir, obj.getElementName ()); + dir.mkdir (); + return dir; + } +} + + +function storePage (obj, action, backPath) { + var str = this.getPage (obj, action, backPath); + var appObj = this.getParentElement (); + var dir = new File (appObj.getAppDir ().getAbsolutePath (), ".docs"); + dir = this.getDir (dir, obj); + var f = new File (dir, action + ".html"); + f.remove (); + f.open (); + f.write (str); + f.close (); + app.log ("wrote file " + f.toString ()); +} + + +function getPage (obj, action, backPath) { + backPath = (backPath==null) ? "" : backPath; + res.pushStringBuffer (); + eval ("obj." + action + "_action ();"); + var str = res.popStringBuffer (); + var reg = new RegExp ("href=\"" + this.href ("") + "([^\"]+)\""); + reg.global = true; + str = str.replace (reg, "href=\"" + backPath + "$1.html\""); + var reg = new RegExp ("src=\"" + this.href ("") + "([^\"]+)\""); + reg.global = true; + str = str.replace (reg, "src=\"" + backPath + "$1.html\""); + return str; +} + + diff --git a/DocApplication/indexSeparator.skin b/DocApplication/indexSeparator.skin new file mode 100644 index 00000000..beb8ee73 --- /dev/null +++ b/DocApplication/indexSeparator.skin @@ -0,0 +1,3 @@ + +<% param.letter %> + \ No newline at end of file diff --git a/DocApplication/macros.js b/DocApplication/macros.js index d14126df..f7b78ccd 100644 --- a/DocApplication/macros.js +++ b/DocApplication/macros.js @@ -42,35 +42,42 @@ function hrefRoot_macro (param) { /** * list all prototypes of this application * @param skin name of skin to render on prototype + * @param separator */ -function prototypes_macro(par) { - var skin = (par && par.skin&&par.skin!="") ? par.skin : "asPrototypeList"; +function prototypes_macro(param) { + var skin = (param.skin) ? param.skin : "asPrototypeList"; + var separator = (param.separator) ? param.separator : ""; var arr = this.listChildren (); for ( var i=0; iApplication <% this.headline %> + + + + + + +
+ Application <% this.headline %>
+
+ +">SUMMARY | +">INDEX | + + <% this.comment encoding="html" %> +
+ + + <% this.prototypes skin="asSummary" + separator="" + %> +
+ + +">SUMMARY | +">INDEX | + diff --git a/DocFunction/asIndexItem.skin b/DocFunction/asIndexItem.skin new file mode 100644 index 00000000..95a998ea --- /dev/null +++ b/DocFunction/asIndexItem.skin @@ -0,0 +1,7 @@ + +<% this.link handler="false" %> +- <% this.type %> in <% docprototype.name %> +
+<% this.comment length="200" %> + + diff --git a/DocFunction/asLargeListItem.skin b/DocFunction/asLargeListItem.skin index 584d72f1..e11013b3 100644 --- a/DocFunction/asLargeListItem.skin +++ b/DocFunction/asLargeListItem.skin @@ -3,5 +3,3 @@ <% this.comment length="200" %> - - diff --git a/DocFunction/macros.js b/DocFunction/macros.js index 679de5ba..7eb66819 100644 --- a/DocFunction/macros.js +++ b/DocFunction/macros.js @@ -24,6 +24,7 @@ function link_macro (param) { return renderLink (this, param); } //// END OF COPIED FUNCTIONS + function headline_macro (param) { var p = this.getParentElement (); var handler = (p!=null) ? p.getName () : ""; @@ -77,7 +78,9 @@ function parameters_macro (param) { } - +function type_macro (param) { + return this.getTypeName (); +} /** diff --git a/DocPrototype/asSummary.skin b/DocPrototype/asSummary.skin new file mode 100644 index 00000000..5ce50bd5 --- /dev/null +++ b/DocPrototype/asSummary.skin @@ -0,0 +1,4 @@ + +"><% this.name %>
+<% this.comment length="200" %> + diff --git a/DocPrototype/macros.js b/DocPrototype/macros.js index 9d509458..b7f852e1 100644 --- a/DocPrototype/macros.js +++ b/DocPrototype/macros.js @@ -91,23 +91,32 @@ function inheritanceUtil (obj, param) { /** * loops through the parent prototypes and renders a skin on each + * if it has got any functions. * @param skin */ function parentPrototype_macro (param) { var skinname = (param.skin) ? param.skin : "asParentList"; var obj = this.getParentPrototype (); while (obj!=null) { - obj.renderSkin (skinname); + if (obj.listChildren ().length>0) { + obj.renderSkin (skinname); + } obj = obj.getParentPrototype (); } } - +/** + * macro rendering a skin depending on wheter this prototype has got + * type-properties or not. + * @param skin + */ function typeProperties_macro (param) { var props = this.getTypeProperties (); - if (props!=null) { - res.encode(props.getContent ()); + if (props!=null && props.getContent ()!="" ) { + var tmp = new Object (); + tmp.content = props.getContent (); + var skinname = (param.skinname) ? param.skinname : "typeproperties"; + this.renderSkin (skinname, tmp); } } - diff --git a/DocPrototype/main.skin b/DocPrototype/main.skin index ec24d999..318ffaed 100644 --- a/DocPrototype/main.skin +++ b/DocPrototype/main.skin @@ -14,6 +14,7 @@ TEMPLATES | TYPE.PROPERTIES +

@@ -36,44 +37,43 @@ filter="actions" skin="asLargeListItem" prefix="" + suffix=" %> <% this.methods separator="" filter="functions" skin="asLargeListItem" prefix="" + suffix=" %> <% this.methods separator="" filter="macros" skin="asLargeListItem" prefix="" + suffix=" %> <% this.methods separator="" filter="skins" skin="asLargeListItemSkin" prefix="" + suffix=" %> <% this.methods separator="" filter="templates" skin="asLargeListItem" prefix="" + suffix=" %> <% this.parentPrototype skin="asParentList" %>
Actions
 
Functions
 
Macros
 
Skins
 
Templates
 
-

- - - - - -
type.properties
<% this.typeProperties prefix="
" suffix="
" %>
- - +

+ +<% this.typeProperties %> diff --git a/DocPrototype/typeproperties.skin b/DocPrototype/typeproperties.skin new file mode 100644 index 00000000..4eead93f --- /dev/null +++ b/DocPrototype/typeproperties.skin @@ -0,0 +1,9 @@ + + + + + + + +
type.properties
<% param.content encoding="html" %>
+ diff --git a/Global/functions.js b/Global/functions.js index 5e678c23..b95b947a 100644 --- a/Global/functions.js +++ b/Global/functions.js @@ -75,9 +75,9 @@ function appStat () { * utility function to sort object-arrays by name */ function sortByName(a,b) { - if ( a.name>b.name) + if ( a.getName () > b.getName ()) return 1; - else if ( a.name==b.name ) + else if (a.getName () == b.getName ()) return 0; else return -1; diff --git a/Global/navig.skin b/Global/navig.skin index 441b2e22..f19ff3df 100644 --- a/Global/navig.skin +++ b/Global/navig.skin @@ -1,22 +1,26 @@

">" title="helma" border="0" width="174" height="35" align="baseline" style="border-width:3px;border-color:white;"> - helma.org - docs - mailinglist

<% root.appCount filter="active" singular=" app" plural=" apps"%> on - "><% root.hostname %> + "><% root.hostname %> (<% root.hostaddress %>)
<% root.appList filter="active" %>

-
and <% root.appCount filter="disabled" %> disabled apps:
<% root.appList filter="disabled" skin="navig_disabled" %> +

+

+ Information on helma.org:
+

  • reference
    +
  • mailinglist
    +
  • cvs
    +
  • download
    +

    diff --git a/Global/renderFunctions.js b/Global/renderFunctions.js index c8c17ea7..84731b8b 100644 --- a/Global/renderFunctions.js +++ b/Global/renderFunctions.js @@ -7,7 +7,7 @@ function renderLink (docEl, param) { } else if (docEl.getType () == docEl.SKIN) { text = docEl.getName () + ".skin"; } else if (docEl.getType () == docEl.MACRO) { - if (docEl.getParentElement () && docEl.getParentElement().getName()!="global") { + if (param.handler!="false" && docEl.getParentElement () && docEl.getParentElement().getName()!="global") { text = docEl.getParentElement ().getName () + "."; } var str = docEl.getName ();