Visual Studio Extention - Context Menu for 'Server Explorer' - visual-studio-extensions

In a VSIX project, in the .vsct file I can see how to target different objects and provide a custom context menu:
For instance, the following will target an item node in the solution explorer:
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/>
<!--<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>-->
</Group>
Changing the id property from IDM_VS_CTXT_ITEMNODE to IDM_VS_CTXT_CODEWIN will result in the context menu appearing in the code window instead.
This is documented here:
Microsoft Documentation
However, I would like my context menu to appear in the 'Server Explorer' instead. An example and a link to the documentation would be very helpful.

To find Visual Studio menu guids, this usually works.
In your registry set EnableVSIPLogging DWORD to 1, under HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\General.
Restart Visual Studio (and computer?) and hold Ctrl+Shift and right click an item in the server explorer, it will open a dialog window with something like this:
You can go from there.

Thanks to Paul Swetz and James Sinclair I was able to get this working.
Using the method described by Paul Swetz I could identify the guid required for the Server Window object I was clicking, in this case the table node.
Having got that I added that id to the Symbols in the .vsct file, with a name of my choice:
<GuidSymbol name="guidWhatever" value="{d4f02a6a-c5ae-4bf2-938d-f1625bdca0e2}"> <!--//server explorer - table-->
<IDSymbol name="IDMX_DV_OBJECT_NODE" value="0x8200"/>
</GuidSymbol>
Now I can use that in Groups and the custom command appears in the dropdown.
<Groups>
<Group guid="guidFirstCommandPackageCmdSet" id="MyMenuGroup" priority="0x0600">
<!--<Parent guid="{D309F791-903F-11D0-9EFC-00A0C911004F}" id="IDM_VS_CTXT_ITEMNODE"/>-->
<Parent guid="guidWhatever" id="IDMX_DV_OBJECT_NODE"/>
</Group>
</Groups>
The only problem now is identifying and accessing the selected table and database but that's another matter.

All of VS 2015's commands, menus, toolbars etc are detailed in a couple of c++ header files (stdidcmd.h and vsshlids.h).
On my install they are in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\VisualStudioIntegration\Common\Inc'.
Had a very brief look in the files and i think you'll need something starting
IDG_SE_CONTEXT_ to target groups within the server explorer context menu
IDG_SE_TOOLBAR_ to get into the toolbar
IDM_SE_CONTEXT_ to get to the context menu
IDM_SE_TOOLBAR_ to get to the toolbar menu

Related

Maximo anywhere apps how to configure

Im new to Maximo. I already have maximo anywhere work execution app. Please let me know how to add new button in it through worklight.
Open the index.html file and add a <button> element.
If this does not help you, please learn how to ask questions first.
You can Edit the app.xml in <: Install Root :>/apps/<: app :>/antifact, like IBM MAXIMO Anywhere guide.
link: https://www.ibm.com/developerworks/community/blogs/a9ba1efe-b731-4317-9724-a181d6155e3a/entry/Adding_Custom_Fields_to_a_Maximo_Anywhere_application?lang=en
Before you embark on that Journey, be sure to back up the default app.xml. In order to add a button you first need to modify the Application UI, changes are made in the app.xml file .\MaximoAnywhere\apps\WorkExecution\artifact\app.xml. You can add additional tags to the file, which builds the UI and makes the app.
<button border="false" cssClass="statusIcon" id="WorkExecution.WorkDetailView_status_button_1" layoutInsertAt="item3" resourceAttribute="returnActive">
<states id="WorkExecution.WorkDetailView_status_buttons_return">
<state id="WorkExecution.WorkOrderDetail_ReturnButton_render_active" image="/images/RETURNED.png" label="Return" value="true"/>
<state default="true" id="WorkExecution.WorkOrderDetail_ReturnButton_render_inactive" image="/images/RETURNED_INACTIVE.png" label="Return" value="false"/>
</states>
<eventHandlers id="WorkExecution.WorkDetailView_status_button_eventHandlers_1">
<eventHandler class="application.handlers.Custom.WODetailHandler" event="render" id="WorkExecution.WorkOrderDetail_ReturnButton_render" method="renderReturnedIcon"/>
<eventHandler class="application.handlers.Custom.WODetailHandler" event="click" id="WorkExecution.WorkDetailView_status_button_1_eventHandlers" method="onReturnStatusIconClicked"/>
</eventHandlers>
</button>
Thats an example of a button we use in the app on the Work Details screen. Notice it has a CSS class that we've added, as well as a resourceAttribute that manages the state of the button. Putting a state on the button tells the app when to render which of the images. Lastly, we have event handlers that are tied to the button, with corresponding code written in the Custom.WODetailHandler file.

Xpages data view icon column with Boostrap4XPages

I'm currently trying to display an icon in a data view. The configuration of the icon column is very simple, selectedValue is equal to 1 and the icon to be displayed is in the icon resources of the database. The xpages theme is currently set to Bootstrap4XPages. The page does not display in the browser. When I set the theme to OneUI, the page displays fine with the icon. Can anyone indicate a way to debug this? Here is a snippet of the error-log on the domino server. I removed most of the exception values to keep the post as short as possible. :
<CommonBaseEvent creationTime="2015-01-12T13:49:54.885-05:00" globalInstanceId="EL0a94000600014a3fc8c8ac000001c0" msg="CLFAD0246E: Exception occurred servicing request for: /test.nsf/test.xsp - HTTP Code: 500" severity="50" version="1.0.1">
<extendedDataElements name="CommonBaseEventLogRecord:level" type="noValue">
<children name="CommonBaseEventLogRecord:name" type="string">
<values>GRAVE</values>
</children>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceClassName" type="string">
<values>com.ibm.domino.xsp.bridge.http.engine.XspCmdManager</values>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:sourceMethodName" type="string">
<values>service</values>
</extendedDataElements>
<extendedDataElements name="CommonBaseEventLogRecord:Exception" type="string">
<values>Context Path: /test.nsf
Page Name: /test.xsp
java.lang.NullPointerException: Argument Error: One or more parameters are null.
at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.writeAttribute(HtmlResponseWriter.java:308)
at com.ibm.xsp.theme.bootstrap.renderkit.html.extlib.data.DataViewRenderer.writeIconColumn(DataViewRenderer.java:267)
at com.ibm.xsp.extlib.renderkit.html_extended.data.DataViewRenderer.writeStandardRow(DataViewRenderer.java:792)
at com.ibm.xsp.extlib.renderkit.html_extended.data.DataViewRenderer.writeRow(DataViewRenderer.java:570)
at com.ibm.xsp.extlib.renderkit.html_extended.data.AbstractDataViewRenderer.writeRows(AbstractDataViewRenderer.java:816)
at com.ibm.xsp.extlib.renderkit.html_extended.data.DataViewRenderer.writeRows(DataViewRenderer.java:548)
at com.ibm.xsp.extlib.renderkit.html_extended.data.DataViewRenderer.writeContent(DataViewRenderer.java:256</values>
</extendedDataElements>
<sourceComponentId component="Expeditor 6.2" componentIdType="ProductName" instanceId="" location="notes" locationType="Hostname" subComponent="" threadId="1" componentType="http://www.w3.org/2001/XMLSchema-instance"/>
<situation categoryName="ReportSituation">
<situationType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ReportSituation" reasoningScope="INTERNAL" reportCategory="LOG"/>
</situation>
</CommonBaseEvent></CommonBaseEvents>
The problem lies here from the error: com.ibm.xsp.theme.bootstrap.renderkit.html.extlib.data.DataViewRenderer.writeIconColumn(DataViewRenderer.java:267)
It is a bug, one that I discovered myself just recently. I have a fix identified for it that we will release in the next extlib version (not sure when that will be). When the title attribute is left empty for the icon, it attempts to use the alt attribute as a title instead. The problem is it doesnt check if an alt value exists, and when it doesn't it tries to write null as an attribute, and you get the NullPointerException. Simple fix in the DataViewRenderer code.
I think you can work around the issue though if you set either the title or alt attributes of the image icon. So give that a go for now.
Check devtools (browser debug tools) and see if there is an Icon in the html code and see it the path is valid. If there is no icon then maybe the bootstrap plugin may not support it.
Either way, you can always easily add an icon client side using jQuery or plain client side JavaScript

Dynamics CRM 2011 Modal Web Resource from Ribbon button size incorrect (IE only)

I am working on Dynamics CRM 2011 (UR13) and trying to display an HTML Web resource (which contains a Silverlight XAP file) as a Modal Dialog from a Ribbon Button.
The Ribbon action XML is as below. More or like the MSDN examples.
<Actions>
<Url Address="$webresource:new_Wizard.htm" PassParams="true" WinMode="1" WinParams="dialogHeight=100; dialogWidth=100" />
</Actions>
In both Chrome and Firefox, the dialogHeight and dialogWidth values are honoured.
However, in IE9 (the RTM supported version) these are ignored and the pop-up window is huge (almost full screen).
Has anyone else seen this behaviour or know a workaround?
Best Regards,
Shaun Harvey
I am opening up the HTML Web Resource from a Javascript Function instead (triggered by the click of the Ribbon Button).
This function uses the Xrm.Utility.openWebResource() method introduced in Roll-Up 8 of CRM 2011.
http://msdn.microsoft.com/en-gb/library/jj602956(v=crm.5).aspx
The Function call allows you to specify the web resource URL, and the size of the pop-up window.
Xrm.Utility.openWebResource("new_webResource.htm?typename=account&userlcid=1033", null, 300, 300);
This seems to be rendered properly by all three of the browsers.
As a possible workaround you can choose one of 2 options:
1. Add OnLoad javascript to your html webresourse that will set correct size to your dialog window.
2. Replace action with JavaScript function that will open your dialog window with proper sizing.

How to add a RibbonButton to a context menu in Outlook?

I am at a loss how to add a custom button to a context menu in Outlook 2013. In Outlook 2007 and 2010 I manage to do that successfully with a CommandBarButton, but that is not possible anymore in 2013. Unfortunately, I could not find a tutorial how to convert my code or mitigate the issue.
My question now is: How can I create, add and access a custom RibbonButton that should appear in the Outlook context menu of mail, calendar and contact items?
I have already tried simple code like this:
<?xml version="1.0" encoding="utf-8" ?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<contextMenus>
<contextMenu idMso="ContextMenuMailItem">
<button id="MyContextMenuContactItem"
label="ContextMenuContactItem"
onAction="OnMyButtonClick"/>
</contextMenu>
</contextMenus>
</customUI>
... but nothing happens, it is not displayed. The constructor of its .cs file is called, but nothing else.
If I try adding it programmatically via
Globals.Factory.GetRibbonFactory().CreateRibbonButton()
.. then I do not know how to add it to a preexisting context menu.
I must be missing something that is necessary to add the item to the context menu. Can anyone please point me to it?
PS: I am testing with Outlook 2007.
The problem was caused by a wrong stub that was automatically inserted by Visual Studio. The return value of GetCustomUI was always null because GetResourceText could not find the resource (although to me it looked valid). When I changed it to File.ReadAllText(Properties.Resources.MyRibbonXmlFile), Ribbon_Load was finally called.

How to suppress Flash migration warnings (1090)

In Flash Professional CS4, I get "migration issue" warnings when I use mouse/keyboard input handler names such as onMouseDown, onKeyUp, etc., even though I have added event listeners for them. These names are perfectly legal for functions, but since these were automatically fired in ActionScript 2.0, we are now (albeit sensibly) warned that their use is no longer automatic in AS3.
I understand the purpose of the warnings, but they aren't useful for me. I want to suppress these warnings, but without suppressing any other warnings, which I generally do find useful.
E.g., when I use code like this:
/** #constructor */
public function MyClass() {
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
}
protected function onMouseDown(e:MouseEvent):void {
I get an annoying warning like this:
Warning: 1090: Migration issue: The onMouseDown event handler is not triggered automatically by Flash Player at run time in ActionScript 3.0. You must first register this handler for the event using addEventListener ( 'mouseDown', callback_handler).
There are flex compiler (mxmlc) flags (and a Flash Pro setting) which can suppress actionscript warnings, or all warnings, but I don't want that. That's too general.
Ideally I could suppress a specific error/warning number (Warning #1090).
Edit: I've found more "advanced" compiler flags with mxmlc -help advanced, which look promising. Specifically, the following seem like likely candidates:
warn-deprecated-event-handler-error
warn-deprecated-function-error
warn-deprecated-property-error
How do I get Flash to use these?
Edit 2: I found a flex-info.xml style document in the Flash User Data dir.
[userdatafolder]/Adobe/Flash CS4/en/Configuration/ActionScript 3.0/FlexInfo.xml
However, this file contains a disappointing comment: <!-- Flash does not support most flex-config options. -->, and doesn't seem to respond to my directives even after restarting flash.
This is getting sad.
Edit 3: Found an issue "Erroneous, annoying "Migration issue" warnings" on Adobe bug tracker. A fix is confirmed for the Flex SDK, but no mention of Flash...
You can if you edit EnabledWarnings.xml in $Flash/$LOCALE/Configuration/Actionscript 3.0/EnabledWarnings.xml, where $Flash is the path to Flash inside your Applications/Program Files folder and $LOCALE is your language.
e.g.
/Applications/Adobe Flash CS4/en/Configuration/ActionScript 3.0/EnabledWarnings.xml
You will need to edit line 29, setting the enabled attribute to false for warning with id 1090:
<warning id="1090" enabled="false" label="kWarning_DepricatedEventHandlerError">EventHandler was not added as a listener.</warning>
Quick sidenote:
"Flash Builder (CS4)" is a confusing term. After Flex Builder 3, Flex Builder got renamed to Flash Builder, there is no Flash Builder CS4. The regular Flash IDE is known as Flash Professional/Flash Professional CS4, this was to avoid confusion between products with similar names: Flash Catalyst, Flash Builder(was Flex Builder), Flash Professional. Obviously it doesn't always work that great :)
What about changing the name of the function being called from onMouseDown to handlerOnMouseDown. Would it solve the issue?
Are you using Flex Builder?
If so, go to Project -> Properties -> Flex Compiler. There you can add arguments to the compiler.
Why are you overriding that? It never existed in the first place. The error message is actually telling you something useful. Don't suppress it.
If you want to create an event handler called onMouseDown, try something like
private function onMouseDown(e:MouseEvent) : void {
// statements
}
I agree with the previous post; the message is trying to tell you that you need to register that event handler. Just adding a method called onMouseDown() won't do it. What you need to do is to add something like
addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
in either your constructor or maybe in the parent component.
You can filter out these warnings using Flash Builder's problems filtering capability:
open problems view
on the right click on the small triangle that opens a drop-down menu
select Configure Contents...
on the left side, create a new configuration, name it as you wish
on the right side adjust its settings:
Scope: On any element in the same project (or anything you want)
Description: choose doesn't contain and type in Migration issue (this will filter out warnings with migration issue in the description)
choose at least Flex problems
You can combine predefined and custom configurations by selecting more then one on the left side.

Resources