lots of formatting fixes,

added functionindex to docapplication
This commit is contained in:
stefanp 2002-11-22 11:39:11 +00:00
parent 7633e98eea
commit 604ab4f8ba
18 changed files with 219 additions and 116 deletions

View file

@ -2,7 +2,8 @@
<% this.description prefix="<br/>" %>
<br/>
-&gt;
<a href="<% this.href action="api" %>/main">AppDoc</a> |
<a href="<% this.href action="api" %>/main">showAPI</a> |
<a href="<% this.href action="api" %>/render">renderAPI</a> |
<a href="<% this.url %>">public</a> |
<a href="<% root.href action="main" %>?app=<% this.title %>&action=flush">flush</a> |
<a href="<% root.href action="main" %>?app=<% this.title %>&action=restart">restart</a> |

View file

@ -1,13 +1,15 @@
<div class="list_apps">
<b><a href="<% this.href action="main" %>"><% this.title %></a></b><br />
<small><% this.countSessions singular=" Session" plural=" Sessions" %>, <% this.getRequestAvg singular=" Request" plural=" Requests" %>/5min</small>
<small><% this.countSessions singular=" Session" plural=" Sessions" %>,
<% this.requestCount singular=" Request" plural=" Requests" %>/5min</small>
<div align="right">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right" valign="top"><small>
<a href="<% this.href action="api" %>/render">render AppDoc</a>
<a href="<% this.href action="api" %>/main">AppDoc</a>
<a href="<% root.href action="main" %>?app=<% this.title %>&action=flush">flush</a>
<td align="right" valign="top"><small style="font-size:9px;">
<a href="<% this.href action="api" %>/main">showAPI</a> |
<a href="<% this.href action="api" %>/render">renderAPI</a> |
<a href="<% this.url %>">public</a> |
<a href="<% root.href action="main" %>?app=<% this.title %>&action=flush">flush</a> |
<a href="<% root.href action="main" %>?app=<% this.title %>&action=restart">restart</a>
</small></td>
</tr>

View file

@ -15,81 +15,30 @@ function summary_action () {
}
function functionindex_action () {
res.data.body = this.renderSkinAsString ("functionindex");
renderSkin ("api");
}
function render_action () {
res.write ("<html><head><title>render</title></head><body>rendering ... " + new Date () );
res.writeln("<html><head><title>render</title></head><body>rendering 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<arr.length; i++) {
this.storePage (arr[i], "list", "../");
this.storePage (arr[i], "main", "../");
res.writeln (arr[i]);
ct += 2;
var subarr = arr[i].listChildren ();
for (var j=0; j<subarr.length; j++) {
this.storePage (subarr[j], "main", "../../");
res.writeln (subarr[j]);
ct += 1;
}
}
res.writeln (" ... wrote " + ct + " files");
}
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);
res.writeln("dir="+dir);
dir = new File (dir, obj.getElementName ());
res.writeln("dir="+dir);
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 ();
}
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;
}

View file

@ -0,0 +1,24 @@
<table width="90%" border="0" cellspacing="1" cellpadding="5">
<tr>
<td class="headline">
<big class="top">Application <% this.headline %></tt></b></big><br>
</td>
</tr>
</table>
<a class="navig" href="<% this.href action="summary"%>">SUMMARY</a> |
<a class="navig" href="<% this.href action="functionindex" %>">INDEX</a> |
<a class="navig" href="#A">A</a>|<a class="navig" href="#B">B</a>|<a class="navig" href="#C">C</a>|<a class="navig" href="#D">D</a>|<a class="navig" href="#E">E</a>|<a class="navig" href="#F">F</a>|<a class="navig" href="#G">G</a>|<a class="navig" href="#H">H</a>|<a class="navig" href="#I">I</a>|<a class="navig" href="#J">J</a>|<a class="navig" href="#K">K</a>|<a class="navig" href="#L">L</a>|<a class="navig" href="#M">M</a>|<a class="navig" href="#N">N</a>|<a class="navig" href="#O">O</a>|<a class="navig" href="#P">P</a>|<a class="navig" href="#Q">Q</a>|<a class="navig" href="#R">R</a>|<a class="navig" href="#S">S</a>|<a class="navig" href="#T">T</a>|<a class="navig" href="#U">U</a>|<a class="navig" href="#V">V</a>|<a class="navig" href="#W">W</a>|<a class="navig" href="#X">X</a>|<a class="navig" href="#Y">Y</a>|<a class="navig" href="#Z">Z</a>|
<table width="90%" border="0" cellspacing="1" cellpadding="5">
<% this.functions skin="asIndexItem"
separator="<tr><td class='mainbox'><img src='' width=0 height=0></td></tr>"
%>
</table>
<a class="navig" href="<% this.href action="summary"%>">SUMMARY</a> |
<a class="navig" href="<% this.href action="functionindex" %>">INDEX</a> |
<a class="navig" href="#A">A</a>|<a class="navig" href="#B">B</a>|<a class="navig" href="#C">C</a>|<a class="navig" href="#D">D</a>|<a class="navig" href="#E">E</a>|<a class="navig" href="#F">F</a>|<a class="navig" href="#G">G</a>|<a class="navig" href="#H">H</a>|<a class="navig" href="#I">I</a>|<a class="navig" href="#J">J</a>|<a class="navig" href="#K">K</a>|<a class="navig" href="#L">L</a>|<a class="navig" href="#M">M</a>|<a class="navig" href="#N">N</a>|<a class="navig" href="#O">O</a>|<a class="navig" href="#P">P</a>|<a class="navig" href="#Q">Q</a>|<a class="navig" href="#R">R</a>|<a class="navig" href="#S">S</a>|<a class="navig" href="#T">T</a>|<a class="navig" href="#U">U</a>|<a class="navig" href="#V">V</a>|<a class="navig" href="#W">W</a>|<a class="navig" href="#X">X</a>|<a class="navig" href="#Y">Y</a>|<a class="navig" href="#Z">Z</a>|

View file

@ -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;
}

View file

@ -0,0 +1,3 @@
<tr><td class='headline'><a name="<% param.letter %>"><!-- --></a>
<big><% param.letter %></big>
</td></tr>

View file

@ -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; i<arr.length; i++ ) {
arr[i].renderSkin(skin);
if (i < arr.length-1)
res.write (separator);
}
}
///**
// * list all methods of all prototypes, sort and separate them alphabetically
// * @param skin name of skin to render on method
// * @param skinSeparator name of skin to render separator between start-letters
// */
//function index_macro(par) {
// var skin = (par && par.skin && par.skin!="") ? par.skin : "indexList";
// var skinSeparator = (par && par.skinSeparator && par.skinSeparator!="") ? par.skinSeparator : "indexListSeparator";
// var arr = this.listFunctions();
// var lastLetter = '';
// for ( var i=0; i<arr.length; i++ ) {
// if ( arr[i].name.substring(0,1)!=lastLetter ) {
// lastLetter = arr[i].name.substring(0,1);
// var obj = new Object();
// obj.letter = lastLetter.toUpperCase();
// arr[i].renderSkin(skinSeparator,obj);
// }
// arr[i].renderSkin(skin);
// }
//}
/**
* list all methods of all prototypes, sort them alphabetically
* @param skin name of skin to render on each method
* @param skinSeparator name of skin to render as separator between each letters
*/
function functions_macro(param) {
var skinname = (param.skin) ? param.skin : "asListItem";
var skinIndexSeparator = (param.indexSeparator) ? param.indexSeparator : "indexSeparator";
var separator = (param.separator) ? param.separator : "";
var arr = this.listFunctions ();
var lastLetter = "";
for (var i=0; i<arr.length; i++) {
if (arr[i].getName ().substring (0,1)!=lastLetter) {
lastLetter = arr[i].getName ().substring (0,1);
var tmp = new Object ();
tmp.letter = lastLetter.toUpperCase ();
this.renderSkin (skinIndexSeparator, tmp);
}
arr[i].renderSkin (skinname);
if (i < arr.length-1)
res.write (separator);
}
}

View file

@ -1,4 +1,29 @@
<h2>Application <% this.headline %></h2>
<table width="90%" border="0" cellspacing="1" cellpadding="5">
<tr>
<td class="headline">
<big class="top">Application <% this.headline %></tt></b></big><br>
</td>
</tr>
</table>
<a class="navig" href="<% this.href action="summary"%>">SUMMARY</a> |
<a class="navig" href="<% this.href action="functionindex" %>">INDEX</a> |
<% this.comment encoding="html" %>
<hr>
<table width="90%" border="0" cellspacing="1" cellpadding="5">
<% this.prototypes skin="asSummary"
separator="<tr><td class='mainbox'><img src='' width=0 height=0></td></tr>"
%>
</table>
<a class="navig" href="<% this.href action="summary"%>">SUMMARY</a> |
<a class="navig" href="<% this.href action="functionindex" %>">INDEX</a> |

View file

@ -0,0 +1,7 @@
<tr><td>
<% this.link handler="false" %>
- <% this.type %> in <% docprototype.name %>
<br/>
<% this.comment length="200" %>
</td></tr>

View file

@ -3,5 +3,3 @@
<% this.comment length="200" %>
</td></tr>

View file

@ -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 ();
}
/**

View file

@ -0,0 +1,4 @@
<tr><td>
<a href="<% this.href action="main" %>"><% this.name %></a><br/>
<% this.comment length="200" %>
</td></tr>

View file

@ -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);
}
}

View file

@ -14,6 +14,7 @@
<a class="navig" href="#templates">TEMPLATES</a> |
<a class="navig" href="#typeproperties">TYPE.PROPERTIES</a>
<br/><br/>
<table width="90%" border="0" cellspacing="1" cellpadding="5">
@ -36,44 +37,43 @@
filter="actions"
skin="asLargeListItem"
prefix="<tr><td class='headline'>Actions<a name='actions'><!-- --></a></td></tr>"
suffix="<tr><td height='8'>&nbsp;</td></tr>
%>
<% this.methods separator="<tr><td class='mainbox'><img src='' width=0 height=0></td></tr>"
filter="functions"
skin="asLargeListItem"
prefix="<tr><td class='headline'>Functions<a name='functions'><!-- --></a></td></tr>"
suffix="<tr><td height='8'>&nbsp;</td></tr>
%>
<% this.methods separator="<tr><td class='mainbox'><img src='' width=0 height=0></td></tr>"
filter="macros"
skin="asLargeListItem"
prefix="<tr><td class='headline'>Macros<a name='macros'><!-- --></a></td></tr>"
suffix="<tr><td height='8'>&nbsp;</td></tr>
%>
<% this.methods separator="<tr><td class='mainbox'><img src='' width=0 height=0></td></tr>"
filter="skins"
skin="asLargeListItemSkin"
prefix="<tr><td class='headline'>Skins<a name='skins'><!-- --></a></td></tr>"
suffix="<tr><td height='8'>&nbsp;</td></tr>
%>
<% this.methods separator="<tr><td class='mainbox'><img src='' width=0 height=0></td></tr>"
filter="templates"
skin="asLargeListItem"
prefix="<tr><td class='headline'>Templates<a name='templates'><!-- --></a></td></tr>"
suffix="<tr><td height='8'>&nbsp;</td></tr>
%>
<% this.parentPrototype skin="asParentList" %>
</table>
<br/><br/><a name='typeproperties'><!-- --></a><table width='90%' border='0' cellspacing='1' cellpadding='5'><tr>
<td class="headline">type.properties</td>
</tr>
<tr>
<td class="mainbox"><% this.typeProperties prefix="<pre>" suffix="</pre>" %></td>
</tr>
</table>
<br/><br/>
<% this.typeProperties %>

View file

@ -0,0 +1,9 @@
<a name='typeproperties'><!-- --></a>
<table width='90%' border='0' cellspacing='1' cellpadding='5'><tr>
<td class="headline">type.properties</td>
</tr>
<tr>
<td class="mainbox"><pre><% param.content encoding="html" %></pre></td>
</tr>
</table>

View file

@ -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;

View file

@ -1,22 +1,26 @@
<p><a href="<% root.href action="main" %>"><img src="<% root.href action="image" %>" title="helma" border="0" width="174" height="35" align="baseline" style="border-width:3px;border-color:white;"></a>
<a href="http://helma.org/">helma.org</a>
<a href="http://helma.org/docs">docs</a>
<a href="http://helma.org/lists/listinfo/hop">mailinglist</a>
</p>
<div class="list_apps">
<i><% root.appCount filter="active" singular=" app" plural=" apps"%> on
<a href="<% root.href action="main" %>"><% root.hostname %></a></i>
<a href="<% root.href action="main" %>"><% root.hostname %> (<% root.hostaddress %>)</a></i>
</div>
<% root.appList filter="active" %>
<p></p>
<div class="list_apps">
<i>and <% root.appCount filter="disabled" %> disabled apps:</i>
</div>
<% root.appList filter="disabled" skin="navig_disabled" %>
<br/><br/>
<p>
Information on <a href="http://helma.org/">helma.org</a>:<br/>
<li><a href="http://helma.org/docs">reference</a><br/>
<li><a href="http://helma.org/lists/listinfo/hop">mailinglist</a><br/>
<li><a href="http://adele.helma.org/source/cvsweb.cgi/?cvsroot=hop">cvs</a><br/>
<li><a href="http://helma.org/download/">download</a><br/>
</p>

View file

@ -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 ();