Skip to content

Commit

Permalink
schema cleanup: SearchBoxConfigurationType.defaultScope usage cleanup…
Browse files Browse the repository at this point in the history
… and removal
  • Loading branch information
Kateryna Honchar committed Jun 6, 2023
1 parent a9dddda commit 510c302
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
Expand Up @@ -70,10 +70,6 @@ public static SearchBoxConfigurationType mergeConfigurations(SearchBoxConfigurat
mergedConfig.setRelationConfiguration(customizedConfig.getRelationConfiguration());
}

if (customizedConfig.getDefaultScope() != null) {
mergedConfig.setDefaultScope(customizedConfig.getDefaultScope());
}

SearchItemsType mergedSearchItems = combineSearchItems(mergedConfig.getSearchItems(), customizedConfig.getSearchItems(), pageBase);
mergedConfig.setSearchItems(mergedSearchItems);
return mergedConfig;
Expand Down
Expand Up @@ -21,7 +21,6 @@
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.List;
import java.util.stream.Collectors;

public class SearchBoxConfigurationHelper implements Serializable {

Expand Down Expand Up @@ -80,13 +79,6 @@ public void setDefaultObjectType(QName defaultObjectType) {
public ScopeSearchItemConfigurationType getDefaultSearchScopeConfiguration() {
if (defaultScopeConfiguration == null) {
defaultScopeConfiguration = searchBoxConfigurationType.getScopeConfiguration();
if (defaultScopeConfiguration == null) {
defaultScopeConfiguration = new ScopeSearchItemConfigurationType();
}
if (defaultScopeConfiguration.getDefaultValue() == null) {
defaultScopeConfiguration.setDefaultValue(searchBoxConfigurationType.getDefaultScope());
}

if (defaultScopeConfiguration == null) {
defaultScopeConfiguration = new ScopeSearchItemConfigurationType();
}
Expand Down
Expand Up @@ -1876,6 +1876,12 @@
<xsd:appinfo>
<a:container/>
<a:since>3.6</a:since>
<a:schemaMigration>
<a:element>tns:defaultScope</a:element>
<a:version>4.8</a:version>
<a:operation>removed</a:operation>
<a:comment>Use scopeConfiguration.defaultValue instead</a:comment>
</a:schemaMigration>
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
Expand Down Expand Up @@ -1971,21 +1977,6 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="defaultScope" type="tns:SearchBoxScopeType" minOccurs="0" maxOccurs="1" default="oneLevel">
<xsd:annotation>
<xsd:documentation>
The scope of the search box. Scope may not be applicable to all types of lists/views.
E.g. it does not make sense for flat searches. Therefore some views may not even display
scope selection at all.
</xsd:documentation>
<xsd:appinfo>
<a:displayName>SearchBoxConfigurationType.defaultScope</a:displayName>
<a:since>3.9</a:since>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>4.3</a:deprecatedSince>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="defaultObjectType" type="xsd:QName" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>
Expand Down
Expand Up @@ -614,9 +614,6 @@ private void compileSearchBox(CompiledObjectCollectionView existingView, GuiObje
if (newSearchBoxConfig.getDefaultObjectType() == null) {
newSearchBoxConfig.setDefaultObjectType(oldSearchBoxConfig.getDefaultObjectType());
}
if (newSearchBoxConfig.getDefaultScope() == null) {
newSearchBoxConfig.setDefaultScope(oldSearchBoxConfig.getDefaultScope());
}
if (newSearchBoxConfig.getSearchItems() == null) {
newSearchBoxConfig.setSearchItems(oldSearchBoxConfig.getSearchItems());
}
Expand Down

0 comments on commit 510c302

Please sign in to comment.