Forum OpenACS Development: acs_object_types.package_name ?

Collapse
Posted by Malte Sussdorff on
What is the package_name of acs_object_types supposed to contain. The name would suggest tha name of the package that created the object_type (or shouldn't it be called package_key). Sadly, this is not the case, but it contains the object_type (so the column object_type and package_name are identical).

I was about to modify apm_package__delete to delete all object types created by this package, but well, now it has to be done for the package individually...

Collapse
Posted by Malte Sussdorff on
Two and a half hour later I managed to uninstall xowiki (horray) and made some changes to the content_type__delete procedure.

Would anyone with Oracle please test this?

Here are the relevant commits:

http://xarg.net/tools/cvs/change-set-details?key=25307

If you want to see how it is called, here is the change to xowiki:

http://xarg.net/tools/cvs/change-set-details?key=25306

P.S.: I could not find a test for deleting a package and I don't have the stomach to write one, maybe someone can take a stab at it during the next bug stomp? sorry...

Collapse
Posted by Emmanuelle Raffenne on
Hi Malte,

I've tested your changes on Oracle and got errors during installation. I didn't test yet the upgrade. See https://openacs.org/bugtracker/openacs/bug?bug%5fnumber=3008. Sorry if I didn't test before, was on vacations. I post the bug yesterday before I saw this thread.

Collapse
Posted by Malte Sussdorff on
Hi Emmenuelle, could you take a look at the issue. I don't have Oracle, but if it is defined twice, just use the definition in the upgrade script 😊
Collapse
Posted by Emmanuelle Raffenne on
Thanks Malte. I've fixed it and committed to HEAD.
Collapse
Posted by Dave Bauer on
Malte Package name refers to PL/SQL package for that type.
Collapse
Posted by Dave Bauer on
You just need to perform content_item__delete you don't need to delete all the revisions because content_item__delete will do that.
Collapse
Posted by Malte Sussdorff on
It does? Cool, because when I tried it told me referential integrity constraint, deleting live revision.

Therefore I assumed we have a chicken and egg problem, content_item__delete deletes the revisions first (which it must as they are linked to the item) but then you delete the live revision, which is not allowed either. And I had written the code anyway, as we cannot be sure (as in the case of ::xowiki::Page type) that the content_type of the item is the content_type I want to delete.

On the other hand, that was before I wrote the code with content_item__delete based on the content_type (I tried the object_type), so maybe I just got confused half way down the road.

As I will install and delete XoWiki for testing purposes anyway a couple of times I will give it a try (without the revisions)

Collapse
Posted by Dave Bauer on
content_item__del has deleted live revisions since
http://cvs.openacs.org/cvs/openacs-4/packages/acs-content-repository/sql/postgresql/content-item.sql?rev=1.63&view=markup

IE: raise
NOTICE ''Unsetting live and latest revisions...'';
update cr_items set live_revision = null, latest_revision = null where item_id = delete__item_id;