Created
December 17, 2011 03:37
-
-
Save nthx/1489057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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