Adding 4.7 Features Guide
Board View
This feature is enabled by default.
These implementations are required for the Drag and Drop functionality of the Board View to work correctly.
Any fields/methods that have the @BoardSearchResultField annotation applied need to be re-indexed to function correctly.
If your project contains AuthorableData or SectionableData
If your project does not contain either of these classes, refer to the below section for alternative implementations.
On AuthorableData and SectionableData, add @BoardSearchResultField to the relevant field as the examples show below, ensuring that all existing annotations remain applied to the field.
1@BoardSearchResultField2private List<AuthoringEntity> authors;
1@BoardSearchResultField2private Section section;
If your project uses HasAuthorWithField , HasSectionWithField, or HasPodcastWithField
If your project uses these classes, you should implement the @BoardSearchResultField annotation as follows.
Apply the annotation to these classes using an alteration. Use the writeField annotation parameter to modify the correct field.
Here is an example of this applied to HasSectionWithField, but a similar pattern can be followed for authors and podcasts.
1public class HasSectionWithFieldAlteration extends Alteration<HasSectionWithField> {2@BoardSearchResultField(writeField = "hasSectionWithField.section")3@InternalName("hasSection.getSectionParent")4private Section getSectionParent;5}
Notice how the above code applies the annotation to getSectionParent. This is an indexed method on the class HasSectionData. It then uses the writeField parameter to specify which field will write the data to that indexed method.
Watchers
This feature is enabled by default.
Remove the following dependencies if they are present on your project to ensure there is no conflict with legacy functionality. Removing these dependencies will ensure the feature works as intended by default.
Remove:
com.psddev:watchlib-model-cms-auto-watch
Content Reports
This feature is enabled by default.
Add com.psddev:content-reporting dependency. Set Brightspot version to 4.7.13+.
OpenAI/ChatGPT
This feature is disabled by default. To enable it, go into Sites & Settings > Global > Integrations tab > Open AI cluster > Enabled.
Add com.psddev:openai dependency.
Hierarchy
Previously in versions <- 4.5, there was a Taxonomy Search Result View (supported by Taxon). In 4.7, this has been removed and replaced by Hierarchy Search Result View (supported by Hierarchy). This features is always enabled. In order to support the new view, implement the changes below as needed.
Add UnresolvedState from GO Library
If your project does not have the dependency com.brightspot.go:lib-util-unresolved-state, then you need to define your Brightspot GO version and add that dependency. This will be used in later steps.
If your application codebase does not already depend on com.brightspot.go, you may need to add a line for this version management to the settings.gradle file where versions for bom dependencies are managed. Refer to the version specified in Brightspot Dependency Version Upgrades Guide. This additional dependency management is only needed if your application contains any dependencies relocated to com.brightspot.go.
It is recommended to leave the comment in the code block below alongside the version to note the purpose of adding the com.brightspot.go dependency management.
If version management for com.brightspot.go needs to be added to the settings.gradle, ensure that the versions configuration block contains the line in the example below:
1versions {2... // likely other versions such as componentLib or brightspot3brightspotGo = '1.4.5' // Using com.brightspot.go for library dependencies moved from component-lib4}
Remove all usages of ExpressTaxon
This interface was used to drive the Taxonomy Search Result View. We need to eliminate all usages of this interface and replace them.
If your project contains brightspot.core.hierarchy.Hierarchy
This class is incompatible with newer hierarchy versions. If this class exists on the project or is in use anywhere, all usages need to be removed.
Follow the below steps for remediation.
Navigate to brightspot.core.hierarchy.Hierarchy and refactor the name to LegacyHierarchy.
Remove the extension of ExpressTaxon from this class class and implement Hierarchy (full path is com.psddev.cms.tool.Hierarchy)
Change the getParents() method to the following:
1@Override2default Set<Hierarchy> getParents() {3return Optional.ofNullable(getParent())4.map(parent -> parent.as(Hierarchy.class))5.map(Collections::singleton)6.orElse(null);7}
Below is an example of fully updated class:
1public interface LegacyHierarchy extends Hierarchical,2Hierarchy,3TypeSpecificCascadingPageElements {45Hierarchy getParent();67@Override8default Set<Hierarchy> getParents() {9return Optional.ofNullable(getParent())10.map(parent -> parent.as(Hierarchy.class))11.map(Collections::singleton)12.orElse(null);13}14}
Next, navigate to SectionableData and change the method getSectionAndAncestors() to the following (ensure that you maintain any annotations applied to the method).
1public Set<? extends LegacyHierarchy> getSectionAndAncestors() {2return Optional.ofNullable(section)3.map(s -> TaxonUtils.getAncestors(s, t ->4Optional.ofNullable(t.getParents()).orElseGet(Collections::emptySet).stream()5.filter(Section.class::isInstance)6.map(Section.class::cast)7.map(UnresolvedState::resolve)8.filter(Objects::nonNull)9.collect(Collectors.toSet())))10.map(HashSet::new)11.map(set -> {12Section resolvedSection = StateUtils.resolve(section);13if (resolvedSection != null) {14set.add(resolvedSection);15}16return set;17})18.orElse(null);19}
Next, navigate to any class that implements LegacyHierarchy and remove the methods isRoot() and getChildren(). Two common classes that implement this are Section and OneOffPage.
Remove other usages of ExpressTaxon
A common place this is found to be implemented is on Tag. Follow this pattern for other classes that implement ExpressTaxon.
In Tag.java, replace ExpressTaxon<Tag> with Hierarchy (full path is com.psddev.cms.tool.Hierarchy).
Next, remove isRoot() and getChildren() from Tag.
Change the implementation of getParents() to the following:
1@Override2public Set<Hierarchy> getParents() {3return Optional.ofNullable(getParent()).map(Hierarchy.class::cast).map(Collections::singleton).orElse(null);4}
Add the following method:
1public Tag getTagParent() {2return parent;3}
Navigate to TaggableData and change the implementation of getTagsAndAncestors() to the following (ensure that any annotations are maintained on the method).
1public Set<Tag> getTagsAndAncestors() {2Set<Tag> tagsAndAncestors = new LinkedHashSet<>();3Set<Tag> visited = new HashSet<>();4Queue<Tag> toProcess = new LinkedList<>(getTags());5while (!toProcess.isEmpty()) {6Tag next = toProcess.remove();7if (!visited.add(next)) {8continue;9}10tagsAndAncestors.add(next);11Optional.ofNullable(UnresolvedState.resolveAndGet(next, Tag::getTagParent))12.ifPresent(toProcess::add);13}14return tagsAndAncestors;15}
Remove all usages of TaxonParentExtension
Your project will likely not include TaxonParentExtension if it included usages of ExpressTaxon.
If your project uses the interface TaxonParentExtension, you need to remove the interface and replace it with Hierarchy.
By removing TaxonParentExtension, you will need to remove the methods getTaxonParent() and getTaxonChildrenQuery().
You will then need to implement the method getParents(). Below is an example of this implementation on SectionPage.
1@Override2public Set<Hierarchy> getParents() {3return Optional.ofNullable(getParent()).map(Hierarchy.class::cast).map(Collections::singleton).orElse(null);4}
Reindex updated hierarchy data
After completion of the above steps, you will need to ensure that you re-index the type com.psddev.cms.tool.Hierarchy, and then run a SQL -> SOLR index on the same type.
This step will need to be completed after the build is deployed to environment. Ensure that this step is completed immediately after production deployment to ensure the hierarchy search results are functioning as expected.