Search in sources :

Example 1 with StorageData

use of com.enonic.xp.repo.impl.storage.StorageData in project xp by enonic.

the class CommitStorageRequestFactory method create.

public static StoreRequest create(final NodeCommitEntry nodeCommitEntry, final InternalContext context) {
    final String id = nodeCommitEntry.getNodeCommitId().toString();
    final StorageData data = StorageData.create().add(CommitIndexPath.COMMIT_ID.getPath(), id).add(CommitIndexPath.MESSAGE.getPath(), nodeCommitEntry.getMessage()).add(CommitIndexPath.TIMESTAMP.getPath(), nodeCommitEntry.getTimestamp()).add(CommitIndexPath.COMMITTER.getPath(), nodeCommitEntry.getCommitter().toString()).build();
    return StoreRequest.create().id(id).settings(StorageSource.create().storageName(StoreStorageName.from(context.getRepositoryId())).storageType(StaticStorageType.COMMIT).build()).data(data).build();
}
Also used : StorageData(com.enonic.xp.repo.impl.storage.StorageData)

Example 2 with StorageData

use of com.enonic.xp.repo.impl.storage.StorageData in project xp by enonic.

the class BranchStorageRequestFactory method create.

public static StoreRequest create(final NodeBranchEntry nodeBranchEntry, final InternalContext context) {
    final StorageData data = StorageData.create().add(BranchIndexPath.VERSION_ID.getPath(), nodeBranchEntry.getVersionId().toString()).add(BranchIndexPath.NODE_BLOB_KEY.getPath(), nodeBranchEntry.getNodeVersionKey().getNodeBlobKey().toString()).add(BranchIndexPath.INDEX_CONFIG_BLOB_KEY.getPath(), nodeBranchEntry.getNodeVersionKey().getIndexConfigBlobKey().toString()).add(BranchIndexPath.ACCESS_CONTROL_BLOB_KEY.getPath(), nodeBranchEntry.getNodeVersionKey().getAccessControlBlobKey().toString()).add(BranchIndexPath.BRANCH_NAME.getPath(), context.getBranch().getValue()).add(BranchIndexPath.NODE_ID.getPath(), nodeBranchEntry.getNodeId().toString()).add(BranchIndexPath.STATE.getPath(), nodeBranchEntry.getNodeState().value()).add(BranchIndexPath.PATH.getPath(), nodeBranchEntry.getNodePath().toString()).add(BranchIndexPath.TIMESTAMP.getPath(), nodeBranchEntry.getTimestamp() != null ? nodeBranchEntry.getTimestamp() : Instant.now()).build();
    final NodeId nodeId = nodeBranchEntry.getNodeId();
    return StoreRequest.create().id(new BranchDocumentId(nodeId, context.getBranch()).toString()).nodePath(nodeBranchEntry.getNodePath()).settings(StorageSource.create().storageName(StoreStorageName.from(context.getRepositoryId())).storageType(StaticStorageType.BRANCH).build()).data(data).parent(nodeBranchEntry.getVersionId().toString()).routing(nodeId.toString()).build();
}
Also used : NodeId(com.enonic.xp.node.NodeId) StorageData(com.enonic.xp.repo.impl.storage.StorageData)

Aggregations

StorageData (com.enonic.xp.repo.impl.storage.StorageData)2 NodeId (com.enonic.xp.node.NodeId)1