use of org.alfresco.repo.virtual.template.ApplyTemplateMethod in project alfresco-repository by Alfresco.
the class VirtualStoreImpl method resolveVirtualFolderDefinition.
public VirtualFolderDefinition resolveVirtualFolderDefinition(final Reference reference) throws VirtualizationException {
ServiceRegistry serviceRegistry = ((AlfrescoEnviroment) environment).getServiceRegistry();
RetryingTransactionHelper transactionHelper = serviceRegistry.getRetryingTransactionHelper();
return transactionHelper.doInTransaction(new RetryingTransactionCallback<VirtualFolderDefinition>() {
@Override
public VirtualFolderDefinition execute() throws Throwable {
NodeRef key = reference.toNodeRef();
Map<NodeRef, VirtualFolderDefinition> definitionsCache = TransactionalResourceHelper.getMap(VIRTUAL_FOLDER_DEFINITION);
VirtualFolderDefinition virtualFolderDefinition = definitionsCache.get(key);
if (virtualFolderDefinition == null) {
virtualFolderDefinition = reference.execute(new ApplyTemplateMethod(environment));
definitionsCache.put(key, virtualFolderDefinition);
}
return virtualFolderDefinition;
}
}, true, false);
}
Aggregations