Forum OpenACS Development: Edit this Page

Collapse
Posted by Jon Griffin on
Edit this Page is temporarily broken.

I am updating this for Oracle and also the PG version for code style. I need to make the etp_* procs etp__* to be consistent with the rest of OpenACS.

When is Ben Adida going to write the code standards doc ;)

Collapse
2: Response to Edit this Page (response to 1)
Posted by Jon Griffin on
The PG version of Edit This Page should be functional again. Oracle definitly won't work,,, yet.

I just checked in 1.1d and it is ready to be hammered on.

Please note that the PG drop script I added isn't really working 100%. This is due to the fact that PG won't allow you to drop a column without dropping the table (yes I know there are other ways, all of which are unsafe on a busy system). Probably this column will just be added to the CR and not have some other package trying to alter its tables.

Also, I didn't have time to write the proc to delete the APM parameters, as the APM api is very lame for most things relating to delete.

Collapse
3: Response to Edit this Page (response to 1)
Posted by Jon Griffin on
I was asked to publicly get some response on adding a the package_id column to cr_folders.

In my (and others) opinions this is the correct way to deal with the CR. This way the progam can answer which folders are from my package.

The way the original (unusable, POS) CMS, worked was by displaying EVERY piece of content on the entire sub-site and I believe in reality, the entire site. This is completly insane. Imagine the implications.

One other thing, I think we need to set a policy of not letting one package modify anothers data-model. At the very least a table can be created with the relevant columns from the parent package and your modified data (in fact that is another way to do the ETP problem). I think in this case though that cr_folders should be modified to add that column as undoubtedly it is useful for more than ETP.

Collapse
4: Response to Edit this Page (response to 1)
Posted by Don Baccus on
I told Jon pretty much the above when he first queried me, so obviously our thinking is inline.
<p>
The problem with the original CMS is real (well, it wasn't real in its original context as the "ACS killer" where it wouldn't have to worry about nasty CR objects created by non-CMS packages living in that horrible ACS space).  The two got "integrated" but not really, the ACS poaches the CMS CR (rightly so) while the CMS still piggedly rolls in the mud of its presumption that it runs standalone, with no db api to call on other than it's own, full of its own proc call conventions divorced from aD proc, etc etc.
<p>Anyway, as it stands someone with the right perms and the CMS can muck with CR content from any package that stores content in the CR, whatever controls such packages think they have over content. *evil*
<p>And yes, of course, let's not ALTER SOME_OTHER_PACKAGES_DATAMODEL_IN_MY_DATAMODEL!  This path leads to unmaintainable spaghetti.  If a package you need to depend on has an inadequate datamodel, either subtype it or change the package itself (after community discussion, of course!)
Collapse
5: Response to Edit this Page (response to 1)
Posted by Neophytos Demetriou on
Adding a package_id to the CR folders will make package-specific searching easier (a request by many community members). So, thank you very much Jon for undertaking this.
Collapse
6: Response to Edit this Page (response to 1)
Posted by Jon Griffin on
I added the package_id to cr_folders.

Anyone wanting to use Edit This Page should either modify their CR manually, or delete and start fresh.

The PG versions should be fine. The Oracle ETP is definitly broke.

Collapse
7: Another quirk in ETP (response to 1)
Posted by John Mileham on
ETP drops cr_item_publish_audit and recreates it to get rid of constraints, citing a bug in PG 7.1.  A nasty side effect of the change is that it breaks all CR stored procedures referring to the table (notably content_item__delete).  I assume that this is because once compiled, they refer to the table only by its ID, which is rendered useless in this process.  This could be looked at as a bug (or at least weakness) in PG, but I wonder what we can do about it from the ACS side.  Would it be worth switching the constraints off within the CR create scripts, upping its package version, removing the offending code from ETP and requiring the incremented CR version number?  I confess that I don't really know what constraints needed dropping or what the PG 7.1 bug was that made it necessary.
Collapse
8: Response to Edit this Page (response to 1)
Posted by Don Baccus on
I was unaware of this, thanks for bringing it to our attention.

As far as the function problem goes, PG 7.3 will have a "CREATE OR REPLACE" function capability that will fix that problem (for those of you wondering why Oracle has that construct, it's to avoid the very same  problem).

We should dig into the constraints issue more deeply.  Any volunteers?  Dropping the table will also kill any audit history you've built up before installing ETP which doesn't sound very cool to me...

Collapse
9: Response to Edit this Page (response to 1)
Posted by John Mileham on
It backs up the contents of the table in a temp table before dropping it and repopulates.  there is no data loss in the audit table, just broken functions, which result unhappily in the etp drop script not working correctly, among (I assume) other problems.
Collapse
Posted by Luke Pond on
Thanks for bringing this up, John.  I will remove that workaround from etp-create.sql.  Can't believe I never noticed that it breaks content_item__delete!!  Especially since the reason I put it there in the first place was that I was trying to get delete to work.  This is irrelevant now since I just move deleted pages to a "Trash" folder, in hopes of implementing an undo function one day.
Collapse
Posted by Stephen . on
Is cr_folders the right place to put the package_id? Why not acs_objects? Do only content repository items need to know which package they belong to?

What about the site_nodes / cr_folders situation? The content repository doesn't play nicely with the rest of ACS which is mounted on site nodes. The site nodes data model supports package_id's already...

Collapse
Posted by Jon Griffin on
It probably should go in acs_objects, but in the interest of not having to rewrite a lot of code (and breaking a lot of installs), I put it there.