Search in sources :

Example 1 with NodeVersionDataJson

use of com.enonic.xp.repo.impl.node.json.NodeVersionDataJson in project xp by enonic.

the class IndexConfigUpgrader method upgradeVersionMeta.

private VersionDumpEntryJson upgradeVersionMeta(final VersionDumpEntryJson version) {
    final DumpBlobRecord nodeBlobRecord = dumpReader.getDumpBlobStore().getRecord(NODE_SEGMENT, BlobKey.from(version.getNodeBlobKey()));
    final NodeVersionDataJson nodeVersionDataJson = getNode(nodeBlobRecord);
    final NodeVersion nodeVersion = nodeVersionDataJson.fromJson().build();
    if (ContentConstants.CONTENT_NODE_COLLECTION.equals(nodeVersion.getNodeType())) {
        final BlobKey newIndexConfigBlob = upgradeIndexConfigDocument(BlobKey.from(version.getIndexConfigBlobKey()), nodeVersion);
        return VersionDumpEntryJson.create(version).indexConfigBlobKey(newIndexConfigBlob.toString()).build();
    }
    return version;
}
Also used : NodeVersion(com.enonic.xp.node.NodeVersion) BlobKey(com.enonic.xp.blob.BlobKey) DumpBlobRecord(com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord) NodeVersionDataJson(com.enonic.xp.repo.impl.node.json.NodeVersionDataJson)

Example 2 with NodeVersionDataJson

use of com.enonic.xp.repo.impl.node.json.NodeVersionDataJson in project xp by enonic.

the class RepositoryIdDumpUpgrader method upgradeNodeVersionBlob.

private void upgradeNodeVersionBlob(final String nodeBlobKey) {
    final DumpBlobRecord dumpBlobRecord = dumpReader.getDumpBlobStore().getRecord(SEGMENT, BlobKey.from(nodeBlobKey));
    final NodeVersionDataJson sourceNodeVersion = getNodeVersion(dumpBlobRecord);
    final NodeVersion updatedNodeVersion = sourceNodeVersion.fromJson().id(NodeId.from(upgradeString(sourceNodeVersion.getId()))).build();
    writeNodeVersion(updatedNodeVersion, dumpBlobRecord);
}
Also used : NodeVersion(com.enonic.xp.node.NodeVersion) DumpBlobRecord(com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord) NodeVersionDataJson(com.enonic.xp.repo.impl.node.json.NodeVersionDataJson)

Aggregations

NodeVersion (com.enonic.xp.node.NodeVersion)2 DumpBlobRecord (com.enonic.xp.repo.impl.dump.blobstore.DumpBlobRecord)2 NodeVersionDataJson (com.enonic.xp.repo.impl.node.json.NodeVersionDataJson)2 BlobKey (com.enonic.xp.blob.BlobKey)1