mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
MNT-14308: CMIS - optionally request rendition(s) when uploading docs - part 2 (#283)
* MNT-14308: CMIS - optionally request rendition(s) when uploading docs - part 2 - note: PublicApiAlfrescoCmisServiceFactory extends AlfrescoCmisServiceFactory and overrides getCmisServiceTarget - hence, also ensure property (cmis.create.doc.request.renditions.set) is set for public rest api spring context - note: set following log4j.properties: log4j.logger.org.alfresco.opencmis=info * MNT-14308: CMIS - optionally request rendition(s) when uploading docs - part 2 - tweak info log to output property on init (since service currently instantiated on every call) - note: set following log4j.properties: log4j.logger.org.alfresco.opencmis=info
This commit is contained in:
@@ -1081,6 +1081,7 @@
|
||||
<property name="authorityService" ref="AuthorityService" />
|
||||
<property name="tenantAdminService" ref="tenantAdminService"/>
|
||||
<property name="networksService" ref="networksService"/>
|
||||
<property name="cmisCreateDocRequestRenditionsSet" value="${cmis.create.doc.request.renditions.set}" />
|
||||
</bean>
|
||||
|
||||
<bean id="cmisDispatcherRegistry" class="org.alfresco.opencmis.CMISDispatcherRegistryImpl">
|
||||
|
@@ -174,6 +174,11 @@ public class AlfrescoCmisServiceFactory extends AbstractServiceFactory
|
||||
// cmisService,
|
||||
// connector.getTypesDefaultMaxItems(), connector.getTypesDefaultDepth(),
|
||||
// connector.getObjectsDefaultMaxItems(), connector.getObjectsDefaultDepth());
|
||||
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
logger.info("init: cmis.create.doc.request.renditions.set=" + cmisCreateDocRequestRenditionsSet);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -206,6 +211,16 @@ public class AlfrescoCmisServiceFactory extends AbstractServiceFactory
|
||||
}
|
||||
|
||||
AlfrescoCmisService service = getCmisServiceTarget(connector);
|
||||
if (service instanceof AlfrescoCmisServiceImpl)
|
||||
{
|
||||
Set<String> stringSet = parseCommaSeparatedSet(getCmisCreateDocRequestRenditionsSet());
|
||||
((AlfrescoCmisServiceImpl)service).setCmisRequestRenditionsOnCreateDoc(stringSet);
|
||||
|
||||
if (logger.isTraceEnabled())
|
||||
{
|
||||
logger.trace("getService: cmis.create.doc.request.renditions.set=" + stringSet);
|
||||
}
|
||||
}
|
||||
|
||||
// Wrap it
|
||||
ProxyFactory proxyFactory = new ProxyFactory(service);
|
||||
@@ -230,13 +245,7 @@ public class AlfrescoCmisServiceFactory extends AbstractServiceFactory
|
||||
|
||||
protected AlfrescoCmisService getCmisServiceTarget(CMISConnector connector)
|
||||
{
|
||||
AlfrescoCmisServiceImpl cmisService = new AlfrescoCmisServiceImpl(connector);
|
||||
|
||||
Set<String> stringSet = parseCommaSeparatedSet(getCmisCreateDocRequestRenditionsSet());
|
||||
logger.info("getCmisServiceTarget: cmis.create.doc.request.renditions.set="+stringSet);
|
||||
cmisService.setCmisRequestRenditionsOnCreateDoc(stringSet);
|
||||
|
||||
return cmisService;
|
||||
return new AlfrescoCmisServiceImpl(connector);
|
||||
}
|
||||
|
||||
private Set<String> parseCommaSeparatedSet(String str)
|
||||
|
Reference in New Issue
Block a user