|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.attachment.repository.DocumentRepository
@Named(value="documentRepository") public class DocumentRepository
Constructor Summary | |
---|---|
DocumentRepository()
|
Method Summary | |
---|---|
void |
addContent(javax.jcr.Session session,
SimpleDocumentPK documentPk,
SimpleAttachment attachment)
Add the content. |
SimpleDocumentPK |
changeVersionState(javax.jcr.Session session,
SimpleDocumentPK documentPk,
String comment)
Change the management of versions of the document if the document is checkouted. |
SimpleDocumentPK |
copyDocument(javax.jcr.Session session,
HistorisedDocument document,
WAPrimaryKey destination)
Copy the document to another attached object. |
SimpleDocumentPK |
copyDocument(javax.jcr.Session session,
SimpleDocument document,
WAPrimaryKey destination)
Copy the document to another attached object. |
void |
copyFullContent(SimpleDocument origin,
SimpleDocument copy)
|
void |
copyMultilangContent(SimpleDocument origin,
SimpleDocument copy)
|
SimpleDocumentPK |
createDocument(javax.jcr.Session session,
SimpleDocument document)
Create file attached to an object who is identified by "PK" SimpleDocument object contains an attribute who identifie the link by a foreign key. |
void |
deleteContent(javax.jcr.Node documentNode,
String instanceId)
|
void |
deleteDocument(javax.jcr.Session session,
SimpleDocumentPK documentPk)
Delete a file attached to an object who is identified by "PK" SimpleDocument object contains an attribute who identifie the link by a foreign key. |
void |
duplicateContent(SimpleDocument origin,
SimpleDocument document)
|
void |
fillNodeName(javax.jcr.Session session,
SimpleDocument document)
|
SimpleDocument |
findDocumentById(javax.jcr.Session session,
SimpleDocumentPK documentPk,
String lang)
|
SimpleDocument |
findDocumentByOldSilverpeasId(javax.jcr.Session session,
String instanceId,
long oldSilverpeasId,
boolean versioned,
String lang)
|
SimpleDocument |
findLast(javax.jcr.Session session,
String instanceId,
String foreignId)
The last document in an instance with the specified foreignId. |
InputStream |
getContent(javax.jcr.Session session,
SimpleDocumentPK pk,
String lang)
Get the content. |
List<SimpleDocument> |
listAllDocumentsByComponentId(javax.jcr.Session session,
String instanceId,
String language)
Search all the documents related to the component instance identified by the specified identifier. |
SimpleDocumentList<SimpleDocument> |
listAllDocumentsByForeignId(javax.jcr.Session session,
String instanceId,
String foreignId,
String language)
Search all the documents of any type in an instance with the specified foreignId. |
List<SimpleDocument> |
listComponentDocumentsByOwner(javax.jcr.Session session,
String instanceId,
String owner,
String language)
Search all the documents in an instance with the specified owner. |
List<SimpleDocument> |
listDocumentsByComponentIdAndType(javax.jcr.Session session,
String instanceId,
DocumentType type,
String language)
Search all the documents in an instance with the specified type. |
SimpleDocumentList<SimpleDocument> |
listDocumentsByForeignId(javax.jcr.Session session,
String instanceId,
String foreignId,
String language)
Search all the documents of type attachment in an instance with the specified foreignId. |
SimpleDocumentList<SimpleDocument> |
listDocumentsByForeignIdAndType(javax.jcr.Session session,
String instanceId,
String foreignId,
DocumentType type,
String language)
Search all the documents in an instance with the specified foreignId. |
List<SimpleDocument> |
listDocumentsLockedByUser(javax.jcr.Session session,
String usedId,
String language)
|
List<SimpleDocument> |
listDocumentsRequiringWarning(javax.jcr.Session session,
Date alertDate,
String language)
Search all the documents in an instance which are locked at the alert date. |
List<SimpleDocument> |
listDocumentsToUnlock(javax.jcr.Session session,
Date expiryDate,
String language)
Search all the documents in an instance requiring to be unlocked at the specified date. |
List<SimpleDocument> |
listExpiringDocuments(javax.jcr.Session session,
Date expiryDate,
String language)
Search all the documents in an instance which are expiring at the specified date. |
boolean |
lock(javax.jcr.Session session,
SimpleDocument document,
String owner)
Lock a document if it is versionned to create a new work in progress version. |
void |
mergeAttachment(javax.jcr.Session session,
SimpleDocument attachment,
SimpleDocument clone)
|
SimpleDocumentPK |
moveDocument(javax.jcr.Session session,
SimpleDocument document,
WAPrimaryKey destination)
Move the document to another attached object. |
void |
moveFullContent(SimpleDocument origin,
SimpleDocument copy)
|
void |
moveMultilangContent(SimpleDocument origin,
SimpleDocument copy)
|
protected javax.jcr.Node |
prepareComponentAttachments(javax.jcr.Session session,
String instanceId,
String folder)
|
void |
prepareComponentAttachments(String instanceId,
String folder)
|
boolean |
removeContent(javax.jcr.Session session,
SimpleDocumentPK documentPk,
String language)
Remove the content for the specified language. |
void |
removeVersionnable(javax.jcr.Session session,
SimpleDocumentPK documentPk)
Remove the version feature to an existing document. |
void |
saveForbiddenDownloadForRoles(javax.jcr.Session session,
SimpleDocument document)
Save the optional slv:forbiddenDownloadForRoles simple document property (MIXIN). |
void |
setClone(javax.jcr.Session session,
SimpleDocument original,
SimpleDocument clone)
Add the document's clone id to the document even if it is locked. |
void |
setOrder(javax.jcr.Session session,
SimpleDocument document)
Update the document order. |
void |
setVersionnable(javax.jcr.Session session,
SimpleDocumentPK documentPk)
Add the version feature to an existing document. |
long |
storeContent(SimpleDocument document,
InputStream in)
|
long |
storeContent(SimpleDocument document,
InputStream in,
boolean update)
|
SimpleDocument |
unlock(javax.jcr.Session session,
SimpleDocument document,
boolean restore)
Unlock a document if it is versionned to create a new version or to restore a previous one. |
SimpleDocument |
unlockFromContentDeletion(javax.jcr.Session session,
SimpleDocument document)
Unlock a document if it is versionned from a context into which a language content has just been deleted. |
void |
updateDocument(javax.jcr.Session session,
SimpleDocument document,
boolean updateLastModifiedData)
Create file attached to an object who is identified by "PK" SimpleDocument object contains an attribute who identifie the link by a foreign key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentRepository()
Method Detail |
---|
public void prepareComponentAttachments(String instanceId, String folder) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Node prepareComponentAttachments(javax.jcr.Session session, String instanceId, String folder) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public SimpleDocumentPK createDocument(javax.jcr.Session session, SimpleDocument document) throws javax.jcr.RepositoryException
session
- document
-
javax.jcr.RepositoryException
public SimpleDocumentPK moveDocument(javax.jcr.Session session, SimpleDocument document, WAPrimaryKey destination) throws javax.jcr.RepositoryException
session
- document
- destination
-
javax.jcr.RepositoryException
public SimpleDocumentPK copyDocument(javax.jcr.Session session, SimpleDocument document, WAPrimaryKey destination) throws javax.jcr.RepositoryException
session
- document
- destination
- the foreingId holding reference to the copy.
javax.jcr.RepositoryException
public SimpleDocumentPK copyDocument(javax.jcr.Session session, HistorisedDocument document, WAPrimaryKey destination) throws javax.jcr.RepositoryException, IOException
session
- document
- destination
- the foreingId holding reference to the copy.
javax.jcr.RepositoryException
IOException
public void updateDocument(javax.jcr.Session session, SimpleDocument document, boolean updateLastModifiedData) throws javax.jcr.RepositoryException, IOException
session
- document
- updateLastModifiedData
-
javax.jcr.RepositoryException
IOException
public void saveForbiddenDownloadForRoles(javax.jcr.Session session, SimpleDocument document) throws javax.jcr.RepositoryException
session
- document
-
javax.jcr.RepositoryException
public void setClone(javax.jcr.Session session, SimpleDocument original, SimpleDocument clone) throws javax.jcr.RepositoryException
session
- the JCR session.original
- the original document to be cloned.clone
- the cone of the original document.
javax.jcr.RepositoryException
public void setOrder(javax.jcr.Session session, SimpleDocument document) throws javax.jcr.RepositoryException
session
- document
-
javax.jcr.RepositoryException
public void deleteDocument(javax.jcr.Session session, SimpleDocumentPK documentPk) throws javax.jcr.RepositoryException
session
- documentPk
-
javax.jcr.RepositoryException
public SimpleDocumentPK changeVersionState(javax.jcr.Session session, SimpleDocumentPK documentPk, String comment) throws javax.jcr.RepositoryException, IOException
session
- documentPk
- the id of the document.comment
-
javax.jcr.RepositoryException
IOException
public SimpleDocument findDocumentById(javax.jcr.Session session, SimpleDocumentPK documentPk, String lang) throws javax.jcr.RepositoryException
session
- documentPk
- lang
-
javax.jcr.RepositoryException
public SimpleDocument findDocumentByOldSilverpeasId(javax.jcr.Session session, String instanceId, long oldSilverpeasId, boolean versioned, String lang) throws javax.jcr.RepositoryException
session
- instanceId
- oldSilverpeasId
- versioned
- lang
-
javax.jcr.RepositoryException
public SimpleDocument findLast(javax.jcr.Session session, String instanceId, String foreignId) throws javax.jcr.RepositoryException
session
- the current JCR session.instanceId
- the component id containing the documents.foreignId
- the id of the container owning the documents.
javax.jcr.RepositoryException
public SimpleDocumentList<SimpleDocument> listDocumentsByForeignId(javax.jcr.Session session, String instanceId, String foreignId, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.instanceId
- the component id containing the documents.foreignId
- the id of the container owning the documents.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public SimpleDocumentList<SimpleDocument> listAllDocumentsByForeignId(javax.jcr.Session session, String instanceId, String foreignId, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.instanceId
- the component id containing the documents.foreignId
- the id of the container owning the documents.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public SimpleDocumentList<SimpleDocument> listDocumentsByForeignIdAndType(javax.jcr.Session session, String instanceId, String foreignId, DocumentType type, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.instanceId
- the component id containing the documents.foreignId
- the id of the container owning the documents.type
- thetype of required documents.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public List<SimpleDocument> listDocumentsByComponentIdAndType(javax.jcr.Session session, String instanceId, DocumentType type, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.instanceId
- the component id containing the documents.type
- thetype of required documents.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public List<SimpleDocument> listAllDocumentsByComponentId(javax.jcr.Session session, String instanceId, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.instanceId
- the component id containing the documents.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public List<SimpleDocument> listComponentDocumentsByOwner(javax.jcr.Session session, String instanceId, String owner, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.instanceId
- the component id containing the documents.owner
- the id of the user owning the document.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public List<SimpleDocument> listDocumentsLockedByUser(javax.jcr.Session session, String usedId, String language) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public List<SimpleDocument> listExpiringDocuments(javax.jcr.Session session, Date expiryDate, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.expiryDate
- the date when the document reservation should expire.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public List<SimpleDocument> listDocumentsRequiringWarning(javax.jcr.Session session, Date alertDate, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.alertDate
- the date when the document reservation should send an alert.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public List<SimpleDocument> listDocumentsToUnlock(javax.jcr.Session session, Date expiryDate, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.expiryDate
- the date when the document reservation should expire.language
- the language in which the documents are required.
javax.jcr.RepositoryException
public void addContent(javax.jcr.Session session, SimpleDocumentPK documentPk, SimpleAttachment attachment) throws javax.jcr.RepositoryException
session
- the current JCR session.documentPk
- the document which content is to be added.attachment
- the attachment metadata.
javax.jcr.RepositoryException
public InputStream getContent(javax.jcr.Session session, SimpleDocumentPK pk, String lang) throws javax.jcr.RepositoryException, IOException
session
- the current JCR session.pk
- the document which content is to be added.lang
- the content language.
javax.jcr.RepositoryException
IOException
public boolean removeContent(javax.jcr.Session session, SimpleDocumentPK documentPk, String language) throws javax.jcr.RepositoryException
session
- the current JCR session.documentPk
- the document which content is to be removed.language
- the language of the content which is to be removed.
javax.jcr.RepositoryException
public boolean lock(javax.jcr.Session session, SimpleDocument document, String owner) throws javax.jcr.RepositoryException
session
- document
- owner
- the user locking the node.
javax.jcr.RepositoryException
public SimpleDocument unlock(javax.jcr.Session session, SimpleDocument document, boolean restore) throws javax.jcr.RepositoryException
session
- the current JCR open session to perform actions.document
- the document data from which all needed identifiers are retrieved.restore
- true to restore the previous version if any.
unlock(Session, SimpleDocument, boolean, boolean)
execution.
javax.jcr.RepositoryException
public SimpleDocument unlockFromContentDeletion(javax.jcr.Session session, SimpleDocument document) throws javax.jcr.RepositoryException
session
- the current JCR open session to perform actions.document
- the document data from which all needed identifiers are retrieved.
unlock(Session, SimpleDocument, boolean, boolean)
execution.
javax.jcr.RepositoryException
public void setVersionnable(javax.jcr.Session session, SimpleDocumentPK documentPk) throws javax.jcr.RepositoryException
session
- documentPk
-
javax.jcr.RepositoryException
public void removeVersionnable(javax.jcr.Session session, SimpleDocumentPK documentPk) throws javax.jcr.RepositoryException
session
- documentPk
-
javax.jcr.RepositoryException
public void fillNodeName(javax.jcr.Session session, SimpleDocument document) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public long storeContent(SimpleDocument document, InputStream in, boolean update) throws javax.jcr.RepositoryException, IOException
javax.jcr.RepositoryException
IOException
public long storeContent(SimpleDocument document, InputStream in) throws javax.jcr.RepositoryException, IOException
javax.jcr.RepositoryException
IOException
public void duplicateContent(SimpleDocument origin, SimpleDocument document) throws IOException, javax.jcr.RepositoryException
IOException
javax.jcr.RepositoryException
public void deleteContent(javax.jcr.Node documentNode, String instanceId) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public void copyMultilangContent(SimpleDocument origin, SimpleDocument copy) throws IOException
IOException
public void copyFullContent(SimpleDocument origin, SimpleDocument copy) throws IOException
IOException
public void moveMultilangContent(SimpleDocument origin, SimpleDocument copy) throws IOException
IOException
public void moveFullContent(SimpleDocument origin, SimpleDocument copy) throws IOException
IOException
public void mergeAttachment(javax.jcr.Session session, SimpleDocument attachment, SimpleDocument clone) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |