Search in sources :

Example 1 with StoreRequest

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);
}
Also used : StoreRequest(com.enonic.xp.repo.impl.storage.StoreRequest)

Example 2 with 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;
}
Also used : StoreRequest(com.enonic.xp.repo.impl.storage.StoreRequest)

Example 3 with StoreRequest

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");
}
Also used : StoreRequest(com.enonic.xp.repo.impl.storage.StoreRequest) Test(org.junit.jupiter.api.Test)

Aggregations

StoreRequest (com.enonic.xp.repo.impl.storage.StoreRequest)3 Test (org.junit.jupiter.api.Test)1