• Document Up to Date

Dependency Resolver Configuration

Crafter Studio extracts and tracks dependencies between content items to assist authors with publishing, workflow and core content operations like copy and delete. This file configures what file paths Crafter considers a dependency and how they should be extracted.

To modify the Dependency Resolver configuration, click on siteConfig from the bottom of the Sidebar, then click on Configuration and select Dependency Resolver from the dropdown list.

Configurations - Open Dependency Resolver Configuration

Sample

CRAFTER_HOME/data/repos/sites/SITENAME/sandbox/config/studio/dependency/resolver-config.xml
  1<?xml version="1.0" encoding="UTF-8"?>
  2<!-- resolver-config.xml
  3
  4  This file configures what file paths Crafter considers a dependency and how they should be extracted
  5
  6-->
  7<dependency-resolver>
  8  <item-types>
  9    <item-type>
 10      <!-- name of type -->
 11      <name>page</name>
 12      <!-- how to identify items of this type -->
 13      <includes>
 14        <!-- path pattern regexes (multiple) -->
 15        <path-pattern>/site/website/.*\.xml</path-pattern>
 16      </includes>
 17      <!-- how to find dependencies in these items -->
 18      <dependency-types>
 19        <dependency-type>
 20          <name>page</name>
 21          <includes>
 22            <pattern>
 23              <find-regex>/site/website/([^&lt;]+)\.xml</find-regex>
 24            </pattern>
 25          </includes>
 26        </dependency-type>
 27        <dependency-type>
 28          <name>component</name>
 29          <includes>
 30            <pattern>
 31              <find-regex>/site/components/([^&lt;]+)\.xml</find-regex>
 32            </pattern>
 33            <pattern>
 34              <find-regex>/site/system/page-components/([^&lt;]+)\.xml</find-regex>
 35            </pattern>
 36            <pattern>
 37              <find-regex>/site/component-bindings/([^&lt;]+)\.xml</find-regex>
 38            </pattern>
 39            <pattern>
 40              <find-regex>/site/indexes/([^&lt;]+)\.xml</find-regex>
 41            </pattern>
 42            <pattern>
 43              <find-regex>/site/resources/([^&lt;]+)\.xml</find-regex>
 44            </pattern>
 45          </includes>
 46        </dependency-type>
 47        <dependency-type>
 48          <name>asset</name>
 49          <includes>
 50            <!-- path patterns to look for (multiple) -->
 51            <pattern>
 52              <find-regex>/static-assets/([^&lt;"'\)]+)</find-regex>
 53            </pattern>
 54          </includes>
 55        </dependency-type>
 56        <dependency-type>
 57          <name>rendering-template</name>
 58          <includes>
 59            <pattern>
 60              <find-regex>/templates/([^&lt;"]+)\.ftl</find-regex>
 61            </pattern>
 62          </includes>
 63        </dependency-type>
 64        <dependency-type>
 65          <name>script</name>
 66          <includes>
 67            <pattern>
 68              <find-regex>/scripts/([^&lt;"]+)\.groovy</find-regex>
 69            </pattern>
 70            <pattern>
 71              <find-regex>&lt;content-type&gt;/(.*)/(.*)&lt;/content-type&gt;</find-regex>
 72              <transforms>
 73                <transform>
 74                  <match>&lt;content-type&gt;/(.*)/(.*)&lt;/content-type&gt;</match>
 75                  <replace>/scripts/$1s/$2.groovy</replace>
 76                </transform>
 77              </transforms>
 78            </pattern>
 79          </includes>
 80        </dependency-type>
 81      </dependency-types>
 82    </item-type>
 83    <item-type>
 84      <!-- name of type -->
 85      <name>component</name>
 86      <!-- how to identify items of this type -->
 87      <includes>
 88        <!-- path pattern regexes (multiple) -->
 89        <path-pattern>/site/components/([^&lt;]+)\.xml</path-pattern>
 90        <path-pattern>/site/system/page-components/([^&lt;]+)\.xml</path-pattern>
 91        <path-pattern>/site/component-bindings/([^&lt;]+)\.xml</path-pattern>
 92        <path-pattern>/site/indexes/([^&lt;]+)\.xml</path-pattern>
 93        <path-pattern>/site/resources/([^&lt;]+)\.xml</path-pattern>
 94      </includes>
 95      <!-- how to find dependencies in these items -->
 96      <dependency-types>
 97        <dependency-type>
 98          <name>page</name>
 99          <includes>
100            <pattern>
101              <find-regex>/site/website/([^&lt;]+)\.xml</find-regex>
102            </pattern>
103          </includes>
104        </dependency-type>
105        <dependency-type>
106          <name>component</name>
107          <includes>
108            <pattern>
109              <find-regex>/site/components/([^&lt;]+)\.xml</find-regex>
110            </pattern>
111            <pattern>
112              <find-regex>/site/system/page-components/([^&lt;]+)\.xml</find-regex>
113            </pattern>
114            <pattern>
115              <find-regex>/site/component-bindings/([^&lt;]+)\.xml</find-regex>
116            </pattern>
117            <pattern>
118              <find-regex>/site/indexes/([^&lt;]+)\.xml</find-regex>
119            </pattern>
120            <pattern>
121              <find-regex>/site/resources/([^&lt;]+)\.xml</find-regex>
122            </pattern>
123          </includes>
124        </dependency-type>
125        <dependency-type>
126          <name>asset</name>
127          <includes>
128            <!-- path patterns to look for (multiple) -->
129            <pattern>
130              <find-regex>/static-assets/([^&lt;"'\)]+)</find-regex>
131            </pattern>
132          </includes>
133        </dependency-type>
134        <dependency-type>
135          <name>rendering-template</name>
136          <includes>
137            <pattern>
138              <find-regex>/templates/([^&lt;"]+)\.ftl</find-regex>
139            </pattern>
140          </includes>
141        </dependency-type>
142        <dependency-type>
143          <name>script</name>
144          <includes>
145            <pattern>
146              <find-regex>/scripts/([^&lt;"]+)\.groovy</find-regex>
147            </pattern>
148            <pattern>
149              <find-regex>&lt;content-type&gt;/(.*)/(.*)&lt;/content-type&gt;</find-regex>
150              <transforms>
151                <transform>
152                  <match>&lt;content-type&gt;/(.*)/(.*)&lt;/content-type&gt;</match>
153                  <replace>/scripts/$1s/$2.groovy</replace>
154                </transform>
155              </transforms>
156            </pattern>
157          </includes>
158        </dependency-type>
159      </dependency-types>
160    </item-type>
161    <item-type>
162      <!-- name of type -->
163      <name>asset</name>
164      <!-- how to identify items of this type -->
165      <includes>
166        <!-- path pattern regexes (multiple) -->
167        <path-pattern>/static-assets/([^&lt;"'\)]+)</path-pattern>
168      </includes>
169      <!-- how to find dependencies in these items -->
170      <dependency-types>
171        <dependency-type>
172          <name>asset</name>
173          <includes>
174            <!-- path patterns to look for (multiple) -->
175            <pattern>
176              <find-regex>/static-assets/([^&lt;"'\)]+)</find-regex>
177            </pattern>
178          </includes>
179        </dependency-type>
180      </dependency-types>
181    </item-type>
182    <item-type>
183      <!-- name of type -->
184      <name>rendering-template</name>
185      <!-- how to identify items of this type -->
186      <includes>
187        <!-- path pattern regexes (multiple) -->
188        <path-pattern>/templates/([^&lt;"]+)\.ftl</path-pattern>
189      </includes>
190      <!-- how to find dependencies in these items -->
191      <dependency-types>
192        <dependency-type>
193          <name>asset</name>
194          <includes>
195            <!-- path patterns to look for (multiple) -->
196            <pattern>
197              <find-regex>/static-assets/([^&lt;"'\)]+)</find-regex>
198            </pattern>
199          </includes>
200        </dependency-type>
201        <dependency-type>
202          <name>rendering-template</name>
203          <includes>
204            <pattern>
205              <find-regex>/templates/([^&lt;"]+)\.ftl</find-regex>
206            </pattern>
207          </includes>
208        </dependency-type>
209        </dependency-types>
210      </item-type>
211      <item-type>
212        <!-- name of type -->
213        <name>script</name>
214        <!-- how to identify items of this type -->
215        <includes>
216          <!-- path pattern regexes (multiple) -->
217          <path-pattern>/scripts/([^&lt;"]+)\.groovy</path-pattern>
218        </includes>
219        <!-- how to find dependencies in these items -->
220        <dependency-types>
221          <dependency-type>
222            <name>script</name>
223            <includes>
224              <!-- path patterns to look for (multiple) -->
225              <pattern>
226                <find-regex>import scripts.(.*)</find-regex>
227                <transforms>
228                  <transform>
229                    <match>(.*)</match>
230                    <replace>$1</replace>
231                  </transform>
232                </transforms>
233              </pattern>
234            </includes>
235          </dependency-type>
236        </dependency-types>
237      </item-type>
238    </item-types>
239</dependency-resolver>