public class EFormContentProvider extends Object implements IRefreshable
Constructor and Description |
---|
EFormContentProvider() |
Modifier and Type | Method and Description |
---|---|
void |
convertBeanToBinary()
Converts beanData into eformData using the template
|
void |
convertBinaryToBean()
Converts e-form data into bean data
|
void |
download()
Streams generated e-form file to the client.
|
ValueBinding |
getBeanBinding() |
Class<?> |
getBeanClass() |
Object |
getBeanData() |
byte[] |
getBinaryData()
Returns e-form binary data generated from data bean using template
|
IFileExportBeanEx |
getDownloadFile() |
String |
getFileName() |
boolean |
getNeedRefresh()
Returns
true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh() method. |
IEFormTemplateProvider |
getTemplateProvider() |
org.apache.commons.fileupload.FileItem |
getUploadFile() |
boolean |
isAutoRefresh()
Returns
true if the provider is currenlty in auto-refresh mode |
void |
refresh()
(Re)loads data from the data source.
|
void |
setAutoRefresh(boolean autoRefresh)
Sets auto refresh mode on.
|
void |
setBeanBinding(ValueBinding beanBinding)
Sets IS document bean value binding
|
void |
setBeanClass(Class<?> beanClass) |
void |
setBeanData(Object beanData)
Sets new e-form data bean (IS Document) instance to use for generation of e-form file
|
void |
setBinaryData(byte[] binaryData) |
void |
setFileName(String fileName)
Sets e-form file name
|
void |
setNeedRefresh(boolean needRefresh)
Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any
output property is requested via
IContentProvider.getValue(Object) . |
void |
setTemplateProvider(IEFormTemplateProvider templateProvider) |
void |
setUploadFile(org.apache.commons.fileupload.FileItem uploadFile)
Convenience property to bind to the File Upload control
and use as the source for the
#setBinaryData() |
boolean |
supportsAutoRefresh()
Returns true if this content provider supports auto refresh feature.
|
void |
upload()
Handles conversion of uploaded e-form file into the document and sets
the bean value.
|
public IEFormTemplateProvider getTemplateProvider()
public void setTemplateProvider(IEFormTemplateProvider templateProvider)
public ValueBinding getBeanBinding()
public void setBeanBinding(ValueBinding beanBinding)
beanBinding
- must not be nullpublic Object getBeanData()
setBeanData(Object)
public void setBeanData(Object beanData)
public Class<?> getBeanClass()
public void setBeanClass(Class<?> beanClass)
public String getFileName()
setFileName(String)
public void setFileName(String fileName)
fileName
- for downloaded e-formpublic void refresh() throws ContentProviderException
IRefreshable
refresh
in interface IRefreshable
ContentProviderException
- if error loading data from the data sourcepublic void convertBeanToBinary() throws ContentProviderException
ContentProviderException
public void convertBinaryToBean() throws ContentProviderException
ContentProviderException
public byte[] getBinaryData()
public void setBinaryData(byte[] binaryData)
public IFileExportBeanEx getDownloadFile()
public org.apache.commons.fileupload.FileItem getUploadFile()
public void setUploadFile(org.apache.commons.fileupload.FileItem uploadFile)
#setBinaryData()
uploadFile
- public void download() throws ContentProviderException
ContentProviderException
public void upload() throws ContentProviderException
ContentProviderException
public boolean getNeedRefresh()
IRefreshable
Returns true
when IRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh()
method.
Implementations may return an accurate value from this method if they can track the changes to the input parameter
properties or they may require the clients to call IRefreshable.setNeedRefresh(boolean)
explicitely.
getNeedRefresh
in interface IRefreshable
true
when the output properties are not up-to-date with the current input parameters, i.e. IRefreshable.refresh()
needs to be executed manually or automatically.public boolean isAutoRefresh()
IRefreshable
true
if the provider is currenlty in auto-refresh modeisAutoRefresh
in interface IRefreshable
public void setAutoRefresh(boolean autoRefresh) throws ContentProviderException
IRefreshable
Sets auto refresh mode on. When auto refresh mode is on, the provider calls IRefreshable.getNeedRefresh()
to determine whether the refresh needs to be done before returning any result properties. If it returns
true
, the provider calls IRefreshable.refresh()
method to updated the result properties.
setAutoRefresh
in interface IRefreshable
autoRefresh
- true to turn it onContentProviderException
- if auto refresh mode is not supportedIRefreshable.supportsAutoRefresh()
,
IRefreshable.getNeedRefresh()
,
IRefreshable.setNeedRefresh(boolean)
public void setNeedRefresh(boolean needRefresh)
IRefreshable
IContentProvider.getValue(Object)
.setNeedRefresh
in interface IRefreshable
needRefresh
- true
if the input parameters have changedpublic boolean supportsAutoRefresh()
IRefreshable
supportsAutoRefresh
in interface IRefreshable
IRefreshable.setAutoRefresh(boolean)