-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #1257: Added the DataverseRequest object, wrapping the datavers…
…e user and some request metadata.
- Loading branch information
1 parent
06bb98e
commit c10cbd9
Showing
118 changed files
with
911 additions
and
742 deletions.
There are no files selected for viewing
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
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
36 changes: 36 additions & 0 deletions
36
src/main/java/edu/harvard/iq/dataverse/DataverseRequestServiceBean.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package edu.harvard.iq.dataverse; | ||
|
||
import edu.harvard.iq.dataverse.engine.command.DataverseRequest; | ||
import javax.annotation.PostConstruct; | ||
import javax.enterprise.context.RequestScoped; | ||
import javax.inject.Inject; | ||
import javax.inject.Named; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.ws.rs.core.Context; | ||
|
||
/** | ||
* The service bean to go to when one needs the current {@link DataverseRequest}. | ||
* @author michael | ||
*/ | ||
@Named | ||
@RequestScoped | ||
public class DataverseRequestServiceBean { | ||
|
||
@Inject | ||
DataverseSession dataverseSessionSvc; | ||
|
||
@Context | ||
HttpServletRequest httpRequest; | ||
|
||
private DataverseRequest dataverseRequest; | ||
|
||
@PostConstruct | ||
protected void setup() { | ||
dataverseRequest = new DataverseRequest(dataverseSessionSvc.getUser(), httpRequest); | ||
} | ||
|
||
public DataverseRequest getDataverseRequest() { | ||
return dataverseRequest; | ||
} | ||
|
||
} |
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
Oops, something went wrong.