use of com.enonic.xp.repo.impl.storage.StoreRequest in project xp by enonic.
the class VersionServiceImpl method store.
@Override
public void store(final NodeVersionMetadata nodeVersionMetadata, final InternalContext context) {
final StoreRequest storeRequest = VersionStorageDocFactory.create(nodeVersionMetadata, context.getRepositoryId());
this.storageDao.store(storeRequest);
}
use of com.enonic.xp.repo.impl.storage.StoreRequest in project xp by enonic.
the class BranchServiceImpl method doStore.
private String doStore(final NodeBranchEntry nodeBranchEntry, final InternalContext context, final boolean validate) {
if (validate) {
verifyNotExistingNodeWithOtherId(nodeBranchEntry, context);
}
final StoreRequest storeRequest = BranchStorageRequestFactory.create(nodeBranchEntry, context);
final String id = this.storageDao.store(storeRequest);
doCache(context, nodeBranchEntry.getNodePath(), BranchDocumentId.from(id));
return id;
}
use of com.enonic.xp.repo.impl.storage.StoreRequest in project xp by enonic.
the class BranchStorageRequestFactoryTest method create.
@Test
public void create() throws Exception {
final StoreRequest storeRequest = BranchStorageRequestFactory.create(NodeBranchEntry.create().nodeId(NodeId.from("nodeId")).nodePath(NodePath.create("nodePath").build()).nodeState(NodeState.DEFAULT).nodeVersionId(NodeVersionId.from("nodeVersionId")).nodeVersionKey(NodeVersionKey.from("nodeBlobKey", "indexConfigBlobKey", "accessControlBlobKey")).build(), InternalContext.create().branch(Branch.from("myBranch")).repositoryId(RepositoryId.from("my-repo-id")).build());
assertEquals(storeRequest.getId(), "nodeId_myBranch");
assertEquals(storeRequest.getParent(), "nodeVersionId");
}
Aggregations