* Bring manage app up to date with current Helma.
This commit is contained in:
parent
c632c8f8bd
commit
437dfb94d3
33 changed files with 1185 additions and 1152 deletions
|
@ -1,18 +1,18 @@
|
|||
function list_action () {
|
||||
if (checkAddress()==false)
|
||||
return;
|
||||
if (checkAuth()==false)
|
||||
return;
|
||||
res.data.body = this.renderSkinAsString ("list");
|
||||
renderSkin ("api");
|
||||
function list_action() {
|
||||
if (checkAddress() == false)
|
||||
return;
|
||||
if (checkAuth() == false)
|
||||
return;
|
||||
res.data.body = this.renderSkinAsString("list");
|
||||
renderSkin("api");
|
||||
}
|
||||
|
||||
function main_action () {
|
||||
if (checkAddress()==false)
|
||||
return;
|
||||
if (checkAuth()==false)
|
||||
return;
|
||||
res.data.body = this.renderSkinAsString ("main");
|
||||
renderSkin ("api");
|
||||
function main_action() {
|
||||
if (checkAddress() == false)
|
||||
return;
|
||||
if (checkAuth() == false)
|
||||
return;
|
||||
res.data.body = this.renderSkinAsString("main");
|
||||
renderSkin("api");
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<% this.methods separator=", " filter="functions" skin="asParentListItem" prefix="<b>Functions: </b>" suffix="<br/>" %>
|
||||
<% this.methods separator=", " filter="macros" skin="asParentListItem" prefix="<b>Macros: </b>" suffix="<br/>" %>
|
||||
<% this.methods separator=", " filter="skins" skin="asParentListItem" prefix="<b>Skins: </b>" suffix="<br/>" %>
|
||||
<% this.methods separator=", " filter="templates" skin="asParentListItem" prefix="<b>Templates: </b>" suffix="<br/>" %>
|
||||
|
||||
</td></tr>
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
///**
|
||||
// * utility function for head_macro, rendering link to app and to prototype
|
||||
// */
|
||||
|
@ -10,25 +9,24 @@
|
|||
//}
|
||||
|
||||
|
||||
|
||||
function translateType (filter) {
|
||||
if (filter=="actions")
|
||||
return Packages.helma.doc.DocElement.ACTION;
|
||||
else if (filter=="templates")
|
||||
return Packages.helma.doc.DocElement.TEMPLATE;
|
||||
else if (filter=="functions")
|
||||
return Packages.helma.doc.DocElement.FUNCTION;
|
||||
else if (filter=="macros")
|
||||
return Packages.helma.doc.DocElement.MACRO;
|
||||
else if (filter=="skins")
|
||||
return Packages.helma.doc.DocElement.SKIN;
|
||||
else
|
||||
return -1;
|
||||
function translateType(filter) {
|
||||
if (filter == "actions")
|
||||
return Packages.helma.doc.DocElement.ACTION;
|
||||
else if (filter == "functions")
|
||||
return Packages.helma.doc.DocElement.FUNCTION;
|
||||
else if (filter == "macros")
|
||||
return Packages.helma.doc.DocElement.MACRO;
|
||||
else if (filter == "skins")
|
||||
return Packages.helma.doc.DocElement.SKIN;
|
||||
else if (filter == "properties")
|
||||
return Packages.helma.doc.DocElement.PROPERTIES;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
function getApplication () {
|
||||
return this.getParentElement ();
|
||||
function getApplication() {
|
||||
return this.getParentElement();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,5 +7,4 @@
|
|||
<% this.methods filter="functions" skin="asListItem" prefix="<p><b>Functions:</b><br/>" suffix="</p> %>
|
||||
<% this.methods filter="macros" skin="asListItem" prefix="<p><b>Macros:</b><br/>" suffix="</p> %>
|
||||
<% this.methods filter="skins" skin="asListItem" prefix="<p><b>Skins:</b><br/>" suffix="</p> %>
|
||||
<% this.methods filter="templates" skin="asListItem" prefix="<p><b>Templates:</b><br/>" suffix="</p> %>
|
||||
|
||||
|
|
|
@ -1,91 +1,105 @@
|
|||
|
||||
/**
|
||||
* macro rendering a skin
|
||||
* @param name name of skin
|
||||
*/
|
||||
function skin_macro(par) {
|
||||
if ( par && par.name ) {
|
||||
this.renderSkin(par.name);
|
||||
}
|
||||
* macro rendering a skin
|
||||
* @param name name of skin
|
||||
*/
|
||||
function skin_macro(par) {
|
||||
if (par && par.name) {
|
||||
this.renderSkin(par.name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* macro-wrapper for href-function
|
||||
* @param action name of action to call on this prototype, default main
|
||||
*/
|
||||
function href_macro(param) { return this.href ((param && param.action) ? param.action : "main"); }
|
||||
function href_macro(param) {
|
||||
return this.href((param && param.action) ? param.action : "main");
|
||||
}
|
||||
|
||||
function comment_macro (param) { return renderComment (this, param); }
|
||||
function content_macro (param) { return this.getContent (); }
|
||||
function tags_macro (param) { return renderTags (this, param); }
|
||||
function location_macro (param) { return renderLocation (this, param); }
|
||||
function link_macro (param) { return renderLink (this, param); }
|
||||
function comment_macro(param) {
|
||||
return renderComment(this, param);
|
||||
}
|
||||
|
||||
function content_macro(param) {
|
||||
return this.getContent();
|
||||
}
|
||||
|
||||
function tags_macro(param) {
|
||||
return renderTags(this, param);
|
||||
}
|
||||
|
||||
function location_macro(param) {
|
||||
return renderLocation(this, param);
|
||||
}
|
||||
|
||||
function link_macro(param) {
|
||||
return renderLink(this, param);
|
||||
}
|
||||
|
||||
//// END OF COPIED FUNCTIONS
|
||||
|
||||
|
||||
|
||||
function headline_macro (param) {
|
||||
res.write (this.getName ());
|
||||
function headline_macro(param) {
|
||||
res.write(this.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* macro formatting list of methods of this prototype
|
||||
* @param filter actions | functions | macros | templates | skins
|
||||
* @param filter actions | functions | macros | skins
|
||||
* @param skin skin to apply to the docfunction object
|
||||
* @param separator
|
||||
* @param desc Description that is passed on to the called skin
|
||||
*/
|
||||
function methods_macro (param) {
|
||||
var skinname = (param.skin) ? param.skin : "list";
|
||||
var separator = (param.separator) ? param.separator : "";
|
||||
var arr = this.listChildren ();
|
||||
var type = this.translateType (param.filter);
|
||||
var sb = new java.lang.StringBuffer ();
|
||||
for (var i=0; i<arr.length; i++) {
|
||||
if (arr[i].getType () == type) {
|
||||
sb.append (arr[i].renderSkinAsString (skinname, param));
|
||||
sb.append (separator);
|
||||
}
|
||||
}
|
||||
var str = sb.toString ();
|
||||
if (str.length>0)
|
||||
return str.substring (0, str.length - separator.length);
|
||||
else
|
||||
return str;
|
||||
function methods_macro(param) {
|
||||
var skinname = (param.skin) ? param.skin : "list";
|
||||
var separator = (param.separator) ? param.separator : "";
|
||||
var arr = this.listChildren();
|
||||
var type = this.translateType(param.filter);
|
||||
var sb = new java.lang.StringBuffer ();
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (arr[i].getType() == type) {
|
||||
sb.append(arr[i].renderSkinAsString(skinname, param));
|
||||
sb.append(separator);
|
||||
}
|
||||
}
|
||||
var str = sb.toString();
|
||||
if (str.length > 0)
|
||||
return str.substring(0, str.length - separator.length);
|
||||
else
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
function inheritance_macro (param) {
|
||||
var action = param.action ? param.action : "main";
|
||||
var target = param.target ? ('target="' + param.target + '" ') : '';
|
||||
var obj = this.getParentPrototype ();
|
||||
if (obj!=null) {
|
||||
obj = this.inheritanceUtil (obj, param);
|
||||
}
|
||||
if (param.deep=="true") {
|
||||
while (obj!=null) {
|
||||
obj = this.inheritanceUtil (obj, param);
|
||||
}
|
||||
}
|
||||
function inheritance_macro(param) {
|
||||
var action = param.action ? param.action : "main";
|
||||
var target = param.target ? ('target="' + param.target + '" ') : '';
|
||||
var obj = this.getParentPrototype();
|
||||
if (obj != null) {
|
||||
obj = this.inheritanceUtil(obj, param);
|
||||
}
|
||||
if (param.deep == "true") {
|
||||
while (obj != null) {
|
||||
obj = this.inheritanceUtil(obj, param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function inheritanceUtil (obj, param) {
|
||||
if (obj.getName ()=="hopobject" && param.hopobject!="true")
|
||||
return null;
|
||||
var tmp = new Object ();
|
||||
for (var i in param)
|
||||
tmp[i] = param[i];
|
||||
tmp.href = obj.href ((param.action) ? param.action : "main");
|
||||
delete tmp.hopobject;
|
||||
delete tmp.action;
|
||||
delete tmp.deep;
|
||||
delete tmp.separator;
|
||||
res.write (renderLinkTag (tmp));
|
||||
res.write (obj.getName () + "</a>");
|
||||
if (obj.getParentPrototype ())
|
||||
res.write (param.separator);
|
||||
return obj.getParentPrototype ();
|
||||
function inheritanceUtil(obj, param) {
|
||||
if (obj.getName() == "hopobject" && param.hopobject != "true")
|
||||
return null;
|
||||
var tmp = new Object ();
|
||||
for (var i in param)
|
||||
tmp[i] = param[i];
|
||||
tmp.href = obj.href((param.action) ? param.action : "main");
|
||||
delete tmp.hopobject;
|
||||
delete tmp.action;
|
||||
delete tmp.deep;
|
||||
delete tmp.separator;
|
||||
res.write(renderLinkTag(tmp));
|
||||
res.write(obj.getName() + "</a>");
|
||||
if (obj.getParentPrototype())
|
||||
res.write(param.separator);
|
||||
return obj.getParentPrototype();
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,15 +108,15 @@ function inheritanceUtil (obj, param) {
|
|||
* 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) {
|
||||
if (obj.listChildren ().length>0) {
|
||||
obj.renderSkin (skinname);
|
||||
}
|
||||
obj = obj.getParentPrototype ();
|
||||
}
|
||||
function parentPrototype_macro(param) {
|
||||
var skinname = (param.skin) ? param.skin : "asParentList";
|
||||
var obj = this.getParentPrototype();
|
||||
while (obj != null) {
|
||||
if (obj.listChildren().length > 0) {
|
||||
obj.renderSkin(skinname);
|
||||
}
|
||||
obj = obj.getParentPrototype();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -110,33 +124,42 @@ function parentPrototype_macro (param) {
|
|||
* type-properties or not.
|
||||
* @param skin
|
||||
*/
|
||||
function typeProperties_macro (param) {
|
||||
var props = this.getTypeProperties ();
|
||||
if (props!=null && props.getContent ()!="" ) {
|
||||
var sb = new java.lang.StringBuffer ();
|
||||
// map of all mappings....
|
||||
var mappings = props.getMappings ();
|
||||
// parse type.properties linewise:
|
||||
var arr = props.getContent ().split ("\n");
|
||||
for (var i=0; i<arr.length; i++) {
|
||||
arr [i] = arr[i].trim ();
|
||||
// look up in mappings table if line matches:
|
||||
for (var e = mappings.keys (); e.hasMoreElements (); ) {
|
||||
var key = e.nextElement ();
|
||||
var reg = new RegExp ('^' + key + '\\s');
|
||||
if (arr[i].match (reg)) {
|
||||
// it matched, wrap line in a link to that prototype:
|
||||
var docProtoObj = this.getApplication ().getPrototype (mappings.getProperty (key));
|
||||
if (docProtoObj!=null) {
|
||||
arr[i] = '<a href="' + docProtoObj.href ("main") + '#typeproperties">' + arr[i] + '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append (arr[i] + "\n");
|
||||
}
|
||||
var tmp = new Object ();
|
||||
tmp.content = sb.toString ();
|
||||
var skinname = (param.skinname) ? param.skinname : "typeproperties";
|
||||
this.renderSkin (skinname, tmp);
|
||||
}
|
||||
function typeProperties_macro(param) {
|
||||
var props = this.getTypeProperties();
|
||||
var iter = props.getResources();
|
||||
while (iter.hasNext()) {
|
||||
var tmp = this.renderTypePropertiesResource(iter.next(), props);
|
||||
var skinname = (param.skinname) ? param.skinname : "typeproperties";
|
||||
this.renderSkin(skinname, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
function renderTypePropertiesResource(res, props) {
|
||||
if (res.getContent() != "") {
|
||||
var sb = new java.lang.StringBuffer ();
|
||||
// map of all mappings....
|
||||
var mappings = props.getMappings();
|
||||
// parse type.properties linewise:
|
||||
var arr = res.getContent().split("\n");
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
arr [i] = arr[i].trim();
|
||||
// look up in mappings table if line matches:
|
||||
for (var e = mappings.keys(); e.hasMoreElements();) {
|
||||
var key = e.nextElement();
|
||||
var reg = new RegExp ('^' + key + '\\s');
|
||||
if (arr[i].match(reg)) {
|
||||
// it matched, wrap line in a link to that prototype:
|
||||
var docProtoObj = this.getApplication().getPrototype(mappings.getProperty(key));
|
||||
if (docProtoObj != null) {
|
||||
arr[i] = '<a href="' + docProtoObj.href("main") + '#typeproperties">' + arr[i] + '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append(arr[i] + "\n");
|
||||
}
|
||||
var tmp = new Object ();
|
||||
tmp.content = sb.toString();
|
||||
tmp.source = res.getName();
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<a class="navig" href="#functions">FUNCTIONS</a> |
|
||||
<a class="navig" href="#macros">MACROS</a> |
|
||||
<a class="navig" href="#skins">SKINS</a> |
|
||||
<a class="navig" href="#templates">TEMPLATES</a> |
|
||||
<a class="navig" href="#typeproperties">TYPE.PROPERTIES</a>
|
||||
|
||||
<br/><br/>
|
||||
|
@ -62,9 +61,9 @@
|
|||
%>
|
||||
|
||||
<% 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>"
|
||||
filter="properties"
|
||||
skin="asLargeListItemSkin"
|
||||
prefix="<tr><td class='headline'>type.properties<a name='typeproperties'><!-- --></a></td></tr>"
|
||||
suffix="<tr><td height='8'> </td></tr>
|
||||
%>
|
||||
|
||||
|
@ -73,7 +72,7 @@
|
|||
|
||||
<br/><br/>
|
||||
|
||||
<% this.typeProperties %>
|
||||
<!-- % this.typeProperties % -->
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<a name='typeproperties'><!-- --></a>
|
||||
<table width='90%' border='0' cellspacing='1' cellpadding='5'><tr>
|
||||
<td class="headline">type.properties</td>
|
||||
<td class="headline">type.properties in <% param.source %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="mainbox"><pre><% param.content %></pre></td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue