def startVersion(self, REQUEST=None): """ """ if not self.checkPermissionEditObject(): raise EXCEPTION_NOTAUTHORIZED, EXCEPTION_NOTAUTHORIZED_MSG if self.hasVersion(): raise EXCEPTION_STARTEDVERSION, EXCEPTION_STARTEDVERSION_MSG self.checkout = 1 self.checkout_user = self.REQUEST.AUTHENTICATED_USER.getUserName() version = exfile_item(self.id) self._setObject('version', version) version = self._getOb('version') version.copy_naaya_properties_from(self) self.copyFileItems(self, version) self._p_changed = 1 self.recatalogNyObject(self) if REQUEST: REQUEST.RESPONSE.redirect('%s/edit_html' % self.absolute_url())
def startVersion(self, REQUEST=None): """ """ if not self.checkPermissionEditObject(): raise EXCEPTION_NOTAUTHORIZED, EXCEPTION_NOTAUTHORIZED_MSG if self.hasVersion(): raise EXCEPTION_STARTEDVERSION, EXCEPTION_STARTEDVERSION_MSG self.checkout = 1 self.checkout_user = self.REQUEST.AUTHENTICATED_USER.getUserName() self.version = exfile_item(self.id, self.title, self.description, self.coverage, self.keywords, self.sortorder, '', '', '', self.downloadfilename, self.releasedate, self.gl_get_selected_language()) self.version._local_properties_metadata = deepcopy(self._local_properties_metadata) self.version._local_properties = deepcopy(self._local_properties) self.version.setProperties(deepcopy(self.getProperties())) self.copyFileItems(self, self.version) self._p_changed = 1 self.recatalogNyObject(self) if REQUEST: REQUEST.RESPONSE.redirect('%s/edit_html' % self.absolute_url())