use of com.enonic.xp.content.CompareContentResults in project xp by enonic.
the class ContentServiceImplTest_resolvePublishDependencies method resolve_children_in_the_middle_excluded.
@Disabled("This test is not correct; it should not be allowed to exclude parent if new")
@Test
public void resolve_children_in_the_middle_excluded() throws Exception {
final ResolvePublishDependenciesParams.Builder builder = getPushParamsWithDependenciesBuilder();
final Content child3 = this.contentService.create(CreateContentParams.create().contentData(new PropertyTree()).displayName("This is my child 3").parent(child1.getPath()).type(ContentTypeName.folder()).build());
refresh();
final ResolvePublishDependenciesParams pushParams = builder.contentIds(ContentIds.from(content1.getId(), content2.getId())).excludedContentIds(ContentIds.from(child1.getId())).build();
final CompareContentResults result = this.contentService.resolvePublishDependencies(pushParams);
assertEquals(4, result.contentIds().getSize());
assertFalse(result.contentIds().contains(child1.getId()));
assertTrue(result.contentIds().contains(child3.getId()));
}
use of com.enonic.xp.content.CompareContentResults in project xp by enonic.
the class ContentServiceImplTest_resolvePublishDependencies method resolve_single.
@Test
public void resolve_single() throws Exception {
nodeService.push(NodeIds.from(ROOT_UUID), WS_OTHER);
refresh();
final CreateContentParams createContentParams = CreateContentParams.create().contentData(new PropertyTree()).displayName("This is my content").parent(ContentPath.ROOT).type(ContentTypeName.folder()).build();
final Content content = this.contentService.create(createContentParams);
refresh();
final CompareContentResults result = this.contentService.resolvePublishDependencies(ResolvePublishDependenciesParams.create().contentIds(ContentIds.from(content.getId())).excludeChildrenIds(ContentIds.from(content.getId())).target(WS_OTHER).build());
assertEquals(1, result.contentIds().getSize());
}
use of com.enonic.xp.content.CompareContentResults in project xp by enonic.
the class ContentServiceImplTest_resolvePublishDependencies method resolve_children_excluded.
@Test
public void resolve_children_excluded() throws Exception {
final ResolvePublishDependenciesParams.Builder builder = getPushParamsWithDependenciesBuilder().contentIds(ContentIds.from(content1.getId())).excludedContentIds(ContentIds.from(child1.getId()));
refresh();
final CompareContentResults result = this.contentService.resolvePublishDependencies(builder.build());
assertEquals(1, result.contentIds().getSize());
assertFalse(result.contentIds().contains(child1.getId()));
}
use of com.enonic.xp.content.CompareContentResults in project xp by enonic.
the class PublishContentCommand method execute.
PublishContentResult execute() {
this.nodeService.refresh(RefreshMode.ALL);
final CompareContentResults results = getSyncWork();
if (publishContentListener != null) {
publishContentListener.contentResolved(results.size());
}
pushAndDelete(results);
this.nodeService.refresh(RefreshMode.ALL);
return resultBuilder.build();
}
Aggregations