use of com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson in project xp by enonic.
the class HtmlAreaDumpUpgrader method upgradeVersionEntry.
@Override
protected void upgradeVersionEntry(final RepositoryId repositoryId, final String entryContent) {
final VersionsDumpEntryJson versionsDumpEntryJson = deserializeValue(entryContent, VersionsDumpEntryJson.class);
versionsDumpEntryJson.getVersions().forEach(this::upgradeVersionMeta);
}
use of com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson 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);
}
Aggregations