use of org.platformlayer.core.model.ManagedItemCollection in project platformlayer by platformlayer.
the class ManagedItemResource method listChildren.
@GET
@Produces({ XML, JSON })
@Path("children")
public ManagedItemCollection<ItemBase> listChildren(@QueryParam("deleted") boolean includeDeleted) throws OpsException, RepositoryException {
boolean fetchTags = true;
ItemBase item = getManagedItem(fetchTags);
Tag parentTag = Tag.buildParentTag(item.getKey());
Filter filter = TagFilter.byTag(parentTag);
if (!includeDeleted) {
filter = StateFilter.excludeDeleted(filter);
}
List<ItemBase> roots = itemService.listAll(getProjectAuthorization(), filter);
ManagedItemCollection<ItemBase> collection = new ManagedItemCollection<ItemBase>();
collection.items = roots;
return cleanup(collection);
}
Aggregations