finding target worksheet for action in twb (xml) file - tableau-api

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.

Related

Stop log4net (or services) using a file when errors are not being placed in it

I have the following log4net config
<?xml version="1.0" encoding="utf-8" ?>
<log4net xmlns="urn:log4net">
<appender name ="RollingFile" type="log4net.Appender.RollingFileAppender">
<file value="C:\temp\Generator.log" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maximumFileSize value="500KB" />
<maxSizeRollBackups value="10" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{DATE} %level %thread %logger - %message%newline" />
</layout>
</appender>
<appender name ="GenerationErrors" type="log4net.Appender.FileAppender">
<file type="log4net.Util.PatternString" value="c:\temp\GenerationErrors.log" />
<appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date{DATE} %level %thread %logger - %message%newline" />
</layout>
</appender>
<root>
<appender-ref ref="RollingFile" />
<level value="INFO" />
</root>
<logger name ="GPA.Module.Generate">
<level value="INFO" />
<appender-ref ref="GenerationErrors" />
</logger>
<logger name="PmuManagement">
<level value="INFO" />
<appender-ref ref="GenerationErrors" />
</logger>
</log4net>
The first appender logs all errors for all of my processes and the second only logs a certain group of errors, as required.
I need to be able to delete the contents of the second log file on the fly however this isn't currently possible as the programme needs constant access to it to run (if you try and make any changes you get the "this file is in use by another programme" error.
Is there a way for log4net to only need access to the file when errors need to be written to it?
Or is there a more generic way to stop services/programmes needing access to file temporarily and allowing access again shortly after?
Thanks
I found this question here Intermittent log4net RollingFileAppender locked file issue and the answer is what I needed. I simply added <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> to my second appender.

What's wrong with my trace compass analysis?

I've generated an event stream with an lttng-ust, using the header file, contatining the following event declaration:
TRACEPOINT_EVENT(
random_chart,
point,
TP_ARGS(
int, value_arg
),
TP_FIELDS(
ctf_integer( int, value, value_arg )
))
After successfully opening it in a TraceCompass, I've tried to write an analysis with an XYChart, showing this value stream as a simple plot. My XML file contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<!-- The state provider assigns states from events -->
<stateProvider id="org.eclipse.linuxtools.ust.random_chart" version="1">
<head>
<traceType id="org.eclipse.linuxtools.lttng2.ust.tracetype" />
<label value="Value chart analysis" />
</head>
<!-- Event handlers -->
<eventHandler eventName="random_chart:point">
<stateChange>
<stateAttribute type="constant" value="Dummy" />
<stateAttribute type="constant" value="Value" />
<stateValue type="eventField" value="value" />
</stateChange>
</eventHandler>
</stateProvider>
<!-- This is the definition of the XY chart view -->
<xyView id="my.test.xy.chart.view">
<head>
<analysis id="org.eclipse.linuxtools.ust.random_chart" />
</head>
<entry path="Dummy/Value">
<display type="constant" value="Value" />
<name type="self" />
</entry>
</xyView>
I can't see what's wrong with it (even after reading all the related xml-schema files in a git-repository).
I can import this successfully, but after clicking on an 'XML XY Chart View' I see an empty plot and a single (last in the event stream) value under the 'type filter text'.
AFAIK the 'State System Explorer' shows me correct 'Value at timestamp' corresponding to the 'Full attribute path' equal to 'Dummy/Value'. Probably I miss something.
EDIT1: I've tried to fix, but still have no luck:
<entry path="Dummy"> <display type="constant" value="Value" /> <name type="self" /> </entry>
EDIT2: Same problem with:
<entry path="Dummy/Value">
<display type="self" />
<name type="self" />
</entry>
You have 2 possibilities to fix the problem, given that you have only one attribute with data:
1- Change the <entry path="Dummy/Value"> to <entry path="Dummy"> and keep the rest
or
2- Keep your entry and change the display element to <display type="self" />
A display of type constant means it tries to read an attribute of that name under the main path, so here, it was trying to read "Dummy/Value/Value", which doesn't exist
EDIT: Here's a working example of the view part for your analysis:
<xyView id="my.test.xy.chart.view">
<head>
<analysis id="org.eclipse.linuxtools.ust.random_chart" />
<label value="Random view" />
</head>
<entry path="Dummy">
<display type="constant" value="Value" />
<name type="self" />
</entry>
</xyView>

Teamcity meta-runner with multiple runners - exiting a runner without failing the build

OK, so here's a TeamCity meta-runner with 2 separate runners inside. Essentially the first runner will have a bunch of logic in it that determines if a deploy should occur or not.
<build-runners>
<runner name="Step 1" type="jetbrains_powershell">
<parameters>
<param name="jetbrains_powershell_bitness" value="x86" />
<param name="jetbrains_powershell_execution" value="PS1" />
<param name="jetbrains_powershell_minVersion" value="4.0" />
<param name="jetbrains_powershell_script_code"><![CDATA[
#Bunch of powershell logic here... under some conditions we want nothing deployed
#Now I want to exit the whole build step, not just this single runner
Exit #<- Fails the whole build, not what I want
]"]]></param>
<param name="jetbrains_powershell_script_mode" value="CODE" />
<param name="teamcity.step.mode" value="default" />
</parameters>
</runner>
<runner name="Deploy Project" type="octopus.deploy.release">
<parameters>
<param name="octopus_additionalcommandlinearguments" value="" />
<param name="octopus_deployto" value="%Octopus.EnvironmentName%" />
<param name="octopus_host" value="%system.Octopus-ServerUrl%" />
<param name="octopus_project_name" value="%ProjectName%" />
<param name="octopus_releasenumber" value="%ProjectRelease%" />
<param name="octopus_version" value="3.0+" />
<param name="octopus_waitfordeployments" value="true" />
<param name="secure:octopus_apikey" value="123123" />
<param name="teamcity.step.mode" value="default" />
</parameters>
</runner>
</build-runners>
What is a way I can exit the whole meta-runner step so it continues just fine with the next build step?
Response from vendor:
"It seems there is no clean way to skip remaining meta-runner steps without affecting build (successful) status. If you do not mind settings build to failed, you can try Execute "If all previous steps finished successfully" in the meta-runner steps to skip."
While the meta-runner feature is quite good in TeamCity, it does have its limitations.

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.