Open a cabinet/folder in Doclist
This sample shows how to open the default Doclist widget in D2 Smartview at a specific cabinet or folder. This sample
leverages a command implementation named Browse from D2 Smartview runtime to do so.
Instruction to try out the sample
- Build the plugin using
npm run buildfrom SDK workspace root. - Copy
D2SV-OpenFolder-Doclist-1.0.0.jarfrom 'dist' folder in workspace root and paste it insideWEB-INF/libfolder of a deployed D2 Smartview application. - Restart application server on which D2 Smartview is deployed.
- Login into D2-Smartview and navigate to any cabinet or folder of choice in Doclist widget.
- Copy the Documentum Object ID of cabinet/folder from browser address bar.
- Navigate to landing page.
- Click user profile icon and select
OpenFoldermenu item. - Paste the copied Object ID in
Enter folder IDfield ofOpenFolderdialog. - Click
Openbutton in the dialog footer to close the dialog and open Doclist at the cabinet/folder identified by the pasted value.
Source code structure
D2SV-OpenFolder-Doclist
|
| pom.xml
|
+---src
| \---main
| +---java
| | \---com
| | +---emc
| | | D2PluginVersion.java
| | |
| | \---opentext
| | \---d2
| | +---rest
| | | \---context
| | | \---jc
| | | PluginRestConfig_D2SVOFDoclist.java
| | |
| | \---smartview
| | \---d2svofdoclist
| | | D2SVOFDoclistPlugin.java
| | |
| | +---api
| | | D2SVOFDoclistVersion.java
| | |
| | +---dialogs
| | | OpenFolder.java
| | |
| | \---rest
| | package-info.java
| |
| +---resources
| | | D2Plugin.properties
| | | d2svofdoclist-version.properties
| | |
| | +---smartview
| | | SmartView.properties
| | |
| | +---strings
| | | +---dialog
| | | | \---OpenFolder
| | | | OpenFolder_en.properties
| | | |
| | | \---menu
| | | \---MenuUser
| | | MenuUser_en.properties
| | |
| | \---xml
| | +---dialog
| | | OpenFolder.xml
| | |
| | \---unitymenu
| | MenuUserDelta.xml
| |
| \---smartview
| | .csslintrc
| | .eslintrc-html.yml
| | .eslintrc.yml
| | .npmrc
| | config-editor.js
| | d2svofdoclist.setup.js
| | Gruntfile.js
| | package.json
| | server.conf.js
| |
| +---src
| | | component.js
| | | config-build.js
| | | d2svofdoclist-extensions.json
| | | d2svofdoclist-init.js
| | | Gruntfile.js
| | |
| | +---bundles
| | | d2svofdoclist-bundle.js
| | |
| | +---extensions
| | | dialog.actions.js
| | |
| | +---test
| | | extensions.spec.js
| | |
| | \---utils
| | | startup.js
| | | utils.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.
Utility to open Doclist widget at a given folder
- src/main/smartview/src/utils/utils.js - Defines a function
openFolderthat in turn executesBrowsecommand instance with a given folder ID set as an attribute to aNodeModelinstance.tipThe
Browsecommand has a multi-faceted implementation i.e. it behaves diffrently based on type of the object. E.g Instead of cabinet/folder, if a document's object ID is used then it opens the Overview perspective for it.
D2FS dialog to collect folder ID
The remaining part of the sample defines a user profile menu item which shows a D2FS dialog having a single text field to collect cabinet/folder ID.
- src/main/java/com/opentext/d2/smartview/d2svofdoclist/dialogs/OpenFolder.java - Java class file behind the
OpenFolderdialog. - src/main/resources/strings/dialog/OpenFolder/OpenFolder_en.properties - Defines labels used in
OpenFolderdialog. - src/main/resources/strings/menu/MenuUser/MenuUser_en.properties - Defines label for the menu item in user profile.
- src/main/resources/xml/dialog/OpenFolder.xml - Form definition for the
OpenFolderdialog. - src/main/resources/xml/unitymenu/MenuUserDelta.xml - Defines the
OpenFoldermenu item under user profile through delta menu concept. - src/main/smartview/src/extensions/dialog.actions.js - Defines the code to be executed for
Openbutton in the dialog footer. InvokesopenFolderinsrc/main/smartview/src/utils/utils.jswith collected ID.