Forum OpenACS Development: Re: moving and copying objects

Collapse
Posted by Malte Sussdorff on
One thing to note: "Move" really means just that. The term associated with the class is exchanged.

In your case what you need to do is create a new instance of the class and copy the existing information to the new class.

Now, we have two possible ways to go about it:

1) Really create new package instances for each of the functionalities and copy the data over manually.

2) Mount the existing packages of the "old" class in the "new" class. This will allow the reuse of e.g. the file-storage both in the "new" and "old" class. Sadly, this means that any change done in the "new" class would reflect also on the "old" class. Not to mention that I'm not even sure this trick will work on .LRN or if .LRN has more mechanisms in place to prevent multiple mounting of a package instance.

Collapse
Posted by Luis de la Fuente on

1) Really create new package instances for each of the functionalities and copy the data over manually.

I would like to develop the functionalities to do this task in an easy way. Unfortunately, this way means the duplication of contents in the database.

2) Mount the existing packages of the "old" class in the "new" class. This will allow the reuse of e.g. the file-storage both in the "new" and "old" class. Sadly, this means that any change done in the "new" class would reflect also on the "old" class. Not to mention that I'm not even sure this trick will work on .LRN or if .LRN has more mechanisms in place to prevent multiple mounting of a package instance.

As you say, i don't think that .LNR is capable to manage this (two references of the same object of the database). Anyway, the actual issue of copying object is to get it without comments or something else. Just think that comments can be done by members which are not included in the "second" class, so you don't need this comments.

Obviously, all the objects has different behaviour, so each of them has to be studied alone.