Example code is provided by a community of developers. They are intended to help you get started more quickly, but are not guaranteed to cover all scenarios nor are they supported by Arc XP.
These examples are licensed under the MIT license: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Reiterated from license above, all code in this example is free to use, and as such, there is NO WARRANTY, SLA or SUPPORT for these examples.
Notes:
- pb-data is a database snapshot of PageBuilder data, taken every 12 hours.
- Mongodb Tools: https://www.mongodb.com/docs/database-tools/installation/installation-macos/
- Duckdb CLI https://duckdb.org/docs/api/cli/overview.html#installation
- Make sure you install the dependencies that
bsondump
andduckdb
commands are present in your current bash session. - First, download the pb-data from Arc XP Admin > PageBuilder > Developer Tools > PB Data screen, to your local computer.
- Unzip the downloaded tar file, and rename the folder as
pb-data
and place it in this projects root folder. - Run
sh _prepare.sh
command to create temp database file (duckdb file) that contains the simplified views that is used in different shell scripts. These views are not copying the actual data, they are just views referring to the actual JSON files converted from mongodb bson files. - Run any of the shell script. These scripts are plain and simple, you can read the code to understand what the parameters, or add
-h
argument to the scripts to see help text for each one of them (i.e:sh find-pages-by-feature-name.sh -h
)
The video and tutorial can be found in "How to check feature/content-source usage using pb-data analysis scripts" ALC documentation.
In terminal, view the below script help with command sh help.sh
This script shows meta data of this page (uri, title), list of chains & features, sorted by how many times used in the page/template, and the content sources configured from features.
-i
Page or Template ID (required, min 2 characters)
Produces list of all chains used in your pb-data (not bundle), in published pages and templates along with how many pages they are used in and the number of times (instances) they are used in these pages.
-c
Output in CSV format
Produces list of pages and templates which uses a specific chain.
You can open pagebuilder editor with the following url template with the page or template id in the query string: https://YOURORG.arcpublishing.com/pagebuilder/editor/curate?p=PAGEID
-n
Chain name (required, min 2 characters)
-c
Output in CSV format
Produces list of all features used in your pb-data (not bundle), in published pages and templates along with how many pages they are used in and the number of times (instances) they are used in these pages.
-c
Output in CSV format
Produces list of pages and templates which uses a specific feature.
You can open pagebuilder editor with the following url template with the page or template id in the query string: https://YOURORG.arcpublishing.com/pagebuilder/editor/curate?p=PAGEID
-n
Feature name (required, min 2 characters)
-c
Output in CSV format
List of all content sources, from feature block configurations.
-c
Output in CSV format
Produces list of features which uses a specific content source name (like match)
-n
Content source filter (required, min 2 characters)
-c
Output in CSV format
List of all content sources, from route resolver configurations.
-c
Output in CSV format
Produces list of resolvers which uses a specific content source name (exact match)
-n
Content source name (required, min 2 characters)
-c
Output in CSV format
Excludes templates, as they are powered by dynamic URL patterns from resolvers and are not included in this script's output.
-c
Output in CSV format
List all pages matching URI containing the provided filter.
-u
URI filter (required, min 2 characters)
-c
Output in CSV format
Select all from view_page_and_template
-c
Output in CSV format
Select all from view_rendering
-c
Output in CSV format
Select all from view_resolver
-c
Output in CSV format