|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.bean.BaseFacesBean
com.webmethods.caf.faces.bean.BaseFacesSessionBean
com.webmethods.caf.faces.data.csp.CSPBaseProvider
com.webmethods.caf.faces.data.csp.CSPAttachmentsProvider
public class CSPAttachmentsProvider
Attachments provider for fetching files from CSP
This attachments provider is intended to be used for exposing files from CSP. However to
work properly it should be provided with Session
instance and a content id
Field Summary | |
---|---|
static String |
CSP_TMP_DIR
|
Fields inherited from class com.webmethods.caf.faces.data.csp.CSPBaseProvider |
---|
fRetrievalModule, fSession |
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean |
---|
fExpireWithPageFlow |
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean |
---|
DATA_BINDING_CLIENTS, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders |
Constructor Summary | |
---|---|
CSPAttachmentsProvider()
|
Method Summary | |
---|---|
void |
addAttachment(FileItem fileItem,
String fileEncoding)
Add Attachment |
protected void |
checkState()
Check if a RetrievalModule has been properly inited.If not it most probably means a session is not set. |
String |
createHttpUrl(String smiPath)
|
String |
getContentId()
Returns the content id whose children will be listed |
String |
getDateAsString(Date date)
|
String |
getDownloadProtocol()
Returns the download protocol that will be used when download link is created. |
boolean |
getHasAttachments()
Returns whether the attachment provider has any attachments |
int |
getHttpPort()
Returns the download port that will be used when download link is created. |
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. |
Date |
getStringAsDate(String str)
|
boolean |
isAddAttachmentsAvailable()
Returns whether attachments can be added |
boolean |
isAutoRefresh()
Returns true if the provider is currenlty in auto-refresh mode |
boolean |
isPermanentDelete()
|
List |
listAttachments()
Returns a list of the current attachments |
void |
refresh()
(Re)loads data from the data source. |
void |
removeAttachment(String attachmentID)
Remove Attachment |
void |
setAutoRefresh(boolean autorefresh)
Sets auto refresh mode on. |
void |
setContentId(String contentId)
Sets the content id whose children will be listed. |
void |
setDownloadProtocol(String downloadProtocol)
Sets the download protocol that will be used when download link is created |
void |
setHttpPort(int httpPort)
Sets the download port that will be used when download link is created |
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 |
setPermanentDelete(boolean permanentDelete)
|
boolean |
supportsAutoRefresh()
Returns true if this content provider supports auto refresh feature. |
void |
updateAttachment(String attachmentID,
FileItem fileItem,
String fileEncoding)
Update an Attachment |
static void |
uploadFileSMI(Session session,
FileItem sourceFile)
|
Methods inherited from class com.webmethods.caf.faces.data.csp.CSPBaseProvider |
---|
getSession, release, setSession |
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean |
---|
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound |
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean |
---|
createMethodBinding, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CSP_TMP_DIR
Constructor Detail |
---|
public CSPAttachmentsProvider()
Method Detail |
---|
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 mode
isAutoRefresh
in interface IRefreshable
public String getDownloadProtocol()
public void setDownloadProtocol(String downloadProtocol)
downloadProtocol
- to be used when download link is createdpublic int getHttpPort()
public void setHttpPort(int httpPort)
httpPort
- to be used when download link is createdpublic 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 on
ContentProviderException
- 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)
public void setContentId(String contentId)
contentId
- Content id whose children will be listed. Mandatory.public String getContentId()
public static void uploadFileSMI(Session session, FileItem sourceFile) throws Exception
Exception
protected void checkState()
CSPBaseProvider
checkState
in class CSPBaseProvider
public void setPermanentDelete(boolean permanentDelete)
public boolean isPermanentDelete()
public void addAttachment(FileItem fileItem, String fileEncoding)
IAttachmentsProvider
addAttachment
in interface IAttachmentsProvider
fileItem
- the attachment contentfileEncoding
- the encoding of the attachment file (if known)public String getDateAsString(Date date)
public Date getStringAsDate(String str)
public boolean getHasAttachments()
IAttachmentsProvider
getHasAttachments
in interface IAttachmentsProvider
public boolean isAddAttachmentsAvailable()
IAttachmentsProvider
isAddAttachmentsAvailable
in interface IAttachmentsProvider
public List listAttachments()
IAttachmentsProvider
listAttachments
in interface IAttachmentsProvider
public void removeAttachment(String attachmentID)
IAttachmentsProvider
removeAttachment
in interface IAttachmentsProvider
attachmentID
- the id of the attachment to removepublic void updateAttachment(String attachmentID, FileItem fileItem, String fileEncoding)
IAttachmentsProvider
updateAttachment
in interface IAttachmentsProvider
attachmentID
- the id of the attachment to updatefileItem
- the new attachment contentfileEncoding
- the encoding of the attachment file (if known)public String createHttpUrl(String smiPath) throws COMM_Exception
COMM_Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |