Commit f8f20a40 authored by 's avatar

Added _postCopy

parent 3be8ce4e
"""Copy interface""" """Copy interface"""
__version__='$Revision: 1.1 $'[11:-2] __version__='$Revision: 1.2 $'[11:-2]
import Globals, Moniker, rPickle import Globals, Moniker, rPickle
from cPickle import loads, dumps from cPickle import loads, dumps
...@@ -45,6 +45,7 @@ class CopyContainer: ...@@ -45,6 +45,7 @@ class CopyContainer:
obj=obj._getCopy(self) obj=obj._getCopy(self)
obj._setId(clip_id) obj._setId(clip_id)
self._setObject(clip_id, obj) self._setObject(clip_id, obj)
obj._postCopy(self)
return self.manage_main(self, REQUEST) return self.manage_main(self, REQUEST)
...@@ -62,6 +63,10 @@ class CopySource: ...@@ -62,6 +63,10 @@ class CopySource:
# Ask an object for a new copy of itself. # Ask an object for a new copy of itself.
return loads(dumps(self)) return loads(dumps(self))
def _postCopy(self, container):
# Called after the copy is finished to accomodate special cases
pass
def _setId(self, id): def _setId(self, id):
# Called to set the new id of a copied object. # Called to set the new id of a copied object.
self.id=id self.id=id
......
...@@ -6,16 +6,12 @@ ...@@ -6,16 +6,12 @@
<!--#if moniker--> <!--#if moniker-->
<!--#in moniker--> <!--#in moniker-->
<H2>Paste <!--#var sequence-var-mtype--></H2> <H2>Paste <!--#var sequence-var-mtype--></H2>
<!--#/in moniker-->
<!--#else moniker-->
<H2>Paste Item</H2>
<!--#/if moniker-->
<!--#if bad--> <!--#if bad-->
<EM>An item with the specified id exists</EM>. <EM>An item with the specified id exists</EM>.
Please specify another id. Please specify another id.
<!--#else bad--> <!--#else bad-->
Please specify the id to use for this item. Please specify the id to use for this <!--#var sequence-var-mtype-->.
<!--#/if bad--> <!--#/if bad-->
<FORM ACTION="pasteFromClipboard" METHOD="POST"> <FORM ACTION="pasteFromClipboard" METHOD="POST">
...@@ -26,11 +22,7 @@ Please specify the id to use for this item. ...@@ -26,11 +22,7 @@ Please specify the id to use for this item.
</TD> </TD>
<TD ALIGN="LEFT" VALIGN="TOP"> <TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="clip_id" SIZE="40" <INPUT TYPE="TEXT" NAME="clip_id" SIZE="40"
<!--#if moniker--> VALUE="<!--#var sequence-var-id-->">
<!--#in moniker-->
VALUE="<!--#var sequence-var-id-->"
<!--#/in moniker-->
<!--#/if moniker-->>
</TD> </TD>
</TR> </TR>
<TR> <TR>
...@@ -41,6 +33,8 @@ Please specify the id to use for this item. ...@@ -41,6 +33,8 @@ Please specify the id to use for this item.
</TR> </TR>
</TABLE> </TABLE>
</FORM> </FORM>
<!--#/in moniker-->
<!--#/if moniker-->
</BODY> </BODY>
</HTML> </HTML>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment