Subversion Repositories linshare

Compare Revisions

Rev 166 → Rev 167

/src/main/java/org/linagora/linShare/core/Facade/impl/ShareFacadeImpl.java
138,7 → 138,8
 
public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMail(
UserVo owner, List<DocumentVo> documents, List<UserVo> recipients,
String comment, String message, String messageTxt,String subject,
String comment, String messageInternal, String messageInternalTxt,
String messageGuest, String messageGuestTxt, String subject,
Calendar expirationDate) throws BusinessException {
SuccessesAndFailsItems<ShareDocumentVo> result = createSharing(owner,documents,recipients, comment, expirationDate);
153,7 → 154,11
}
for(UserVo userVo : successfullRecipient){
logger.debug("Sending sharing notification to user " + userVo.getLogin());
notifierService.sendNotification(owner.getMail(),userVo.getMail(), subject, message,messageTxt);
if (userVo.isGuest()) {
notifierService.sendNotification(owner.getMail(),userVo.getMail(), subject, messageGuest,messageGuestTxt);
} else {
notifierService.sendNotification(owner.getMail(),userVo.getMail(), subject, messageInternal,messageInternalTxt);
}
}
return result;
}
218,19 → 223,19
public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMailUsingRecipientsEmail(
UserVo owner, List<DocumentVo> documents,
List<String> recipientsEmail, String comment, String subject,
String linShareUrl, boolean secureSharing,
String linShareUrlInternal, String linShareUrlAnonymous, boolean secureSharing,
String sharedTemplateContent, String sharedTemplateContentTxt,
String passwordSharedTemplateContent,
String passwordSharedTemplateContentTxt)
throws BusinessException {
return createSharingWithMailUsingRecipientsEmailAndExpiryDate(owner, documents, recipientsEmail, comment, subject, linShareUrl, secureSharing, sharedTemplateContent, sharedTemplateContentTxt, passwordSharedTemplateContent, passwordSharedTemplateContentTxt, null);
return createSharingWithMailUsingRecipientsEmailAndExpiryDate(owner, documents, recipientsEmail, comment, subject, linShareUrlInternal, linShareUrlAnonymous, secureSharing, sharedTemplateContent, sharedTemplateContentTxt, passwordSharedTemplateContent, passwordSharedTemplateContentTxt, null);
}
 
 
public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMailUsingRecipientsEmailAndExpiryDate(
UserVo owner, List<DocumentVo> documents,
List<String> recipientsEmail, String comment, String subject,
String linShareUrl, boolean secureSharing,
String linShareUrlInternal, String linShareUrlAnonymous, boolean secureSharing,
String sharedTemplateContent, String sharedTemplateContentTxt,
String passwordSharedTemplateContent,
String passwordSharedTemplateContentTxt, Calendar expiryDateSelected)
249,7 → 254,7
templateParams.put("${firstName}", owner.getFirstName());
templateParams.put("${lastName}", owner.getLastName());
templateParams.put("${number}", new Integer(documents.size()).toString());
templateParams.put("${url}", linShareUrl);
templateParams.put("${url}", linShareUrlInternal); //modified later for anonymous user and guest
templateParams.put("${urlparam}", "");
StringBuffer names = new StringBuffer();
263,8 → 268,11
templateParams.put("${documentNames}", names.toString());
templateParams.put("${documentNamesTxt}", namesTxt.toString());
String messageForInternalUserAndGuest = templating.getMessage(sharedTemplateContent, templateParams);
String messageForInternalUserAndGuestTxt = templating.getMessage(sharedTemplateContentTxt, templateParams);
String messageForInternalUser = templating.getMessage(sharedTemplateContent, templateParams);
String messageForInternalUserTxt = templating.getMessage(sharedTemplateContentTxt, templateParams);
templateParams.put("${url}", linShareUrlAnonymous);
String messageForGuestUser = templating.getMessage(sharedTemplateContent, templateParams);
String messageForGuestUserTxt = templating.getMessage(sharedTemplateContentTxt, templateParams);
// find known and unknown recipients of the share
for (String mail : recipientsEmail) {
301,8 → 309,8
//compose the secured url to give in mail
StringBuffer httpUrlBase = new StringBuffer();
httpUrlBase.append(linShareUrl);
if(!linShareUrl.endsWith("/")) httpUrlBase.append("/");
httpUrlBase.append(linShareUrlAnonymous);
if(!linShareUrlAnonymous.endsWith("/")) httpUrlBase.append("/");
httpUrlBase.append(securedUrl.getUrlPath());
if(!securedUrl.getUrlPath().endsWith("/")) httpUrlBase.append("/");
httpUrlBase.append(securedUrl.getAlea());
331,7 → 339,7
}
//keep old method to share with user referenced in db
return createSharingWithMail(owner, documents, knownRecipients, comment, messageForInternalUserAndGuest, messageForInternalUserAndGuestTxt, subject, expiryDateSelected);
return createSharingWithMail(owner, documents, knownRecipients, comment, messageForInternalUser, messageForInternalUserTxt,messageForGuestUser, messageForGuestUserTxt, subject, expiryDateSelected);
}
/src/main/java/org/linagora/linShare/core/Facade/ShareFacade.java
57,7 → 57,8
* @return SuccessesAndFailsItems<SharedDocumentVo> : the list of sharing that succedded and failed
* @throws BusinessException if a recipient cannot be found in the db nor in the ldap
*/
public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMail(UserVo owner, List<DocumentVo> documents, List<UserVo> recipients,String comment, String message,String messageTxt,String subject, Calendar expirationDate) throws BusinessException;
public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMail(UserVo owner, List<DocumentVo> documents, List<UserVo> recipients,String comment, String messageInternal, String messageInternalTxt,
String messageGuest, String messageGuestTxt,String subject, Calendar expirationDate) throws BusinessException;
 
69,14 → 70,15
* @param comment
* @param message
* @param subject
* @param linShareUrl
* @param linShareUrlInternal
* @param linShareUrlAnonymous
* @param secureSharing
* @param sharedTemplateContent
* @param passwordSharedTemplateContent
* @return
* @throws BusinessException
*/
public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMailUsingRecipientsEmail(UserVo owner, List<DocumentVo> documents, List<String> recipientsEmail,String comment,String subject,String linShareUrl,boolean secureSharing,String sharedTemplateContent,String sharedTemplateContentTxt,String passwordSharedTemplateContent,String passwordSharedTemplateContentTxt) throws BusinessException;
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;
 
/**
* same function as createSharingWithMailUsingRecipientsEmail() BUT we give the expiration date selected by the user
86,7 → 88,8
* @param comment
* @param message
* @param subject
* @param linShareUrl
* @param linShareUrlInternal
* @param linShareUrlAnonymous
* @param secureSharing
* @param sharedTemplateContent
* @param passwordSharedTemplateContent
94,7 → 97,7
* @return
* @throws BusinessException
*/
public SuccessesAndFailsItems<ShareDocumentVo> createSharingWithMailUsingRecipientsEmailAndExpiryDate(UserVo owner, List<DocumentVo> documents, List<String> recipientsEmail,String comment,String subject,String linShareUrl,boolean secureSharing,String sharedTemplateContent,String sharedTemplateContentTxt,String passwordSharedTemplateContent,String passwordSharedTemplateContentTxt, Calendar expiryDateSelected) throws BusinessException;
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;
/**
/src/main/java/org/linagora/linShare/view/tapestry/components/ConfirmSharePopup.java
421,7 → 421,8
* retrieve the url from propertie file
*
*/
String linShareUrl=propertiesSymbolProvider.valueForSymbol("linshare.info.urlShare");
String linShareUrlInternal=propertiesSymbolProvider.valueForSymbol("linshare.info.url.internal");
String linShareUrlBase=propertiesSymbolProvider.valueForSymbol("linshare.info.url.base");
 
/**
* retrieve the subject of the mail.
463,7 → 464,7
//sharing = shareFacade.createSharingWithMail(userVo, documentsVo, usersVo,textAreaValue, message,subject);
//CALL new share function with all adress mails !
sharing = shareFacade.createSharingWithMailUsingRecipientsEmailAndExpiryDate(userVo, documentsVo,recipientsEmail,textAreaValue,subject,linShareUrl,secureSharing,sharedTemplateContent,sharedTemplateContentTxt,passwordSharedTemplateContent,passwordSharedTemplateContentTxt, dateExpiry);
sharing = shareFacade.createSharingWithMailUsingRecipientsEmailAndExpiryDate(userVo, documentsVo,recipientsEmail,textAreaValue,subject,linShareUrlInternal, linShareUrlBase,secureSharing,sharedTemplateContent,sharedTemplateContentTxt,passwordSharedTemplateContent,passwordSharedTemplateContentTxt, dateExpiry);
 
/src/main/java/org/linagora/linShare/view/tapestry/components/GuestEditForm.java
165,7 → 165,7
String mailContent = null;
String mailContentTxt = null;
 
String url=propertiesSymbolProvider.valueForSymbol("linshare.info.urlShare");
String url=propertiesSymbolProvider.valueForSymbol("linshare.info.url.base");
 
String ownerCN = userLoggedIn.getFirstName() + " " + userLoggedIn.getLastName();
 
/src/main/java/org/linagora/linShare/view/tapestry/components/QuickSharePopup.java
384,7 → 384,8
* retrieve the url from propertie file
*
*/
String linShareUrl=propertiesSymbolProvider.valueForSymbol("linshare.info.urlShare");
String linShareUrlInternal=propertiesSymbolProvider.valueForSymbol("linshare.info.url.internal");
String linShareUrlBase=propertiesSymbolProvider.valueForSymbol("linshare.info.url.base");
 
/**
* retrieve the subject of the mail.
423,7 → 424,7
try {
//CALL new share function with all adress mails !
sharing = shareFacade.createSharingWithMailUsingRecipientsEmail(userVo, addedDocuments,recipientsEmail,textAreaValue,subject,linShareUrl,secureSharing,sharedTemplateContent,sharedTemplateContentTxt,passwordSharedTemplateContent,passwordSharedTemplateContentTxt);
sharing = shareFacade.createSharingWithMailUsingRecipientsEmail(userVo, addedDocuments,recipientsEmail,textAreaValue,subject,linShareUrlInternal, linShareUrlBase,secureSharing,sharedTemplateContent,sharedTemplateContentTxt,passwordSharedTemplateContent,passwordSharedTemplateContentTxt);
} catch (BusinessException e1) {
/src/main/java/org/linagora/linShare/view/tapestry/rest/impl/DocumentRestServiceImpl.java
236,7 → 236,7
response.setStatus(HttpStatus.SC_CREATED);
String url = propertiesSymbolProvider.valueForSymbol("linshare.info.urlShare");
String url = propertiesSymbolProvider.valueForSymbol("linshare.info.url.base");
response.setHeader("Location", url +"documentrestservice/getdocument/" + doc.getIdentifier());
String xml = xstreamMarshaller.toXml(doc);
/src/main/java/org/linagora/linShare/view/tapestry/rest/impl/UserRestServiceImpl.java
161,7 → 161,7
// Get the messages service to localize the mail sent
Messages messages = validationMessagesSource.getValidationMessages(threadLocale.getLocale());
String url=propertiesSymbolProvider.valueForSymbol("linshare.info.urlShare");
String url=propertiesSymbolProvider.valueForSymbol("linshare.info.url.base");
 
String ownerCN = actor.getFirstName() + " " + actor.getLastName();
 
/src/main/java/org/linagora/linShare/view/tapestry/rest/impl/ShareRestServiceImpl.java
137,7 → 137,8
SuccessesAndFailsItems<ShareDocumentVo> successes;
 
// Prepare mail content :
String linShareUrl=propertiesSymbolProvider.valueForSymbol("linshare.info.urlShare");
String linShareUrlInternal=propertiesSymbolProvider.valueForSymbol("linshare.info.url.internal");
String linShareUrlBase=propertiesSymbolProvider.valueForSymbol("linshare.info.url.base");
 
String sharedTemplateContent = templating.readFullyTemplateContent(sharedTemplate.getResource().openStream());
String sharedTemplateContentTxt = templating.readFullyTemplateContent(sharedTemplateTxt.getResource().openStream());
155,7 → 156,7
 
try {
successes = shareFacade.createSharingWithMailUsingRecipientsEmail(
actor, listDoc, listRecipient, "", subject, linShareUrl,
actor, listDoc, listRecipient, "", subject, linShareUrlInternal, linShareUrlBase,
secureSharing, sharedTemplateContent, sharedTemplateContentTxt, passwordSharedTemplateContent, passwordSharedTemplateContentTxt);
} catch (BusinessException e) {
logger.error("could not share the document " + docVo.getIdentifier() + " to user " + targetMail + " by user " + actor.getMail() + " reason : " + e.getMessage());
252,7 → 253,8
}
// getting the templating data
String linShareUrl=propertiesSymbolProvider.valueForSymbol("linshare.info.urlShare");
String linShareUrlInternal=propertiesSymbolProvider.valueForSymbol("linshare.info.url.internal");
String linShareUrlBase=propertiesSymbolProvider.valueForSymbol("linshare.info.url.base");
String sharedTemplateContent = null;
277,7 → 279,7
try {
successes = shareFacade.createSharingWithMailUsingRecipientsEmail(
actor, listDoc, listRecipient, message, subject, linShareUrl, secureSharing,
actor, listDoc, listRecipient, message, subject, linShareUrlInternal, linShareUrlBase, secureSharing,
sharedTemplateContent, sharedTemplateContentTxt,passwordSharedTemplateContent,passwordSharedTemplateContentTxt);
} catch (BusinessException e) {
logger.error("could not share the document " + docVo.getIdentifier() + " to user " + targetMail + " by user " + actor.getMail() + " reason : " + e.getMessage());
/src/main/resources/linShare.properties.sample
56,8 → 56,10
linshare.default.maxUpload=10
#Maximum size (in bytes) of a single upload request Defaults to -1 (no limit).
linshare.default.maxUploadSize=-1
#linshare url which is used in mail templates
linshare.info.urlShare=http://localhost:8080/linshare/
#linshare url which is used in mail templates. give a different internal url if internal
# user connect with a different url (e.g. CAS url)
linshare.info.url.base=http://localhost:8080/linshare/
linshare.info.url.internal=http://localhost:8080/linshare/
#set to true in tapestry production environnement
linshare.productionMode=false
#local work directory to encrypt/decrypt data
/src/main/resources/linShare-default.properties
61,7 → 61,8
#Maximum size (in bytes) of a single upload request Defaults to -1 (no limit).
linshare.default.maxUploadSize=-1
#linshare url which is used in mail templates
linshare.info.urlShare=http://localhost:8080/linshare/
linshare.info.url.base=http://localhost:8080/linshare/
linshare.info.url.internal=http://localhost:8080/linshare/
#set to true in tapestry production environnement
linshare.productionMode=false
#local work directory to encrypt/decrypt data
/src/main/resources/springContext-service.xml
103,7 → 103,7
<constructor-arg index="3" value="${mail.smtp.password}"/>
<constructor-arg index="4" value="${mail.smtp.auth.needed}"/>
<constructor-arg index="5" value="${mail.smtp.charset}"/>
<constructor-arg index="6" value="${linshare.info.urlShare}"/>
<constructor-arg index="6" value="${linshare.info.url.base}"/>
</bean>
<bean name="enciphermentService" class="org.linagora.linShare.core.service.impl.EnciphermentServiceImpl">
/misc/linShare.properties
1,7 → 1,8
 
#******************** LINSHARE URL
 
linshare.info.urlShare=http://localhost:8080/
linshare.info.url.base=http://localhost:8080/
linshare.info.url.internal=http://localhost:8080/
 
#******************** MAIL CONFIGURATION TO SEND MAIL INFORMATION TO USER