Search in sources :

Example 1 with PublishRequestItem

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]));
}
Also used : PublishRequestItem(com.enonic.xp.issue.PublishRequestItem) Reference(com.enonic.xp.util.Reference) ArrayList(java.util.ArrayList) PropertySet(com.enonic.xp.data.PropertySet)

Aggregations

PropertySet (com.enonic.xp.data.PropertySet)1 PublishRequestItem (com.enonic.xp.issue.PublishRequestItem)1 Reference (com.enonic.xp.util.Reference)1 ArrayList (java.util.ArrayList)1