Isn’t it odd to open your Desktop and land in Teamspace View or Search View? Wouldn’t it be wonderful to have a landing page where you could add notifications and other notes to the customers to see when they open Desktop? Nowadays, UI is the priority in the web applications and thanks to AJAX web development became very rich in user experience. Today, we will look at developing a Feature that plays role as landing page (default Feature) for your Desktop.
Please note that this may be one of the few ways to achieve this kind of functionality and there might be better ones out there. If you know a better solution or noticed some errors or mistakes in this blog I encourage you to comment and/or join our community and share your experience with hundreds of others in IBM developerworks.
1. Open new feature
We open new feature and populate it’s variables as we need.
2. Load required dojo modules
We load 3 modeules: ecm/model/Desktop, dojo/dom-style, and dojo/ready.
- Desktop is used to get the Feature icon/button that is located in the Feature Pane on the left.
- domStyle is used to hide the retrieved icon/button in the above step
- ready is used to tell the domStyle when to hide the button
It should be similar to this:
3. Source Code
After loading required modules we can start putting pieces of puzzle together.
First, we get retrieve the feature icon through Desktop.getLayout().launchBarContainer.getButtons()[“idOfTheFeature”] as assign it to featureIcon (or any other name you choose for your variable). After first step domStyle is used to change the display attribute of featureIcon to “none”. When both steps are complete, we put those two lines of code in a ready function to tell the dojo to run them as soon as DOM (Document Object Model) is loaded and ready.
The source code should be similar to this:
And we put source code in the postCreate function of declared Feature class by name “YourFeatureName”.js .This class is auto-generated when the feature is created in Eclipse using IBM Content Navigator Plug-in and could be located under com.ibm.ecm.”YourProjectName”.WebContent.”YourProjectName”Dojo
Note: I’m new to IBM Content Navigator and I learn by trying, experimenting, and discovering possible ways of implementing a solution as well as looking through IBM developerworks forum for guidance.