org.silverpeas.attachment.webdav
Interface WebdavRepository

All Known Implementing Classes:
WebdavDocumentRepository

public interface WebdavRepository


Method Summary
 void createAttachmentNode(javax.jcr.Session session, SimpleDocument attachment)
          Create a new node for the specified attachment so that the file may be accessed through webdav.
 void deleteAttachmentContentNode(javax.jcr.Session session, SimpleDocument attachment, String language)
          Delete the node associated to the specified language content attachment.
 void deleteAttachmentNode(javax.jcr.Session session, SimpleDocument attachment)
          Delete the node associated to the specified attachment.
 String getContentEditionLanguage(javax.jcr.Session session, SimpleDocument attachment)
          Gets the current content edition language of the specified attachment.
 long getContentEditionSize(javax.jcr.Session session, SimpleDocument attachment)
          Gets the current content edition size of the specified attachment.
 boolean isNodeLocked(javax.jcr.Session session, SimpleDocument attachment)
          Indicate if the node for the specified attachment is currently locked (for example by Office in the case of a webdav online edition).
 void moveNodeAttachment(javax.jcr.Session session, SimpleDocument attachment, String targetComponentInstanceId)
          Move the specified attachment to the specified component instance id.
 void updateAttachmentBinaryContent(javax.jcr.Session session, SimpleDocument attachment)
          Update the file content of the specified attachment without modifying its metadata.
 void updateNodeAttachment(javax.jcr.Session session, SimpleDocument attachment)
          Update the node using the SimpleDocument.
 

Method Detail

createAttachmentNode

void createAttachmentNode(javax.jcr.Session session,
                          SimpleDocument attachment)
                          throws javax.jcr.RepositoryException,
                                 IOException
Create a new node for the specified attachment so that the file may be accessed through webdav. For an attachment, it can exist in webdav one, and only one, content language of the attachment.

Parameters:
session - the JCR session.
attachment - the attachment.
Throws:
javax.jcr.RepositoryException
IOException

deleteAttachmentNode

void deleteAttachmentNode(javax.jcr.Session session,
                          SimpleDocument attachment)
                          throws javax.jcr.RepositoryException
Delete the node associated to the specified attachment. All contents will be removed. If a specific content (language) must be removed, then use deleteAttachmentContentNode(Session, SimpleDocument, String) method.

Parameters:
session - the JCR session.
attachment - the attachment.
Throws:
javax.jcr.RepositoryException

deleteAttachmentContentNode

void deleteAttachmentContentNode(javax.jcr.Session session,
                                 SimpleDocument attachment,
                                 String language)
                                 throws javax.jcr.RepositoryException
Delete the node associated to the specified language content attachment.

Parameters:
session - the JCR session.
attachment - the attachment.
language - the aimed language content to delete.
Throws:
javax.jcr.RepositoryException

updateAttachmentBinaryContent

void updateAttachmentBinaryContent(javax.jcr.Session session,
                                   SimpleDocument attachment)
                                   throws javax.jcr.RepositoryException,
                                          IOException
Update the file content of the specified attachment without modifying its metadata.

Parameters:
session - the JCR session.
attachment - the attachment for which the file content will be updated with the ralated webdav content.
Throws:
javax.jcr.RepositoryException
IOException

updateNodeAttachment

void updateNodeAttachment(javax.jcr.Session session,
                          SimpleDocument attachment)
                          throws javax.jcr.RepositoryException,
                                 IOException
Update the node using the SimpleDocument. For an attachment, it can exist in webdav one, and only one, content language of the attachment.

Parameters:
session - the JCR session.
attachment - the attachment.
Throws:
javax.jcr.RepositoryException
IOException

moveNodeAttachment

void moveNodeAttachment(javax.jcr.Session session,
                        SimpleDocument attachment,
                        String targetComponentInstanceId)
                        throws javax.jcr.RepositoryException,
                               IOException
Move the specified attachment to the specified component instance id.

Parameters:
session - the JCR session.
attachment - the attachment to move to another component instance identifier.
targetComponentInstanceId - the identifier of the target component instance.
Throws:
javax.jcr.RepositoryException
IOException

isNodeLocked

boolean isNodeLocked(javax.jcr.Session session,
                     SimpleDocument attachment)
                     throws javax.jcr.RepositoryException
Indicate if the node for the specified attachment is currently locked (for example by Office in the case of a webdav online edition).

Parameters:
session - the JCR session.
attachment - the attachment.
Returns:
true if the node is locked - false otherwise.
Throws:
javax.jcr.RepositoryException

getContentEditionLanguage

String getContentEditionLanguage(javax.jcr.Session session,
                                 SimpleDocument attachment)
                                 throws javax.jcr.RepositoryException
Gets the current content edition language of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.

Parameters:
session - the JCR session.
attachment - the attachment.
Returns:
the content edition language if the specified attachment exists in the webdav repository, null otherwise.
Throws:
javax.jcr.RepositoryException

getContentEditionSize

long getContentEditionSize(javax.jcr.Session session,
                           SimpleDocument attachment)
                           throws javax.jcr.RepositoryException
Gets the current content edition size of the specified attachment. If several webdav document exists (several content languages), then the one which has the highest modified date is taken into account.

Parameters:
session - the JCR session.
attachment - the attachment.
Returns:
the content edition size if the specified attachment exists in the webdav repository, -1 otherwise.
Throws:
javax.jcr.RepositoryException


Copyright © 2016 Silverpeas. All Rights Reserved.