Example of an exception based update

satya - Friday, February 17, 2012 2:05:01 PM

How to do updates in Aspire

How to do updates in Aspire

satya - Friday, February 17, 2012 2:05:47 PM

Raising an exception through a filter


request.DFUL.validateExistingFile.classname=com.ai.db.DBRequestExecutor2
request.DFUL.validateExistingFile.stmt=select * from file_attachments where filename = {datafile_filename.quote} and file_id = {reportId}
request.DFUL.validateExistingFile.filterName=VEFFilter

request.VEFFilter.classname=com.ai.filters.EmptySetValidator
request.VEFFilter.exception_message=DUPLICATE_FILENAME:filename already exists

satya - Friday, February 17, 2012 2:13:08 PM

here is how to respond to the exception


request.DocFUL.redirectURL=/akc/display?url=UploadMPURL&reportId={reportId}&ownerUserId={ownerUserId}

request.DocFUL.failureRedirectURL.DUPLICATE_FILENAME=/akc/display?url=UploadMPURL&reportId={reportId}&ownerUserId={ownerUserId}&status=dulicate&filename={datafile_filename}

satya - Friday, February 17, 2012 2:59:01 PM

Or you can do this more elegantly


###################################
# DFSoftDelete
#    Delete a folder if it has no children
# inputs: folderId
###################################
request.DFSoftDelete.classname=com.ai.parts.CollectionWorkSplitterObjectPart
request.DFSoftDelete.db=reportsDB
request.DFSoftDelete.query_type=update
request.DFSoftDelete.collectionRequestName=DFFiledItems
request.DFSoftDelete.emptyRequestName=DeleteFolderRow
request.DFSoftDelete.beginRequestName=DFRejectDelete

##if successful go to folders page
request.DFSoftDelete.redirectURL=/akc/display?url=ShowFiledReportsJSPURL&ownerUserId={profile_user}

##if failure go to same page and warn the user
request.DFSoftDelete.redirectURL.DFNonEmptyFolder=\
/akc/display?url=DeleteFolderURL&errorCode=NonEmptyFolder


##DFRejectDelete
request.DFRejectDelete.classname=com.ai.parts.SubstitutionPart
request.DFRejectDelete.substitution=DFNonEmptyFolder
request.DFRejectDelete.resultName=aspire_target_url

satya - Sat Apr 28 2012 15:06:08 GMT-0400 (Eastern Daylight Time)

See this page for managing view state for forms

See this page for managing view state for forms