}
}
// manage if versionID is not came by request
VersionHistory history = VersionUtil.retrieveVersionHistory(context,
item);
if (versionID == null || versionID.isEmpty())
{
Version version = history.getVersion(item);
if (version != null)
{
versionID = String.valueOf(version.getVersionId());
}
}
String submit = UIUtil.getSubmitButton(request, "submit");
if (submit != null && submit.equals("submit_cancel"))
{
// Pressed the cancel button, redirect us to the item page
response.sendRedirect(request.getContextPath() + "/handle/"
+ item.getHandle());
context.complete();
return;
}
else if (submit != null && submit.equals("submit_delete"))
{
String[] versionIDs = request.getParameterValues("remove");
Integer result = doDeleteVersions(request, itemID, versionIDs);
if (result != null)
{
response.sendRedirect(request.getContextPath()
+ "/tools/history?delete=true&itemID="+history.getLatestVersion().getItemID());
}
else
{
// We have removed everything, redirect us to the home page !
response.sendRedirect(request.getContextPath());