Commit 1ca805ca authored by Frank Bergmann's avatar Frank Bergmann

- Modified package-view - the portlet to show a package's

  procedures, files etc. for use within XoWiki
parent dbc76529
<if @show_master_p@>
<master>
<property name=title>@title;noquote@</property>
<property name="context">@context;noquote@</property>
</if>
<if "" ne @error_message@>
<!-- <font color=red> -->
@error_message@
<!-- </font> -->
</if>
<if "" ne @version_id@>
@dimensional_slider;noquote@
<if @kind@ eq "procs_files">
<if @procs_files_p@>
<blockquote>
<h2>TCL Libraries</h2>
<table cellspacing="0" cellpadding="0">
<multiple name="procs_files">
<tr valign=top>
<td><b><a href="procs-file-view?version_id=@version_id@&amp;path=@procs_files.full_path@">@procs_files.path@</a></b></td>
<td width="30%"><b><a href="@url@/procs-file-view?version_id=@version_id@&amp;path=@procs_files.full_path@">@procs_files.path@</a></b></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>@procs_files.first_sentence@&nbsp;</td>
<td width="70%">@procs_files.first_sentence@&nbsp;</td>
</tr>
</multiple>
</table>
</blockquote>
</if>
<if @kind@ eq "procs">
<if @procs_p@>
<blockquote>
<h2>TCL Procedures</h2>
<table cellspacing="0" cellpadding="0">
<multiple name="procedures">
<tr valign=top>
<td><b><a href="proc-view?version_id=@version_id@&amp;proc=@procedures.proc@">@procedures.proc@</a></b></td>
<td><b><a href="@url@/proc-view?version_id=@version_id@&amp;proc=@procedures.proc@">@procedures.proc@</a></b></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>@procedures.first_sentence@&nbsp;</td>
</tr>
......@@ -30,12 +42,13 @@
</table>
</blockquote>
</if>
<if @kind@ eq "sql_files">
<if @sql_files_p@>
<blockquote>
<h2>SQL Files</h2>
<table cellspacing="0" cellpadding="0">
<multiple name="sql_files">
<tr valign=top>
<td><b><a href="display-sql?package_key=@package_key@&amp;url=@sql_files.relative_path@&amp;version_id=@version_id@">@sql_files.path@</a></b></td>
<td><b><a href="@url@/display-sql?package_key=@package_key@&amp;url=@sql_files.relative_path@&amp;version_id=@version_id@">@sql_files.path@</a></b></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td>&nbsp;</td>
</tr>
......@@ -43,13 +56,14 @@
</table>
</blockquote>
</if>
<if @kind@ eq "content">
<if @content_p@>
<h2>Content Files</h2>
<table cellspacing="0" cellpadding="0">
<multiple name="content_pages">
<tr valign=top>
<if @content_pages.content_type@ eq "page">
<td>@content_pages.indentation;noquote@
<b><a href="content-page-view?version_id=@version_id@&amp;path=@content_pages.full_path@">@content_pages.name@</a></b>
<b><a href="@url@/content-page-view?version_id=@version_id@&amp;path=@content_pages.full_path@">@content_pages.name@</a></b>
<if @content_pages.type@ ne "">
<a href="type-view?type=@content_pages.type@"></a>
</if>
......@@ -63,3 +77,6 @@
</multiple>
</table>
</if>
</if>
ad_page_contract {
Shows APIs for a particular package.
@param version_id the ID of the version whose API to view.
@param public_p view only public APIs?
@param kind view which type of APIs? One of <code>procs_files</code>,
if {![info exists package_key]} {
ad_page_contract {
Shows APIs for a particular package.
@param version_id the ID of the version whose API to view.
@param public_p view only public APIs?
@param kind view which type of APIs? One of <code>procs_files</code>,
<code>procs</code> or <code>content</code>.
@author Jon Salz (jsalz@mit.edu)
@creation-date 3 Jul 2000
@cvs-id $Id$
} {
{ version_id "" }
{ package_key "" }
{ public_p "" }
{ kind "procs_files" }
} -properties {
title:onevalue
context:onevalue
dimensional_slider:onevalue
kind:onevalue
version_id:onevalue
package_key:onevalue
procs_files:multirow
procedures:multirow
sql_files:multirow
content_pages:multirow
@author Jon Salz (jsalz@mit.edu)
@creation-date 3 Jul 2000
@cvs-id $Id$
} {
{ version_id "" }
{ public_p "" }
{ kind "all" }
{ package_key "" }
} -properties {
title:onevalue
context:onevalue
dimensional_slider:onevalue
kind:onevalue
version_id:onevalue
package_key:onevalue
procs_files:multirow
procedures:multirow
sql_files:multirow
content_pages:multirow
}
} else {
set kind "all"
set public_p ""
}
if {"" != $package_key} {
set version_id [db_string package_version "select min(version_id) from apm_package_versions where package_key = :package_key" -default ""]
set error_message ""
set dimensional_slider ""
if {![info exists show_master_p]} { set show_master_p 1 }
# if {[info exists package_key]} {
# set version_id [db_string package_version "select min(version_id) from apm_package_versions where package_key = :package_key" -default ""]
# }
if {![info exists version_id] || "" == $version_id} {
if {[info exists package_key] && "" != $package_key} {
set version_id [db_string package_version "select min(version_id) from apm_package_versions where package_key = :package_key" -default ""]
}
}
if {"" == $version_id} { ad_return_complaint 1 "package-view: You need to specify version_id or package_key" }
# ad_return_complaint 1 $version_id
if {"" == $version_id} { set error_message "Package '$package_key' is not installed on this server, so there is no documentation available." }
if {"all" == $kind} { set kind "procs_files procs sql_files content" }
set url "/api-doc"
set public_p [api_set_public $version_id $public_p]
db_1row pretty_name_from_package_id {
set pretty_name ""
set version_name ""
set relative_path ""
if {![info exists package_key] || "" == $package_key} {
set package_key "intranet-hr"
}
db_0or1row pretty_name_from_package_id {
select pretty_name, package_key, version_name
from apm_package_version_info
where version_id = :version_id
......@@ -64,8 +95,15 @@ set dimensional_slider "[ad_dimensional \
"" \
[ad_tcl_vars_to_ns_set version_id kind public_p]]"
switch $kind {
set procs_p 0
set procs_files_p 0
set sql_files_p 0
set content_p 0
foreach k $kind {
switch $k {
procs_files {
set procs_files_p 1
array set procs [list]
multirow create procs_files path full_path first_sentence
......@@ -84,6 +122,7 @@ switch $kind {
}
}
procs {
set procs_p 1
array set procs [list]
foreach path [apm_get_package_files -package_key $package_key -file_types tcl_procs] {
......@@ -107,6 +146,7 @@ switch $kind {
}
}
sql_files {
set sql_files_p 1
multirow create sql_files path relative_path
set file_types [list data_model data_model_create data_model_drop data_model_upgrade]
......@@ -119,6 +159,7 @@ switch $kind {
}
}
content {
set content_p 1
multirow create content_pages indentation full_path content_type name type first_sentence
set last_components [list]
foreach path [apm_get_package_files -package_key $package_key -file_types content_page] {
......@@ -169,3 +210,4 @@ switch $kind {
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment