null,
0,
10);
PageResponse<AssetPageRow> response = jcrRepositoryAssetService.findAssetPage(request);
if (response.getTotalRowSize() >0) {
AssetPageRow row = response.getPageRowList().get(0);
AssetItem assetItemJCR = rulesRepository.loadAssetByUUID(row.getUuid());
header = assetItemJCR.getContent();
}
} catch (SerializationException e) {
Jcr2VfsMigrationApp.hasErrors = true;
throw new IllegalStateException(e);
}
boolean hasMorePages = true;
int startRowIndex = 0;
final int pageSize = 100;
PageResponse<AssetPageRow> response;
while (hasMorePages) {
AssetPageRequest request = new AssetPageRequest(jcrModule.getUuid(),
null, // get all formats
null,
startRowIndex,
pageSize);
try {
response = jcrRepositoryAssetService.findAssetPage(request);
for (AssetPageRow row : response.getPageRowList()) {
AssetItem assetItemJCR = rulesRepository.loadAssetByUUID(row.getUuid());
System.out.format(" Asset [%s] with format [%s] is being migrated... \n",
assetItemJCR.getName(), assetItemJCR.getFormat());
//TODO: Git wont check in a version if the file is not changed in this version. Eg, the version 3 of "testFunction.function"
//We need to find a way to force a git check in. Otherwise migrated version history is not consistent with the version history in old Guvnor.
//Migrate historical versions first, this includes the head version(i.e., the latest version)
migrateAssetHistory(jcrModule, row.getUuid());
//Still need to migrate the "current version" even though in most cases the "current version" (actually it is not a version in version
//control, its just the current content on jcr node) is equal to the latest version that had been checked in.
//Eg, when we import mortgage example, we just dump the mortgage package to a jcr node, no version check in.
migrate(jcrModule, assetItemJCR);
System.out.format(" Done.\n",
assetItemJCR.getName(), assetItemJCR.getFormat());
//Migrate asset discussions
migrateAssetDiscussions(jcrModule, row.getUuid());
}
} catch (SerializationException e) {
Jcr2VfsMigrationApp.hasErrors = true;
throw new IllegalStateException(e);
}