Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
acs-developer-support
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-developer-support
Commits
b5465f89
Commit
b5465f89
authored
Dec 04, 2015
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- OpenACS 5.9
parent
2a05cb83
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
448 additions
and
316 deletions
+448
-316
acs-developer-support.info
acs-developer-support.info
+9
-8
footer.adp
lib/footer.adp
+1
-1
footer.tcl
lib/footer.tcl
+8
-2
toolbar.adp
lib/toolbar.adp
+16
-19
toolbar.tcl
lib/toolbar.tcl
+37
-28
acs-developer-support-init.tcl
tcl/acs-developer-support-init.tcl
+8
-2
acs-developer-support-procs.tcl
tcl/acs-developer-support-procs.tcl
+124
-100
index.tcl
www/admin/index.tcl
+6
-0
css-edit.tcl
www/css-edit.tcl
+28
-16
css-list.adp
www/css-list.adp
+1
-1
css-list.tcl
www/css-list.tcl
+6
-0
css-make-live.tcl
www/css-make-live.tcl
+7
-1
developer-support-example.html
www/doc/developer-support-example.html
+2
-1
editlocal.adp
www/doc/editlocal.adp
+1
-1
index.html
www/doc/index.html
+21
-26
index.adp
www/index.adp
+2
-2
index.tcl
www/index.tcl
+31
-20
request-info.adp
www/request-info.adp
+2
-2
request-info.tcl
www/request-info.tcl
+87
-72
acs-developer-support.css
www/resources/acs-developer-support.css
+7
-0
search.adp
www/search.adp
+2
-2
search.tcl
www/search.tcl
+7
-1
send.tcl
www/send.tcl
+9
-3
set-user.tcl
www/set-user.tcl
+8
-2
set.tcl
www/set.tcl
+8
-1
shell.adp
www/shell.adp
+2
-2
shell.tcl
www/shell.tcl
+8
-3
No files found.
acs-developer-support.info
View file @
b5465f89
...
...
@@ -2,25 +2,26 @@
<!-- Generated by the OpenACS Package Manager -->
<package
key=
"acs-developer-support"
url=
"http://openacs.org/repository/apm/packages/acs-developer-support/"
type=
"apm_service"
>
<package-name>
Developer Support
</package-name>
<pretty-plural>
Developer Support
</pretty-plural>
<package-name>
ACS
Developer Support
</package-name>
<pretty-plural>
ACS
Developer Support
</pretty-plural>
<initial-install-p>
f
</initial-install-p>
<singleton-p>
t
</singleton-p>
<auto-mount>
ds
</auto-mount>
<version
name=
"5.
6.0d1"
url=
"http://openacs.org/repository/download/apm/acs-developer-support-5.6.0d1
.apm"
>
<version
name=
"5.
9.0"
url=
"http://openacs.org/repository/download/apm/acs-developer-support-5.9.0
.apm"
>
<owner
url=
"mailto:lars@pinds.com"
>
Lars Pind
</owner>
<summary>
Profiling for requests including database timing information.
</summary>
<release-date>
20
05-02
-04
</release-date>
<release-date>
20
15-10
-04
</release-date>
<vendor
url=
"http://openacs.org"
>
OpenACS
</vendor>
<description
format=
"text/html"
>
Developer support stores timing and other logged information for requests
to support debugging and tuning and supports user switching and a Tcl Shell to invoke arbitrary tcl code on the server.
</description>
<maturity>
0
</maturity>
<maturity>
3
</maturity>
<provides
url=
"acs-developer-support"
version=
"5.6.0d1"
/>
<requires
url=
"acs-kernel"
version=
"5.6.0d1"
/>
<requires
url=
"acs-templating"
version=
"5.6.0d1"
/>
<provides
url=
"acs-developer-support"
version=
"5.9.0"
/>
<requires
url=
"acs-kernel"
version=
"5.9.0"
/>
<requires
url=
"acs-templating"
version=
"5.9.0"
/>
<callbacks>
</callbacks>
...
...
lib/footer.adp
View file @
b5465f89
...
...
@@ -5,7 +5,7 @@
</if>
<if @comments:rowcount@ gt 0>
<multiple name="comments">
<b>Comment:</b> <pre
style="display: inline;">@comments.text
@</pre><br>
<b>Comment:</b> <pre
>@comments.text;noi18n
@</pre><br>
</multiple>
<hr>
</if>
...
...
lib/footer.tcl
View file @
b5465f89
...
...
@@ -34,7 +34,7 @@ if { [ds_show_p] } {
if
{
$user
_switching_p
}
{
set show_p 1
set fake_user_id
[
ad_
get_
user_id
]
set fake_user_id
[
ad_
conn
user_id
]
set real_user_id
[
ds_get_real_user_id
]
if
{
$fake
_user_id == 0
}
{
...
...
@@ -57,7 +57,7 @@ if { [ds_show_p] } {
set unfake_url
[
export_vars -base
$set
_user_url
{
{
user_id
$real
_user_id
}
{
return_url
[
ad_return_url
]
}
}]
#Decide what to do based on how many users there are.
set n_users
[
util_memoize
[
list
db_string select_n_users
"select count(user_id) from users"
-default
"unknown"
]
300
]
set n_users
[
util_memoize
{
db_string select_n_users
"select count(user_id) from users"
-default
"unknown"
}
300
]
if
{
$n
_users > 100
}
{
set search_p 1
...
...
@@ -97,3 +97,9 @@ if { [ds_show_p] } {
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
lib/toolbar.adp
View file @
b5465f89
...
...
@@ -15,35 +15,32 @@
<td align="center" class="actions">
<ul>
<li><a href="@request_info_url@" title="View request information">@request_info_label@</a>
<span>|</span></li>
<li><a href="/intranet/admin/parameters" title="View Parameters">PAR</a>
<span>|</span></li>
<li><a href="/intranet/admin/profiles" title="View Profiles">PRF</a>
<span>|</span></li>
<li><a href="/intranet/components/" title="Portlet Components">COM</a>
<li><a href="@request_info_url@" title="View request information">@request_info_label@</a>
<span>|</span></li>
<li><a href="@oacs_shell_url@" title="Execute commands and see the result">Shell</a>
<span>|</span></li>
<li><a href="
@base_url@
/acs-admin/apm/" title="Modify/reload packages">APM</a>
<li><a href="/acs-admin/apm/" title="Modify/reload packages">APM</a>
<span>|</span></li>
<li><a href="
@base_url@/admin/site-map/" title="Manage your package instances
">Site Map</a>
<li><a href="
/admin/site-map/?root_id=@this_side_node@" title="Configure current package via Site Map
">Site Map</a>
<span>|</span></li>
<li><a href="
@base_url@
/acs-admin/apm/?reload_links_p=1" title="Scan for changed library files">Changed</a>
<li><a href="/acs-admin/apm/?reload_links_p=1" title="Scan for changed library files">Changed</a>
<span>|</span></li>
<li><a href="@flush_url@" title="Flush entire util_memoize cache">Flush</a>
<span>|</span></li>
<li><a href="@auto_test_url@" title="Automated Testing Home">Test</a>
<span>|</span></li>
<li><a href="
@base_url@
/acs-admin/users/" title="Add/edit/become users">Users</a>
<li><a href="/acs-admin/users/" title="Add/edit/become users">Users</a>
<span>|</span></li>
<li><a href="
@base_url@
/acs-lang/admin/" title="Add/edit message keys">I18n</a>
<li><a href="/acs-lang/admin/" title="Add/edit message keys">I18n</a>
<span>|</span></li>
<li><a href="
@base_url@
/doc/" title="View system documentation">Docs</a>
<li><a href="/doc/" title="View system documentation">Docs</a>
<span>|</span></li>
<li><a href="@base_url@/api-doc/" title="View/search OpenACS Tcl API documentation">API doc</a>
<if @rm_url@ ne ""><span>|</span></li>
<li><a href="@rm_url@" title="View requests in the request monitor">Requests</a></li>
<li><a href="/api-doc/" title="View/search OpenACS Tcl API documentation">API doc</a></li>
<if @xocore_url@ ne ""><span>|</span>
<li><a href="@xocore_url@" title="XoTcl Documentation Browser">XoTcl</a></li>
</if>
<if @rm_url@ ne ""><span>|</span>
<li><a href="@rm_url@" title="View requests in the request monitor">Requests</a></li>
</if><else>
</li>
</else>
...
...
@@ -51,13 +48,13 @@
</td>
<td align="right" id="developer-search">
<form action="
@base_url@
/api-doc/proc-search">
<input type="hidden" name="search_type" value="All+matches">
<form action="/api-doc/proc-search">
<div>
<input type="hidden" name="search_type" value="All+matches">
<input type="hidden" name="name_weight" value="5">
<input type="hidden" name="param_weight" value="3">
<input type="hidden" name="doc_weight" value="2">
<input name="query_string" onfocus="if(this.value=='Search API')this.value='';" onblur="if(this.value=='')this.value='Search API';" value="Search API">
<input type="submit" value="Go">
<input type="submit" value="Go">
</div>
</form>
</td>
</tr>
...
...
lib/toolbar.tcl
View file @
b5465f89
# TODO: Handle the case when developer-support is not mounted
set
ip_address
[
ns_info address
]
:
[
ns_config
[
ns_driversection
]
port
]
set
ip_address
[
ns_config ns/server/
[
ns_info server
]
/module/nssock address
]
set
show_p
[
ds_show_p
]
if
{
$show
_p
}
{
set ds_url
[
ds_support_url
]
set
base_url
""
set
ds_url
[
ds_support_url
]
set num_comments
[
llength
[
ds_get_comments
]]
multirow create ds_buttons label title toggle_url state
# multirow append ds_buttons COM
\
"Display comments inline"
\
[
export_vars -base
"
${ds_url}
comments-toggle"
{
{
return_url
[
ad_return_url
]
}
}]
\
[
export_vars -base
"
${ds_url}
comments-toggle"
{
{
return_url
[
ad_return_url
]}
}]
\
[
ad_decode
[
ds_comments_p
]
1
"on"
"off"
]
multirow append ds_buttons USR
\
"Toggle user switching"
\
[
export_vars -base
"
${ds_url}
set"
{
{
field user
}
{
enabled_p
{[
expr
!
[
ds_user_switching_enabled_p
]
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
export_vars -base
"
${ds_url}
set"
{
{
field user
}
{
enabled_p
{[
expr
{
!
[
ds_user_switching_enabled_p
]}
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
ad_decode
[
ds_user_switching_enabled_p
]
1
"on"
"off"
]
multirow append ds_buttons DB
\
"Toggle DB data collection"
\
[
export_vars -base
"
${ds_url}
set"
{
{
field db
}
{
enabled_p
{[
expr
!
[
ds_database_enabled_p
]
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
export_vars -base
"
${ds_url}
set"
{
{
field db
}
{
enabled_p
{[
expr
{
!
[
ds_database_enabled_p
]}
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
ad_decode
[
ds_database_enabled_p
]
1
"on"
"off"
]
multirow append ds_buttons PRO
\
"Toggle template profiling"
\
[
export_vars -base
"
${ds_url}
set"
{
{
field prof
}
{
enabled_p
{[
expr
!
[
ds_profiling_enabled_p
]
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
export_vars -base
"
${ds_url}
set"
{
{
field prof
}
{
enabled_p
{[
expr
{
!
[
ds_profiling_enabled_p
]}
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
ad_decode
[
ds_profiling_enabled_p
]
1
"on"
"off"
]
multirow append ds_buttons FRG
\
"Toggle caching page fragments"
\
[
export_vars -base
"
${ds_url}
set"
{
{
field frag
}
{
enabled_p
{[
expr
!
[
ds_page_fragment_cache_enabled_p
]
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
export_vars -base
"
${ds_url}
set"
{
{
field frag
}
{
enabled_p
{[
expr
{
!
[
ds_page_fragment_cache_enabled_p
]}
]}}
{
return_url
[
ad_return_url
]}
}]
\
[
ad_decode
[
ds_page_fragment_cache_enabled_p
]
1
"on"
"off"
]
multirow append ds_buttons TRN
\
"Toggle translation mode"
\
[
export_vars -base
"/acs-lang/admin/translator-mode-toggle"
{
{
return_url
[
ad_return_url
]
}
}]
\
[
export_vars -base
"/acs-lang/admin/translator-mode-toggle"
{
{
return_url
[
ad_return_url
]
}
}]
\
[
ad_decode
[
lang::util::translator_mode_p
]
1
"on"
"off"
]
multirow append ds_buttons ADP
\
...
...
@@ -53,26 +52,25 @@ if { $show_p } {
{
javascript:void
(
d=document
);
void
(
el=d.getElementsByTagName
(
'div'
));
for
(
i=0
;
i<el.length
;
i++
){
if
(
el
[
i
]
.className=='developer-support-footer'
){
void
(
el
[
i
]
.className='developer-support-footer-off'
)}
else
{
if
(
el
[
i
]
.className=='developer-support-footer-off'
){
void
(
el
[
i
]
.className='developer-support-footer'
)}}};}
\
off
set oacs_shell_url
"
${ds_url}
shell"
set auto_test_url
[
site_node::get_package_url -package_key acs-automated-testing
]
set request_info_url
[
export_vars -base
"
${ds_url}
request-info"
{
{
request
{[
ad_conn request
]}
}
}]
set page_ms
[
lc_numeric
[
ds_get_page_serve_time_ms
]]
lassign
[
ds_get_db_command_info
]
db_num_cmds db_num_ms
if
{
$db
_num_ms ne
""
}
{
set db_num_ms
[
lc_numeric
[
format
%.1f
$db
_num_ms
]]
}
set db_info
[
ds_get_db_command_info
]
set db_num_cmds
[
lindex
$db
_info 0
]
set db_num_ms
[
lc_numeric
[
lindex
$db
_info 1
]]
set flush_url
[
export_vars -base
"/acs-admin/cache/flush-cache"
{
{
suffix util_memoize
}
{
return_url
[
ad_return_url
]
}
}]
set flush_url
[
export_vars -base
"/acs-admin/cache/flush-cache"
{
{
suffix util_memoize
}
{
return_url
[
ad_return_url
]}
}]
if
{
[
empty_string_p
$page
_ms
]
}
{
if
{
$page
_ms eq
""
}
{
set request_info_label
"Request info"
}
else
{
if
{
[
empty_string_p
$db
_num_ms
]
}
{
if
{
$db
_num_ms eq
""
}
{
set request_info_label
"
$page
_ms ms"
}
else
{
set request_info_label
"
${page_ms}
ms/
${db_num_cmds}
db/
${db_num_ms}
ms"
...
...
@@ -92,7 +90,7 @@ if {[array exists links]} {
if
{
$type
eq
"text/css"
}
{
lappend css_list
$href
}
}
}
}
}
...
...
@@ -100,12 +98,23 @@ if {$css_list ne ""} {
multirow append ds_buttons CSS
\
"Show CSS"
\
[
export_vars -base
"/ds/css-list"
{
css_list
{
return_url
[
ad_return_url
]
}
}]
\
off
off
}
set
rm_package_id
[
apm_package_id_from_key xotcl-request-monitor
]
if
{
$rm
_package_id > 0
}
{
set rm_url
"
${base_url}
[
apm_package_url_from_id
$rm
_package_id
]
"
}
else
{
set rm_url
""
#get url for xotcl-core and xotcl-request-monitor
foreach
{
package_name package_url
}
{
xotcl-core xocore_url xotcl-request-monitor rm_url
}
{
set package_id
[
apm_package_id_from_key
$package
_name
]
if
{
$package
_id > 0
}
{
set
$package
_url
[
apm_package_url_from_id
$package
_id
]
}
else
{
set
$package
_url
""
}
}
set
this_side_node
[
site_node_id
[
ad_conn url
]]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
tcl/acs-developer-support-init.tcl
View file @
b5465f89
...
...
@@ -15,11 +15,11 @@ if { ![nsv_exists ds_properties enabled_p] } {
# Take the IP list
(
space or comma seperated
)
and turn it into a tcl list.
set IPs
[
list
]
foreach ip
[
lsort
-unique
[
split
[
parameter::get -package_id
[
ds_instance_id
]
-parameter EnabledIPs -default *
]
{
,
}]]
{
if
{
[
string
equal
$ip
"*"
]
}
{
if
{
$ip
eq
"*"
}
{
# a star means anything will match so just use the * instead
set IPs
"*"
break
}
else
if
{
!
[
empty_string_p
$ip
]
}
{
}
else
if
{
$ip
ne
""
}
{
lappend IPs
$ip
}
}
...
...
@@ -40,3 +40,9 @@ if { ![nsv_exists ds_properties enabled_p] } {
}
ds_watch_packages
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
tcl/acs-developer-support-procs.tcl
View file @
b5465f89
This diff is collapsed.
Click to expand it.
www/admin/index.tcl
View file @
b5465f89
ad_returnredirect ..
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/css-edit.tcl
View file @
b5465f89
#
ad_page_contract
{
Edit and write the CSS file
@author Malte Sussdorff
(
malte.sussdorff@cognovis.de
)
@creation-date 2007-09-29
@cvs-id $Id$
}
{
{
file_location
}
{
css_location
}
{
revision_id
""
}
{
return_url
"/"
}
}
-properties
{
}
-validate
{
...
...
@@ -21,7 +18,6 @@ ds_require_permission [ad_conn package_id] "admin"
if
{[
file
exists
$file
_location
]
&&
[
file
extension
$file
_location
]
eq
".css"
}
{
ad_form -name css-edit -export
{
file_location css_location
}
-form
{
{
css_path:text
(
inform
)}
{
revision_html:text
(
inform
)}
...
...
@@ -30,10 +26,10 @@ if {[file exists $file_location] && [file extension $file_location] eq ".css"} {
}
{
css_description:text
(
text
)
,optional
}
}
-on_request
{
set package_id
[
ad_conn package_id
]
set css_path
"<a href='
$css
_location
'>
$css
_location</a>"
set fp
[
open
"
$file
_location"
"r"
]
set css_path
"<a href='
[
ns_quotehtml
$css
_location
]
'>
$css
_location</a>"
set fp
[
open
$file
_location
"r"
]
set css_content
""
while
{
[
gets
$fp
line
]
>= 0
}
{
append css_content
"
$line
\n
"
...
...
@@ -44,15 +40,21 @@ if {[file exists $file_location] && [file extension $file_location] eq ".css"} {
set revision_html
""
if
{
$item
_id ne
""
}
{
append revision_html
"<ol>"
db_foreach revision
{
select revision_id, publish_date, description from cr_revisions where item_id = :item_id order by publish_date desc
}
{
if
{
[
content::revision::is_live -revision_id
$revision
_id
]
eq
"t"
}
{
db_foreach revision
{
select revision_id, publish_date, description
from cr_revisions where item_id = :item_id order by publish_date desc
}
{
if
{
[
content::revision::is_live -revision_id
$revision
_id
]
==
"t"
}
{
set make_live
"<strong>that's live!</strong>"
}
else
{
set return_url_2
[
ad_return_url
]
set make_live
"<a href=
\"
[
export_vars -base
"css-make-live"
-url
{
revision_id return_url_2 file_location
}]
\"
>make live!</a>"
set href
[
export_vars -base css-make-live -url
{
revision_id return_url_2 file_location
}]
set make_live
[
subst
{
<a href=
"
[
ns_quotehtml
$href
]
"
>make live!</a>
}]
}
set return_url
""
append revision_html
"<li><a href='/o/
$revision
_id'>
$publish
_date</a>
\[
$make
_live
\]
:
[
string
range
$description
0 50
]
</li>"
append revision_html
[
subst
{
<li><a href=
"/o/
$revision
_id"
>$publish_date</a>
\[
$make
_live
\]
:
[
string
range
$description
0 50
]
</li>
}]
}
append revision_html
"</ol>"
file stat
$file
_location file_stat_arr
...
...
@@ -76,10 +78,14 @@ if {[file exists $file_location] && [file extension $file_location] eq ".css"} {
# Get the old version to initialize the item with
set fp
[
open
"
$file
_location"
"r"
]
set old_css_content
[
read
$fp
]
set old_css_content
[
read
$fp
]
close
$fp
set item_id
[
content::item::new -name
$file
_location -parent_id
$package
_id -title
"
$css
_location"
-description
"First revision"
-text
$old
_css_content
]
set item_id
[
content::item::new -name
$file
_location
\
-parent_id
$package
_id
\
-title
"
$css
_location"
\
-description
"First revision"
\
-text
$old
_css_content
]
}
...
...
@@ -98,4 +104,10 @@ if {[file exists $file_location] && [file extension $file_location] eq ".css"} {
}
-cancel_url
$return
_url
}
else
{
ad_returnredirect
$return
_url
}
\ No newline at end of file
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/css-list.adp
View file @
b5465f89
<master>
<multiple name="css_multirow">
<a href="@css_multirow.css_location
;noquote@">@css_multirow.file_location;noquote@</a> || <a href="@css_multirow.edit_url;noquote
@">Edit</a><br>
<a href="@css_multirow.css_location
@">@css_multirow.file_location;noquote@</a> || <a href="@css_multirow.edit_url
@">Edit</a><br>
</multiple>
\ No newline at end of file
www/css-list.tcl
View file @
b5465f89
...
...
@@ -35,3 +35,9 @@ foreach css $css_list {
}
template::multirow append css_multirow
$css
$file
_location
$edit
_location
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/css-make-live.tcl
View file @
b5465f89
...
...
@@ -8,7 +8,7 @@ ad_page_contract {
@creation-date 2007-09-30
@cvs-id $Id$
}
{
{
revision_id:
integer
}
{
revision_id:
naturalnum,notnull
}
{
file_location
}
{
return_url_2
"/"
}
}
-properties
{
...
...
@@ -29,3 +29,9 @@ set source [content::revision::get_cr_file_path -revision_id $revision_id]
file
copy -force
$source
$target
ad_returnredirect
$return
_url_2
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/doc/developer-support-example.html
View file @
b5465f89
...
...
@@ -8,7 +8,8 @@
<h2>
Request Information
</h2>
<a
href=
"/pvt/home"
>
Your Workspace
</a>
:
<a
href=
"/admin/"
>
Admin Home
</a>
:
<a
href=
"/admin/monitoring/"
>
Monitoring
</a>
: Request Information
<a
href=
"/pvt/home"
>
Your Workspace
</a>
:
<a
href=
"/admin/"
>
Admin
Home
</a>
:
<a
href=
"/ds"
>
Developer Support
</a>
: Request Information
<hr>
<h3>
Parameters
</h3>
...
...
www/doc/editlocal.adp
View file @
b5465f89
<master>
<property name="
title
">Edit and code links</property>
<property name="
doc(title)
">Edit and code links</property>
<property name="context">editlocal</property>
<p>
The <u>e</u> and <u>c</u> links in the bottom profiling pane display when ds is enabled
...
...
www/doc/index.html
View file @
b5465f89
<html>
<head>
<title>
Developer Support
</title>
<title>
ACS
Developer Support
</title>
</head>
<body
bgcolor=
white
text=
black
>
<h
2>
Developer Support
</h2
>
<h
1>
ACS Developer Support
</h1
>
part of the
<a
href=
""
>
ArsDigita Community System
</a>
, by
<a
href=
"mailto:jsalz@mit.edu"
>
Jon Salz
</a>
<p>
part of the
<a
href=
""
>
ArsDigita Community System
</a>
, by
<a
href=
"mailto:jsalz@mit.edu"
>
Jon Salz
</a>
<hr>
...
...
@@ -20,14 +20,14 @@ part of the <a href="">ArsDigita Community System</a>, by <a href="mailto:jsalz@
</ul>
</ul>
<h
3>
The Big Picture
</h3
>
<h
2>
The Big Picture
</h2
>
<p>
Software development is a big feedback loop: a developer writes something, tests it, and
then repeats until the results are satisfactory. It's important to streamline this cycle
by having a development environment which makes it easy to analyze what the software is
doing under the hood.
<h
3>
Peeking Under the Hood
</h3
>
<h
2>
Peeking Under the Hood
</h2
>
<p>
Our development environment previously consisted largely of Emacs, and
<tt>
tail -f
/web/servername/log/servername-error.log
</tt>
. Now this has been augmented:
...
...
@@ -52,7 +52,7 @@ If an error occurs while serving a page, a stack trace is printed out.
administrator! Revealing this information to anyone else would pose a huge security
risk.
<h
3>
Comments
</h3
>
<h
2>
Comments
</h2
>
Tired of using
<tt>
ns_log
</tt>
to instrument your code, then grokking the error log
to see what's wrong with your page? Use the
<tt>
ds_comment
</tt>
routine instead:
...
...
@@ -66,31 +66,26 @@ Developer Information page itself.
<p>
Comments are displayed even if an error occurs in the page!
<h3>
Enabling It
</h3>
<p>
Load the packate acs-developer-support via package manager,
browse to /ds and enable the desired options.
<p>
Be careful of you enable developer support on busy production systems - they probably
incur a performance hit.
Add the following to your
<tt>
parameters/yourservername.ini
</tt>
file:
<blockquote><pre>
[ns/server/yourservername/acs/developer-support]
; remember information about connections, for developers' benefit?
EnabledP=1
; remember information about every database request?
DatabaseEnabledP=1
; remember information for which client hosts?
EnabledIPs=*
; remember this information for how long? sweep how often? (in seconds)
DataLifetime=900
DataSweepInterval=900
</pre></blockquote>
Note that you may not want to enable this stuff for production systems - they probably
incur a slight performance hit (although this hasn't been benchmarked).
<h3>
How It Works
</h3>
<h2>
How It Works
</h2>
<p>
The security subsystem registers preauth and trace filters which store relevant
connection information in shared variables (
<tt>
nsv
</tt>
s). The security subsystem
also renames the AOLserver
<tt>
ns_db
</tt>
procedure and registers a wrapper
which aggregates information about database queries.
<p>
<a
href=
"developer-support-example"
>
Example
</a>
output of ACS
Developer Support.
<h2>
Release Notes
</h2>
<p>
Please file bugs in the
<a
href=
"http://openacs.org/bugtracker/openacs/"
>
Bug Tracker
</a>
.
</p>
<hr>
<address><a
href=
"mailto:jsalz@mit.edu"
>
jsalz@mit.edu
</a></address>
...
...
www/index.adp
View file @
b5465f89
<master>
<property name="
title">@page_title;noquote
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
@body;noquote@
www/index.tcl
View file @
b5465f89
...
...
@@ -10,11 +10,11 @@ ad_page_contract {
ds_require_permission
[
ad_conn package_id
]
"admin"
set
enabled_p
[
nsv_get ds_properties
enabled_p
]
set
user_switching_enabled_p
[
nsv_get ds_properties
user_switching_enabled_p
]
set
database_enabled_p
[
nsv_get ds_properties
database_enabled_p
]
set
profiling_enabled_p
[
nsv_get ds_properties
profiling_enabled_p
]
set
adp_reveal_enabled_p
[
nsv_get ds_properties
adp_reveal_enabled_p
]
set
enabled_p
[
ds_
enabled_p
]
set
user_switching_enabled_p
[
ds_
user_switching_enabled_p
]
set
database_enabled_p
[
ds_
database_enabled_p
]
set
profiling_enabled_p
[
ds_
profiling_enabled_p
]
set
adp_reveal_enabled_p
[
ds_
adp_reveal_enabled_p
]
set
package_id
[
ad_conn package_id
]
...
...
@@ -31,7 +31,7 @@ append body "
<li>Developer support information is currently
restricted to the following IP addresses:
<ul
type=disc
>
<ul>
"
set
enabled_ips
[
nsv_get ds_properties enabled_ips
]
...
...
@@ -51,18 +51,19 @@ if { [llength $enabled_ips] == 0 } {
}
}
if
{
!$includes_this_ip_p
}
{
append body
"<li><a href=
\"
add-ip?ip=
[
ad_conn peeraddr
]
\"
>add your IP,
[
ad_conn peeraddr
]
</a>
\n
"
append body
"<li><a href=
'
[
ns_quotehtml add-ip?ip=
[
ad_conn peeraddr
]
'
>add your IP,
[
ad_conn peeraddr
]
</a>
\n
"
}
set
requests
[
nsv_array names ds_request
]
set
parameterHref
[
export_vars -base /shared/parameters
{
package_id
{
return_url
{[
ad_return_url
]}
}
}]
append
body
"
</ul>
<li>Information is being swept every
[
parameter::get -parameter DataSweepInterval -default 900
]
sec
and has a lifetime of
[
parameter::get -parameter DataLifetime -default 900
]
sec
<li><a href=
\"
/shared/parameters?
[
export_vars
{
package_id
{
return_url
{[
ad_return_url
]}
}
}]
\"
>Set package parameters</a>
<li><a href=
'
[
ns_quotehtml
$parameter
Href
]
'
>Set package parameters</a>
<p>
...
...
@@ -87,7 +88,7 @@ and has a lifetime of [parameter::get -parameter DataLifetime -default 900] sec
"off (<a href=
\"
set?field=adp&enabled_p=1
\"
>turn it on</a>)"
]
<p>
<li> Help on <a href=
\"
doc/editlocal
\"
>edit and code links</a>.
<li> Help on <a href=
'doc/editlocal'
>edit and code links</a>.
</ul>
<h3>Available Request Information</h3>
...
...
@@ -97,15 +98,15 @@ and has a lifetime of [parameter::get -parameter DataLifetime -default 900] sec
if
{
[
llength
$requests
]
== 0
}
{
append body
"There is no request information available."
}
else
{
append body
"
<table cellspacing=
0 cellpadding=0
>
<tr
bgcolor=#AAAAAA
>
append body
[
subst
{
<table cellspacing=
"0"
cellpadding=
"0"
>
<tr
style=
"background:#AAAAAA"
>
<th>Time</th>
<th>Duration</th>
<th>IP</th>
<th>Request</th>
</tr>
"
}]
set colors
{
white #EEEEEE
}
set counter 0
...
...
@@ -157,7 +158,7 @@ if { [llength $requests] == 0 } {
set url
{}
}
if
{
[
info
exists conn
(
query
)]
&&
!
[
empty_string_p
$conn
(
query
)]
}
{
if
{
[
info
exists conn
(
query
)]
&&
$conn
(
query
)
ne
""
}
{
if
{
[
string
length
$conn
(
query
)]
> 50
}
{
set query
"?
[
string
range
$conn
(
query
)
0 46
]
..."
}
else
{
...
...
@@ -167,26 +168,36 @@ if { [llength $requests] == 0 } {
set query
""
}
if
{[
ns_cache get ds_page_bits
$id:error
dummy
]}
{
set elink
" <a href=
\"
send?output=
$id:error
\"
style=
\"
color: red
\"
>Errors</span></a>"
set elink
[
subst
{
<a href=
"send?output=
$id:error
"
style=
"color: red"
>Errors</span></a>
}]
}
else
{
set elink
{}
}
append body
"
<tr
bgcolor=
[
lindex
$colors
[
expr
{
$counter
%
[
llength
$colors
]
}]]
>
append body
[
subst
{
<tr
style=
"background:
[
lindex
$colors
[
expr
{
$counter
%
[
llength
$colors
]
}]]
"
>
<td align=center> 
;
$start
 
;
</td>
<td align=right> 
;
$duration
 
;
</td>
<td> 
;
$peeraddr
 
;
</td>
<td><a href=
\"
request-info?request=
$id
\
"
>
[
ns_quotehtml
"
$method
$url$query
"
]
</a>
$elink
</td>
<td><a href=
"request-info?request=
[
ns_quotehtml
$id
]
"
>
[
ns_quotehtml
"
$method
$url$query
"
]
</a>$elink</td>
</tr>
"
}]
incr counter
}
}
if
{
$show
_more > 0
}
{
append body
"<tr><td colspan=4 align=right><a href=
\"
index?request_limit=0
\"
><i>show
$show
_more more requests</i></td></tr>
\n
"
append body
[
subst
{
<tr><td colspan=
"4"
align=
"right"
><a href=
"index?request_limit=0"
>
<i>show
$show
_more more requests</i></td>
</tr>
}]
}
append body
"</table>
\n
"
}
append
body
"</blockquote>"
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/request-info.adp
View file @
b5465f89
<master>
<property name="
title">@page_title;noquote
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
<if @page_fragment_cache_p@ true>
<p>
...
...
www/request-info.tcl
View file @
b5465f89
This diff is collapsed.
Click to expand it.
www/resources/acs-developer-support.css
View file @
b5465f89
...
...
@@ -116,6 +116,13 @@ div.developer-support-adp-output-off {
text-align
:
left
;
}
div
.developer-support-footer
pre
{
display
:
inline
;
background-color
:
inherit
;
border
:
0px
;
padding
:
2px
2px
2px
2px
;
}
.developer-support-footer-off
{
display
:
none
;
}
...
...
www/search.adp
View file @
b5465f89
<master>
<property name="
title
">Search</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)
">Search</property>
<property name="context">@context;
literal
@</property>
<p>
<form name="searchfrags" action="search">
...
...
www/search.tcl
View file @
b5465f89
...
...
@@ -28,7 +28,7 @@ if {![ns_cache get ds_page_bits $request pages]} {
append file_links
" <a href=
\"
send?code=
[
ns_urlencode
$page
]
\"
title=
\"
compiled code
\"
>c</a>"
append file_links
" <a href=
\"
send?output=
$request:
[
ns_urlencode
$page
]
\"
title=
\"
output
\"
>o</a>"
set size
[
string
length
$content
]
set highlight
"...
[
ad_quotehtml
[
string
trimleft
[
string
range
$content
[
expr
[
lindex
$offset
0
]
- 50
]
[
expr
[
lindex
$offset
0
]
- 1
]]]]
<b>
[
ad_quotehtml
[
string
range
$content
[
lindex
$offset
0
]
[
lindex
$offset
1
]]]
</b>
[
ad_quotehtml
[
string
trimright
[
string
range
$content
[
expr
[
lindex
$offset
1
]
+ 1
]
[
expr
[
lindex
$offset
1
]
+ 50
]]]]
..."
set highlight
"...
[
ns_quotehtml
[
string
trimleft
[
string
range
$content
[
expr
{[
lindex
$offset
0
]
- 50
}]
[
expr
{[
lindex
$offset
0
]
- 1
}]]]]
<b>
[
ns_quotehtml
[
string
range
$content
[
lindex
$offset
0
]
[
lindex
$offset
1
]]]
</b>
[
ns_quotehtml
[
string
trimright
[
string
range
$content
[
expr
{[
lindex
$offset
1
]
+ 1
}]
[
expr
{[
lindex
$offset
1
]
+ 50
}
]]]]
..."
multirow append matches
$page
$highlight
$file
_links
$size
}
...
...
@@ -36,3 +36,9 @@ if {![ns_cache get ds_page_bits $request pages]} {
}
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/send.tcl
View file @
b5465f89
...
...
@@ -7,15 +7,15 @@ ad_page_contract {
}
ds_require_permission
[
ad_conn package_id
]
"admin"
if
{
!
[
empty_string_p
$code
]
}
{
if
{
$code
ne
""
}
{
if
{[
regexp
{(
.*
)
\.
(
adp
)}
$code
match stub ext
]}
{
ns_return 200 text/plain
[
info
body ::template::code::$
{
ext
}
::$stub
]
}
else
{
ns_returnfile 200 text/plain
$code
}
}
else
if
{
!
[
empty_string_p
$fname
]
}
{
}
else
if
{
$fname
ne
""
}
{
ns_return 200 application/x-editlocal
[
ns_set get
[
ns_conn form
]
fname
]
}
else
if
{
!
[
empty_string_p
$output
]
}
{
}
else
if
{
$output
ne
""
}
{
if
{[
regexp
{[
0-9
]
+:error
}
$output
]}
{
if
{[
ns_cache get ds_page_bits
$output
content
]}
{
foreach error
$content
{
...
...
@@ -32,3 +32,9 @@ if {![empty_string_p $code]} {
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/set-user.tcl
View file @
b5465f89
ad_page_contract
{
A hack that will allow us to simulate being a different user
}
{
user_id:
integer
user_id:
naturalnum,notnull
return_url
}
##NOTE THIS DOESN'T REQUIRE ADMIN SO THAT WE CAN DO USER SWITCHING
ad_require_permission
[
ad_conn package_id
]
"read"
permission::require_permission -object_id
[
ad_conn package_id
]
-privilege
"read"
ad_set_client_property developer-support user_id
$user
_id
ad_returnredirect
$return
_url
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/set.tcl
View file @
b5465f89
...
...
@@ -7,7 +7,7 @@ ad_page_contract {
@cvs-id $Id$
}
{
field
enabled_p
enabled_p
:boolean
{
return_url
"."
}
}
...
...
@@ -28,6 +28,7 @@ switch -- $field {
}
ds
{
nsv_set ds_properties enabled_p
$enabled
_p
set ::ds_enabled_p
$enabled
_p
}
frag
{
nsv_set ds_properties page_fragment_cache_p
$enabled
_p
...
...
@@ -40,3 +41,9 @@ switch -- $field {
}
}
ad_returnredirect
$return
_url
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
www/shell.adp
View file @
b5465f89
<master>
<property name="
title">@page_title;noquote
@</property>
<property name="context">@context;
noquote
@</property>
<property name="
doc(title)">@page_title;literal
@</property>
<property name="context">@context;
literal
@</property>
<formtemplate id="shell"></formtemplate>
<h3>Result</h3>
...
...
www/shell.tcl
View file @
b5465f89
...
...
@@ -25,12 +25,17 @@ ad_form -name shell -form {
{
html
{
cols 80 rows 10
}}
}
}
-on_submit
{
if
{
!
[
string
equal POST
[
ns_conn method
]
]
}
{
if
{
"POST"
ne
[
ns_conn method
]
}
{
set out
"You cannot use GET to invoke a script on this page.
\n
Click OK to resubmit the form as a POST."
}
else
{
if
{[
catch
{
set
out
[
uplevel
1
[
string
map
{
"
\\\r\n
"
" "
}
$script
]]}]}
{
global errorInfo
set out
"ERROR:
\n
$error
Info"
set out
"ERROR:
\n
$::error
Info"
}
}
}
# 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