public class SessionDataProducer extends java.lang.Object implements SettableServeDataProducer
DEFAULT_SERVE_DATA_TAG
Constructor and Description |
---|
SessionDataProducer(AppContext conn,
java.lang.String tag) |
Modifier and Type | Method and Description |
---|---|
MimeStreamData |
find(int id) |
AppContext |
getContext() |
MimeStreamData |
getData(SessionService user,
java.util.List<java.lang.String> path)
Get a MimeStreamData corresponding to the data to be served
This method also implements access control and returns null if access is denied.
|
java.lang.String |
getDownloadName(SessionService user,
java.util.List<java.lang.String> path)
get a download file-name to be added to a download link.
|
java.lang.String |
getTag()
get the construction tag
|
java.util.List<java.lang.String> |
setData(MimeStreamData data)
Store a MimeStreamData object generating a new path location
|
public SessionDataProducer(AppContext conn, java.lang.String tag)
public MimeStreamData find(int id) throws DataException
DataException
public java.lang.String getTag()
Tagged
public AppContext getContext()
getContext
in interface Contexed
public MimeStreamData getData(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducer
SessionService
may not have a current person set so you have to check for
null SessionService
and null AppUser
as well as the users permissions.getData
in interface ServeDataProducer
java.lang.Exception
public java.util.List<java.lang.String> setData(MimeStreamData data)
SettableServeDataProducer
setData
in interface SettableServeDataProducer
data
- Data to addpublic java.lang.String getDownloadName(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducer
MimeStreamData.getName()
if ServeDataProducer.getData(SessionService, List)
returns a non-null value.
However this method may be called by display content generation code so if the result is generated on the fly it might be possible to generate the download name in
a more lightweight fashion. It should also work to always return null thought he browser will use the last part of the selection path as the downloadgetDownloadName
in interface ServeDataProducer
java.lang.Exception