|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.bean.PageFlowScopeAdapter
com.webmethods.caf.jcr.faces.data.JcrAttachmentsProvider
public class JcrAttachmentsProvider
Content provider for exposing the children of a JCR node for use with the CAF AttachmentsPanel control.
Nested Class Summary | |
---|---|
protected static class |
JcrAttachmentsProvider.ErrorReportingMode
Used to affect how errors are reported |
protected class |
JcrAttachmentsProvider.JcrAttachmentItem
Implementation of IAttachmentItem to wrap a JCR file node. |
static class |
JcrAttachmentsProvider.JcrFileItem
Implementation of FileItem to wrap a JCR file node. |
Field Summary | |
---|---|
protected boolean |
autoSave
True if the attachment changes are automatically saved. |
protected String |
iconBaseUrl
Holds the base Url for attachment icons. |
protected String |
jcrFileServletPath
Holds the path of the JCR File download servlet |
protected Session |
jcrSession
Reference to the current JCR session |
protected String |
parentId
Holds the parent node id |
protected Node |
parentNode
Reference to the parent Node where the attachments are stored |
protected String |
parentPath
Holds the parent node path |
protected boolean |
useWebDav
true to use WebDAV urls, false otherwise |
Fields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter |
---|
fExpireWithPageFlow |
Constructor Summary | |
---|---|
JcrAttachmentsProvider()
|
Method Summary | |
---|---|
void |
addAttachment(FileItem fileItem,
String fileEncoding)
Add Attachment |
boolean |
getHasAttachments()
Returns whether the attachment provider has any attachments |
String |
getIconBaseUrl()
Returns the icon base URL which is prepended to all the icon URLs |
String |
getJcrFileServletPath()
Returns the servlet path to the JCR file streaming servlet |
Session |
getJcrSession()
Returns the active JCR session |
String |
getParentId()
Returns the id of the parent JCR node |
Node |
getParentNode()
Returns a reference to the JCR Node that is the parent of the attachments. |
String |
getParentPath()
Returns the path of the parent Node |
protected String |
getSafeFileName(String filePath)
Gets a normalized file name from the supplied file path. |
boolean |
isAddAttachmentsAvailable()
Returns whether attachments can be added |
boolean |
isAutoSave()
Returns whether auto-save is enabled. |
boolean |
isUseWebDav()
Returns whether to use WebDAV urls |
List |
listAttachments()
Returns a list of the current attachments |
void |
refresh()
Does nothing |
void |
removeAttachment(String attachmentID)
Remove Attachment |
protected void |
reportError(JcrAttachmentsProvider.ErrorReportingMode mode,
String msg)
Report an error |
protected void |
safeNodeSave(Node node)
Saves changes to the supplied nodes |
protected boolean |
sanityCheck(JcrAttachmentsProvider.ErrorReportingMode mode)
Validates that the JCR session is alive and that the parent node has been configured correctly |
void |
setAutoSave(boolean autoSave)
Sets whether autoSave is enabled |
void |
setIconBaseUrl(String iconBaseUrl)
Sets the base URL to prepend to all the icon URLs |
void |
setJcrFileServletPath(String jcrFileServletPath)
Sets the servlet path to the JCR file streaming servlet |
void |
setJcrSession(Session jcrSession)
Sets the active JCR session |
void |
setParentId(String id)
Sets the id of the parent JCR node to use |
void |
setParentPath(String path)
Sets the path of the parent JCR Node to use. |
void |
setUseWebDav(boolean useWebDav)
Sets whether to use WebDAV urls |
void |
updateAttachment(String attachmentID,
FileItem fileItem,
String fileEncoding)
Update an Attachment |
Methods inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter |
---|
getExpireWithPageFlow, setExpireWithPageFlow |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient Session jcrSession
protected transient Node parentNode
protected boolean autoSave
protected String jcrFileServletPath
protected String iconBaseUrl
protected String parentId
protected String parentPath
protected boolean useWebDav
Constructor Detail |
---|
public JcrAttachmentsProvider()
Method Detail |
---|
public String getIconBaseUrl()
public void setIconBaseUrl(String iconBaseUrl)
iconBaseUrl
- the baseURL to usepublic String getParentId()
public void setParentId(String id)
id
- the uuid of the JCR node to use as the attachments parentpublic void setParentPath(String path)
path
- the path of the JCR node to use as the attachments parentpublic String getParentPath()
public Session getJcrSession()
public void setJcrSession(Session jcrSession)
jcrSession
- the JCR session to usepublic boolean isAutoSave()
public void setAutoSave(boolean autoSave)
autoSave
- the autoSave to setpublic String getJcrFileServletPath()
public void setJcrFileServletPath(String jcrFileServletPath)
jcrFileServletPath
- the jcrFileServletPath to setpublic Node getParentNode()
protected void reportError(JcrAttachmentsProvider.ErrorReportingMode mode, String msg)
mode
- the error reporting mode to usemsg
- the error messageprotected boolean sanityCheck(JcrAttachmentsProvider.ErrorReportingMode mode)
mode
- the error reporting mode
public void addAttachment(FileItem fileItem, String fileEncoding)
IAttachmentsProvider
addAttachment
in interface IAttachmentsProvider
fileItem
- the attachment contentfileEncoding
- the encoding of the attachment file (if known)protected void safeNodeSave(Node node) throws RepositoryException
node
- the node to save
RepositoryException
public boolean isAddAttachmentsAvailable()
IAttachmentsProvider
isAddAttachmentsAvailable
in interface IAttachmentsProvider
public List listAttachments()
IAttachmentsProvider
listAttachments
in interface IAttachmentsProvider
public boolean getHasAttachments()
IAttachmentsProvider
getHasAttachments
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)protected String getSafeFileName(String filePath)
filePath
- the file path to process
public boolean isUseWebDav()
isUseWebDav
in interface IWebDavAwareAttachmentsProvider
public void setUseWebDav(boolean useWebDav)
setUseWebDav
in interface IWebDavAwareAttachmentsProvider
public void refresh()
refresh
in interface IWebDavAwareAttachmentsProvider
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |