diff --git a/config/alfresco/repository.properties b/config/alfresco/repository.properties index a01944e737..0e68e574b1 100644 --- a/config/alfresco/repository.properties +++ b/config/alfresco/repository.properties @@ -702,6 +702,21 @@ opencmis.activities.enabled=true opencmis.bulkUpdateProperties.maxItemsSize=1000 opencmis.bulkUpdateProperties.batchSize=20 opencmis.bulkUpdateProperties.workerThreads=2 +# max content size of a file in byte +opencmis.maxContentSize=4294967296 +# memory threshold in byte +opencmis.memoryThreshold=4194304 + +# URL generation overrides + +# if true, the context path of OpenCMIS generated urls will be set to "opencmis.context.value", otherwise it will be taken from the request url +opencmis.context.override=false +opencmis.context.value= +# if true, the servlet path of OpenCMIS generated urls will be set to "opencmis.servletpath.value", otherwise it will be taken from the request url +opencmis.servletpath.override=false +opencmis.servletpath.value= +opencmis.server.override=false +opencmis.server.value= # IMAP imap.server.enabled=false @@ -995,19 +1010,6 @@ system.quickshare.expiry_date.enforce.minimum.period=DAYS mail.service.corePoolSize=8 mail.service.maximumPoolSize=20 -# OpenCMIS - -# URL generation overrides - -# if true, the context path of OpenCMIS generated urls will be set to "opencmis.context.value", otherwise it will be taken from the request url -opencmis.context.override=false -opencmis.context.value= -# if true, the servlet path of OpenCMIS generated urls will be set to "opencmis.servletpath.value", otherwise it will be taken from the request url -opencmis.servletpath.override=false -opencmis.servletpath.value= -opencmis.server.override=false -opencmis.server.value= - nodes.bulkLoad.cachingThreshold=10 # Multi-Tenancy diff --git a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceFactory.java b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceFactory.java index b091b289c2..a88ce2dfe4 100644 --- a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceFactory.java +++ b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceFactory.java @@ -1,41 +1,41 @@ -/* - * #%L - * Alfresco Repository - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * This file is part of the Alfresco software. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * Alfresco is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Alfresco 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 Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - * #L% - */ +/* + * #%L + * Alfresco Repository + * %% + * Copyright (C) 2005 - 2016 Alfresco Software Limited + * %% + * This file is part of the Alfresco software. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * Alfresco is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Alfresco 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + * #L% + */ package org.alfresco.opencmis; -import java.util.Map; - -import org.alfresco.repo.security.authentication.AuthenticationUtil; -import org.alfresco.repo.transaction.RetryingTransactionInterceptor; -import org.alfresco.service.cmr.security.AuthorityService; -import org.apache.chemistry.opencmis.commons.impl.server.AbstractServiceFactory; -import org.apache.chemistry.opencmis.commons.server.CallContext; -import org.apache.chemistry.opencmis.commons.server.CmisService; -import org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import java.util.Map; + +import org.alfresco.repo.security.authentication.AuthenticationUtil; +import org.alfresco.repo.transaction.RetryingTransactionInterceptor; +import org.alfresco.service.cmr.security.AuthorityService; +import org.apache.chemistry.opencmis.commons.impl.server.AbstractServiceFactory; +import org.apache.chemistry.opencmis.commons.server.CallContext; +import org.apache.chemistry.opencmis.commons.server.CmisService; +import org.apache.chemistry.opencmis.server.support.wrapper.ConformanceCmisServiceWrapper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.aop.framework.ProxyFactory; /** @@ -47,7 +47,9 @@ import org.springframework.aop.framework.ProxyFactory; public class AlfrescoCmisServiceFactory extends AbstractServiceFactory { private static final Log logger = LogFactory.getLog(AlfrescoCmisServiceFactory.class); - + + private int memoryThreshold = super.getMemoryThreshold(); + private long maxContentSize = super.getMaxContentSize(); private CMISConnector connector; private RetryingTransactionInterceptor cmisTransactions; private AlfrescoCmisExceptionInterceptor cmisExceptions; @@ -55,6 +57,26 @@ public class AlfrescoCmisServiceFactory extends AbstractServiceFactory private AlfrescoCmisStreamInterceptor cmisStreams; private AuthorityService authorityService; + public void setMemoryThreshold(int memoryThreshold) + { + this.memoryThreshold = memoryThreshold; + } + + public void setMaxContentSize(long maxContentSize) + { + this.maxContentSize = maxContentSize; + } + + @Override + public int getMemoryThreshold() { + return memoryThreshold; + } + + @Override + public long getMaxContentSize() { + return maxContentSize; + } + /** * Sets the Authority Service. */