def handleBuild(self, action): """\ Build the thing """ # validate all groups. errors = extractError(self) if errors: self.status = _(u"Unable to build exposure due to input error; " "please review the form and make the appropriate changes, " "update each subsection using the provided button, and try " "again.") return wh = zope.component.getAdapter(self.context, IExposureWizard) try: moldExposure(self.context, self.request, wh.structure) except ProcessingError, e: # XXX almost certainly a bad idea but this fixes # tracker item 3610. import transaction transaction.doom() self._doomed = True status = IStatusMessage(self.request) status.addStatusMessage(_(str(e)), 'error') # maybe the subscriber to this can do the rollback? raise ActionExecutionError(e)
def mold(self, target): """\ Creates the new exposure at target, using what is produced by the export method. """ exported = self.export() return moldExposure(target, self.request, exported)