Subversion Repositories linshare

[/] [branches/] [0.7/] [linshare/] [src/] [main/] [java/] [org/] [linagora/] [linShare/] [core/] [Facade/] [ShareFacade.java] - Blame information for rev 167

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1 sbahloul
/*
2
 *    This file is part of Linshare.
3
 *
4
 *   Linshare is free software: you can redistribute it and/or modify
5
 *   it under the terms of the GNU Affero General Public License as
6
 *   published by the Free Software Foundation, either version 3 of
7
 *   the License, or (at your option) any later version.
8
 *
9
 *   Linshare is distributed in the hope that it will be useful,
10
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 *   GNU Affero General Public License for more details.
13
 *
14
 *   You should have received a copy of the GNU Affero General Public
15
 *   License along with Foobar.  If not, see
16
 *                                    <http://www.gnu.org/licenses/>.
17
 *
18
 *   (c) 2008 Groupe Linagora - http://linagora.org
19
 *
20
*/
21
package org.linagora.linShare.core.Facade;
22
 
23 25 sduprey
import java.util.Calendar;
24 1 sbahloul
import java.util.List;
25
 
26 33 sduprey
import org.linagora.linShare.core.domain.entities.Share;
27 1 sbahloul
import org.linagora.linShare.core.domain.objects.SuccessesAndFailsItems;
28
import org.linagora.linShare.core.domain.vo.DocumentVo;
29
import org.linagora.linShare.core.domain.vo.ShareDocumentVo;
30
import org.linagora.linShare.core.domain.vo.UserVo;
31
import org.linagora.linShare.core.exception.BusinessException;
32
 
33
public interface ShareFacade {
34
 
35
 
36
        /**
37
         * Create a whole set of sharing
38
         * The expiration date will be defined in the config
39
         * @param owner : the document owner
40
         * @param documents : the list of documents to be shared
41
         * @param recipients : the recipients list
42
         * @throws BusinessException if a recipient cannot be found in the db nor in the ldap
43
         */
44 25 sduprey
        public SuccessesAndFailsItems<ShareDocumentVo> createSharing(UserVo owner, List<DocumentVo> documents, List<UserVo> recipients, String comment, Calendar expiryDate) throws BusinessException;
45 1 sbahloul
 
46
 
47
        /**
48
         * Create a whole set of shared documents
49
         * The expiration date will be defined in the config
50
         * Send the email only to the recipients who really received an email
51
         * @param owner : the document owner
52
         * @param documents : the list of documents to be shared
53
         * @param recipients : the recipients list
54
         * @param comment : the comment added by the user
55
         * @param message : the message to send by mail
56
         * @param subject : the subject of the mail
57
         * @return SuccessesAndFailsItems<SharedDocumentVo> : the list of sharing that succedded and failed
58
         * @throws BusinessException if a recipient cannot be found in the db nor in the ldap
59
         */
60 167 sduprey
        public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMail(UserVo owner, List<DocumentVo> documents, List<UserVo> recipients,String comment, String messageInternal, String messageInternalTxt,
61
                        String messageGuest, String messageGuestTxt,String subject, Calendar expirationDate) throws BusinessException;
62 1 sbahloul
 
63
 
64
 
65
        /**
66
         * same function as createSharingWithMail() BUT we give Recipients Emails which can be found or NOT FOUND in database.
67
         * @param owner
68
         * @param documents
69
         * @param recipientsEmail
70
         * @param comment
71
         * @param message
72
         * @param subject
73 167 sduprey
         * @param linShareUrlInternal
74
         * @param linShareUrlAnonymous
75 1 sbahloul
         * @param secureSharing
76
         * @param sharedTemplateContent
77
         * @param passwordSharedTemplateContent
78
         * @return
79
         * @throws BusinessException
80
         */
81 167 sduprey
        public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMailUsingRecipientsEmail(UserVo owner, List<DocumentVo> documents, List<String> recipientsEmail,String comment,String subject,String linShareUrlInternal, String linShareUrlAnonymous,boolean secureSharing,String sharedTemplateContent,String sharedTemplateContentTxt,String passwordSharedTemplateContent,String passwordSharedTemplateContentTxt) throws BusinessException;
82 25 sduprey
 
83
        /**
84
         * same function as createSharingWithMailUsingRecipientsEmail() BUT we give the expiration date selected by the user
85
         * @param owner
86
         * @param documents
87
         * @param recipientsEmail
88
         * @param comment
89
         * @param message
90
         * @param subject
91 167 sduprey
         * @param linShareUrlInternal
92
         * @param linShareUrlAnonymous
93 25 sduprey
         * @param secureSharing
94
         * @param sharedTemplateContent
95
         * @param passwordSharedTemplateContent
96
     * @param expiryDateSelected
97
         * @return
98
         * @throws BusinessException
99
         */
100 167 sduprey
        public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMailUsingRecipientsEmailAndExpiryDate(UserVo owner, List<DocumentVo> documents, List<String> recipientsEmail,String comment,String subject,String linShareUrlInternal, String linShareUrlAnonymous,boolean secureSharing,String sharedTemplateContent,String sharedTemplateContentTxt,String passwordSharedTemplateContent,String passwordSharedTemplateContentTxt, Calendar expiryDateSelected) throws BusinessException;
101 1 sbahloul
 
102
 
103
        /**
104
         * Retrieve all the sharing received by a user
105
         * @param recipient the user
106
         * @return
107
         */
108
        public List<ShareDocumentVo> getAllSharingReceivedByUser(UserVo recipient);
109
 
110
 
111
        /**
112 33 sduprey
         * Retrieve all the sharings of a file by a user
113
         * @param sender the user
114
         * @param document
115
         * @return
116
         */
117
        public List<Share> getSharingsByUserAndFile(UserVo sender, DocumentVo document);
118
 
119
 
120
        /**
121 1 sbahloul
         * Delete a sharing
122
         * @param share
123
         * @param actor
124
         * @throws BusinessException
125
         */
126
        void deleteSharing(ShareDocumentVo share, UserVo actor) throws BusinessException;
127
 
128
 
129
    /** Create a local copy of a shared document.
130
     * @param shareDocumentVo shared document.
131
     * @param userVo user that the document belongs to.
132
     * @throws BusinessException if document is too large for user account or forbidden mime type.
133
     */
134
    public void createLocalCopy(ShareDocumentVo shareDocumentVo, UserVo userVo) throws BusinessException;
135
 
136
 
137
 
138
    public void sendDownloadNotification(ShareDocumentVo sharedDocument, UserVo currentUser, String subject, String downloadTemplateContent,String downloadTemplateContentTxt);
139
 
140
 
141
    /**
142
     * send a mail notification to all users which have received a given shared document which has been updated
143
     * @param currentDoc current document with an updated content
144
     * @param currentUser current user which does the update action
145
     * @param oldFileName old file name of the updated doc
146
     * @param fileSizeTxt friendly size of the file
147
     * @param subject of the mail notification
148
     * @param sharedUpdateDocTemplateContent template
149
     * @param sharedUpdateDocTemplateContentTxt template
150
     * @throws BusinessException
151
     */
152
    public void sendSharedUpdateDocNotification(DocumentVo currentDoc, UserVo currentUser, String fileSizeTxt,String oldFileName, String subject, String sharedUpdateDocTemplateContent,String sharedUpdateDocTemplateContentTxt) throws BusinessException;
153
 
154
}