use of com.enonic.xp.repo.impl.dump.serializer.json.VersionDumpEntryJson in project xp by enonic.
the class IndexConfigUpgrader method upgradeBranchEntry.
@Override
protected byte[] upgradeBranchEntry(final RepositoryId repositoryId, final String entryContent) {
final BranchDumpEntryJson sourceBranchEntry = deserializeValue(entryContent, BranchDumpEntryJson.class);
final VersionDumpEntryJson sourceVersionEntry = sourceBranchEntry.getMeta();
final VersionDumpEntryJson upgradedVersionEntry = upgradeVersionMeta(sourceVersionEntry);
if (!sourceVersionEntry.equals(upgradedVersionEntry)) {
return serialize(BranchDumpEntryJson.create(sourceBranchEntry).meta(upgradedVersionEntry).build());
}
return entryContent.getBytes(StandardCharsets.UTF_8);
}
use of com.enonic.xp.repo.impl.dump.serializer.json.VersionDumpEntryJson in project xp by enonic.
the class IndexConfigUpgrader method upgradeVersionEntry.
@Override
protected byte[] upgradeVersionEntry(final RepositoryId repositoryId, final String entryContent) {
final VersionsDumpEntryJson sourceVersionsEntry = deserializeValue(entryContent, VersionsDumpEntryJson.class);
final Collection<VersionDumpEntryJson> upgradedVersionList = sourceVersionsEntry.getVersions().stream().map(this::upgradeVersionMeta).collect(Collectors.toList());
final VersionsDumpEntryJson upgradedVersionsEntry = VersionsDumpEntryJson.create().nodeId(sourceVersionsEntry.getNodeId()).versions(upgradedVersionList).build();
return !sourceVersionsEntry.equals(upgradedVersionsEntry) ? serialize(upgradedVersionsEntry) : entryContent.getBytes(StandardCharsets.UTF_8);
}
use of com.enonic.xp.repo.impl.dump.serializer.json.VersionDumpEntryJson in project xp by enonic.
the class HtmlAreaDumpUpgrader method upgradeBranchEntry.
@Override
protected void upgradeBranchEntry(final RepositoryId repositoryId, final String entryContent) {
final BranchDumpEntryJson branchDumpEntryJson = deserializeValue(entryContent, BranchDumpEntryJson.class);
final VersionDumpEntryJson versionDumpEntryJson = branchDumpEntryJson.getMeta();
upgradeVersionMeta(versionDumpEntryJson);
}
Aggregations