Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
acs-api-browser
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
acs-api-browser
Commits
76c4c08d
Commit
76c4c08d
authored
Dec 04, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- OpenACS 5.9
parent
0dbf680f
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
155 additions
and
46 deletions
+155
-46
acs-api-browser.info
acs-api-browser.info
+6
-6
search.tcl
lib/search.tcl
+6
-0
acs-api-documentation-procs.tcl
tcl/acs-api-documentation-procs.tcl
+30
-14
acs-api-browser-procs.tcl
tcl/test/acs-api-browser-procs.tcl
+6
-1
content-page-view.tcl
www/content-page-view.tcl
+6
-0
deprecated.tcl
www/deprecated.tcl
+6
-0
display-sql.tcl
www/display-sql.tcl
+6
-0
index.tcl
www/index.tcl
+6
-0
package-view.tcl
www/package-view.tcl
+14
-3
plsql-subprogram-one.tcl
www/plsql-subprogram-one.tcl
+6
-0
plsql-subprograms-all.tcl
www/plsql-subprograms-all.tcl
+10
-12
proc-browse.tcl
www/proc-browse.tcl
+6
-0
proc-search.tcl
www/proc-search.tcl
+6
-0
proc-view.adp
www/proc-view.adp
+4
-5
proc-view.tcl
www/proc-view.tcl
+4
-2
procs-file-view.tcl
www/procs-file-view.tcl
+9
-3
set-default.tcl
www/set-default.tcl
+6
-0
tcl-doc-search.tcl
www/tcl-doc-search.tcl
+6
-0
tcl-proc-view.tcl
www/tcl-proc-view.tcl
+6
-0
type-view.tcl
www/type-view.tcl
+6
-0
No files found.
acs-api-browser.info
View file @
76c4c08d
...
...
@@ -2,23 +2,23 @@
<!-- Generated by the OpenACS Package Manager -->
<package
key=
"acs-api-browser"
url=
"http://openacs.org/repository/apm/packages/acs-api-browser/"
type=
"apm_service"
>
<package-name>
API Browser
</package-name>
<pretty-plural>
API Browsers
</pretty-plural>
<package-name>
A
CS A
PI Browser
</package-name>
<pretty-plural>
A
CS A
PI Browsers
</pretty-plural>
<initial-install-p>
t
</initial-install-p>
<singleton-p>
t
</singleton-p>
<version
name=
"5.
10.0d1"
url=
"http://openacs.org/repository/download/apm/acs-api-browser-5.10.0d1
.apm"
>
<version
name=
"5.
9.0"
url=
"http://openacs.org/repository/download/apm/acs-api-browser-5.9.0
.apm"
>
<owner
url=
"http://openacs.org"
>
OpenACS
</owner>
<summary>
Interactive documentation for the Tcl and SQL APIs.
</summary>
<release-date>
201
3-09-08
</release-date>
<release-date>
201
5-10-04
</release-date>
<maturity>
3
</maturity>
<vendor
url=
"http://openacs.org"
>
OpenACS
</vendor>
<license
url=
"http://www.gnu.org/copyleft/gpl.html"
>
GPL
</license>
<maturity>
3
</maturity>
<description
format=
"text/html"
>
On line interactive documentation for the locally installed Tcl and SQL APIs. Links to the Tcl core and AOLServer online documentation as well.
</description>
<provides
url=
"acs-api-browser"
version=
"5.
10.0d1
"
/>
<requires
url=
"acs-kernel"
version=
"5.
10.0d1
"
/>
<provides
url=
"acs-api-browser"
version=
"5.
9.0
"
/>
<requires
url=
"acs-kernel"
version=
"5.
9.0
"
/>
<callbacks>
</callbacks>
...
...
lib/search.tcl
View file @
76c4c08d
...
...
@@ -69,3 +69,9 @@ switch [db_type] {
}
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
tcl/acs-api-documentation-procs.tcl
View file @
76c4c08d
...
...
@@ -105,7 +105,7 @@ ad_proc -public api_read_script_documentation {
regsub -all
{
\#
.*$
}
$line
""
line
set line
[
string
trim
$line
]
if
{
$line
ne
""
}
{
set has_contract_p
[
regexp
{(
^ad_
page_contract
\s
)
|
(
initialize
)}
$line
match
]
set has_contract_p
[
regexp
{(
^ad_
(
page|include
)
_contract
\s
)
|
(
Package initialize
)}
$line
]
break
}
}
...
...
@@ -128,7 +128,7 @@ ad_proc -public api_read_script_documentation {
if
{[
regexp
{
^ad_page_contract documentation
}
$::error
Info
]
}
{
array set doc_elements
$error
}
if
{
[
info
exists doc_elements
]
}
{
if
{
[
array
exists doc_elements
]
}
{
return
[
array
get doc_elements
]
}
return
[
list
]
...
...
@@ -764,26 +764,42 @@ namespace eval ::apidoc {
}
ad_proc -public format_see
{
see
}
{
Takes the value in the argument
"see"
and possibly formats it
into a link that will give the user more info about that
resource
@param see a string expected to comtain the resource to format
@return the html string representing the resource
}
{
regsub -all
{
proc
*
}
$see
{}
see
set see
[
string
trim
$see
]
if
{[
nsv_exists api_proc_doc
$see
]}
{
return
"<a href=
\"
[
ns_quotehtml proc-view?proc=
[
ns_urlencode
${see}
]]
\"
>
$see
</a>"
set href
[
export_vars -base proc-view
{{
proc
$see
}}]
return
[
subst
{
<a href=
"
[
ns_quotehtml
$href
]
"
>$see</a>
}]
}
if
{[
string
match
"/doc/*
.html
"
$see
]
if
{[
string
match
"/doc/*"
$see
]
||
[
util_url_valid_p
$see
]}
{
return
"<a href=
\"
[
ns_quotehtml
$see
]
\"
>
$see
</a>"
return
[
subst
{
<a href=
"
[
ns_quotehtml
$see
]
"
>$see</a>
}]
}
if
{[
file
exists
"
$::acs::rootdir${see}
"
]}
{
return
"<a href=
\"
[
ns_quotehtml content-page-view?source_p=1&path=
[
ns_urlencode
$see
]]
\"
>
$see
</a>"
set href
[
export_vars -base content-page-view
{{
source_p 1
}
{
path
$see
}}]
return
[
subst
{
<a href=
"
[
ns_quotehtml
$href
]
"
>$see</a>
}]
}
return
${see}
}
ad_proc -public format_author
{
author_string
}
{
Extracts information about the author and formats it into an
HTML string.
@param author_string author information to format
@return the formatted result
}
{
if
{
[
regexp
{
^
[
^
\n\r\t
]
+$
}
$author
_string
]
&&
[
string
first
"@"
$author
_string
]
>= 0
&&
[
string
first
":"
$author
_string
]
< 0
}
{
return
"<a href=
\"
mailto:
$author
_string
\"
>
$author
_string</a>"
return
[
subst
{
<a href=
"mailto:
$author
_string"
>$author_string</a>
}]
}
else
if
{
[
regexp
{
^
([
^
\(\)
]
+
)
\s
+
\(
(
.+
)
\)
$
}
[
string
trim
$author
_string
]
{}
name email
]
}
{
return
"
$name
<<a href=
\"
mailto:
$email
\"
>
$email
</a>>"
}
...
...
@@ -971,15 +987,15 @@ namespace eval ::apidoc {
Given a proc name, formats it as HTML, including highlighting syntax in
various colors and creating hyperlinks to other proc definitions.<BR>
The inspiration for this proc was the tcl2html script created by Jeff Hobbs.
<
P
>
<
p
>
Known Issues:
<
OL
>
<
LI
> This proc will mistakenly highlight switch strings that look like commands as commands, etc.
<
LI
> There are many undocumented AOLserver commands including all of the commands added by modules.
<
LI
> When a proc inside a string has explicitly quoted arguments, they are not formatted.
<
LI
> regexp and regsub are hard to parse properly. E.g. If we use the start option, and we quote its argument,
<
ol
>
<
li
> This proc will mistakenly highlight switch strings that look like commands as commands, etc.
<
li
> There are many undocumented AOLserver commands including all of the commands added by modules.
<
li
> When a proc inside a string has explicitly quoted arguments, they are not formatted.
<
li
> regexp and regsub are hard to parse properly. E.g. If we use the start option, and we quote its argument,
and we have an ugly regexp,
then
this code might highlight it incorrectly.
</
OL
>
</
ol
>
@author Jamie Rasmussen
(
jrasmuss@mle.ie
)
...
...
tcl/test/acs-api-browser-procs.tcl
View file @
76c4c08d
...
...
@@ -19,4 +19,9 @@ aa_register_case \
aa_true
"api documentation proc can document itself"
\
[
string match
"*packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl*"
$result
]
}
}
\ No newline at end of file
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/content-page-view.tcl
View file @
76c4c08d
...
...
@@ -84,3 +84,9 @@ template::util::list_to_multirow xql_links [::apidoc::xql_links_list $path]
set
title
[
file
tail
$path
]
set
script_documentation
[
api_script_documentation
$path
]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/deprecated.tcl
View file @
76c4c08d
...
...
@@ -28,3 +28,9 @@ foreach proc [lsort [nsv_array names api_proc_doc]] {
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/display-sql.tcl
View file @
76c4c08d
...
...
@@ -74,3 +74,9 @@ if { $safe_p } {
}
else
{
ad_return_warning
"Invalid file location"
"Can only display files in package or doc directory"
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/index.tcl
View file @
76c4c08d
...
...
@@ -61,3 +61,9 @@ if { [info exists about_package_key] } {
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/package-view.tcl
View file @
76c4c08d
...
...
@@ -11,8 +11,8 @@ ad_page_contract {
}
{
version_id:naturalnum,notnull
{
public_p:boolean
""
}
{
kind
"procs_files"
}
{
about_package_key
""
}
{
kind
:word
"procs_files"
}
{
about_package_key
:token
""
}
}
-properties
{
title:onevalue
context:onevalue
...
...
@@ -79,7 +79,12 @@ switch $kind {
set first_sentence
[
::apidoc::first_sentence
[
lindex
$doc
_elements
(
main
)
0
]]
set view procs-file-view
}
else
{
set first_sentence
""
array set doc_elements
[
api_read_script_documentation
$full
_path
]
if
{
[
info
exists doc_elements
(
main
)]
}
{
set first_sentence
[
::apidoc::first_sentence
[
lindex
$doc
_elements
(
main
)
0
]]
}
else
{
set first_sentence
""
}
set view content-page-view
}
...
...
@@ -171,3 +176,9 @@ switch $kind {
}
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/plsql-subprogram-one.tcl
View file @
76c4c08d
...
...
@@ -54,3 +54,9 @@ set name [string tolower $name]
db_release_unused_handles
ad_return_template
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/plsql-subprograms-all.tcl
View file @
76c4c08d
...
...
@@ -14,16 +14,14 @@ ad_page_contract {
set
context
[
list
"All PL/SQL Subprograms"
]
# Organize the subprograms under three headings: FUNCTION, PROCEDURE,
# and PACKAGE.
#
# Organize the subprograms und types like FUNCTION, PROCEDURE, and
# PACKAGE in oracle or FUNCTION in PostgresSQL
#
db_multirow all_subprograms all_subprograms
{}
db_multirow all_subprograms all_subprograms
{
select object_type as type, object_name as name
from user_objects
where object_type in
(
'PACKAGE', 'PROCEDURE', 'FUNCTION'
)
order by
decode
(
object_type, 'PACKAGE', 0, 'PROCEDURE', 1, 'FUNCTION', 2
)
asc
}
db_release_unused_handles
ad_return_template
\ No newline at end of file
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/proc-browse.tcl
View file @
76c4c08d
...
...
@@ -64,3 +64,9 @@ foreach sublist $matches {
multirow append proc_list
$file
$proc
$url
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/proc-search.tcl
View file @
76c4c08d
...
...
@@ -186,3 +186,9 @@ foreach output $private_matches {
set
show_private_url
[
export_vars -base
[
ad_conn url
]
-override
{
{
show_private_p 1
}
}
{
name_weight doc_weight param_weight source_weight search_type query_string show_deprecated_p
}]
set
hide_private_url
[
export_vars -base
[
ad_conn url
]
-override
{
{
show_private_p 0
}
}
{
name_weight doc_weight param_weight source_weight search_type query_string show_deprecated_p
}]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/proc-view.adp
View file @
76c4c08d
...
...
@@ -7,19 +7,18 @@
</if>
<else>
<table width="100%">
<tr><td style="background: #eeeeee">@documentation;
noquote
@</td></tr>
<tr><td style="background: #eeeeee">@documentation;
literal
@</td></tr>
</table>
<if @source_p@ eq 0>
[ <a href="
proc-view?proc=@proc@&source_p=1&version_id=@version_id
@">show source</a> ]
[ <a href="
@procViewToggleURL;noi18n
@">show source</a> ]
</if>
<else>
[ <a href="
proc-view?proc=@proc@&source_p=0&version_id=@version_id
@">hide source</a> ]
[ <a href="
@procViewToggleURL;noi18n
@">hide source</a> ]
</else>
<if @source_p@ ne @default_source_p@>
| [ <a href="set-default?source_p=@source_p@&return_url=@return_url@">make this
the default</a> ]
| [ <a href="@setDefaultURL;noi18n@">make this the default</a> ]
</if>
</else>
...
...
www/proc-view.tcl
View file @
76c4c08d
...
...
@@ -3,7 +3,7 @@ ad_page_contract {
@cvs-id $Id$
}
{
proc:
token
,trim
proc:
nohtml
,trim
source_p:boolean,optional,trim
{
version_id:naturalnum,optional
""
}
}
-properties
{
...
...
@@ -71,7 +71,7 @@ if { !$documented_call } {
a private interface.</p><p>The procedure is defined as:
<pre class='code'>
proc
$proc
{[
info
args
$proc
]}
{
[
ad
_quotehtml
[
info
body
$proc
]]
[
ns
_quotehtml
[
info
body
$proc
]]
}
</pre></p>
}]
...
...
@@ -127,6 +127,8 @@ proc $proc {[info args $proc]} {
set documentation
[
api_proc_documentation -script
$proc
_index
]
}
}
set
procViewToggleURL
[
export_vars -base proc-view
[
list
proc
[
list
source_p
[
expr
{
!$source_p
}]]
version_id
]]
set
setDefaultURL
[
export_vars -base set-default
[
list
source_p return_url
]]
#
# Local variables:
...
...
www/procs-file-view.tcl
View file @
76c4c08d
...
...
@@ -5,7 +5,7 @@ ad_page_contract {
}
{
version_id:naturalnum,optional
{
public_p:boolean
""
}
path:
token
,trim
path:
path
,trim
source_p:boolean,optional,trim
}
-properties
{
title:onevalue
...
...
@@ -36,9 +36,9 @@ if {![file readable $::acs::rootdir/$path] || [file isdirectory $::acs::rootdir/
if
{[
info
exists version_id
]}
{
set kind procs
set href
[
export_vars -base
[
ad_conn package_url
]
/package-view
{
version_id
{
kind procs
}}]
set link
[
subst
{
<p>Go back to <a href=
"
[
ns_quoteh
r
ml
$href
]
"
>Package Documentation</a>.
}]
set link
[
subst
{
<p>Go back to <a href=
"
[
ns_quoteh
t
ml
$href
]
"
>Package Documentation</a>.
}]
}
else
{
set link
[
subst
{
<p>Go back to <a href=
"
[
ns_quoteh
r
ml
[
ad_conn package_url
]]
"
>API Browser</a>.
}]
set link
[
subst
{
<p>Go back to <a href=
"
[
ns_quoteh
t
ml
[
ad_conn package_url
]]
"
>API Browser</a>.
}]
}
ad_return_warning
"No such library file"
[
subst
{
The file '$path' was not found. Maybe the url contains a typo.
...
...
@@ -111,3 +111,9 @@ if { $source_p } {
set file_contents
[
template::util::read_file
$::acs::rootdir
/$path
]
set file_contents
[
apidoc::tclcode_to_html
$file
_contents
]
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/set-default.tcl
View file @
76c4c08d
...
...
@@ -17,3 +17,9 @@ if { $found_p } {
}
else
{
ad_return_error
"Unknown Property"
"Couldn't find any property to set"
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/tcl-doc-search.tcl
View file @
76c4c08d
...
...
@@ -33,3 +33,9 @@ for { set i [expr { $len-1 }] } { $i >= 0 } { incr i -1 } {
set
title
"Tcl API Procedure Search for:
\"
$tcl
_proc
\"
"
set
context
[
list
"Tcl API Search:
$tcl
_proc"
]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/tcl-proc-view.tcl
View file @
76c4c08d
...
...
@@ -34,3 +34,9 @@ if {$url ne ""} {
set title
"
[
ns_info name
]
Tcl API Search for:
\"
$tcl
_proc
\"
"
set
context
[
list
"Tcl API Search:
$tcl
_proc"
]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/type-view.tcl
View file @
76c4c08d
...
...
@@ -42,3 +42,9 @@ lappend context $type
set
title
$type
set
documentation
[
api_type_documentation
$type
]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment