mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-22 15:12:38 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
100117: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud)
99965: Merged DEV to 5.0.N (5.0.2)
98656: MNT-13529 : Just-installed Alfresco does not return a CMIS latestChangeLogToken
- Add initial change log token
99911: MNT-13529 : Just-installed Alfresco does not return a CMIS latestChangeLogToken
- Added test
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@100540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -3921,7 +3921,10 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
|||||||
params.setApplicationName(CMIS_CHANGELOG_AUDIT_APPLICATION);
|
params.setApplicationName(CMIS_CHANGELOG_AUDIT_APPLICATION);
|
||||||
params.setForward(false);
|
params.setForward(false);
|
||||||
auditService.auditQuery(auditQueryCallback, params, 1);
|
auditService.auditQuery(auditQueryCallback, params, 1);
|
||||||
latestChangeLogToken = auditQueryCallback.getEntryId();
|
String entryId = auditQueryCallback.getEntryId();
|
||||||
|
// MNT-13529
|
||||||
|
// add initial change log token
|
||||||
|
latestChangeLogToken = entryId == null ? "0" : entryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// compile repository info
|
// compile repository info
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This file is part of Alfresco
|
* This file is part of Alfresco
|
||||||
*
|
*
|
||||||
@@ -56,6 +56,7 @@ import org.alfresco.repo.audit.model.AuditModelRegistryImpl;
|
|||||||
import org.alfresco.repo.content.MimetypeMap;
|
import org.alfresco.repo.content.MimetypeMap;
|
||||||
import org.alfresco.repo.dictionary.DictionaryDAO;
|
import org.alfresco.repo.dictionary.DictionaryDAO;
|
||||||
import org.alfresco.repo.dictionary.M2Model;
|
import org.alfresco.repo.dictionary.M2Model;
|
||||||
|
import org.alfresco.repo.domain.audit.AuditDAO;
|
||||||
import org.alfresco.repo.domain.node.NodeDAO;
|
import org.alfresco.repo.domain.node.NodeDAO;
|
||||||
import org.alfresco.repo.model.Repository;
|
import org.alfresco.repo.model.Repository;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
@@ -155,6 +156,7 @@ public class CMISTest
|
|||||||
private PermissionService permissionService;
|
private PermissionService permissionService;
|
||||||
private DictionaryDAO dictionaryDAO;
|
private DictionaryDAO dictionaryDAO;
|
||||||
private CMISDictionaryService cmisDictionaryService;
|
private CMISDictionaryService cmisDictionaryService;
|
||||||
|
private AuditDAO auditDAO;
|
||||||
|
|
||||||
private AlfrescoCmisServiceFactory factory;
|
private AlfrescoCmisServiceFactory factory;
|
||||||
|
|
||||||
@@ -326,6 +328,7 @@ public class CMISTest
|
|||||||
this.permissionService = (PermissionService) ctx.getBean("permissionService");
|
this.permissionService = (PermissionService) ctx.getBean("permissionService");
|
||||||
this.dictionaryDAO = (DictionaryDAO)ctx.getBean("dictionaryDAO");
|
this.dictionaryDAO = (DictionaryDAO)ctx.getBean("dictionaryDAO");
|
||||||
this.cmisDictionaryService = (CMISDictionaryService)ctx.getBean("OpenCMISDictionaryService1.1");
|
this.cmisDictionaryService = (CMISDictionaryService)ctx.getBean("OpenCMISDictionaryService1.1");
|
||||||
|
this.auditDAO = (AuditDAO) ctx.getBean("auditDAO");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2188,6 +2191,57 @@ public class CMISTest
|
|||||||
}
|
}
|
||||||
}, "user2", "tenant2");
|
}, "user2", "tenant2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MNT-13529: Just-installed Alfresco does not return a CMIS latestChangeLogToken
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testMNT13529() throws Exception
|
||||||
|
{
|
||||||
|
setupAudit();
|
||||||
|
|
||||||
|
AuthenticationUtil.pushAuthentication();
|
||||||
|
AuthenticationUtil.setFullyAuthenticatedUser(AuthenticationUtil.getAdminUserName());
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Delete the entries, it simulates just installed Alfresco for reproduce the issue
|
||||||
|
final Long appId = auditSubsystem.getAuditApplicationByName("CMISChangeLog").getApplicationId();
|
||||||
|
RetryingTransactionCallback<Void> deletedCallback = new RetryingTransactionCallback<Void>()
|
||||||
|
{
|
||||||
|
public Void execute() throws Throwable
|
||||||
|
{
|
||||||
|
auditDAO.deleteAuditEntries(appId, null, null);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
transactionService.getRetryingTransactionHelper().doInTransaction(deletedCallback);
|
||||||
|
|
||||||
|
// Retrieve initial latestChangeLogToken
|
||||||
|
final String initialChangeLogToken = withCmisService(new CmisServiceCallback<String>()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public String execute(CmisService cmisService)
|
||||||
|
{
|
||||||
|
List<RepositoryInfo> repositories = cmisService.getRepositoryInfos(null);
|
||||||
|
assertNotNull(repositories);
|
||||||
|
assertTrue(repositories.size() > 0);
|
||||||
|
RepositoryInfo repo = repositories.iterator().next();
|
||||||
|
|
||||||
|
return repo.getLatestChangeLogToken();
|
||||||
|
}
|
||||||
|
}, CmisVersion.CMIS_1_1);
|
||||||
|
|
||||||
|
assertNotNull(initialChangeLogToken);
|
||||||
|
assertEquals("0", initialChangeLogToken);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
auditSubsystem.destroy();
|
||||||
|
AuthenticationUtil.popAuthentication();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MNT-11726: Test that {@link CMISChangeEvent} contains objectId of node in short form (without StoreRef).
|
* MNT-11726: Test that {@link CMISChangeEvent} contains objectId of node in short form (without StoreRef).
|
||||||
|
|||||||
Reference in New Issue
Block a user