Search in sources :

Example 1 with VersionsDumpEntryJson

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);
}
Also used : VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson)

Example 2 with VersionsDumpEntryJson

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);
}
Also used : VersionDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.VersionDumpEntryJson) VersionsDumpEntryJson(com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson)

Aggregations

VersionsDumpEntryJson (com.enonic.xp.repo.impl.dump.serializer.json.VersionsDumpEntryJson)2 VersionDumpEntryJson (com.enonic.xp.repo.impl.dump.serializer.json.VersionDumpEntryJson)1