use of com.enonic.xp.issue.PublishRequestItem in project xp by enonic.
the class IssueDataSerializer method addPublishRequest.
private void addPublishRequest(final PropertySet issueProperties, final PublishRequest publishRequest) {
final PropertySet publishRequestSet = issueProperties.addSet(PUBLISH_REQUEST);
publishRequestSet.addStrings(PublishRequestPropertyNames.EXCLUDE_IDS, publishRequest.getExcludeIds().asStrings());
final Collection<PropertySet> itemSets = new ArrayList<>();
for (final PublishRequestItem item : publishRequest.getItems()) {
final PropertySet itemSet = new PropertySet();
itemSet.setReference(PublishRequestPropertyNames.ITEM_ID, new Reference(NodeId.from(item.getId())));
itemSet.setBoolean(PublishRequestPropertyNames.ITEM_RECURSIVE, item.getIncludeChildren());
itemSets.add(itemSet);
}
publishRequestSet.addSets(PublishRequestPropertyNames.ITEMS, itemSets.toArray(new PropertySet[0]));
}
Aggregations