Skip to content

Instantly share code, notes, and snippets.

@nthx
Created December 17, 2011 03:37
Show Gist options
  • Save nthx/1489057 to your computer and use it in GitHub Desktop.
Save nthx/1489057 to your computer and use it in GitHub Desktop.
public class ProlongCopy
extends IlybraAction
{
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
{
BookForm bookForm = (BookForm) form;
String prolongDate = bookForm.getReturnDate();
Library library = getWorld().getLibrary(); //the first reason for
//the base IlybraAction class
Copy copy = library.getCopies().getCopyById(
bookForm.getCopyId()
);
Utils.notNullAssertion("Copy: ", copy);
//I wait for this to become an aspect :)
library.prolongCopy(copy, Dates.someDateByString(prolongDate));
saveOneMessage(request, "message.prolong.change.success",
copy.getSignature());
//second reason for IlybraAction
return mapping.findForward("success");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment