Forum OpenACS Development: RFC: Adding -resolve_index and -revision parameters to content::init

content::init can be used to resolve a URL to a content repository item. It seems like to useful parameters were left out of the procedure.

Currently content::init cannot resolve a URL for a folder to an index page. Default web site behavior is to return an index page when a URL that corresponds to a folder is accessed. content::init called content_item.get_path with the resolve_index parameter hard coded to "f". I would create an optional paramter and default it to "f" so that the default behavior would be the same.

The second change would be to allow an optional paramter to specify which revision to return. The options would be "live" or "best". Live would return  a live revision, and respond that no item was found if there is no live revision. Best would return the live revision if one existed, otherwise it would return the latest revision.

It would also be useful if content::init could check the publish_status and publish_date attributes of a content_item/content_revision to suppress unpublished items in a system that supported the concept of a release date for items.

Comments?

I think those changes sound good, and that this might be an appropriate moment to write a wrapper to it that has a more up-to-date interface (e.g., using named arguments).

Not many packages are using the mechanism yet - File Storage being the only one I know of which currently uses it.

Hi Dave,

I think it would be better to leave of "best" revision even though it existed in the plsql.  Initially I tried to use it but in turns out not much of a use and caused confusion.  I think its up to the package that uses content::init or whatever tcl api it is to decide what is "best" revision.  I propose to to have "live" and "latest" revision.

Jun,

Thanks. I will revise it to accept live or latest revision defaulting to live. This will allow more flexible optional behavior without changing default behavior.

Hi Dave,

Yes that will be great.

live or latest defaulting to live.

I changed my mind again.

There are tcl procs for item::best_revision and item::live_revision so I used those.

For now. Maybe it should support all three options, latest, live, best (live or latest if no live).