Skip to main content

Override search tile with tree view

This sample shows how to override the behavior of the existing search list widget in the landing page with tree based view

Instruction to try out the sample

  • Build the plugin using npm run build from SDK workspace root.
  • Copy D2CustomSearchList-1.0.0 from 'dist' folder in workspace root and paste it inside WEB-INF/lib folder of a deployed D2 Smartview application.
  • Restart application server on which D2 Smartview is deployed.
  • Login into D2-Smartview and check on the Search list widget.

Source code structure

D2CustomSearchList
¦ pom.xml
¦
+---src
¦ +---main
¦ +---java
¦ ¦ +---com
¦ ¦ +---emc
¦ ¦ ¦ D2PluginVersion.java
¦ ¦ ¦
¦ ¦ +---opentext
¦ ¦ +---d2
¦ ¦ +---rest
¦ ¦ ¦ +---context
¦ ¦ ¦ +---jc
¦ ¦ ¦ PluginRestConfig_D2CustomSearchList.java
¦ ¦ ¦
¦ ¦ +---smartview
¦ ¦ +---d2customsearchlist
¦ ¦ ¦ D2CustomSearchListPlugin.java
¦ ¦ ¦
¦ ¦ +---api
¦ ¦ ¦ D2CustomSearchListVersion.java
¦ ¦ ¦
¦ ¦ +---rest
¦ ¦ package-info.java
¦ ¦
¦ +---resources
¦ ¦ ¦ d2customsearchlist-version.properties
¦ ¦ ¦ D2Plugin.properties
¦ ¦ ¦
¦ ¦ +---smartview
¦ ¦ SmartView.properties
¦ ¦
¦ +---smartview
¦ ¦ .csslintrc
¦ ¦ .eslintrc-html.yml
¦ ¦ .eslintrc.yml
¦ ¦ .npmrc
¦ ¦ config-editor.js
¦ ¦ d2customsearchlist.setup.js
¦ ¦ Gruntfile.js
¦ ¦ package.json
¦ ¦ server.conf.js
¦ ¦
¦ +---src
¦ ¦ ¦ component.js
¦ ¦ ¦ config-build.js
¦ ¦ ¦ d2customsearchlist-extensions.json
¦ ¦ ¦ d2customsearchlist-init.js
¦ ¦ ¦ Gruntfile.js
¦ ¦ ¦
¦ ¦ +---bundles
¦ ¦ ¦ d2customsearchlist-bundle.js
¦ ¦ ¦
¦ ¦ +---overrides
¦ ¦ ¦ +---widgets
¦ ¦ ¦ +---savedsearch
¦ ¦ ¦ savedsearch.group.model.js
¦ ¦ ¦
¦ ¦ +---test
¦ ¦ ¦ extensions.spec.js
¦ ¦ ¦
¦ ¦ +---utils
¦ ¦ ¦ startup.js
¦ ¦ ¦
¦ ¦ +---theme
¦ ¦ ¦ action.icons.js
¦ ¦ ¦
¦ ¦ +---action_icons
¦ ¦ action_sample_icon.svg
¦ ¦
¦ +---test
¦ Gruntfile.js
¦ karma.conf.js
¦
+---target

Files and their purpose

Following are the list of function oriented source files and their purpose. Other source files present within the plugin are part of common infrastructure code and explained in Understanding D2SV plugin project.

Overriding the structure of the search category to tree vuew
  • src/main/smartview/src/overrides/widgets/savedsearch/savedsearch.group.model.js - Here we are overriding the sync function for D2SV to get get a tree structure for Search category using the tab index.
  • src/main/smartview/src/utils/startup.js - load the src/main/smartview/src/overrides/widgets/savedsearch/savedsearch.group.model.js using the require module