org.bejug.javacareers.jobs.view.jsf.action
Class ResumeAction
java.lang.Object
org.bejug.javacareers.jobs.view.jsf.action.BaseAction
org.bejug.javacareers.jobs.view.jsf.action.ResumeAction
- public class ResumeAction
- extends BaseAction
- Version:
- $Revision: 1.34 $ - $Date: 2005/12/20 15:36:47 $
- Author:
- Peter Symoens (Last modified by $Author: shally $)
|
Method Summary |
void |
displayResume(javax.faces.event.ActionEvent event)
Process the display resume action |
void |
listAllResumes(javax.faces.event.ActionEvent event)
Process the resume upload. |
void |
processAjaxSearch(javax.faces.context.FacesContext context,
java.lang.String prefix,
CompletionResult result)
Process delete resume. |
void |
processSimpleSearch(javax.faces.event.ActionEvent actionEvent)
Process the simple cv search action. |
void |
setCurrentItem(CurrentItem currentItem)
|
void |
setLucenePdfService(org.bejug.javacareers.jobs.service.LucenePdfService lucenePdfService)
Set lucenePdfService via Springs IoC injection. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResumeAction
public ResumeAction()
setLucenePdfService
public void setLucenePdfService(org.bejug.javacareers.jobs.service.LucenePdfService lucenePdfService)
- Set lucenePdfService via Springs IoC injection.
- Parameters:
lucenePdfService - JobService
listAllResumes
public void listAllResumes(javax.faces.event.ActionEvent event)
- Process the resume upload.
- Parameters:
event - the JSF action event.
public void processUploadResume(ActionEvent event) {
LOG.info("Debug: --executing processUploadResume");
PostResumeForm form = getUploadresumeForm();
User user = userTracker.getCurrentUser();
LOG.info("Debug: user = " + user);
String path = getFilePath(user);
form.getResume().setPublicationDate(form.getResume().getCreationDate());
//for some reason hibertnate does not delete the resume if you just override the users resume
if (user.getResume() != null){
user.getResume().setPublicationDate(form.getResume().getPublicationDate());
user.getResume().setTitle(form.getResume().getTitle());
}else{
user.setResume(form.getResume());
}
LOG.info("Debug: loading resume: " + path);
try {
File file = getUploadedFile(path);
if (file != null) {
user.setCvAvailable(true);
try {
adminService.storeUser(user);
} catch (DuplicateUserNameException e) {
LOG.error(e);
} catch (LastAdminException e) {
LOG.error(e);
}
//TODO update user, create update method
form.setInfoMessage("label_uploaded_ok");
form.setRenderInfoMessage(true);
LOG.info("Debug: Delegating to luceneIndexer: "
+ file.getAbsolutePath());
lucenePdfService.addToIndex(file.getAbsolutePath(), user.getUserName());
} else {
LOG.error("error loading resume: " + path);
LOG.error("error loading resume: " + path + " as internal "
+ file.getAbsolutePath());
}
} catch (IOException e) {
LOG.error("FileNotFoundException caught : " + path);
} catch (PdfException e) {
LOG.info("Debug: LuceneException caught");
}
}
/**
List all posted resumes
displayResume
public void displayResume(javax.faces.event.ActionEvent event)
- Process the display resume action
- Parameters:
event - the JSF action event.
processAjaxSearch
public void processAjaxSearch(javax.faces.context.FacesContext context,
java.lang.String prefix,
CompletionResult result)
- Process delete resume.
- Parameters:
context - the JSF contextprefix - a String containing the prefix.result - the completionresult of the ajax search.
processSimpleSearch
public void processSimpleSearch(javax.faces.event.ActionEvent actionEvent)
- Process the simple cv search action.
- Parameters:
actionEvent - the JSF action event.
setCurrentItem
public void setCurrentItem(CurrentItem currentItem)
- Parameters:
currentItem - The currentItem to set.
Copyright © 2005-2006 BeJUG. All Rights Reserved.