Enonic XP - query content with status "Modified"

Enonic version: 6.10
OS: Linux

I have saved a draft version of a content. In Content studio I see that the content is marked as “Modified”.
How can i query all contents that are marked with “Modified”.

The content type is “item”. I come up with something like this, but not completed:
var itemsResult = contentLib.query({
start: 0,
count: 10000,
sort: “id ASC”,
branch: “draft”,
contentTypes: [
app.name + “:item”
]
});

but this gives all draft version, not only the “Modified”

Thanks for any help.

Hi.

The “Modified” status is not a property on a content, but rather a dynamically state for the content when comparing two different branches. In Content-Studio, this is the comparison of a content in the repository “cms-repo” between the “draft”-branch (the data you see in Content Studio) and the “master”-branch (The data available in the portal). So, in other words, its not possible to fetch this with a normal query, but rather a special handler for comparing two branches.

Sadly, we have no exposed method in the content-API to fetch this, but we certainly will implement this.
For the moment, you can use the node-API to get this: http://repo.enonic.com/public/com/enonic/xp/docs/6.10.1/docs-6.10.1-libdoc.zip!/module-node-RepoConnection.html#diff

This will give you a list of all the content that are not using the same version in both specified branches, the “NEWER” flag will indicate that the content is modified in the source-branch compared to the target-branch given in the request.

We will come back to you with a ETA for exposing this in the content-API also.

1 Like