public class EFormJcrTemplateProvider extends Object implements IEFormTemplateProvider, IRefreshable
Constructor and Description |
---|
EFormJcrTemplateProvider() |
Modifier and Type | Method and Description |
---|---|
javax.jcr.Session |
getJcrSession() |
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. |
String |
getNodeID() |
String |
getNodePath() |
byte[] |
getTemplateData() |
String |
getTemplateFileName() |
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 |
setJcrSession(javax.jcr.Session jcrSession) |
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 |
setNodeID(String nodeID) |
void |
setNodePath(String location) |
boolean |
supportsAutoRefresh()
Returns true if this content provider supports auto refresh feature.
|
public byte[] getTemplateData()
getTemplateData
in interface IEFormTemplateProvider
public void setNodeID(String nodeID)
public String getNodeID()
public void setNodePath(String location)
public String getNodePath()
public String getTemplateFileName()
getTemplateFileName
in interface IEFormTemplateProvider
public void setJcrSession(javax.jcr.Session jcrSession)
public javax.jcr.Session getJcrSession()
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 refresh() throws ContentProviderException
IRefreshable
refresh
in interface IRefreshable
ContentProviderException
- if error loading data from the data sourcepublic 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)