Subversion Repositories linshare

Compare Revisions

Rev 1915 → Rev 1916

/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/FunctionalityOldService.java
37,11 → 37,6
 
import org.linagora.linshare.core.domain.entities.AbstractDomain;
import org.linagora.linshare.core.domain.entities.Functionality;
import org.linagora.linshare.core.domain.entities.IntegerValueFunctionality;
import org.linagora.linshare.core.domain.entities.StringValueFunctionality;
import org.linagora.linshare.core.domain.objects.SizeUnitValueFunctionality;
import org.linagora.linshare.core.domain.objects.TimeUnitBooleanValueFunctionality;
import org.linagora.linshare.core.domain.objects.TimeUnitValueFunctionality;
import org.linagora.linshare.core.exception.BusinessException;
 
public interface FunctionalityOldService {
64,13 → 59,6
public List<Functionality> getAllFunctionalities(AbstractDomain domain);
/**
* This method is designed to return a list of all existing functionalities from a domain.
* @param domain identifier
* @return
*/
public List<Functionality> getAllFunctionalities(String domainIdentifier);
/**
* This method returns an updatable functionality. Do not try to update a functionality whit other ways.
* @param domain identifier
* @param functionality identifier
125,117 → 113,4
* @return
*/
public List<Functionality> getAllEditableFunctionalities(String domainIdentifier);
 
/**
* Shortcuts to functionalities
*/
 
public SizeUnitValueFunctionality getGlobalQuotaFunctionality (AbstractDomain domain);
public SizeUnitValueFunctionality getUserQuotaFunctionality (AbstractDomain domain);
public SizeUnitValueFunctionality getUserMaxFileSizeFunctionality (AbstractDomain domain);
public TimeUnitBooleanValueFunctionality getDefaultShareExpiryTimeFunctionality (AbstractDomain domain);
public TimeUnitValueFunctionality getDefaultFileExpiryTimeFunctionality (AbstractDomain domain);
public Functionality getGuestFunctionality (AbstractDomain domain);
public TimeUnitValueFunctionality getGuestAccountExpiryTimeFunctionality (AbstractDomain domain);
public StringValueFunctionality getTimeStampingFunctionality(AbstractDomain domain);
public StringValueFunctionality getDomainMailFunctionality(AbstractDomain domain);
public Functionality getMimeTypeFunctionality(AbstractDomain domain);
public Functionality getEnciphermentFunctionality(AbstractDomain domain);
public Functionality getAntivirusFunctionality(AbstractDomain domain);
public Functionality getAnonymousUrlFunctionality(AbstractDomain domain);
public Functionality getSecuredAnonymousUrlFunctionality(AbstractDomain domain);
public Functionality getRestrictedGuestFunctionality(AbstractDomain domain);
public Functionality getSignatureFunctionality(AbstractDomain domain);
public Functionality getThreadCreationPermissionFunctionality(AbstractDomain domain);
public Functionality getUpdateFilesFunctionality(AbstractDomain domain);
public Functionality getUserCanUploadFunctionality(AbstractDomain domain);
public StringValueFunctionality getCustomLogoFunctionality(AbstractDomain domain);
public StringValueFunctionality getCustomLinkLogoFunctionality(AbstractDomain domain);
public StringValueFunctionality getCustomNotificationUrlFunctionality(AbstractDomain domain);
public StringValueFunctionality getShareNotificationBeforeExpirationFunctionality(AbstractDomain domain);
public IntegerValueFunctionality getCompletionFunctionality(AbstractDomain domain);
public Functionality getUserTabFunctionality(AbstractDomain domain);
public Functionality getAuditTabFunctionality(AbstractDomain domain);
public Functionality getThreadTabFunctionality(AbstractDomain domain);
public Functionality getHelpTabFunctionality(AbstractDomain domain);
public Functionality getListTabFunctionality(AbstractDomain domain);
/**
* Check if SecuredAnonymousUrl (SAU) is mandatory
* @param domain : the current domain identifier
* @return
*/
public boolean isSauMadatory(String domainIdentifier);
/**
* Check if SecuredAnonymousUrl (SAU) is allowed
* @param domain : the current domain identifier
* @return
*/
public boolean isSauAllowed(String domainIdentifier);
 
/**
* return the default value for SecuredAnonymousUrl (SAU)
* @param domain : the current domain identifier
* @return
*/
public boolean getDefaultSauValue(String domainIdentifier);
/**
* return the default value for RestrictedGuest
* @param domain : the current domain identifier
* @return
*/
public boolean getDefaultRestrictedGuestValue(String domainIdentifier);
 
/**
* Check if RestrictedGuest is mandatory
* @param domain : the current domain identifier
* @return
*/
public boolean isRestrictedGuestMadatory(String domainIdentifier);
/**
* Check if RestrictedGuest is allowed
* @param domain : the current domain identifier
* @return
*/
public boolean isRestrictedGuestAllowed(String domainIdentifier);
 
/**
* Return the status of the custom logo in root domain
* @return the status
*/
public boolean isCustomLogoActiveInRootDomain() throws BusinessException;
/**
* Return the status of the custom logo in root domain
* @return the status
*/
public String getCustomLogoUrlInRootDomain() throws BusinessException;
/**
* Return the status of the custom link logo in root domain
* @return the status
*/
public boolean isCustomLinkLogoActiveInRootDomain() throws BusinessException;
/**
* Return the status of the custom link logo in root domain
* @return the status
*/
public String getCustomLinkLogoInRootDomain() throws BusinessException;
/**
* Return the status of the custom Notification URL in root domain
* @return the status
*/
public String getCustomNotificationURLInRootDomain() throws BusinessException;
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/ShareExpiryDateServiceImpl.java
41,17 → 41,18
import org.linagora.linshare.core.domain.entities.DocumentEntry;
import org.linagora.linshare.core.domain.entities.ShareExpiryRule;
import org.linagora.linshare.core.domain.objects.TimeUnitBooleanValueFunctionality;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.ShareExpiryDateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public class ShareExpiryDateServiceImpl implements ShareExpiryDateService {
private static final Logger logger = LoggerFactory.getLogger(ShareExpiryDateServiceImpl.class);
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
 
public ShareExpiryDateServiceImpl(FunctionalityOldService functionalityService) {
this.functionalityService = functionalityService;
public ShareExpiryDateServiceImpl(FunctionalityReadOnlyService functionalityService) {
this.functionalityReadOnlyService = functionalityService;
}
62,7 → 63,7
*/
@Override
public Calendar computeShareExpiryDate(DocumentEntry document, Account owner) {
TimeUnitBooleanValueFunctionality shareExpirationTimeFunctionality = functionalityService.getDefaultShareExpiryTimeFunctionality(owner.getDomain());
TimeUnitBooleanValueFunctionality shareExpirationTimeFunctionality = functionalityReadOnlyService.getDefaultShareExpiryTimeFunctionality(owner.getDomain());
Calendar defaultExpiration = null;
if(shareExpirationTimeFunctionality.getActivationPolicy().getStatus()) {
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/UserServiceImpl.java
63,7 → 63,7
import org.linagora.linshare.core.repository.UserRepository;
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.EntryService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.LogEntryService;
import org.linagora.linshare.core.service.MailContentBuildingService;
import org.linagora.linshare.core.service.NotifierService;
97,7 → 97,8
private final AbstractDomainService abstractDomainService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final PasswordService passwordService;
private final EntryService entryService;
116,7 → 117,7
final RecipientFavouriteService recipientFavouriteService,
final AllowedContactRepository allowedContactRepository,
final MailContentBuildingService mailElementsFactory,
final FunctionalityOldService functionalityService,
final FunctionalityReadOnlyService functionalityService,
final AbstractDomainService abstractDomainService,
final PasswordService passwordService,
final EntryService entryService,
130,7 → 131,7
this.allowedContactRepository = allowedContactRepository;
this.mailElementsFactory = mailElementsFactory;
this.abstractDomainService = abstractDomainService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
this.passwordService = passwordService;
this.entryService = entryService;
this.threadService = threadService;
203,7 → 204,7
// Guest must not be able to create other guests.
guest.setCanCreateGuest(false);
 
Functionality userCanUploadFunc = functionalityService.getUserCanUploadFunctionality(guestDomain);
Functionality userCanUploadFunc = functionalityReadOnlyService.getUserCanUploadFunctionality(guestDomain);
guest.setCanUpload(userCanUploadFunc.getActivationPolicy().getStatus());
 
guest.setCreationDate(new Date());
256,7 → 257,7
*/
private Date calculateUserExpiryDate(Account sender) {
Calendar expiryDate = Calendar.getInstance();
TimeUnitValueFunctionality func = functionalityService.getGuestAccountExpiryTimeFunctionality(sender.getDomain());
TimeUnitValueFunctionality func = functionalityReadOnlyService.getGuestAccountExpiryTimeFunctionality(sender.getDomain());
expiryDate.add(func.toCalendarUnitValue(), func.getValue());
return expiryDate.getTime();
}
897,10 → 898,10
} else {
logger.debug("userRepository.create(user)");
// create
Functionality guestfunc = functionalityService.getGuestFunctionality(user.getDomain());
Functionality guestfunc = functionalityReadOnlyService.getGuestFunctionality(user.getDomain());
user.setCanCreateGuest(guestfunc.getActivationPolicy().getStatus());
 
Functionality userCanUploadFunc = functionalityService.getUserCanUploadFunctionality(user.getDomain());
Functionality userCanUploadFunc = functionalityReadOnlyService.getUserCanUploadFunctionality(user.getDomain());
user.setCanUpload(userCanUploadFunc.getActivationPolicy().getStatus());
 
user.setCreationDate(new Date());
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/ShareEntryServiceImpl.java
44,7 → 44,6
import org.linagora.linshare.core.domain.entities.Account;
import org.linagora.linshare.core.domain.entities.DocumentEntry;
import org.linagora.linshare.core.domain.entities.Guest;
import org.linagora.linshare.core.domain.entities.GuestDomain;
import org.linagora.linshare.core.domain.entities.ShareEntry;
import org.linagora.linshare.core.domain.entities.ShareLogEntry;
import org.linagora.linshare.core.domain.entities.SystemAccount;
54,9 → 53,8
import org.linagora.linshare.core.exception.BusinessErrorCode;
import org.linagora.linshare.core.exception.BusinessException;
import org.linagora.linshare.core.repository.GuestRepository;
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.DocumentEntryService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.LogEntryService;
import org.linagora.linshare.core.service.MailContentBuildingService;
import org.linagora.linshare.core.service.NotifierService;
71,7 → 69,7
private final GuestRepository guestRepository;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityService;
private final ShareEntryBusinessService shareEntryBusinessService;
88,12 → 86,12
private final MailContentBuildingService mailContentBuildingService;
 
 
public ShareEntryServiceImpl(GuestRepository guestRepository, FunctionalityOldService functionalityService, ShareEntryBusinessService shareEntryBusinessService,
public ShareEntryServiceImpl(GuestRepository guestRepository, FunctionalityReadOnlyService functionalityReadOnlyService, ShareEntryBusinessService shareEntryBusinessService,
ShareExpiryDateService shareExpiryDateService, LogEntryService logEntryService, DocumentEntryService documentEntryService, NotifierService notifierService,
MailContentBuildingService mailElementsFactory, DocumentEntryBusinessService documentEntryBusinessService) {
super();
this.guestRepository = guestRepository;
this.functionalityService = functionalityService;
this.functionalityService = functionalityReadOnlyService;
this.shareEntryBusinessService = shareEntryBusinessService;
this.shareExpiryDateService = shareExpiryDateService;
this.logEntryService = logEntryService;
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/FunctionalityReadOnlyServiceImpl.java New file
0,0 → 1,312
/*
* LinShare is an open source filesharing software, part of the LinPKI software
* suite, developed by Linagora.
*
* Copyright (C) 2013 LINAGORA
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version, provided you comply with the Additional Terms applicable for
* LinShare software by Linagora pursuant to Section 7 of the GNU Affero General
* Public License, subsections (b), (c), and (e), pursuant to which you must
* notably (i) retain the display of the “LinShare™” trademark/logo at the top
* of the interface window, the display of the “You are using the Open Source
* and free version of LinShare™, powered by Linagora © 2009–2013. Contribute to
* Linshare R&D by subscribing to an Enterprise offer!” infobox and in the
* e-mails sent with the Program, (ii) retain all hypertext links between
* LinShare and linshare.org, between linagora.com and Linagora, and (iii)
* refrain from infringing Linagora intellectual property rights over its
* trademarks and commercial brands. Other Additional Terms apply, see
* <http://www.linagora.com/licenses/> for more details.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License and
* its applicable Additional Terms for LinShare along with this program. If not,
* see <http://www.gnu.org/licenses/> for the GNU Affero General Public License
* version 3 and <http://www.linagora.com/licenses/> for the Additional Terms
* applicable to LinShare software.
*/
package org.linagora.linshare.core.service.impl;
 
import org.linagora.linshare.core.domain.constants.FunctionalityNames;
import org.linagora.linshare.core.domain.constants.Policies;
import org.linagora.linshare.core.domain.entities.AbstractDomain;
import org.linagora.linshare.core.domain.entities.Functionality;
import org.linagora.linshare.core.domain.entities.IntegerValueFunctionality;
import org.linagora.linshare.core.domain.entities.StringValueFunctionality;
import org.linagora.linshare.core.domain.entities.UnitBooleanValueFunctionality;
import org.linagora.linshare.core.domain.entities.UnitValueFunctionality;
import org.linagora.linshare.core.domain.objects.SizeUnitValueFunctionality;
import org.linagora.linshare.core.domain.objects.TimeUnitBooleanValueFunctionality;
import org.linagora.linshare.core.domain.objects.TimeUnitValueFunctionality;
import org.linagora.linshare.core.exception.BusinessException;
import org.linagora.linshare.core.repository.AbstractDomainRepository;
import org.linagora.linshare.core.repository.FunctionalityRepository;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public class FunctionalityReadOnlyServiceImpl implements
FunctionalityReadOnlyService {
protected final Logger logger = LoggerFactory.getLogger(FunctionalityReadOnlyServiceImpl.class);
private final AbstractDomainRepository abstractDomainRepository;
private final FunctionalityRepository functionalityRepository;
 
public FunctionalityReadOnlyServiceImpl(
AbstractDomainRepository abstractDomainRepository,
FunctionalityRepository functionalityRepository) {
super();
this.abstractDomainRepository = abstractDomainRepository;
this.functionalityRepository = functionalityRepository;
}
 
@Override
public Functionality get(String domainIdentifier, String functionalityIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality functionality = _getFunctionality(domain, functionalityIdentifier);
// Always return a read only functionality.
return (Functionality)functionality.clone();
}
 
/**
* This method should not be used except by the FunctionalityReadOnlyServiceImpl.get method.
* @param domain
* @param functionalityIdentifier
* @return
*/
private Functionality _getFunctionality(AbstractDomain domain, String functionalityIdentifier) {
Functionality fonc = functionalityRepository.findById(domain, functionalityIdentifier);
if (fonc == null && domain.getParentDomain() != null) {
fonc = _getFunctionality(domain.getParentDomain(), functionalityIdentifier);
}
return fonc;
}
 
@Override
public TimeUnitBooleanValueFunctionality getDefaultShareExpiryTimeFunctionality(AbstractDomain domain) {
return new TimeUnitBooleanValueFunctionality((UnitBooleanValueFunctionality)_getFunctionality(domain, FunctionalityNames.SHARE_EXPIRATION));
}
 
@Override
public TimeUnitValueFunctionality getDefaultFileExpiryTimeFunctionality(AbstractDomain domain) {
return new TimeUnitValueFunctionality((UnitValueFunctionality)_getFunctionality(domain, FunctionalityNames.FILE_EXPIRATION));
}
 
@Override
public SizeUnitValueFunctionality getGlobalQuotaFunctionality(AbstractDomain domain) {
return new SizeUnitValueFunctionality((UnitValueFunctionality)_getFunctionality(domain, FunctionalityNames.QUOTA_GLOBAL));
}
 
@Override
public SizeUnitValueFunctionality getUserQuotaFunctionality(AbstractDomain domain) {
return new SizeUnitValueFunctionality((UnitValueFunctionality)_getFunctionality(domain, FunctionalityNames.QUOTA_USER));
}
 
@Override
public Functionality getGuestFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.GUESTS);
}
 
@Override
public TimeUnitValueFunctionality getGuestAccountExpiryTimeFunctionality(AbstractDomain domain) {
return new TimeUnitValueFunctionality((UnitValueFunctionality)_getFunctionality(domain, FunctionalityNames.ACCOUNT_EXPIRATION));
}
 
@Override
public StringValueFunctionality getTimeStampingFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) _getFunctionality(domain, FunctionalityNames.TIME_STAMPING);
}
@Override
public StringValueFunctionality getDomainMailFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) _getFunctionality(domain, FunctionalityNames.DOMAIN_MAIL);
}
 
@Override
public Functionality getMimeTypeFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.MIME_TYPE);
}
 
@Override
public Functionality getEnciphermentFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.ENCIPHERMENT);
}
 
@Override
public Functionality getAntivirusFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.ANTIVIRUS);
}
 
@Override
public Functionality getAnonymousUrlFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.ANONYMOUS_URL);
}
 
@Override
public Functionality getSecuredAnonymousUrlFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.SECURED_ANONYMOUS_URL);
}
 
@Override
public Functionality getRestrictedGuestFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.RESTRICTED_GUEST);
}
 
@Override
public SizeUnitValueFunctionality getUserMaxFileSizeFunctionality(AbstractDomain domain) {
return new SizeUnitValueFunctionality((UnitValueFunctionality)_getFunctionality(domain, FunctionalityNames.FILESIZE_MAX));
}
 
@Override
public Functionality getSignatureFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.SIGNATURE);
}
 
@Override
public StringValueFunctionality getCustomLogoFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) _getFunctionality(domain, FunctionalityNames.CUSTOM_LOGO);
}
 
@Override
public StringValueFunctionality getCustomLinkLogoFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) _getFunctionality(domain, FunctionalityNames.LINK_LOGO);
}
@Override
public Functionality getUserCanUploadFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.USER_CAN_UPLOAD);
}
 
@Override
public IntegerValueFunctionality getCompletionFunctionality(AbstractDomain domain) {
return (IntegerValueFunctionality) _getFunctionality(domain, FunctionalityNames.COMPLETION);
}
 
@Override
public Functionality getUserTabFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.TAB_USER);
}
@Override
public Functionality getThreadCreationPermissionFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.CREATE_THREAD_PERMISSION);
}
 
@Override
public Functionality getUpdateFilesFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.UPDATE_FILE);
}
@Override
public Functionality getAuditTabFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.TAB_AUDIT);
}
 
@Override
public Functionality getThreadTabFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.TAB_THREAD);
}
 
@Override
public Functionality getHelpTabFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.TAB_HELP);
}
@Override
public Functionality getListTabFunctionality(AbstractDomain domain) {
return _getFunctionality(domain, FunctionalityNames.TAB_LIST);
}
@Override
public StringValueFunctionality getShareNotificationBeforeExpirationFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) _getFunctionality(domain, FunctionalityNames.SHARE_NOTIFICATION_BEFORE_EXPIRATION);
}
@Override
public StringValueFunctionality getCustomNotificationUrlFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) _getFunctionality(domain, FunctionalityNames.NOTIFICATION_URL);
}
 
@Override
public boolean isSauAllowed(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality funcAU = getAnonymousUrlFunctionality(domain);
// We check if Anonymous Url are activated.
if(funcAU.getActivationPolicy().getStatus()) {
Functionality funcSAU = getSecuredAnonymousUrlFunctionality(domain);
return funcSAU.getActivationPolicy().getPolicy().equals(Policies.ALLOWED);
}
return false;
}
@Override
public boolean isSauMadatory(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getSecuredAnonymousUrlFunctionality(domain);
return func.getActivationPolicy().getPolicy().equals(Policies.MANDATORY);
}
@Override
public boolean getDefaultSauValue(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getSecuredAnonymousUrlFunctionality(domain);
return func.getActivationPolicy().getStatus();
}
@Override
public boolean getDefaultRestrictedGuestValue(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getRestrictedGuestFunctionality(domain);
return func.getActivationPolicy().getStatus();
}
@Override
public boolean isRestrictedGuestAllowed(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality funcRG = getRestrictedGuestFunctionality(domain);
return funcRG.getActivationPolicy().getPolicy().equals(Policies.ALLOWED);
}
@Override
public boolean isRestrictedGuestMadatory(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getRestrictedGuestFunctionality(domain);
return func.getActivationPolicy().getPolicy().equals(Policies.MANDATORY);
}
@Override
public boolean isCustomLogoActiveInRootDomain() throws BusinessException {
return this.getCustomLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getActivationPolicy().getStatus();
}
@Override
public String getCustomLogoUrlInRootDomain() throws BusinessException {
return this.getCustomLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getValue();
}
@Override
public boolean isCustomLinkLogoActiveInRootDomain() throws BusinessException {
return this.getCustomLinkLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getActivationPolicy().getStatus();
}
@Override
public String getCustomLinkLogoInRootDomain() throws BusinessException {
return this.getCustomLinkLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getValue();
}
@Override
public String getCustomNotificationURLInRootDomain() throws BusinessException {
return this.getCustomNotificationUrlFunctionality(abstractDomainRepository.getUniqueRootDomain()).getValue();
}
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/MailContentBuildingServiceImpl.java
48,7 → 48,6
import org.linagora.linshare.core.domain.entities.Contact;
import org.linagora.linshare.core.domain.entities.DocumentEntry;
import org.linagora.linshare.core.domain.entities.Guest;
import org.linagora.linshare.core.domain.entities.GuestDomain;
import org.linagora.linshare.core.domain.entities.MailContainer;
import org.linagora.linshare.core.domain.entities.MailContainerWithRecipient;
import org.linagora.linshare.core.domain.entities.MailSubject;
60,6 → 59,7
import org.linagora.linshare.core.exception.TechnicalException;
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.MailContentBuildingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
81,7 → 81,7
private final AbstractDomainService abstractDomainService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
class ContactRepresentation {
private String mail;
142,28 → 142,25
 
public MailContentBuildingServiceImpl(final String mailContentTxt,
final String mailContentHTML, final String mailContentHTMLWithoutLogo,
final boolean displayLogo, AbstractDomainService abstractDomainService,FunctionalityOldService functionalityService, boolean insertLicenceTerm) throws BusinessException {
final boolean displayLogo, AbstractDomainService abstractDomainService,FunctionalityReadOnlyService functionalityReadOnlyService, boolean insertLicenceTerm) throws BusinessException {
this.mailContentTxt = mailContentTxt;
this.mailContentHTML = mailContentHTML;
this.mailContentHTMLWithoutLogo = mailContentHTMLWithoutLogo;
this.displayLogo = displayLogo;
this.abstractDomainService = abstractDomainService;
this.insertLicenceTerm = insertLicenceTerm;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityReadOnlyService;
}
 
/**
*
* TOOLS
*
*/
private String getLinShareUrlForAUserRecipient(Account recipient) {
return functionalityService.getCustomNotificationUrlFunctionality(recipient.getDomain()).getValue();
return functionalityReadOnlyService.getCustomNotificationUrlFunctionality(recipient.getDomain()).getValue();
}
private String getLinShareUrlForAContactRecipient(Account sender) {
172,7 → 169,7
if(senderDomain == null) {
senderDomain = sender.getDomain();
}
return functionalityService.getCustomNotificationUrlFunctionality(senderDomain).getValue();
return functionalityReadOnlyService.getCustomNotificationUrlFunctionality(senderDomain).getValue();
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/AbstractDomainServiceImpl.java
62,6 → 62,7
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.DomainPolicyService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.UserProviderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
73,7 → 74,8
 
private final AbstractDomainRepository abstractDomainRepository;
private final DomainPolicyService domainPolicyService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final UserProviderService userProviderService;
private final MessagesRepository messagesRepository;
private final UserRepository<User> userRepository;
81,18 → 83,17
public AbstractDomainServiceImpl(
AbstractDomainRepository abstractDomainRepository,
DomainPolicyService domainPolicyService,
FunctionalityOldService functionalityService,
FunctionalityReadOnlyService functionalityReadOnlyService,
UserProviderService userProviderService,
MessagesRepository messagesRepository,
UserRepository<User> userRepository) {
super();
this.abstractDomainRepository = abstractDomainRepository;
this.domainPolicyService = domainPolicyService;
this.functionalityService = functionalityService;
this.userProviderService = userProviderService;
this.messagesRepository = messagesRepository;
this.userRepository = userRepository;
 
this.functionalityReadOnlyService = functionalityReadOnlyService;
}
 
@Override
738,7 → 739,7
 
AbstractDomain domain = sender.getDomain();
if (domain != null) {
Functionality func = functionalityService
Functionality func = functionalityReadOnlyService
.getAnonymousUrlFunctionality(domain);
return func.getActivationPolicy().getStatus();
}
754,7 → 755,7
 
AbstractDomain domain = user.getDomain();
if (domain != null) {
Functionality func = functionalityService
Functionality func = functionalityReadOnlyService
.getGuestFunctionality(domain);
if (func.getActivationPolicy().getStatus()) {
GuestDomain g = findGuestDomain(domain);
830,7 → 831,7
logger.debug("No Domain found.");
return null;
}
return functionalityService.getDomainMailFunctionality(domain)
return functionalityReadOnlyService.getDomainMailFunctionality(domain)
.getValue();
}
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/AnonymousShareEntryServiceImpl.java
53,7 → 53,7
import org.linagora.linshare.core.exception.BusinessErrorCode;
import org.linagora.linshare.core.exception.BusinessException;
import org.linagora.linshare.core.service.AnonymousShareEntryService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.LogEntryService;
import org.linagora.linshare.core.service.MailContentBuildingService;
import org.linagora.linshare.core.service.NotifierService;
63,7 → 63,7
 
public class AnonymousShareEntryServiceImpl implements AnonymousShareEntryService {
 
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final AnonymousShareEntryBusinessService anonymousShareEntryBusinessService;
79,11 → 79,11
private static final Logger logger = LoggerFactory.getLogger(AnonymousShareEntryServiceImpl.class);
public AnonymousShareEntryServiceImpl(FunctionalityOldService functionalityService, AnonymousShareEntryBusinessService anonymousShareEntryBusinessService,
public AnonymousShareEntryServiceImpl(FunctionalityReadOnlyService functionalityService, AnonymousShareEntryBusinessService anonymousShareEntryBusinessService,
ShareExpiryDateService shareExpiryDateService, LogEntryService logEntryService, NotifierService notifierService, MailContentBuildingService mailElementsFactory,
DocumentEntryBusinessService documentEntryBusinessService) {
super();
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
this.anonymousShareEntryBusinessService = anonymousShareEntryBusinessService;
this.shareExpiryDateService = shareExpiryDateService;
this.logEntryService = logEntryService;
112,9 → 112,9
@Override
public List<AnonymousShareEntry> createAnonymousShare(List<DocumentEntry> documentEntries, User sender, Contact recipient, Calendar expirationDate, Boolean passwordProtected, MailContainer mailContainer) throws BusinessException {
if(functionalityService.isSauMadatory(sender.getDomain().getIdentifier())) {
if(functionalityReadOnlyService.isSauMadatory(sender.getDomain().getIdentifier())) {
passwordProtected = true;
} else if(!functionalityService.isSauAllowed(sender.getDomain().getIdentifier())) {
} else if(!functionalityReadOnlyService.isSauAllowed(sender.getDomain().getIdentifier())) {
// if it is not mandatory an not allowed, it must be forbidden
passwordProtected = false;
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/DocumentEntryServiceImpl.java
67,7 → 67,7
import org.linagora.linshare.core.exception.TechnicalException;
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.DocumentEntryService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.LogEntryService;
import org.linagora.linshare.core.service.MimeTypeService;
import org.linagora.linshare.core.service.VirusScannerService;
82,18 → 82,18
private final DocumentEntryBusinessService documentEntryBusinessService;
private final LogEntryService logEntryService;
private final AbstractDomainService abstractDomainService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final MimeTypeService mimeTypeService;
private final VirusScannerService virusScannerService;
private final MimeTypeMagicNumberDao mimeTypeIdentifier;
 
public DocumentEntryServiceImpl(DocumentEntryBusinessService documentEntryBusinessService, LogEntryService logEntryService, AbstractDomainService abstractDomainService,
FunctionalityOldService functionalityService, MimeTypeService mimeTypeService, VirusScannerService virusScannerService, MimeTypeMagicNumberDao mimeTypeIdentifier) {
FunctionalityReadOnlyService functionalityReadOnlyService, MimeTypeService mimeTypeService, VirusScannerService virusScannerService, MimeTypeMagicNumberDao mimeTypeIdentifier) {
super();
this.documentEntryBusinessService = documentEntryBusinessService;
this.logEntryService = logEntryService;
this.abstractDomainService = abstractDomainService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityReadOnlyService;
this.mimeTypeService = mimeTypeService;
this.virusScannerService = virusScannerService;
this.mimeTypeIdentifier = mimeTypeIdentifier;
113,24 → 113,24
 
// check if the file MimeType is allowed
AbstractDomain domain = abstractDomainService.retrieveDomain(actor.getDomain().getIdentifier());
Functionality mimeFunctionality = functionalityService.getMimeTypeFunctionality(domain);
Functionality mimeFunctionality = functionalityReadOnlyService.getMimeTypeFunctionality(domain);
if (mimeFunctionality.getActivationPolicy().getStatus()) {
mimeTypeService.checkFileMimeType(fileName, mimeType, actor);
}
 
Functionality antivirusFunctionality = functionalityService.getAntivirusFunctionality(domain);
Functionality antivirusFunctionality = functionalityReadOnlyService.getAntivirusFunctionality(domain);
if (antivirusFunctionality.getActivationPolicy().getStatus()) {
checkVirus(fileName, actor, tempFile);
}
 
// want a timestamp on doc ?
String timeStampingUrl = null;
StringValueFunctionality timeStampingFunctionality = functionalityService.getTimeStampingFunctionality(domain);
StringValueFunctionality timeStampingFunctionality = functionalityReadOnlyService.getTimeStampingFunctionality(domain);
if (timeStampingFunctionality.getActivationPolicy().getStatus()) {
timeStampingUrl = timeStampingFunctionality.getValue();
}
 
Functionality enciphermentFunctionality = functionalityService.getEnciphermentFunctionality(domain);
Functionality enciphermentFunctionality = functionalityReadOnlyService.getEnciphermentFunctionality(domain);
Boolean checkIfIsCiphered = enciphermentFunctionality.getActivationPolicy().getStatus();
 
// We need to set an expiration date in case of file cleaner
174,24 → 174,24
checkSpace(size, fileName, actor);
 
// check if the file MimeType is allowed
Functionality mimeFunctionality = functionalityService.getMimeTypeFunctionality(domain);
Functionality mimeFunctionality = functionalityReadOnlyService.getMimeTypeFunctionality(domain);
if (mimeFunctionality.getActivationPolicy().getStatus()) {
mimeTypeService.checkFileMimeType(fileName, mimeType, actor);
}
Functionality antivirusFunctionality = functionalityService.getAntivirusFunctionality(domain);
Functionality antivirusFunctionality = functionalityReadOnlyService.getAntivirusFunctionality(domain);
if (antivirusFunctionality.getActivationPolicy().getStatus()) {
checkVirus(fileName, actor, tempFile);
}
// want a timestamp on doc ?
String timeStampingUrl = null;
StringValueFunctionality timeStampingFunctionality = functionalityService.getTimeStampingFunctionality(domain);
StringValueFunctionality timeStampingFunctionality = functionalityReadOnlyService.getTimeStampingFunctionality(domain);
if (timeStampingFunctionality.getActivationPolicy().getStatus()) {
timeStampingUrl = timeStampingFunctionality.getValue();
}
Functionality enciphermentFunctionality = functionalityService.getEnciphermentFunctionality(domain);
Functionality enciphermentFunctionality = functionalityReadOnlyService.getEnciphermentFunctionality(domain);
Boolean checkIfIsCiphered = enciphermentFunctionality.getActivationPolicy().getStatus();
// We need to set an expiration date in case of file cleaner activation.
225,7 → 225,7
 
private Calendar getDocumentExpirationDate(AbstractDomain domain) {
Calendar expirationDate = Calendar.getInstance();
TimeUnitValueFunctionality fileExpirationTimeFunctionality = functionalityService.getDefaultFileExpiryTimeFunctionality(domain);
TimeUnitValueFunctionality fileExpirationTimeFunctionality = functionalityReadOnlyService.getDefaultFileExpiryTimeFunctionality(domain);
expirationDate.add(fileExpirationTimeFunctionality.toCalendarUnitValue(), fileExpirationTimeFunctionality.getValue());
return expirationDate;
}
247,7 → 247,7
 
// want a timestamp on doc ?
String timeStampingUrl = null;
StringValueFunctionality timeStampingFunctionality = functionalityService.getTimeStampingFunctionality(domain);
StringValueFunctionality timeStampingFunctionality = functionalityReadOnlyService.getTimeStampingFunctionality(domain);
if (timeStampingFunctionality.getActivationPolicy().getStatus()) {
timeStampingUrl = timeStampingFunctionality.getValue();
}
337,7 → 337,7
public long getUserMaxFileSize(Account account) throws BusinessException {
// if user is not in one domain = BOUM
AbstractDomain domain = abstractDomainService.retrieveDomain(account.getDomain().getIdentifier());
SizeUnitValueFunctionality userMaxFileSizeFunctionality = functionalityService.getUserMaxFileSizeFunctionality(domain);
SizeUnitValueFunctionality userMaxFileSizeFunctionality = functionalityReadOnlyService.getUserMaxFileSizeFunctionality(domain);
 
if (userMaxFileSizeFunctionality.getActivationPolicy().getStatus()) {
 
357,8 → 357,8
 
AbstractDomain domain = abstractDomainService.retrieveDomain(account.getDomain().getIdentifier());
 
SizeUnitValueFunctionality globalQuotaFunctionality = functionalityService.getGlobalQuotaFunctionality(domain);
SizeUnitValueFunctionality userQuotaFunctionality = functionalityService.getUserQuotaFunctionality(domain);
SizeUnitValueFunctionality globalQuotaFunctionality = functionalityReadOnlyService.getGlobalQuotaFunctionality(domain);
SizeUnitValueFunctionality userQuotaFunctionality = functionalityReadOnlyService.getUserQuotaFunctionality(domain);
 
if (globalQuotaFunctionality.getActivationPolicy().getStatus()) {
 
389,8 → 389,8
 
AbstractDomain domain = abstractDomainService.retrieveDomain(account.getDomain().getIdentifier());
 
SizeUnitValueFunctionality globalQuotaFunctionality = functionalityService.getGlobalQuotaFunctionality(domain);
SizeUnitValueFunctionality userQuotaFunctionality = functionalityService.getUserQuotaFunctionality(domain);
SizeUnitValueFunctionality globalQuotaFunctionality = functionalityReadOnlyService.getGlobalQuotaFunctionality(domain);
SizeUnitValueFunctionality userQuotaFunctionality = functionalityReadOnlyService.getUserQuotaFunctionality(domain);
 
if (globalQuotaFunctionality.getActivationPolicy().getStatus()) {
return globalQuotaFunctionality.getPlainSize();
442,27 → 442,27
 
@Override
public boolean isSignatureActive(Account account) {
return functionalityService.getSignatureFunctionality(account.getDomain()).getActivationPolicy().getStatus();
return functionalityReadOnlyService.getSignatureFunctionality(account.getDomain()).getActivationPolicy().getStatus();
}
 
@Override
public boolean isEnciphermentActive(Account account) {
return functionalityService.getEnciphermentFunctionality(account.getDomain()).getActivationPolicy().getStatus();
return functionalityReadOnlyService.getEnciphermentFunctionality(account.getDomain()).getActivationPolicy().getStatus();
}
 
@Override
public boolean isGlobalQuotaActive(Account account) throws BusinessException {
return functionalityService.getGlobalQuotaFunctionality(account.getDomain()).getActivationPolicy().getStatus();
return functionalityReadOnlyService.getGlobalQuotaFunctionality(account.getDomain()).getActivationPolicy().getStatus();
}
 
@Override
public boolean isUserQuotaActive(Account account) throws BusinessException {
return functionalityService.getUserQuotaFunctionality(account.getDomain()).getActivationPolicy().getStatus();
return functionalityReadOnlyService.getUserQuotaFunctionality(account.getDomain()).getActivationPolicy().getStatus();
}
 
@Override
public Long getGlobalQuota(Account account) throws BusinessException {
SizeUnitValueFunctionality globalQuotaFunctionality = functionalityService.getGlobalQuotaFunctionality(account.getDomain());
SizeUnitValueFunctionality globalQuotaFunctionality = functionalityReadOnlyService.getGlobalQuotaFunctionality(account.getDomain());
return globalQuotaFunctionality.getPlainSize();
}
 
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/ThreadServiceImpl.java
33,7 → 33,6
*/
package org.linagora.linshare.core.service.impl;
 
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
 
56,7 → 55,7
import org.linagora.linshare.core.repository.ThreadMemberRepository;
import org.linagora.linshare.core.repository.ThreadRepository;
import org.linagora.linshare.core.repository.ThreadViewRepository;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.LogEntryService;
import org.linagora.linshare.core.service.ThreadService;
import org.slf4j.Logger;
74,14 → 73,14
 
private final DocumentEntryBusinessService documentEntryBusinessService;
 
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final TagRepository tagRepository;
 
private final LogEntryService logEntryService;
 
public ThreadServiceImpl(ThreadRepository threadRepository, ThreadViewRepository threadViewRepository, ThreadMemberRepository threadMemberRepository, TagRepository tagRepository,
DocumentEntryBusinessService documentEntryBusinessService, LogEntryService logEntryService,FunctionalityOldService functionalityService) {
DocumentEntryBusinessService documentEntryBusinessService, LogEntryService logEntryService,FunctionalityReadOnlyService functionalityService) {
super();
this.threadRepository = threadRepository;
this.threadViewRepository = threadViewRepository;
89,7 → 88,7
this.tagRepository = tagRepository;
this.documentEntryBusinessService = documentEntryBusinessService;
this.logEntryService = logEntryService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
}
 
@Override
110,7 → 109,7
@Override
public Boolean create(Account actor, String name) throws BusinessException {
boolean isGuest = actor.getAccountType().equals(AccountType.GUEST);
Functionality creation = functionalityService.getThreadCreationPermissionFunctionality(actor.getDomain());
Functionality creation = functionalityReadOnlyService.getThreadCreationPermissionFunctionality(actor.getDomain());
if (creation.getActivationPolicy().getStatus() && !isGuest){
Thread thread = null;
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/FunctionalityOldServiceImpl.java
37,6 → 37,7
import java.util.List;
import java.util.Set;
 
import org.linagora.linshare.core.domain.constants.DomainType;
import org.linagora.linshare.core.domain.constants.FunctionalityNames;
import org.linagora.linshare.core.domain.constants.Policies;
import org.linagora.linshare.core.domain.entities.AbstractDomain;
57,6 → 58,8
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
 
// TODO : to be rename as FunctionalityReadOnlyService
public class FunctionalityOldServiceImpl implements FunctionalityOldService {
 
protected final Logger logger = LoggerFactory.getLogger(FunctionalityOldServiceImpl.class);
83,6 → 86,7
this.abstractDomainRepository = domainRepository;
}
 
@Deprecated
@Override
public Functionality findById(long id) {
Functionality func = functionalityRepository.findById(id);
101,6 → 105,7
* : list of functionality entities
* @return
*/
@Deprecated
private List<String> getFunctionalityIdentifiers(Set<Functionality> set) {
List<String> allfunctionalityIdentifiers = new ArrayList<String>();
 
128,7 → 133,7
List<Functionality> allfunctionalities = new ArrayList<Functionality>(domain.getFunctionalities());
// Add all functionality identifiers from this domain
List<String> allfunctionalityIdentifiers = getFunctionalityIdentifiers(domain.getFunctionalities());
 
if (domain.getParentDomain() != null) {
List<Functionality> parentFunctionalitites = getAllFunctionalities(domain.getParentDomain());
for (Functionality functionality : parentFunctionalitites) {
144,26 → 149,13
}
 
/**
* This method return a list of functionality including all its
* functionalities and its parent's functionalities
*
* @param domainIdentifier
* domain entity identifier
* @return functionality list
*/
@Override
public List<Functionality> getAllFunctionalities(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
return getAllFunctionalities(domain);
}
 
/**
* This method return the functionality by its IDENTIFIER
*
* @param domainIdentifier
* domain entity identifier
* @return functionality
*/
@Deprecated
@Override
public Functionality getFunctionalityByIdentifiers(String domainIdentifier, String functionalityIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
172,6 → 164,7
return (Functionality)functionality.clone();
}
 
@Deprecated
private Functionality getFunctionalityEntityByIdentifiers(AbstractDomain domain, String functionalityIdentifier) {
Functionality fonc = functionalityRepository.findById(domain, functionalityIdentifier);
if (fonc == null && domain.getParentDomain() != null) {
522,6 → 515,10
 
// Add all my functionality identifiers
List<String> allFunctionalityIdentifiers = getFunctionalityIdentifiers(domain.getFunctionalities());
boolean isGuestDomain = domain.getDomainType().equals(DomainType.GUESTDOMAIN);
if(isGuestDomain) {
allFunctionalityIdentifiers.add(FunctionalityNames.ACCOUNT_EXPIRATION);
}
 
if (domain.getParentDomain() != null) {
parentFunctionalitites = getAllFunctionalities(domain.getParentDomain());
542,7 → 539,9
// Add all my functionalities
for (Functionality functionality : domain.getFunctionalities()) {
if(checkCriteriaForMySelf(criteria, functionality, parentFunctionalitites)) {
allFunctionalities.add(functionality);
if(!(isGuestDomain && functionality.getIdentifier().equals(FunctionalityNames.ACCOUNT_EXPIRATION))) {
allFunctionalities.add(functionality);
}
}
}
584,223 → 583,4
public List<Functionality> getAllEditableFunctionalities(AbstractDomain domain) {
return getAllFunctionality(domain, CST_FUNC_EDITABLES);
}
 
@Override
public TimeUnitBooleanValueFunctionality getDefaultShareExpiryTimeFunctionality(AbstractDomain domain) {
return new TimeUnitBooleanValueFunctionality((UnitBooleanValueFunctionality)getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.SHARE_EXPIRATION));
}
 
@Override
public TimeUnitValueFunctionality getDefaultFileExpiryTimeFunctionality(AbstractDomain domain) {
return new TimeUnitValueFunctionality((UnitValueFunctionality)getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.FILE_EXPIRATION));
}
 
@Override
public SizeUnitValueFunctionality getGlobalQuotaFunctionality(AbstractDomain domain) {
return new SizeUnitValueFunctionality((UnitValueFunctionality)getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.QUOTA_GLOBAL));
}
 
@Override
public SizeUnitValueFunctionality getUserQuotaFunctionality(AbstractDomain domain) {
return new SizeUnitValueFunctionality((UnitValueFunctionality)getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.QUOTA_USER));
}
 
@Override
public Functionality getGuestFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.GUESTS);
}
 
@Override
public TimeUnitValueFunctionality getGuestAccountExpiryTimeFunctionality(AbstractDomain domain) {
return new TimeUnitValueFunctionality((UnitValueFunctionality)getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.ACCOUNT_EXPIRATION));
}
 
@Override
public StringValueFunctionality getTimeStampingFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.TIME_STAMPING);
}
@Override
public StringValueFunctionality getDomainMailFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.DOMAIN_MAIL);
}
 
@Override
public Functionality getMimeTypeFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.MIME_TYPE);
}
 
@Override
public Functionality getEnciphermentFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.ENCIPHERMENT);
}
 
@Override
public Functionality getAntivirusFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.ANTIVIRUS);
}
 
@Override
public Functionality getAnonymousUrlFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.ANONYMOUS_URL);
}
 
@Override
public Functionality getSecuredAnonymousUrlFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.SECURED_ANONYMOUS_URL);
}
 
@Override
public Functionality getRestrictedGuestFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.RESTRICTED_GUEST);
}
 
@Override
public SizeUnitValueFunctionality getUserMaxFileSizeFunctionality(AbstractDomain domain) {
return new SizeUnitValueFunctionality((UnitValueFunctionality)getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.FILESIZE_MAX));
}
 
@Override
public Functionality getSignatureFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.SIGNATURE);
}
 
@Override
public StringValueFunctionality getCustomLogoFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.CUSTOM_LOGO);
}
 
@Override
public StringValueFunctionality getCustomLinkLogoFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.LINK_LOGO);
}
@Override
public Functionality getUserCanUploadFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.USER_CAN_UPLOAD);
}
 
@Override
public IntegerValueFunctionality getCompletionFunctionality(AbstractDomain domain) {
return (IntegerValueFunctionality) getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.COMPLETION);
}
 
@Override
public Functionality getUserTabFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.TAB_USER);
}
@Override
public Functionality getThreadCreationPermissionFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.CREATE_THREAD_PERMISSION);
}
 
@Override
public Functionality getUpdateFilesFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.UPDATE_FILE);
}
@Override
public Functionality getAuditTabFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.TAB_AUDIT);
}
 
@Override
public Functionality getThreadTabFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.TAB_THREAD);
}
 
@Override
public Functionality getHelpTabFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.TAB_HELP);
}
@Override
public Functionality getListTabFunctionality(AbstractDomain domain) {
return getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.TAB_LIST);
}
@Override
public StringValueFunctionality getShareNotificationBeforeExpirationFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.SHARE_NOTIFICATION_BEFORE_EXPIRATION);
}
@Override
public StringValueFunctionality getCustomNotificationUrlFunctionality(AbstractDomain domain) {
return (StringValueFunctionality) getFunctionalityEntityByIdentifiers(domain, FunctionalityNames.NOTIFICATION_URL);
}
 
@Override
public boolean isSauAllowed(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality funcAU = getAnonymousUrlFunctionality(domain);
// We check if Anonymous Url are activated.
if(funcAU.getActivationPolicy().getStatus()) {
Functionality funcSAU = getSecuredAnonymousUrlFunctionality(domain);
return funcSAU.getActivationPolicy().getPolicy().equals(Policies.ALLOWED);
}
return false;
}
@Override
public boolean isSauMadatory(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getSecuredAnonymousUrlFunctionality(domain);
return func.getActivationPolicy().getPolicy().equals(Policies.MANDATORY);
}
@Override
public boolean getDefaultSauValue(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getSecuredAnonymousUrlFunctionality(domain);
return func.getActivationPolicy().getStatus();
}
@Override
public boolean getDefaultRestrictedGuestValue(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getRestrictedGuestFunctionality(domain);
return func.getActivationPolicy().getStatus();
}
@Override
public boolean isRestrictedGuestAllowed(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality funcRG = getRestrictedGuestFunctionality(domain);
return funcRG.getActivationPolicy().getPolicy().equals(Policies.ALLOWED);
}
@Override
public boolean isRestrictedGuestMadatory(String domainIdentifier) {
AbstractDomain domain = abstractDomainRepository.findById(domainIdentifier);
Functionality func = getRestrictedGuestFunctionality(domain);
return func.getActivationPolicy().getPolicy().equals(Policies.MANDATORY);
}
@Override
public boolean isCustomLogoActiveInRootDomain() throws BusinessException {
return this.getCustomLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getActivationPolicy().getStatus();
}
@Override
public String getCustomLogoUrlInRootDomain() throws BusinessException {
return this.getCustomLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getValue();
}
@Override
public boolean isCustomLinkLogoActiveInRootDomain() throws BusinessException {
return this.getCustomLinkLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getActivationPolicy().getStatus();
}
@Override
public String getCustomLinkLogoInRootDomain() throws BusinessException {
return this.getCustomLinkLogoFunctionality(abstractDomainRepository.getUniqueRootDomain()).getValue();
}
@Override
public String getCustomNotificationURLInRootDomain() throws BusinessException {
return this.getCustomNotificationUrlFunctionality(abstractDomainRepository.getUniqueRootDomain()).getValue();
}
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/impl/ThreadEntryServiceImpl.java
45,8 → 45,6
import org.linagora.linshare.core.domain.entities.AbstractDomain;
import org.linagora.linshare.core.domain.entities.Account;
import org.linagora.linshare.core.domain.entities.AntivirusLogEntry;
import org.linagora.linshare.core.domain.entities.DocumentEntry;
import org.linagora.linshare.core.domain.entities.FileLogEntry;
import org.linagora.linshare.core.domain.entities.Functionality;
import org.linagora.linshare.core.domain.entities.LogEntry;
import org.linagora.linshare.core.domain.entities.StringValueFunctionality;
63,7 → 61,7
import org.linagora.linshare.core.repository.ThreadMemberRepository;
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.AccountService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.LogEntryService;
import org.linagora.linshare.core.service.MimeTypeService;
import org.linagora.linshare.core.service.ThreadEntryService;
79,7 → 77,7
private final DocumentEntryBusinessService documentEntryBusinessService;
private final LogEntryService logEntryService;
private final AbstractDomainService abstractDomainService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final MimeTypeService mimeTypeService;
private final AccountService accountService;
private final VirusScannerService virusScannerService;
88,13 → 86,13
private final MimeTypeMagicNumberDao mimeTypeIdentifier;
 
public ThreadEntryServiceImpl(DocumentEntryBusinessService documentEntryBusinessService, LogEntryService logEntryService, AbstractDomainService abstractDomainService,
FunctionalityOldService functionalityService, MimeTypeService mimeTypeService, AccountService accountService, VirusScannerService virusScannerService, TagBusinessService tagBusinessService,
FunctionalityReadOnlyService functionalityReadOnlyService, MimeTypeService mimeTypeService, AccountService accountService, VirusScannerService virusScannerService, TagBusinessService tagBusinessService,
ThreadMemberRepository threadMemberRepository, MimeTypeMagicNumberDao mimeTypeIdentifier) {
super();
this.documentEntryBusinessService = documentEntryBusinessService;
this.logEntryService = logEntryService;
this.abstractDomainService = abstractDomainService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityReadOnlyService;
this.mimeTypeService = mimeTypeService;
this.accountService = accountService;
this.virusScannerService = virusScannerService;
115,24 → 113,24
AbstractDomain domain = abstractDomainService.retrieveDomain(actor.getDomain().getIdentifier());
 
// check if the file MimeType is allowed
Functionality mimeFunctionality = functionalityService.getMimeTypeFunctionality(domain);
Functionality mimeFunctionality = functionalityReadOnlyService.getMimeTypeFunctionality(domain);
if (mimeFunctionality.getActivationPolicy().getStatus()) {
mimeTypeService.checkFileMimeType(filename, mimeType, actor);
}
 
Functionality antivirusFunctionality = functionalityService.getAntivirusFunctionality(domain);
Functionality antivirusFunctionality = functionalityReadOnlyService.getAntivirusFunctionality(domain);
if (antivirusFunctionality.getActivationPolicy().getStatus()) {
checkVirus(filename, actor, tempFile);
}
 
// want a timestamp on doc ?
String timeStampingUrl = null;
StringValueFunctionality timeStampingFunctionality = functionalityService.getTimeStampingFunctionality(domain);
StringValueFunctionality timeStampingFunctionality = functionalityReadOnlyService.getTimeStampingFunctionality(domain);
if (timeStampingFunctionality.getActivationPolicy().getStatus()) {
timeStampingUrl = timeStampingFunctionality.getValue();
}
 
Functionality enciphermentFunctionality = functionalityService.getEnciphermentFunctionality(domain);
Functionality enciphermentFunctionality = functionalityReadOnlyService.getEnciphermentFunctionality(domain);
Boolean checkIfIsCiphered = enciphermentFunctionality.getActivationPolicy().getStatus();
 
threadEntry = documentEntryBusinessService.createThreadEntry(thread, tempFile, size, filename, checkIfIsCiphered, timeStampingUrl, mimeType);
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/service/FunctionalityReadOnlyService.java New file
0,0 → 1,160
/*
* LinShare is an open source filesharing software, part of the LinPKI software
* suite, developed by Linagora.
*
* Copyright (C) 2013 LINAGORA
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version, provided you comply with the Additional Terms applicable for
* LinShare software by Linagora pursuant to Section 7 of the GNU Affero General
* Public License, subsections (b), (c), and (e), pursuant to which you must
* notably (i) retain the display of the “LinShare™” trademark/logo at the top
* of the interface window, the display of the “You are using the Open Source
* and free version of LinShare™, powered by Linagora © 2009–2013. Contribute to
* Linshare R&D by subscribing to an Enterprise offer!” infobox and in the
* e-mails sent with the Program, (ii) retain all hypertext links between
* LinShare and linshare.org, between linagora.com and Linagora, and (iii)
* refrain from infringing Linagora intellectual property rights over its
* trademarks and commercial brands. Other Additional Terms apply, see
* <http://www.linagora.com/licenses/> for more details.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License and
* its applicable Additional Terms for LinShare along with this program. If not,
* see <http://www.gnu.org/licenses/> for the GNU Affero General Public License
* version 3 and <http://www.linagora.com/licenses/> for the Additional Terms
* applicable to LinShare software.
*/
package org.linagora.linshare.core.service;
 
import org.linagora.linshare.core.domain.entities.AbstractDomain;
import org.linagora.linshare.core.domain.entities.Functionality;
import org.linagora.linshare.core.domain.entities.IntegerValueFunctionality;
import org.linagora.linshare.core.domain.entities.StringValueFunctionality;
import org.linagora.linshare.core.domain.objects.SizeUnitValueFunctionality;
import org.linagora.linshare.core.domain.objects.TimeUnitBooleanValueFunctionality;
import org.linagora.linshare.core.domain.objects.TimeUnitValueFunctionality;
import org.linagora.linshare.core.exception.BusinessException;
 
public interface FunctionalityReadOnlyService {
 
public Functionality get(String domainIdentifier,String functionalityIdentifier);
/**
* Shortcuts to functionalities
*/
 
public SizeUnitValueFunctionality getGlobalQuotaFunctionality (AbstractDomain domain);
public SizeUnitValueFunctionality getUserQuotaFunctionality (AbstractDomain domain);
public SizeUnitValueFunctionality getUserMaxFileSizeFunctionality (AbstractDomain domain);
public TimeUnitBooleanValueFunctionality getDefaultShareExpiryTimeFunctionality (AbstractDomain domain);
public TimeUnitValueFunctionality getDefaultFileExpiryTimeFunctionality (AbstractDomain domain);
public Functionality getGuestFunctionality (AbstractDomain domain);
public TimeUnitValueFunctionality getGuestAccountExpiryTimeFunctionality (AbstractDomain domain);
public StringValueFunctionality getTimeStampingFunctionality(AbstractDomain domain);
public StringValueFunctionality getDomainMailFunctionality(AbstractDomain domain);
public Functionality getMimeTypeFunctionality(AbstractDomain domain);
public Functionality getEnciphermentFunctionality(AbstractDomain domain);
public Functionality getAntivirusFunctionality(AbstractDomain domain);
public Functionality getAnonymousUrlFunctionality(AbstractDomain domain);
public Functionality getSecuredAnonymousUrlFunctionality(AbstractDomain domain);
public Functionality getRestrictedGuestFunctionality(AbstractDomain domain);
public Functionality getSignatureFunctionality(AbstractDomain domain);
public Functionality getThreadCreationPermissionFunctionality(AbstractDomain domain);
public Functionality getUpdateFilesFunctionality(AbstractDomain domain);
public Functionality getUserCanUploadFunctionality(AbstractDomain domain);
public StringValueFunctionality getCustomLogoFunctionality(AbstractDomain domain);
public StringValueFunctionality getCustomLinkLogoFunctionality(AbstractDomain domain);
public StringValueFunctionality getCustomNotificationUrlFunctionality(AbstractDomain domain);
public StringValueFunctionality getShareNotificationBeforeExpirationFunctionality(AbstractDomain domain);
public IntegerValueFunctionality getCompletionFunctionality(AbstractDomain domain);
public Functionality getUserTabFunctionality(AbstractDomain domain);
public Functionality getAuditTabFunctionality(AbstractDomain domain);
public Functionality getThreadTabFunctionality(AbstractDomain domain);
public Functionality getHelpTabFunctionality(AbstractDomain domain);
public Functionality getListTabFunctionality(AbstractDomain domain);
/**
* Check if SecuredAnonymousUrl (SAU) is mandatory
* @param domain : the current domain identifier
* @return
*/
public boolean isSauMadatory(String domainIdentifier);
/**
* Check if SecuredAnonymousUrl (SAU) is allowed
* @param domain : the current domain identifier
* @return
*/
public boolean isSauAllowed(String domainIdentifier);
 
/**
* return the default value for SecuredAnonymousUrl (SAU)
* @param domain : the current domain identifier
* @return
*/
public boolean getDefaultSauValue(String domainIdentifier);
/**
* return the default value for RestrictedGuest
* @param domain : the current domain identifier
* @return
*/
public boolean getDefaultRestrictedGuestValue(String domainIdentifier);
 
/**
* Check if RestrictedGuest is mandatory
* @param domain : the current domain identifier
* @return
*/
public boolean isRestrictedGuestMadatory(String domainIdentifier);
/**
* Check if RestrictedGuest is allowed
* @param domain : the current domain identifier
* @return
*/
public boolean isRestrictedGuestAllowed(String domainIdentifier);
 
/**
* Return the status of the custom logo in root domain
* @return the status
*/
public boolean isCustomLogoActiveInRootDomain() throws BusinessException;
/**
* Return the status of the custom logo in root domain
* @return the status
*/
public String getCustomLogoUrlInRootDomain() throws BusinessException;
/**
* Return the status of the custom link logo in root domain
* @return the status
*/
public boolean isCustomLinkLogoActiveInRootDomain() throws BusinessException;
/**
* Return the status of the custom link logo in root domain
* @return the status
*/
public String getCustomLinkLogoInRootDomain() throws BusinessException;
/**
* Return the status of the custom Notification URL in root domain
* @return the status
*/
public String getCustomNotificationURLInRootDomain() throws BusinessException;
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/facade/webservice/user/impl/ThreadEntryFacadeImpl.java
10,7 → 10,7
import org.linagora.linshare.core.exception.BusinessException;
import org.linagora.linshare.core.facade.webservice.user.ThreadEntryFacade;
import org.linagora.linshare.core.service.AccountService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.ThreadEntryService;
import org.linagora.linshare.core.service.ThreadService;
import org.linagora.linshare.webservice.dto.ThreadEntryDto;
24,19 → 24,19
private final ThreadEntryService threadEntryService;
private final ThreadService threadService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
 
public ThreadEntryFacadeImpl(AccountService accountService, ThreadService threadService, ThreadEntryService threadEntryService, FunctionalityOldService functionalityService) {
public ThreadEntryFacadeImpl(AccountService accountService, ThreadService threadService, ThreadEntryService threadEntryService, FunctionalityReadOnlyService functionalityService) {
super(accountService);
this.threadService = threadService;
this.threadEntryService = threadEntryService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
}
@Override
public User checkAuthentication() throws BusinessException {
User user = super.checkAuthentication();
Functionality functionality = functionalityService.getThreadTabFunctionality(user.getDomain());
Functionality functionality = functionalityReadOnlyService.getThreadTabFunctionality(user.getDomain());
 
if (!functionality.getActivationPolicy().getStatus()) {
throw new BusinessException(BusinessErrorCode.WEBSERVICE_UNAUTHORIZED, "You are not authorized to use this service");
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/facade/webservice/user/impl/UserFacadeImpl.java
42,7 → 42,7
import org.linagora.linshare.core.exception.BusinessException;
import org.linagora.linshare.core.facade.webservice.user.UserFacade;
import org.linagora.linshare.core.service.AccountService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.UserService;
import org.linagora.linshare.webservice.dto.UserDto;
import org.slf4j.Logger;
56,20 → 56,20
 
private final UserService userService;
 
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
 
public UserFacadeImpl(final UserService userService,
final AccountService accountService,
FunctionalityOldService functionalityService) {
FunctionalityReadOnlyService functionalityService) {
super(accountService);
this.userService = userService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
}
 
@Override
public User checkAuthentication() throws BusinessException {
User user = super.checkAuthentication();
Functionality functionality = functionalityService
Functionality functionality = functionalityReadOnlyService
.getUserTabFunctionality(user.getDomain());
if (!functionality.getActivationPolicy().getStatus()) {
throw new BusinessException(
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/facade/webservice/user/impl/ThreadFacadeImpl.java
44,7 → 44,7
import org.linagora.linshare.core.exception.BusinessException;
import org.linagora.linshare.core.facade.webservice.user.ThreadFacade;
import org.linagora.linshare.core.service.AccountService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.ThreadService;
import org.linagora.linshare.core.service.UserService;
import org.linagora.linshare.webservice.dto.ThreadDto;
60,19 → 60,19
 
private final UserService userService;
 
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
 
public ThreadFacadeImpl(ThreadService threadService, AccountService accountService, UserService userService, FunctionalityOldService functionalityService) {
public ThreadFacadeImpl(ThreadService threadService, AccountService accountService, UserService userService, FunctionalityReadOnlyService functionalityService) {
super(accountService);
this.threadService = threadService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
this.userService = userService;
}
 
@Override
public User checkAuthentication() throws BusinessException {
User user = super.checkAuthentication();
Functionality functionality = functionalityService.getThreadTabFunctionality(user.getDomain());
Functionality functionality = functionalityReadOnlyService.getThreadTabFunctionality(user.getDomain());
 
if (!functionality.getActivationPolicy().getStatus()) {
throw new BusinessException(BusinessErrorCode.WEBSERVICE_UNAUTHORIZED, "You are not authorized to use this service");
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/facade/impl/AbstractDomainFacadeImpl.java
68,6 → 68,7
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.DomainPolicyService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.UserAndDomainMultiService;
import org.linagora.linshare.core.service.UserProviderService;
import org.linagora.linshare.core.utils.AESCrypt;
77,18 → 78,18
public class AbstractDomainFacadeImpl implements AbstractDomainFacade {
 
private final AbstractDomainService abstractDomainService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final UserAndDomainMultiService userAndDomainMultiService;
private final UserProviderService userProviderService;
private final DomainPolicyService domainPolicyService;
 
private static final Logger logger = LoggerFactory.getLogger(AbstractDomainFacadeImpl.class);
 
public AbstractDomainFacadeImpl(AbstractDomainService abstractDomainService, FunctionalityOldService functionalityService,
public AbstractDomainFacadeImpl(AbstractDomainService abstractDomainService, FunctionalityReadOnlyService functionalityReadOnlyService,
UserProviderService userProviderService, DomainPolicyService domainPolicyService, UserAndDomainMultiService userAndDomainMultiService) {
super();
this.abstractDomainService = abstractDomainService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityReadOnlyService;
this.userProviderService = userProviderService;
this.domainPolicyService = domainPolicyService;
this.userAndDomainMultiService = userAndDomainMultiService;
298,7 → 299,7
if(domainIdentifier != null) {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
logger.debug("domain found : " + domain.getIdentifier());
Functionality func = functionalityService.getGuestFunctionality(domain);
Functionality func = functionalityReadOnlyService.getGuestFunctionality(domain);
if(func.getActivationPolicy().getStatus()) {
return true;
}
510,34 → 511,34
@Override
public boolean isCustomLogoActive(UserVo actorVo) throws BusinessException {
AbstractDomain domain = abstractDomainService.retrieveDomain(actorVo.getDomainIdentifier());
return functionalityService.getCustomLogoFunctionality(domain).getActivationPolicy().getStatus();
return functionalityReadOnlyService.getCustomLogoFunctionality(domain).getActivationPolicy().getStatus();
}
 
@Override
public boolean isCustomLogoActiveInRootDomain() throws BusinessException {
return functionalityService.isCustomLogoActiveInRootDomain();
return functionalityReadOnlyService.isCustomLogoActiveInRootDomain();
}
@Override
public String getCustomLogoUrl(UserVo actorVo) throws BusinessException {
User actor = userAndDomainMultiService.findOrCreateUser(actorVo.getMail(),actorVo.getDomainIdentifier());
return functionalityService.getCustomLogoFunctionality(actor.getDomain()).getValue();
return functionalityReadOnlyService.getCustomLogoFunctionality(actor.getDomain()).getValue();
}
 
@Override
public String getCustomLogoUrlInRootDomain() throws BusinessException {
return functionalityService.getCustomLogoUrlInRootDomain();
return functionalityReadOnlyService.getCustomLogoUrlInRootDomain();
}
@Override
public String getCustomLogoLink(UserVo actorVo) throws BusinessException {
User actor = userAndDomainMultiService.findOrCreateUser(actorVo.getMail(),actorVo.getDomainIdentifier());
return functionalityService.getCustomLinkLogoFunctionality(actor.getDomain()).getValue();
return functionalityReadOnlyService.getCustomLinkLogoFunctionality(actor.getDomain()).getValue();
}
 
@Override
public String getCustomLogoLinkInRootDomain() throws BusinessException {
return functionalityService.getCustomLinkLogoInRootDomain();
return functionalityReadOnlyService.getCustomLinkLogoInRootDomain();
}
@Override
631,7 → 632,7
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
if(domain!=null) {
Functionality mimeTypeFunctionality = functionalityService.getMimeTypeFunctionality(domain);
Functionality mimeTypeFunctionality = functionalityReadOnlyService.getMimeTypeFunctionality(domain);
if(mimeTypeFunctionality.getActivationPolicy().getStatus()){
return true;
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/facade/impl/ShareFacadeImpl.java
68,14 → 68,13
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.AnonymousShareEntryService;
import org.linagora.linshare.core.service.DocumentEntryService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.MailContentBuildingService;
import org.linagora.linshare.core.service.NotifierService;
import org.linagora.linshare.core.service.ShareEntryService;
import org.linagora.linshare.core.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.orm.jpa.support.SharedEntityManagerBean;
 
public class ShareFacadeImpl implements ShareFacade {
 
99,7 → 98,7
private final AbstractDomainService abstractDomainService;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final AnonymousShareEntryService anonymousShareEntryService;
108,7 → 107,7
public ShareFacadeImpl(ShareEntryTransformer shareEntryTransformer, UserRepository<User> userRepository, NotifierService notifierService,
MailContentBuildingService mailElementsFactory, UserService userService, ShareEntryService shareEntryService, DocumentEntryTransformer documentEntryTransformer,
DocumentEntryService documentEntryService, AbstractDomainService abstractDomainService, FunctionalityOldService functionalityService, AnonymousShareEntryService anonymousShareEntryService, SignatureTransformer signatureTransformer) {
DocumentEntryService documentEntryService, AbstractDomainService abstractDomainService, FunctionalityReadOnlyService functionalityService, AnonymousShareEntryService anonymousShareEntryService, SignatureTransformer signatureTransformer) {
super();
this.shareEntryTransformer = shareEntryTransformer;
this.userRepository = userRepository;
119,7 → 118,7
this.documentEntryTransformer = documentEntryTransformer;
this.documentEntryService = documentEntryService;
this.abstractDomainService = abstractDomainService;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
this.anonymousShareEntryService = anonymousShareEntryService;
this.signatureTransformer = signatureTransformer;
}
405,13 → 404,13
@Override
public boolean isVisibleSecuredAnonymousUrlCheckBox(String domainIdentifier) {
return functionalityService.isSauAllowed(domainIdentifier);
return functionalityReadOnlyService.isSauAllowed(domainIdentifier);
}
 
@Override
public boolean getDefaultSecuredAnonymousUrlCheckBoxValue(String domainIdentifier) {
return functionalityService.getDefaultSauValue(domainIdentifier);
return functionalityReadOnlyService.getDefaultSauValue(domainIdentifier);
}
 
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/facade/impl/FunctionalityFacadeImpl.java
59,20 → 59,28
import org.linagora.linshare.core.facade.FunctionalityFacade;
import org.linagora.linshare.core.service.AbstractDomainService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public class FunctionalityFacadeImpl implements FunctionalityFacade {
 
protected final Logger logger = LoggerFactory.getLogger(FunctionalityFacadeImpl.class);
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final AbstractDomainService abstractDomainService;
public FunctionalityFacadeImpl(FunctionalityOldService functionalityService, AbstractDomainService abstractDomainService) {
public FunctionalityFacadeImpl(FunctionalityOldService functionalityService,
AbstractDomainService abstractDomainService,
FunctionalityReadOnlyService functionalityReadOnlyService) {
super();
this.functionalityService = functionalityService;
this.abstractDomainService = abstractDomainService;
this.functionalityReadOnlyService = functionalityReadOnlyService;
}
 
205,7 → 213,7
public Integer completionThreshold(String domainIdentifier) {
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
IntegerValueFunctionality completionFunctionality = functionalityService.getCompletionFunctionality(domain);
IntegerValueFunctionality completionFunctionality = functionalityReadOnlyService.getCompletionFunctionality(domain);
if(completionFunctionality.getActivationPolicy().getStatus()) {
return completionFunctionality.getValue();
}
221,7 → 229,7
public boolean isEnableUserTab(String domainIdentifier) {
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality userTabFunctionality = functionalityService.getUserTabFunctionality(domain);
Functionality userTabFunctionality = functionalityReadOnlyService.getUserTabFunctionality(domain);
return userTabFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find user tab functionality for domain : " + domainIdentifier);
235,7 → 243,7
public boolean isEnableAuditTab(String domainIdentifier) {
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality auditTabFunctionality = functionalityService.getAuditTabFunctionality(domain);
Functionality auditTabFunctionality = functionalityReadOnlyService.getAuditTabFunctionality(domain);
return auditTabFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find audit tab functionality for domain : " + domainIdentifier);
249,7 → 257,7
public boolean isEnableThreadTab(String domainIdentifier) {
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality threadTabFunctionality = functionalityService.getThreadTabFunctionality(domain);
Functionality threadTabFunctionality = functionalityReadOnlyService.getThreadTabFunctionality(domain);
return threadTabFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find help tab functionality for domain : " + domainIdentifier);
262,7 → 270,7
public boolean isEnableUpdateFiles(String domainIdentifier){
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality updateFilesFunctionality = functionalityService.getUpdateFilesFunctionality(domain);
Functionality updateFilesFunctionality = functionalityReadOnlyService.getUpdateFilesFunctionality(domain);
return updateFilesFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find update files functionality for domain : " + domainIdentifier);
275,7 → 283,7
public boolean isEnableCustomLogoLink(String domainIdentifier){
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality customLogoLinkFunctionality = functionalityService.getCustomLinkLogoFunctionality(domain);
Functionality customLogoLinkFunctionality = functionalityReadOnlyService.getCustomLinkLogoFunctionality(domain);
return customLogoLinkFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find custom logo link functionality for domain : " + domainIdentifier);
288,7 → 296,7
public boolean isEnableCreateThread(String domainIdentifier){
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality createThreadFunctionality = functionalityService.getThreadCreationPermissionFunctionality(domain);
Functionality createThreadFunctionality = functionalityReadOnlyService.getThreadCreationPermissionFunctionality(domain);
return createThreadFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find thread creation functionality for domain : " + domainIdentifier);
301,7 → 309,7
public boolean isEnableHelpTab(String domainIdentifier) {
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality helpTabFunctionality = functionalityService.getHelpTabFunctionality(domain);
Functionality helpTabFunctionality = functionalityReadOnlyService.getHelpTabFunctionality(domain);
return helpTabFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find help tab functionality for domain : " + domainIdentifier);
314,7 → 322,7
public boolean isEnableListTab(String domainIdentifier) {
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality listTabFunctionality = functionalityService.getListTabFunctionality(domain);
Functionality listTabFunctionality = functionalityReadOnlyService.getListTabFunctionality(domain);
return listTabFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find list tab functionality for domain : " + domainIdentifier);
327,7 → 335,7
public boolean isEnableGuest(String domainIdentifier) {
try {
AbstractDomain domain = abstractDomainService.retrieveDomain(domainIdentifier);
Functionality helpTabFunctionality = functionalityService.getGuestFunctionality(domain);
Functionality helpTabFunctionality = functionalityReadOnlyService.getGuestFunctionality(domain);
return helpTabFunctionality.getActivationPolicy().getStatus();
} catch (BusinessException e) {
logger.error("Can't find help tab functionality for domain : " + domainIdentifier);
338,12 → 346,12
 
@Override
public boolean getDefaultRestrictedGuestValue(String domainIdentifier) {
return functionalityService.getDefaultRestrictedGuestValue(domainIdentifier);
return functionalityReadOnlyService.getDefaultRestrictedGuestValue(domainIdentifier);
}
 
 
@Override
public boolean isRestrictedGuestEnabled(String domainIdentifier) {
return functionalityService.isRestrictedGuestAllowed(domainIdentifier);
return functionalityReadOnlyService.isRestrictedGuestAllowed(domainIdentifier);
}
}
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/batches/impl/DocumentManagementBatchImpl.java
54,7 → 54,7
import org.linagora.linshare.core.repository.DocumentRepository;
import org.linagora.linshare.core.service.DocumentEntryService;
import org.linagora.linshare.core.service.EntryService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.MailContentBuildingService;
import org.linagora.linshare.core.service.NotifierService;
import org.linagora.linshare.core.service.ThreadEntryService;
88,7 → 88,7
private final MailContentBuildingService mailBuilder;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final EntryService entryService;
100,7 → 100,7
DocumentEntryRepository documentEntryRepository, DocumentEntryService documentEntryService,
AccountRepository<Account> accountRepository, FileSystemDao fileSystemDao, boolean cronActivated,
NotifierService notifierService, MailContentBuildingService mailBuilder,
FunctionalityOldService functionalityService, EntryService entryService,
FunctionalityReadOnlyService functionalityService, EntryService entryService,
DocumentEntryBusinessService documentEntryBusinessService, MimeTypeMagicNumberDao mimeTypeMagicNumberDao, ThreadEntryService threadEntryService) {
super();
this.documentRepository = documentRepository;
111,7 → 111,7
this.cronActivated = cronActivated;
this.notifierService = notifierService;
this.mailBuilder = mailBuilder;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
this.entryService = entryService;
this.documentEntryBusinessService = documentEntryBusinessService;
this.mimeTypeMagicNumberDao = mimeTypeMagicNumberDao;
203,7 → 203,7
// we check if there is not related shares. Should not happen.
if (documentEntryBusinessService.getRelatedEntriesCount(documentEntry) > 0) {
 
TimeUnitValueFunctionality fileExpirationTimeFunctionality = functionalityService
TimeUnitValueFunctionality fileExpirationTimeFunctionality = functionalityReadOnlyService
.getDefaultFileExpiryTimeFunctionality(documentEntry.getEntryOwner().getDomain());
if (fileExpirationTimeFunctionality.getActivationPolicy().getStatus()) {
if (documentEntry.getExpirationDate().before(now)) {
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/core/batches/impl/ShareManagementBatchImpl.java
56,7 → 56,7
import org.linagora.linshare.core.repository.ShareEntryRepository;
import org.linagora.linshare.core.service.AnonymousShareEntryService;
import org.linagora.linshare.core.service.DocumentEntryService;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.core.service.ShareEntryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
79,7 → 79,7
 
private final AccountRepository<Account> accountRepository;
private final FunctionalityOldService functionalityService;
private final FunctionalityReadOnlyService functionalityReadOnlyService;
private final DocumentEntryService documentEntryService;
88,7 → 88,7
 
public ShareManagementBatchImpl(ShareEntryService shareEntryService, AnonymousShareEntryService anonymousShareEntryService, ShareEntryRepository shareEntryRepository,
AnonymousShareEntryRepository anonymousShareEntryRepository, DocumentEntryRepository documentEntryRepository, AccountRepository<Account> accountRepository,
FunctionalityOldService functionalityService, DocumentEntryService documentEntryService, AnonymousUrlRepository anonymousUrlRepository) {
FunctionalityReadOnlyService functionalityService, DocumentEntryService documentEntryService, AnonymousUrlRepository anonymousUrlRepository) {
super();
this.shareEntryService = shareEntryService;
this.anonymousShareEntryService = anonymousShareEntryService;
96,7 → 96,7
this.anonymousShareEntryRepository = anonymousShareEntryRepository;
this.documentEntryRepository = documentEntryRepository;
this.accountRepository = accountRepository;
this.functionalityService = functionalityService;
this.functionalityReadOnlyService = functionalityService;
this.documentEntryService = documentEntryService;
this.anonymousUrlRepository = anonymousUrlRepository;
}
120,7 → 120,7
for (AnonymousShareEntry shareEntry : expiredEntries) {
AbstractDomain domain = shareEntry.getEntryOwner().getDomain();
TimeUnitBooleanValueFunctionality shareExpiryTimeFunctionality = functionalityService.getDefaultShareExpiryTimeFunctionality(domain);
TimeUnitBooleanValueFunctionality shareExpiryTimeFunctionality = functionalityReadOnlyService.getDefaultShareExpiryTimeFunctionality(domain);
// test if this functionality is enable for the current domain.
if(shareExpiryTimeFunctionality.getActivationPolicy().getStatus()) {
try {
146,7 → 146,7
boolean doDeleteDoc = false;
AbstractDomain domain = documentEntry.getEntryOwner().getDomain();
long sum = documentEntryRepository.getRelatedEntriesCount(documentEntry);
TimeUnitBooleanValueFunctionality shareExpiryTimeFunctionality = functionalityService.getDefaultShareExpiryTimeFunctionality(domain);
TimeUnitBooleanValueFunctionality shareExpiryTimeFunctionality = functionalityReadOnlyService.getDefaultShareExpiryTimeFunctionality(domain);
 
if(shareExpiryTimeFunctionality.getActivationPolicy().getStatus()) {
// we check if the current share is the last related entry to the document
157,7 → 157,7
logger.debug("current document " + documentEntry.getUuid() + " need to be deleted.");
} else {
TimeUnitValueFunctionality fileExpirationTimeFunctionality = functionalityService.getDefaultFileExpiryTimeFunctionality(domain);
TimeUnitValueFunctionality fileExpirationTimeFunctionality = functionalityReadOnlyService.getDefaultFileExpiryTimeFunctionality(domain);
Calendar deletionDate = Calendar.getInstance();
deletionDate.add(fileExpirationTimeFunctionality.toCalendarUnitValue(), fileExpirationTimeFunctionality.getValue());
189,7 → 189,7
for (ShareEntry shareEntry : expiredEntries) {
AbstractDomain domain = shareEntry.getEntryOwner().getDomain();
TimeUnitBooleanValueFunctionality shareExpiryTimeFunctionality = functionalityService.getDefaultShareExpiryTimeFunctionality(domain);
TimeUnitBooleanValueFunctionality shareExpiryTimeFunctionality = functionalityReadOnlyService.getDefaultShareExpiryTimeFunctionality(domain);
// test if this functionality is enable for the current domain.
if(shareExpiryTimeFunctionality.getActivationPolicy().getStatus()) {
try {
232,7 → 232,7
SystemAccount systemAccount = accountRepository.getSystemAccount();
StringValueFunctionality notificationBeforeExpirationFunctionality = functionalityService.getShareNotificationBeforeExpirationFunctionality(systemAccount.getDomain());
StringValueFunctionality notificationBeforeExpirationFunctionality = functionalityReadOnlyService.getShareNotificationBeforeExpirationFunctionality(systemAccount.getDomain());
List<Integer> datesForNotifyUpcomingOutdatedShares = new ArrayList<Integer>();
/linshare-1.2.3-ldap-dm/src/main/java/org/linagora/linshare/view/tapestry/pages/LocalDecrypt.java
46,7 → 46,7
import org.linagora.linshare.core.exception.BusinessException;
import org.linagora.linshare.core.exception.TechnicalErrorCode;
import org.linagora.linshare.core.exception.TechnicalException;
import org.linagora.linshare.core.service.FunctionalityOldService;
import org.linagora.linshare.core.service.FunctionalityReadOnlyService;
import org.linagora.linshare.view.tapestry.objects.CustomStreamResponse;
import org.linagora.linshare.view.tapestry.services.Templating;
import org.slf4j.Logger;
80,7 → 80,7
private Asset jwsTemplate;
 
@Inject
private FunctionalityOldService functionalityService;
private FunctionalityReadOnlyService functionalityService;
@Inject
private Templating templating;
/linshare-1.2.3-ldap-dm/src/main/resources/springContext-facade.xml
66,7 → 66,7
<constructor-arg ref="documentEntryTransformer" />
<constructor-arg ref="documentEntryService" />
<constructor-arg ref="abstractDomainService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="anonymousShareEntryService" />
<constructor-arg ref="signatureTransformer" />
</bean>
124,7 → 124,7
 
<bean name="abstractDomainFacade" class="org.linagora.linshare.core.facade.impl.AbstractDomainFacadeImpl">
<constructor-arg ref="abstractDomainService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="userAndDomainMultiService" />
<constructor-arg ref="userProviderService" />
<constructor-arg ref="domainPolicyService" />
139,6 → 139,7
<bean name="functionalityFacade" class="org.linagora.linshare.core.facade.impl.FunctionalityFacadeImpl">
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="abstractDomainService" />
<constructor-arg ref="functionalityReadOnlyService" />
</bean>
 
<bean name="antiSamyPolicy" class="org.owasp.validator.html.Policy" factory-method="getInstance">
169,7 → 170,7
<constructor-arg ref="threadService" />
<constructor-arg ref="accountService" />
<constructor-arg ref="userService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
</bean>
<bean id="wsThreadMemberFacade" class="org.linagora.linshare.core.facade.webservice.user.impl.ThreadMemberFacadeImpl">
<constructor-arg ref="threadService" />
179,12 → 180,12
<constructor-arg ref="accountService" />
<constructor-arg ref="threadService" />
<constructor-arg ref="threadEntryService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
</bean>
<bean id="wsUserFacade" class="org.linagora.linshare.core.facade.webservice.user.impl.UserFacadeImpl">
<constructor-arg ref="userService" />
<constructor-arg ref="accountService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
</bean>
 
<bean id="wsAdminGenericFacade" class="org.linagora.linshare.core.facade.webservice.admin.impl.AdminGenericFacadeImpl">
/linshare-1.2.3-ldap-dm/src/main/resources/springContext-service.xml
34,7 → 34,7
<constructor-arg ref="tagRepository" />
<constructor-arg ref="documentEntryBusinessService" />
<constructor-arg ref="logEntryService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
</bean>
 
<bean name="userService" class="org.linagora.linshare.core.service.impl.UserServiceImpl">
45,7 → 45,7
<constructor-arg ref="recipientFavouriteService" />
<constructor-arg ref="allowedContactRepository" />
<constructor-arg ref="mailContentBuildingService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="abstractDomainService" />
<constructor-arg ref="passwordService" />
<constructor-arg ref="entryService" />
69,7 → 69,7
<constructor-arg ref="documentEntryBusinessService" />
<constructor-arg ref="logEntryService" />
<constructor-arg ref="abstractDomainService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="mimeTypeService" />
<constructor-arg ref="clamavVirusScannerService" />
<constructor-arg ref="mimeTypeMagicNumberDao" />
79,7 → 79,7
<constructor-arg ref="documentEntryBusinessService" />
<constructor-arg ref="logEntryService" />
<constructor-arg ref="abstractDomainService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="mimeTypeService" />
<constructor-arg ref="accountService" />
<constructor-arg ref="clamavVirusScannerService" />
89,7 → 89,7
</bean>
 
<bean id="shareExpiryDateService" class="org.linagora.linshare.core.service.impl.ShareExpiryDateServiceImpl">
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
</bean>
 
<bean id="entryService" class="org.linagora.linshare.core.service.impl.EntryServiceImpl">
102,7 → 102,7
 
<bean id="shareEntryService" class="org.linagora.linshare.core.service.impl.ShareEntryServiceImpl">
<constructor-arg ref="guestRepository" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="shareEntryBusinessService" />
<constructor-arg ref="shareExpiryDateService" />
<constructor-arg ref="logEntryService" />
113,7 → 113,7
</bean>
 
<bean id="anonymousShareEntryService" class="org.linagora.linshare.core.service.impl.AnonymousShareEntryServiceImpl">
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="anonymousShareEntryBusinessService" />
<constructor-arg ref="shareExpiryDateService" />
<constructor-arg ref="logEntryService" />
165,7 → 165,7
<constructor-arg value="${linshare.mails.htmlwithoutlogo.container}" />
<constructor-arg value="${linshare.logo.mails.visible}" />
<constructor-arg ref="abstractDomainService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg value="${linshare.display.licenceTerm}" />
</bean>
185,6 → 185,11
<constructor-arg ref="functionalityRepository" />
<constructor-arg ref="abstractDomainRepository" />
</bean>
<bean name="functionalityReadOnlyService" class="org.linagora.linshare.core.service.impl.FunctionalityReadOnlyServiceImpl">
<constructor-arg ref="functionalityRepository" />
<constructor-arg ref="abstractDomainRepository" />
</bean>
 
 
<bean name="domainPolicyService" class="org.linagora.linshare.core.service.impl.DomainPolicyServiceImpl">
193,7 → 198,7
</bean>
 
<bean name="abstractDomainService" class="org.linagora.linshare.core.service.impl.AbstractDomainServiceImpl">
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="abstractDomainRepository" />
<constructor-arg ref="domainPolicyService" />
<constructor-arg ref="userProviderService" />
/linshare-1.2.3-ldap-dm/src/main/resources/springContext-batches.xml
20,7 → 20,7
<constructor-arg ref="anonymousShareEntryRepository"/>
<constructor-arg ref="documentEntryRepository"/>
<constructor-arg ref="accountRepository"/>
<constructor-arg ref="functionalityOldService"/>
<constructor-arg ref="functionalityReadOnlyService"/>
<constructor-arg ref="documentEntryService"/>
<constructor-arg ref="anonymousUrlRepository"/>
</bean>
34,7 → 34,7
<constructor-arg value="${job.document.cleaner.activation}" />
<constructor-arg ref="notifierService" />
<constructor-arg ref="mailContentBuildingService" />
<constructor-arg ref="functionalityOldService" />
<constructor-arg ref="functionalityReadOnlyService" />
<constructor-arg ref="entryService" />
<constructor-arg ref="documentEntryBusinessService" />
<constructor-arg ref="mimeTypeMagicNumberDao" />