Change shortcuts in MySql Workbench wont work - mysql-workbench

I want to change the shortcut for executing the current statement in MySql Workbench to Control-E, and I found this to get it done, but I can not get it to work.
This is the modification I have made in main_menu.xml
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.execute_current_statementwin">
<link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
<value type="string" key="caption">Execute Current Statement</value>
<value type="string" key="name">query.execute_current_statement</value>
<value type="string" key="command">builtin:query.execute_current_statement</value>
<value type="string" key="itemType">action</value>
<value type="string" key="shortcut">Modifier+E</value>
<value type="string" key="platform">windows</value>
</value>
But the shortcut for executing current statement is still Control-Enter.
What have I done wrong?
I found the main-menu.xml-file in the directory C:\Program Files\MySQL\MySQL Workbench 6.3 CE\data

It seems that MySQL Workbench does not allow multiple shortcuts for the same action. Make sure there is only one entry for com.mysql.wb.menu.query.execute_current_statementwin.
In the SQL Workbench installation folder, edit data/main_menu.xml. This example sets both execute and execute current statement (highlighted) to Ctrl-E to match SSMS.
<!-- be sure this id does not have another shortcut -->
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.exec">
<link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
<value type="string" key="caption">Execute (All or Selection)</value>
<value type="string" key="name">query.execute</value>
<value type="string" key="command">builtin:query.execute</value>
<value type="string" key="itemType">action</value>
<value type="string" key="shortcut">Modifier+E</value>
</value>
<value type="object" struct-name="app.MenuItem" id="com.mysql.wb.menu.query.execute_current_statementwin">
<link type="object" key="owner" struct-name="app.MenuItem">com.mysql.wb.menu.query</link>
<value type="string" key="caption">Execute Current Statement</value>
<value type="string" key="name">query.execute_current_statement</value>
<value type="string" key="command">builtin:query.execute_current_statement</value>
<value type="string" key="itemType">action</value>
<value type="string" key="shortcut">Modifier+E</value>
<value type="string" key="platform">windows</value>
</value>

Related

finding target worksheet for action in twb (xml) file

My intention is to find target worksheet for actions in tableau workbook. where should I search for that target worksheet correspond to some particular action in twb(xml) file?
For example:
<actions>
<action caption='Filter 1 (generated)' name='[Action1]'>
<activation auto-clear='true' type='on-select' />
<source dashboard='Figure 8-60 thought 8-65' type='sheet' worksheet='Heat Map' />
<command command='tsc:tsl-filter'>
<param name='special-fields' value='all' />
<param name='target' value='Figure 8-60 thought 8-65' />
</command>
</action>
<action caption='Filter 2 (generated)' name='[Action2]'>
<activation auto-clear='true' type='on-select' />
<source dashboard='Figure 8-59' type='sheet' worksheet='Poor Filter Design' />
<command command='tsc:tsl-filter'>
<param name='special-fields' value='all' />
<param name='target' value='Figure 8-59' />
</command>
</action>
<action caption='Filter 3 (generated)' name='[Action3]'>
<activation auto-clear='true' type='on-select' />
<source dashboard='Figure 8-59' type='sheet' worksheet='Good Filter Design' />
<command command='tsc:tsl-filter'>
<param name='special-fields' value='all' />
<param name='target' value='Figure 8-59' />
</command>
</action>
</actions>
As you can see above code filter1 action got a param tag inside that target attribute is present, but the value present there is a dashoard name. What i want is target woksheet corresponded to the action filter.
Tried to play a bit with .twb file and got this for dashboard actions:
<actions>
<action caption='Filter 1 (generated)' name='[Action1]'>
<activation auto-clear='true' type='on-select' />
<source dashboard='Dashboard 1' type='sheet' worksheet='Sheet 3' />
<command command='tsc:tsl-filter'>
<param name='special-fields' value='all' />
<param name='target' value='Dashboard 1' />
</command>
</action>
<action caption='Filter 2 (generated)' name='[Action2]'>
<activation auto-clear='true' type='on-select' />
<source dashboard='Dashboard 2' type='sheet' worksheet='Sheet 2' />
<command command='tsc:tsl-filter'>
<param name='special-fields' value='all' />
<param name='target' value='Dashboard 2' />
</command>
</action>
<action caption='Filter 3 (generated)' name='[Action3]'>
<activation auto-clear='true' type='on-select' />
<source dashboard='Dashboard 2' type='sheet' worksheet='Sheet 3' />
<command command='tsc:tsl-filter'>
<param name='special-fields' value='all' />
<param name='target' value='Dashboard 2' />
</command>
</action>
</actions>
Honestly I couldn't find any direct link to the target sheet while source sheet is always available in actions, This can be observed in Actions window.
But I was able to see the actions that were mapped to target sheets if we go to the individual sheet actions instead of dashboard actions where we can see target as dashboard.
See below data where I have created a dummy dashboard to check actions.
These are the actions that created in report:
<group caption='Action (Product Category)' hidden='true' name='[Action (Product Category)]' name-style='unqualified' user:auto-column='sheet_link'>
<groupfilter function='crossjoin'>
<groupfilter function='level-members' level='[Product Category]' />
</groupfilter>
</group>
<group caption='Action (Product Sub-Category)' hidden='true' name='[Action (Product Sub-Category)]' name-style='unqualified' user:auto-column='sheet_link'>
<groupfilter function='crossjoin'>
<groupfilter function='level-members' level='[Product Sub-Category]' />
</groupfilter>
</group>
Along with this if we go to individual sheets then we can see the actions mapped first one is for Sheet 2 and other is for Sheet 3:
<filter class='categorical' column='[federated.0idnrl40bk56fg130xiy30dnljux].[Action (Product Category)]'>
<groupfilter function='level-members' level='[Product Category]' user:ui-enumeration='all' user:ui-marker='enumerate' />
</filter>
<slices>
<column>[federated.0idnrl40bk56fg130xiy30dnljux].[Action (Product Category)]</column>
</slices>
<filter class='categorical' column='[federated.0idnrl40bk56fg130xiy30dnljux].[Action (Product Sub-Category)]'>
<groupfilter function='level-members' level='[Product Sub-Category]' user:ui-enumeration='all' user:ui-marker='enumerate' />
</filter>
<slices>
<column>[federated.0idnrl40bk56fg130xiy30dnljux].[Action (Product Sub-Category)]</column>
</slices>
If we keep track of actions that were created in dashboards then we can easily tell what all sheets are joined in a dashboard using the name of the actions.
Would like to know your thoughts and observations aswell.
Changing the names of the actions
Going into the .twb XML and changing the order of the <> blocks.
Going into the .twb XML and changing the internal Action1, Action2, etc. names. Doing this I'm able to change which of Dashboard 2 and Dashboard 3 is opened.
adding a Web Page object to Dashboard 1 and then a URL action using about:blank as the target, on the idea that maybe URL actions take precedence over filter actions.

Sulu Pagebuilder: Add Multiple Types in a Collection

In Sulu cmf demo there is a sctionb where i can add multiple blocks.
I'd like to use this as "Pagebuilder".
I thought this block in my pages/default.xml will do the trick (and I think it is).
Do I need to clear any cache for this to work, or what am I missing?
<section name="content">
<meta>
<title lang="de">Inhalt</title>
<title lang="en">Content</title>
<info_text lang="de">Bereich für den Inhalt</info_text>
<info_text lang="en">Content Section</info_text>
</meta>
<properties>
<property name="article" type="text_editor" mandatory="true">
<meta>
<title lang="de">Artikel</title>
<title lang="en">Article</title>
</meta>
</property>
<block name="block"
default-type="editor"
minOccurs="2"
maxOccurs="10"
mandatory="true">
<meta>
<title lang="de">Block</title>
<title lang="en">Block</title>
</meta>
<types>
<type name="editor">
<meta>
<title lang="de">Texteditor</title>
<title lang="en">Text editor</title>
</meta>
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="de">Titel</title>
<title lang="en">Title</title>
</meta>
<tag name="sulu.content.sortmode.show"/>
</property>
<property name="article" type="text_editor" mandatory="true">
<meta>
<title lang="de">Artikel</title>
<title lang="en">Article</title>
</meta>
</property>
</properties>
</type>
<type name="textarea">
<meta>
<title lang="de">Texteingabe</title>
<title lang="en">Text area</title>
</meta>
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="de">Titel</title>
<title lang="en">Title</title>
</meta>
<tag name="sulu.content.sortmode.show"/>
</property>
<property name="article" type="text_area" mandatory="true">
<meta>
<title lang="de">Artikel</title>
<title lang="en">Article</title>
</meta>
</property>
</properties>
</type>
<type name="title_only">
<meta>
<title lang="de">Nur Titel</title>
<title lang="en">Title Only</title>
</meta>
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="de">Titel</title>
<title lang="en">Title</title>
</meta>
<tag name="sulu.content.sortmode.show"/>
</property>
</properties>
</type>
</types>
</block>
<property name="name" type="text_line" mandatory="false" minOccurs="2" maxOccurs="5">
<meta>
<title lang="de">Name</title>
<title lang="en">Name</title>
</meta>
</property>
</properties>
</section>
<property name="links" type="internal_links">
<meta>
<title lang="de">Verknüpfungen</title>
<title lang="en">Internal links</title>
</meta>
</property>
</properties>
If you do changes in a template file you need to clear the cache with the default symfony command:
app/console cache:clear
EDIT
Did test it Daniel Rotter is right on dev you don't need to clear the cache. Just refresh the page and it should show your changes.
Okay, after i logged off and signed in again, it works like expected.

How do I check if a file contains a string (using Nant)?

At the moment I'm calling findstr and storing the output in a property to check afterwards - I'm sure there must be a better solution.
<exec program="findstr.exe"
workingdir="${workspaceDir}"
commandline='/i /c:"someText" ${fileName}'
failonerror="false"
output="${coverageExcludeLog}"
resultproperty="foundFile"
/>
Is this really the best way of doing this?
<loadfile file="${fileName}" property="MyFileContents" />
<property name="Mystring" value="someText" />
<property name="search.file" value="${string::contains(MyFileContents, Mystring)}" />
<if test="${bool::parse(search.file)}" > <!-- true or false-->
<echo message="Found the string ${Mystring} in the file ${fileName}" />
</if>

Default components in install4j

When my "installation components" screen runs (I'm in console mode, if it matters), I get the list of components to install, as expected. However, the "default" response is to accept 2 of the components, even though their "Initially Selected for installation" option is false.
I want the user to be able to NOT select any of the optional components, and this isn't possible when it's defaulting to have some of them "Selected".
As far as I can tell, there are no varfiles being loaded.
Snippet from my install4j file:
<component name="A" id="527" customizedId="a" displayDescription="false" hideHelpButton="false" selected="false" changeable="true" downloadable="false" hidden="false">
<description />
<include all="false">
<entry location=".i4j_external_314/a" fileType="regular" />
<entry location=".i4j_external_2366/a" fileType="regular" />
<entry location=".i4j_external_316/a" fileType="regular" />
<entry location=".i4j_external_8155/a" fileType="regular" />
<entry location=".i4j_external_318/a" fileType="regular" />
</include>
<dependencies />
</component>
<component name="B" id="528" customizedId="b" displayDescription="false" hideHelpButton="false" selected="false" changeable="true" downloadable="false" hidden="false">
<description />
<include all="false">
<entry location=".i4j_external_316/b" fileType="regular" />
<entry location=".i4j_external_8155/b" fileType="regular" />
<entry location=".i4j_external_318/b" fileType="regular" />
</include>
<dependencies />
</component>
<component name="C" id="69" customizedId="c" displayDescription="false" hideHelpButton="false" selected="false" changeable="true" downloadable="false" hidden="false">
<description />
<include all="false">
<entry location=".i4j_external_316/c" fileType="regular" />
<entry location=".i4j_external_8155/c" fileType="regular" />
<entry location=".i4j_external_318/c" fileType="regular" />
</include>
<dependencies />
Notice that in all 3 components, "selected" is false, and "changeable" is true.
When the installer runs, though, here is how it is presented:
Which components should be installed?
*: D
*: E
1: A
2: B
3: C
Please enter a comma-separated list of the selected values or [Enter] for the default selection:
[1,2]
(D and E are fine - they're set to "selected" and "not user changeable")
So, even though A and B are not "selected", they show up as a default. Also notice that "C" is configured the same way as "A" and "B", yet doesn't show up in the default.
This is problematic, because I have no way to select "none" of the optional components. I have to select at least 1 in order to not accept the default.
Thanks for any info - if you need more detail, I'd be happy to provide it.

Formatting XML files in eclipse

When i try to format a xml file in eclipse it puts each of the fields on a new line. instead i want each property to be on one line. for e.g. now when i press CTRL+SHFT+F, eclipse formats it like this.
<hibernate-mapping package="com.server.entities">
<class
name="Branch"
table="Branch"
>
<meta attribute="sync-DAO">false</meta>
<id name="Id"
type="java.lang.Long"
column="id"
>
<generator class="native"/>
</id>
<property
name="Created"
column="created"
type="timestamp"
not-null="false"
length="23"
/>
<property
name="LastUpdated"
column="lastUpdated"
type="timestamp"
not-null="false"
length="23"
/>
<property
name="CreatedBy"
column="createdBy"
type="java.lang.Long"
not-null="false"
length="19"
/>
but what i want is
<hibernate-mapping package="com.kaizen.report.server.entities">
<class name="Branch" table="Branch">
<meta attribute="sync-DAO">false</meta>
<id name="Id" type="java.lang.Long" column="id">
<generator class="native"/>
</id>
<property name="Created" column="created" type="timestamp" not-null="false" length="23"/>
If you're using the XML Editor from eclipse.org, go tot he XML Editor preference page and change the options to allow much longer lines and to not split multiple attributes each onto new lines.