Forum OpenACS Development: Continuing with Edit This Page

Posted by Luke Pond on
I've added ETP to the openacs-4 repository, so now if you check out the full openacs-4 project, you'll get the latest code for ETP. I tagged the current sources with a version 1.01 tag, to indicate the single change from the 1.0 code that I made available at I had to change the internal package name, from "editthispage" to "edit- this-page", since using hyphens in package names is the accepted convention.

Unfortunately, the package name change causes difficulty if you've got an existing installation of ETP. You'll need to install the new package and use it to recreate all your content sections and content items. This is because the APM data model uses package_name as a foreign key, and postgresql won't allow you to update it.

Now that the code is part of openacs-4, it's easier to accept contributions from the community. Soon we'll be checking in a keyword/categorization feature, thanks to Dave Bauer. If you're appalled by the lack of Feature X, please contact me or discuss it on this thread, and we'll try to converge on a good design that can become part of the standard package.

Here are the features that I consider most important to add. If you would like to take any of these on, please let me know.

  • Date/time widget and validation
  • Port SQL directory to Oracle
  • Integration with a site-wide image-management interface that stores images in the content-repository tables. (Does anything like this exist yet?)
  • Tuning the get_content_items query for scalability
THANK YOU! to the 40 people who registered at and sent me feedback on the demo.
Posted by Ed Avis on
Integration with a site-wide image-management interface that stores images in the content-repository tables. (Does anything like this exist yet?)

Heh. I wrote a basic image-management package at aD. Its main advantage is making it easy to include pictures in other packages and get administration of them 'for free'; it doesn't do much interesting stuff with the images themselves (though it does generate pleasingly low-bandwidth thumbnails). It's called simple-pictures and it's part of my leftover ACS stuff. There have actually been a few bugfixes recently, I'll upload a new version to that page soon.

Making it use the content repository was something I never got around to doing...

Posted by Jun Yamog on
Hi Ed,

This must be what I am looking for.  Thumbnail generator.  I need to make on for file-storage.  So basically file-storage will display image thumbnails if the mime type is an image.  I will be looking at simple pics package.  I will borrow or adapt your code.  If possible maybe just use your simple pics.


Posted by Walter McGinnis on

You may also want to check out the photo-album code (PG
version is now at the point of testing).  It relies on a few
extensions for the image content type to the CR that Dan and I
are working out.  Email me for the extensions if you need them
right away.

Posted by Ed Avis on
The thumbnails are generated with a long ImageMagick command line (ImageMagick seems to be the conventional thing to use for this, it has been used for other ACS Tcl sites).
Posted by Tilmann Singer on

I just installed edit-this-page-1.01.apm on a fresh openacs4 system (cvs updated today). I mounted an instance of edit-this-page, visited that url, clicked "create new subtopic", filled the two fields and get the following error after submitting:

Request Error
Query did not return any rows.
    while executing
"db_1row get_application_parameter_id """
    invoked from within
"if { $confirmed == "t" } {
    if { [empty_string_p $subtopic_name] ||
         [regexp {[^a-zA-Z0-9-_]} $subtopic_name] } { ad_return_complaint 1 "..."
    ("uplevel" body line 21)
    invoked from within
"uplevel { ad_page_contract {
    @author Luke Pond (
    @creation-date 2001-07-06     Presents a simple form for creatin..."
    (procedure "code::tcl::/web/lari/packages/edit-this-page/www/etp-subtopi..." line 2)
    invoked from within "code::tcl::$__adp_stub"
    invoked from within
"if { [file exists $__adp_stub.tcl] } {       # ensure that data source preparation procedure exists and is up-to-date
      adp_init tcl $__adp_stub
..." [...]

That's because there are two places where it still says editthispage instead of edit-this-page: www/etp-subtopic-create.xql and tcl/etp-procs.xql. After correcting those two files it seems to work fine.

Posted by Don Baccus on
Thanks, Tilman ... I took the liberty of changing the two and committing  the changes to the CVS tree.  Didn't test though because I'm on my way out the door, but I did double-check to see that I spelled "edit-this-page" correctly...
Posted by Jon Griffin on
I just installed this and can't seem to get the thing to work. It seems that:
cd /web/MYSERVER/www
mkdir index-backup
mv index* index-backup
ln -s ../packages/edit-this-page/www/index.vuh .

doesn't allow me to edit. Also my package is mounted at /etp and all pages are relative to this. I must be confused.
One other thing that breaks is:
etp::modify_application default {
    index_template        www/templates/article-index
    content_template      www/templates/article-content
breaks the link and gives me a not found error.

Am I missing something stupid?

Posted by Tilmann Singer on
I think etp is getting confused when mounted under the url /etp. xxx/etp is the generic url that will be constructed for the editing view of a page - it may think it is the editing view of itself or something strange like that.
Posted by Luke Pond on
I just tested mounting the package at /etp and it works fine.

Jon, the way to debug this is to look in your error log for the two messages that get written out by ETP's index.vuh for each request. They'll tell you what is the URL of the actual template that ETP is going to serve.

If you don't see a link that says "Edit this page", then either a) the page it's serving is using a master template that doesn't display the result of etp::get_etp_link, or b) you don't have admin permission on the package and therefore etp::get_etp_link doesn't generate the link.

Posted by Jon Griffin on
Is etp supposed to be sub-site aware?
I can't get it to work on a 2001-10-22 tarball.
Posted by Luke Pond on
Hi Jon, please provide more information.  What exactly isn't working?
Posted by Jon Griffin on
I mounted a subsite called agents.
Then I created a new instance of etp called agents-static and mounted it.

I get the following suggesting it isn't working with sub-sites:

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
    while executing
"ns_pg_bind 0or1row nsdb0 {
select content_folder__new(:name, :title, '', etp_get_folder_id(:parent_package_id));
Again, this is running tarballs and cvs updates so maybe it is something to do with that.