Grokking the Paradigm Modifying Menus
description
Transcript of Grokking the Paradigm Modifying Menus
![Page 1: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/1.jpg)
© 2006 EMC Corporation. All rights reserved.
Grokking the ParadigmModifying MenusDennis Dawson
Principal Technical Writer
EMC/Documentum
![Page 2: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/2.jpg)
Grokking the Paradigm 2© 2006 EMC Corporation. All rights reserved.
Ten Minutes’ Worth of Stuff
• Here’s what I’m gonna talk about:– Adding a menu command– Rearranging commands– Removing a menu command
![Page 3: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/3.jpg)
Grokking the Paradigm 3© 2006 EMC Corporation. All rights reserved.
Remember...
Magic is easy, once YOU
know the secret!
Marshall Brodien
![Page 4: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/4.jpg)
Grokking the Paradigm 4© 2006 EMC Corporation. All rights reserved.
Overview
• To modify menu commands we need to:– Identify the configuration file and JSP to modify– Copy the file to the custom/config directory– Edit the dmfx:actionmenuitem elements and attributes– Refresh the configuration
• Similar to customizing the toolbar
![Page 5: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/5.jpg)
Grokking the Paradigm 5© 2006 EMC Corporation. All rights reserved.
Adding a Menu CommandIdentifying the Files to Modify
• The “obvious” place to start is /webtop/config/menubar_component.xml
• Copy to /custom/config/menubar_component.xml
![Page 6: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/6.jpg)
Grokking the Paradigm 6© 2006 EMC Corporation. All rights reserved.
Adding a Menu CommandIdentifying the Files to Modify
Note the location of the menubar.jsp (so we can copy it) <component id="menubar"
extends="menubar:/webcomponent/config/library/menubar/menubar_component.xml">
... <pages> <start> /webtop/classic/menubar/menubar.jsp </start> </pages>...</component>
![Page 7: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/7.jpg)
Grokking the Paradigm 7© 2006 EMC Corporation. All rights reserved.
Adding a Menu CommandIdentifying the Files to Modify
• Change the extends attribute to point to the Webtop file we just copied.
• Change the <start> page to a new custom page we’ll modify<component id="menubar"
extends="menubar:/webtop/config/menubar_component.xml">... <pages> <start> /custom/menubar/menubar.jsp </start> </pages>...</component>
![Page 8: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/8.jpg)
Grokking the Paradigm 8© 2006 EMC Corporation. All rights reserved.
Adding a Menu CommandIdentifying the Files to Modify
• Copy /webtop/classic/menubar to the /custom directory
![Page 9: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/9.jpg)
Grokking the Paradigm 9© 2006 EMC Corporation. All rights reserved.
Adding a Menu CommandIdentifying the Files to Modify
• menubar.jsp includes menubar_body.jsp
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page errorPage="/wdk/errorhandler.jsp" %>
<%@ taglib uri="/WEB-INF/tlds/dmform_1_0.tld" prefix="dmf" %>
<%@ taglib uri="/WEB-INF/tlds/dmformext_1_0.tld" prefix="dmfx" %>
<%@ include file='/webcomponent/library/menubar/menubar_body.jsp' %>
![Page 10: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/10.jpg)
Grokking the Paradigm 10© 2006 EMC Corporation. All rights reserved.
Adding a Menu CommandIdentifying the Files to Modify
• Menubar.jsp includes menubar_body.jsp• Copy the file from /webcomponent/library/menubar to
/custom/menubar
![Page 11: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/11.jpg)
Grokking the Paradigm 11© 2006 EMC Corporation. All rights reserved.
Adding a Menu CommandIdentifying the Files to Modify
• Edit /custom/menubar/menubar.jsp to include our custom menubar_body.jsp (same directory)
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page errorPage="/wdk/errorhandler.jsp" %>
<%@ taglib uri="/WEB-INF/tlds/dmform_1_0.tld" prefix="dmf" %>
<%@ taglib uri="/WEB-INF/tlds/dmformext_1_0.tld" prefix="dmfx" %>
<%@ include file="menubar_body.jsp" %>
![Page 12: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/12.jpg)
Grokking the Paradigm 12© 2006 EMC Corporation. All rights reserved.
Adding a Menu Command
• Adding a command to a menu (actionmenuitem) follows the same paradigm as adding an actionlink to the toolbar
<dmfx:actionmenuitem
dynamic="multiselect"
name="file_rename"
value="Rename"
action="rename"
/>
![Page 13: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/13.jpg)
Grokking the Paradigm 13© 2006 EMC Corporation. All rights reserved.
Adding a Menu Command
• Slip the new item between the file_saveas command and file_checkin
<dmfx:actionmenuitem dynamic='singleselect' id='file_saveas' name='file_saveas' nlsid='MSG_SAVE_AS' action='saveasxforms' showifinvalid='true'/>
<!-- Added by Dennis Dawson 11-16-06 -->
<dmfx:actionmenuitem dynamic="multiselect" id = "file_rename" name = "file_rename" value = "Rename" action = "rename" />
<dmfx:actionmenuitem dynamic='multiselect' name='file_checkin' nlsid='MSG_CHECKIN' action='checkin' showifinvalid='true'/>
![Page 14: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/14.jpg)
Grokking the Paradigm 14© 2006 EMC Corporation. All rights reserved.
Adding a Menu Command
• The Rename command added to the File menu
![Page 15: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/15.jpg)
Grokking the Paradigm 15© 2006 EMC Corporation. All rights reserved.
Adding a Menu Command
• Enabled when one or more items are selected
![Page 16: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/16.jpg)
Grokking the Paradigm 16© 2006 EMC Corporation. All rights reserved.
Moving a Menu Command
• To move a menu command, change its position in the JSP
<dmfx:actionmenuitem dynamic='singleselect' id='file_view' name='file_view' nlsid='MSG_VIEW_FILE' action='view' showifinvalid='true'/>
<!-- Added by Dennis Dawson 11-16-06 -->
<dmfx:actionmenuitem dynamic="multiselect" id = "file_rename" name = "file_rename" value = "Rename" action = "rename" />
<dmfx:actionmenuitem dynamic='singleselect' id='file_saveas' name='file_saveas' nlsid='MSG_SAVE_AS' action='saveasxforms' showifinvalid='true'/>
![Page 17: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/17.jpg)
Grokking the Paradigm 17© 2006 EMC Corporation. All rights reserved.
Moving a Menu Command
• The Rename command in its new position
![Page 18: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/18.jpg)
Grokking the Paradigm 18© 2006 EMC Corporation. All rights reserved.
Removing a Menu Command
• Comment out a command to remove it from the menu
<% /* Removed by Dennis Dawson 11-16-06
<dmfx:actionmenuitem dynamic='multiselect' name='file_cancelcheckout' nlsid='MSG_CANCEL_CHECKOUT' action='cancelcheckout' showifinvalid='true'/>
*/ %>
![Page 19: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/19.jpg)
Grokking the Paradigm 19© 2006 EMC Corporation. All rights reserved.
Removing a Menu Command
• The Cancel Checkout command removed
![Page 20: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/20.jpg)
Grokking the Paradigm 20© 2006 EMC Corporation. All rights reserved.
Multiplicitas Componatis Res Simplex
• Taken as a whole, Webtop and WDK-based applications are intricate, multifaceted feats of programming
• When you focus on any one element of the application, it’s easy to follow the logic and duplicate its behavior
• Once you grok the paradigm, enhancing and customizing complex applications becomes a series of simple steps
![Page 21: Grokking the Paradigm Modifying Menus](https://reader033.fdocuments.in/reader033/viewer/2022051517/56815720550346895dc4bf71/html5/thumbnails/21.jpg)
© 2006 EMC Corporation. All rights reserved.
Clarifications/comments?Please send them to:
WDK Questions? Please visit:http://developer.emc.com/developer/