Forum OpenACS Q&A: Walkthrough of Creating, Publishing, and Displaying Content

I have (re)searched the boards and other resources looking for the
steps required to perform what I believe should be the simple and
straightforward task of creating and displaying content items on a
page.

I would think that this would be the first thing to be done by anyone
after perfoming the basic installation of OpenACS 4. Yet, I was
unable to determine how to do this.

Let's say that I want to create a brand new website and I want that
site's main page to look something like dev.openacs.org, with
templated header, footer, and content; and a templated Articles box.

Furthermore, I want to create and publish both the main page content
and the News box content through the content repository with whatever
tools are required to do this. I don't care if the tool is ETP, CMS,
modetp, or some other method, I just want it to work.

I am seeking assistance in learning the process that I've outlined
above. I figure that, if I can do the simple layout described, I can
extrapolate to develop an entire site.

Thanks in advance you for your time.

Randy

Hi Randy,

The first step is to experiment with the subsite templates.  Read on ACS Templating.

Try to start on the Skin demo.  http://youracs/doc/skin/

Thank you, Jun. That was an educational experience in how the templating system works.

Now, I would like to try creating, submitting, publishing, editing, and retrieving some content through the content repository.

How can this be accomplished?

Hi Randy,

First of read the CR doc.  And the API its a hidden treasure of OpenACS.  You can also try ETP.

Here is how things basically work.

Create a acs_object, and cr_item.  You can then add a acs_object and cr_revision.  Of course all cr_revision must point to a cr_item.  You can also put your items on a special container item called cr_folder.

Normally when publishing just set the cr_item.live_revision to the revision you want to publish. And your queries should query this column to get the correct cr_revisions row. There are some api to get the content out or just select the cr_revisions.content column.

Make sure that you do all of this via CR's api.  Although you can insert the rows manually its not encouraged.  I use to do this but slowly I am also learning to use the CR api.

If you are not in a hurry study the CR and CMS package well.  Don't be like me who rushed on things.  Although in my case I did not have a choice since my job is always fast track this and that.

Thank you again, Jun. I will look at the doc and code you suggest.

However, isn't there some UI to do all of this? I have seen mention of CMS, ETP, and modetp. I have looked at the confusing interface of CMS and the ETP demo (nothing on modetp). I just can't figure out how to use the stuff to publish content and display it magically from the CR. Is there a step-by-step dummy users' guide somewhere?

Thank you.

Randy,

I have not yet seen a document such as you are looking for.  As I am in the process of learning how to do such things, I may well be writing one in the near future.  Would you like to help me with it?  I plan to take notes as I discover things and try to flesh them out as things become clear to me.  It will likely start life as a wimpy point presentation here on openacs.org - simple way to make text available.

Randy,

CMS and ETP _are_ user interfaces to the content repository. The point of a user interface over the CR is to hide the details of the CR from the user. The user has no need to know how the content is stored.

If you want to write your own UI the content repository documentation explains how the datamodel works and explains the APIs to access content in the CR.

The way to get content out of the CR is to query the database using the CR APIs and to display it you need to use the templating system that is built in to OpenACS.

Hi Randy,

I hope you would have an expectation that CR and CMS are one of the biggest and complex parts of OpenACS.  I advise you to look at templating more.  Also file-storage is a good app that makes use of CR too.

Gregory, I would be happy to contribute my findings so that others may benefit from my stumbling through this.

Dave, thanks for responding. I am aware that CMS and ETP are interfaces to the CR subsystem. I have looked and clicked around in both. What I am really seeking is guidance in using either these or other interfaces to publish content through the CR. I will analyze the CR code and experiment with the CR API _only_ if I find that the existing higher level tools are inadequate. My feeling at this point is that the tools will probably work. What I need is for someone(s) familiar with using the tools to summarize (the more specific, the better) their use. I know there are folks out there that can do this... I see that dev.openacs.org is built using the CR and ETP as can be seen in my CVS snapshot of that site. As a matter of fact, that CVS snapshot was what whetted my appetite and sent me down this road.

Jun, thanks again for your insight. I believe you when you say that CR and CMS are big and complex, and I hope to someday truly appreciate their elegance. But I would really like to understand how to use existing UIs to perform high-level operations. I expect I'll soon be looking also to manipulate subsites, groups, and permissions from this same high-level perspective.

Thank you all.

Randy