Tableau not loading custom color palette - tableau-api

I have edited Preferences.tps file from my tableau repository to add following code -
<?xml version='1.0'?>
<workbook>
<preferences>
<color-palette name="My Custom Palette" type="regular">
<color>#75787B</color>
<color>#A7A8AA</color>
<color>#BBBCBC</color>
<color>#B7C9D3</color>
<color>#C6BCD0</color>
<color>#E4D77E</color>
<color>#D9C89E</color>
</color-palette>
</preferences>
</workbook>
Upon restarting the Tableau, I still can't see my color pallet in there. I tried searching online for possible solutions and have even replaced the code with custom codes available online. No luck though!

For continuous/ordered data, the type of the color palette would need to be "ordered-sequential" or "ordered-diverging".
See the link below for more info about creating a custom palette and with examples of various types.
https://onlinehelp.tableau.com/current/pro/desktop/en-us/formatting_create_custom_colors.html
For example:
<?xml version='1.0'?>
<workbook>
<preferences>
<color-palette name="My Custom Palette" type="ordered-diverging">
<color>#75787B</color>
<color>#A7A8AA</color>
<color>#BBBCBC</color>
<color>#B7C9D3</color>
<color>#C6BCD0</color>
<color>#E4D77E</color>
<color>#D9C89E</color>
</color-palette>
</preferences>
</workbook>
Ordered-diverging above produces:

If there are multiple versions of Tableau installed, try testing the custom colors on default one. it works.

Related

SAPUI5 Custom Launchpad Tile: Chip definition with Component

I'll add a custom tile for my Fiori Launchpad. More precisely, I like to use a component instead of a view in my Chip Definition File. The reason why is getting the option for eg. load my own I18n or CSS files.
The Chip definition is descriped here. On your Server you can find a description by using this URL: http://:/sap/public/bc/ui2/services/sap/ui2/srvc/chipdefinition.xsd
The chipdefinition.xsd from your own server provides the option loading a custom tile by Component and not by View. The specific tag can be found under: chip => implementation => sapui5 => viewName or componentName.
I would like to use "componentName" instead of "viewName" but I can't find a dokumentation for this specific usage. Does anybody know how to add your own Path/Namespace to access the component.js?
The usage by using "viewName" is descriped as follows: "The viewName comprises package path, the name of the view and the file extension, for example tests.sample.Myview.view.xml." But this syntax doesn't work for "componentName"
Thanks for your Help!!
Jimboh
You could try to implement the tile as SAPUI5 Components.
Instead of a SAPUI5 view (sap.ui.core.mvc.View), try using a component by specifying the component's name instead (sap.ui.core.UIComponent). Note that this refers to the folder where SAPUI5 expects a Component.js file to be found.
/hana/sap/hba/apps/kpi/WebContent/KPITile/resources/Kpi.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2013 SAP AG, All Rights Reserved -->
<chip xmlns="http://schemas.sap.com/sapui2/services/Chip/1">
<implementation>
<sapui5>
<basePath>../../../../../../..</basePath>
<componentName>sap.hba.apps.kpi.WebContent.KPITile.resources</componentName>
</sapui5>
</implementation>
</chip>

Stop Umbraco 7.2.8 tinyMCE editor removing script tags

I've been trying to stop the latest version of Umbraco's tinyMCE editor from automatically stripping any script tags. This was working fine some months ago. Umbraco has not been updated to my knowledge.
I have tried a number of solutions, mostly summed up in this thread: https://our.umbraco.org/forum/using/ui-questions/48866-RTE-not-updating-to-show-new-HTML-tags-in-Umbraco-7
I have edited umbracoSettings.config
<content>
<TidyEditorContent>False</TidyEditorContent>
<errors>...
And have allowed all in validElements in tinyMceConfig.config
<validElements><![CDATA[*[*]]]></validElements>
Finally I changed wed.config in order to force Umbraco to reload.
I still cannot get the script tags to save?
Any suggestions appreciated.
First off, This Is A Very Bad Idea (tm) - don't do it - you'll open it up to all sorts of problems.
The better way to do it is develop a macro that takes a block of text as a parameter, and make that macro useable in the Richtext Edit control.
Your Macro Script can then render the input any way you want, including using script tags (which probably should be part of the macro script). This way you have complete control over what's rendered.
I know this is old but this works on all versions of 7+
To enable javascript to be added to the editor you need to change the following.
You need to replace some of the configs in the config > tinyMceConfig.config file
<![CDATA[+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|
ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],
-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],
img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],
-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],
-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],
thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],
-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],
-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],
-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],
dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],
param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],script[language|type|src]]]>
</validElements>
<invalidElements>font</invalidElements>
<!-- this area is for custom config settings that should be added during TinyMCE initialization -->
<customConfig>
<!-- <config key="myKey">mySetting</config>-->
<config key="entity_encoding">raw</config>
<config key="codemirror">
{
"indentOnInit": false,
"path": "../../../../lib/codemirror",
"config": {
},
"jsFiles": [
],
"cssFiles": [
]
}
</config>
<config key="allow_script_urls">true</config>

Populate extension point's element attribute during runtime

Here is my use case. I have an Editor that different plugins can use to display their data. These plugins can create (with intervention from user - wizards) different files that Editor can accept: .p1, .p2, etc. Each plugin contributes file extensions of files that it produces and this data is available via custom extension point. I need a way, if possible to "inject" this data into org.eclipse.ui.editors extension point's extensions attribute.
One way I was thinking about doing this is in a plugin that is called early enough collect file extensions from all plugins that use my extension point and write these values into plugin.properties file's key like supportedFileExtension and extension point org.eclipse.ui.editors will in turn consume this file:
<extension
point="org.eclipse.ui.editors">
<editor
class="MyEditor"
contributorClass="MyActionBarContributor"
default="false"
extensions="%supportedFileExtensions"
id="my.com.editor"
name="My Editor">
</editor>
I also saw class ExtensionParameterValues which is something I can possibly use, but for developer who might want to reuse this little mechanism, it might not be obvious enough what's going, especially when extensions attribute would be empty when using ExtensionParameterValues class. Of course I can put this in documentation, but who reads that, right? :)
Perhaps I am overlooking something simple and there is an easier way to do what I am trying to accomplish?
Rather than using extensions directly you can Eclipse Content Types to do this. First define a base content type:
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
id="contenttype.base"
name="Base content type"/>
Then your different plugins can define a content type for their file extensions using a a content type derived from the base type:
<content-type
base-type="contenttype.base"
file-extensions="p1"
id="contenttype.p1"
name="P1 content type"/>
<content-type
base-type="contenttype.base"
file-extensions="p2"
id="contenttype.p2"
name="P2 content type"/>
For your editor don't specify any extensions, instead use the contentTypeBinding for the base type:
<extension
point="org.eclipse.ui.editors">
<editor
class="MyEditor"
contributorClass="MyActionBarContributor"
default="false"
id="my.com.editor"
name="My Editor">
<contentTypeBinding
contentTypeId="contenttype.base"/>
</editor>
The editor will now be used for all content types based on the base content type.

Creating a working copy for Plone 4 custom content types

I have created a custom Plone content type in my package i.e. my.product.
I am in need of integrating a working copy support: so that a "published" document (in my case, a published content type) stays online while it is being edited. Basically, I want to take advantage of 'Working Copy Support (Iterate)' provided by plone.app.iterate to achieve what is explained here. This will provide me with ability to check-in/check-out my changes.
Is this possible in Plone 4 with custom content types using Archetypes? How would one go about it if yes?
I added the following two files inside my.product/my/product/profiles/default folder and it appears to work:
diff_tool.xml
<?xml version="1.0"?>
<object>
<difftypes>
<type portal_type="MyCustomType">
<field name="any" difftype="Compound Diff for AT types"/>
</type>
</difftypes>
</object>
repositorytool.xml
<?xml version="1.0"?>
<repositorytool>
<policymap>
<type name="MyCustomType">
<policy name="at_edit_autoversion"/>
<policy name="version_on_revert"/>
</type>
</policymap>
</repositorytool>
I have never used plone.app.iterate, but this is the generic approach how to solve the problem.
Actions are installed by plone.app.iterate GenericSetup profile. You can see actions here:
https://github.com/plone/plone.app.iterate/blob/master/plone/app/iterate/profiles/default/actions.xml
Pay note to the line *available_expr* which tells when to show the action or not. It points to helper view with the conditition.
The view is defined here
https://github.com/plone/plone.app.iterate/blob/master/plone/app/iterate/browser/configure.zcml#L7
The checks that are performed for the content item if it's archiveable
https://github.com/plone/plone.app.iterate/blob/master/plone/app/iterate/browser/control.py#L47
Most likely the failure comes from if not interfaces.IIterateAware.providedBy condition. Your custom contennt must declare this interface. However, you can confirm this putting a pdb breakpoint in checkin_allowed(self) and step it though line-by-line and see what happens with your content type.

Eclipse plugin development: how to add functionality to editor

I have been trying there last days to extend the default editor (java, xml, all of them) functionality,
what I want to do is add a big ruler with text on the side of every editor.
example:
a default editor page looks like this:
|-----------|
|source |
|code |
| |
|-----------|
but i want it to be like this
|------|----|
|source| |
|code |line|
| |text|
|------|----|
also i can't use a view because the text in my ruler corresponds to a certain line and has to scroll along with the source code.
I have tried to do this by implementing IEditorActionDelegate
since I don't want a new editor, but to add functionality, but I could not find any solutions.
Wanted to mention that for putting my solution in practice i extended AbstractContributedRulerColumn
public class MyRuler extends AbstractContributedRulerColumn {
....
}
Arne's answer gave some good suggestions, but it still took me a while to figure out how to write a plugin that adds a column of text next to the editor.
I published a sample that just displays line numbers with an "x" after each line. Some useful resources I found along the way were:
Introduction to plugin development
Eclipse extensions and extension points
LineNumberColumn example that is really just a small amount of code that delegates to LineNumberRulerColumn buried in a bunch of compatibility stuff.
I think you are after the extension point org.eclipse.ui.workbench.texteditor.rulerColumns. The component that displays the line numbers in text editors is added using this point, so it should be possible to add other information, too.
Example from the API doc:
<extension
point="org.eclipse.ui.workbench.texteditor.rulerColumns">
<column
id="org.eclipse.ui.editors.columns.linenumbers"
name="Line Numbers"
class="org.eclipse.ui.internal.texteditor.LineNumberColumn"
enabled="false"
global="true"
includeInMenu="false">
<placement
gravity="0.9">
<after id="org.eclipse.ui.editors.columns.annotations"/>
</placement>
<targetClass
class="org.eclipse.ui.texteditor.AbstractDecoratedTextEditor">
</targetClass>
</column>
</extension>
After working with the ruler columns extension point for a while, I learned about the org.python.pydev.pydev_pyedit_listener extension point that lets you intercept the PyEdit creation event and wrap other controls around it. Some digging in the SWT widget reference let me add another pane on the right with a splitter, and I published a sample project. The main advantages are that you can choose where the new display appears, you can use any controls you like, and the user can scroll if there's too much text to fit in the display.