JE Bailey
JE Bailey

Reputation: 750

Capturing a single page in an AEM package from a tree of pages

Imagine you have a structure of pages called:

/content/site/en_us/foo/bar

You need to move the foo page from another environment to this one, but we don't want to include the bar page or any other children.

If I define a package with

/content/site/en_us/foo 

it will capture the children, if I add an exclude of

/content/site/en_us/*.*

I will exclude the actual content of the page I'm trying to restore.

I could explicitly define an exclude for each child page, but in our case there are a rather large number of child pages for foo that makes this type of manual exclusion difficult.

Is there a way to capture just a page and it's contents and not child pages?

Upvotes: 3

Views: 3110

Answers (2)

flotang
flotang

Reputation: 11

I recommend to use /content/site/en_us/foo/jcr:content directly.

Upvotes: 1

Tomek Rękawek
Tomek Rękawek

Reputation: 9304

Content of the page is stored under the jcr:content node. We can use this fact to exclude everything except the content of this node:

<filter root="/content/site/en_us/foo">
    <exclude pattern=".*"/>
    <include pattern=".*/jcr:content.*"/>
</filter>

This filter definition will include the foo node, exclude all its descendants, except the jcr:content node and its subtree.

Upvotes: 7

Related Questions