Data Review and Modification API |
To enable this API, the system administrator must add datareviewapi=true to the servlet
parameters and restart the ViewsFlash application.
See also Revising Entries for an easier way to allow a visitor to enter data and revise it later, as in a Profile, for example.
In certain applications, it may be requirement to review or modify the contents of a submitted survey after it has been completed. The following queries allow this. These operations require that the data be stored in its own table or in the Normalized database format in the VWFDATA table. They do not work with data saved in a text file. The queries do not work on partially completed surveys, since they are not written to the database until the survey is completed or the survey is closed.
In the table below, "(reviewer only)" means that this option is only available when using application security, and the logged in user is an administrator with data review access rights, and that option is selected in the Settings / Security page.
Data Review
Command, parameters |
Operation |
cmd=reviewdata &pollid=pollingplace!poll |
Retrieves the survey form and fills it with data on a single page. The previous, next, save and submit buttons are not displayed. The form cannot be submitted. |
&review_uniqueid=UUU | The value to search for in review_fieldname. If multiple records meet the search, the most recent one will be displayed. ( reviewer only ) |
&style=TTT | If present, use this Poll Style template instead of the default. This is particularly useful to change the presentation to include a Print button and additional text on why this is a review and not an editable form. |
&review_fieldname=NNNN | (optional) The name of the database field to use to select a record. Leave blank to select a response based on the ID selected in the Security page. When saving data to its own table ( rather than the Normalized table), it is possible to select a response based on another column in the database; enter the column name here. Note: unless you have a reason for doing otherwise, omit this field. ( reviewer only ) |
&vwfdisableall=yes | (optional) If present, all editable fields such as radio buttons, text areas, etc., are disabled, giving a more clear idea that the data is presented in a read-only mode. |
Data Modification
Command, parameters |
Operation |
cmd=showupdata &pollid=pollingplace!poll |
Retrieves the survey form and fills it with data on a single page. Only the submit buttons is displayed. |
&review_uniqueid | The value to search for in review_fieldname. If multiple records meet the search, the most recent one will be displayed. ( reviewer only ) |
&review_redirect | (optional) If present, redirects to this URL after the form is updated. The url must be complete, including the leading http://. If not present, the updated form is shown in the same format as reviewdata. |
&style=TTT | (optional) If present, use this Poll Style template instead of the default. This is particularly useful to change the presentation to include a Cancel button or other navigation. |
&review_fieldname | (optional) The name of the database field to use to select a record. Leave blank to select a response based on the ID selected in the Security page. When saving data to its own table ( rather than the Normalized table), it is possible to select a response based on another column in the database; enter the column name here. Note: unless you have a reason for doing otherwise, omit this field. ( reviewer only ) |
If this page is submitted, the unique record identified by review_fieldname and review_uniqueid will be modified. Any values that have changed will be updated in the database. For security, it is not possible to issue a query that modifies data directly, but rather it is necessary to go through this URL.
How to use the data review and modification URLs
A common usage is to use the Response page's redirect field to redirect to
these URLs. For example, redirect to
/ViewsFlash/servlet/viewsflash?cmd=reviedata&pollid=XXX&style=reviewstyle
In the reviewstyle poll template, replace the Submit button with a Print button
and add a Continue button to redirect to another page.
These URLs can also be used in a JSP page that offers the opportunity to review or update a record.
Security
These commands are sent to the URL specified in the URL column in the table below. The options in the Security page determine who can review or modify data. A visitor can review or modify only his survey submission. When using User Security, only a user with Review Data access rights to the survey's place can review or modify anyone else's data; if not using User Security, only the visitor who created his survey can review or modify his own data. Depending on the option in the Security, page, here's the review_uniqueID used:
Review | Modify | URL | |
No one | N/A | N/A | |
The visitor , right after completing it | The user ID from the survey's Authentication method; review_uniqueid is ignored | same | servlet/viewsflash |
The visitor, anytime after completing it | The user ID from the survey's Authentication method; review_uniqueid is ignored | same | servlet/viewsflash |
Aministrator with access rights | Uses review_uniqueid | same | servlet/vfadmin |
Data updating looks for a unique ID and fieldname saved by the showupdata command, rather than the command line or form fields, so that data cannot be changed by simply entering a URL.