Using overlayButtons on FusionCharts with javascript links - fusioncharts

I would like to use a javascript function link such as 'link:j-myJS-data' for drill down type charts. I have everything working great to drill down but cannot figure out how to incorporate the overlayButton through the configureLink when drilling down. At present, I can drill down but cannot go back. Can anyone provide a basic example of how I may go about this? Is it even possible?
I thought I could add my own "Back" button to hande this as one option. I do not want to use a jsonURL as there is a lot of data and many paramertes need to be passed resutling in a long links and a lot of extra data in the JSON.
Thanks in advance.

There are multiple options available to create a drill-down chart with FusionCharts XT. Here is a table which explains all of them, with each one's syntax.
The method that you've used is the JavaScript function link. Using this one, you won't get an overlay button to go back to the parent chart.
The overlay button is available only when a LinkedChart is created.
So there are 2 ways that you could go about:
You could change all your charts to use the LinkedCharts technique. Here is a blog post detailing how LinkedCharts can be created using PHP + MySQL. If you aren't using PHP, the general idea shown still applies to any server-side environment.
You could create a separate button sitting near the chart, and this button would re-create the parent chart for you.

The button (which we call "overlay-button") can be made automatically visible using LinkedCharts alone.
However the overlay-button can be internally invoked using the charts' private API. Since these APIs are private, it may change between implementations and may not work as desired under certain circumstances. I would not recommend you to use this. If you are still interested in knowing more on this API, put in a comment and I will update this post.

Related

Is there a recommended way to implement a multi-step-Wizard in TYPO3?

TYPO3 is kind of new to me, but what I try (need) to implement is a multi-step-Wizard without a form, just a few buttons which lead to other buttons which then lead to specific pages. It should contain a back button and a step-indicator.
I first started to use html with vanilla JS but since the Wizard should support multi language I am a bit confused. Could it be better done with a own Extension? Use the Controller with Fluid?
Can you give me any tips on how I could tackle the problem in a good, TYPO3 manner way?
I tried it with vanilla JS and many if-else conditions. If button1 was clicked, set its style to none; and set the style of button2 to block; etc.
I tried it with a controller passing all the wizzard data to the view, use fluid to iterate and generate buttons.
But nothing seems to be a good solution. It all ends up with a bunch of DRY and hacky code.
Pretty much sounds like a "tab" element to me. You could go for the official introduction package or maybe the bootstrap package, that is the base for the introduction package.
https://extensions.typo3.org/extension/introduction
https://extensions.typo3.org/extension/bootstrap_package
With these packages as a base, you could easily implement something like this:
https://getbootstrap.com/docs/5.0/components/navs-tabs/#javascript-behavior
As you want that wizard in front end it is no specific TYPO3 problem.
There are elements in TYPO3 which are called 'wizard'. But that are forms to get some information to fill in a normal back end form field. That has nothing to do with the front end and the wizard you want.
For your solution it is necessary to analyse your requirements.
First: is the decision tree fix or may it vary sometime?
Second: how many decision levels do you have? how many endpoints do you have?
A small fix tree can be hardcoded.
If you expect changes or have lot of levels it might be better to have a flexible solution which gets called recursively.
This might include a hierarchical data structure to represent the decisions until you get an end point with an url to the final page.
The answer to the question about the amount of decisions might change the implementation:
If you only have a few decisions all data might be stored in the initial page and javascript only changes visibility or content of elements.
If you have a lot of data you might consider AJAX to get only small parts of data for the next decision from the server. repeating until you reach an end point with a final url.
In general:
have a data structure with something like:
ID
title/question
option1-text
option1-url / next node-ID
option2-text
option2-url / next node-ID
:

Reload a Tableau custom SQL DataSource (live) with a parameter = username() after a logout and login with a different user

I created a DataSource like this:
select sd.* from global_reporting.summary_drivers sd
join global_reporting.vw_row_level_security vrls
on vrls.company = sd.company
where vrls.company = SUBSTRING_INDEX(<Parameters.COMPANY_AND_USER>, '~~', 1)
and
vrls.username = SUBSTRING_INDEX(<Parameters.COMPANY_AND_USER>, '~~', -1)
The problem is that if I logout and log back in from a WebApplication that includes the dashboard into an iframe, the username() function changes correctly but the derived parameter does not change and so also the DataSource remains with the old data.
Parameters.COMPANY_AND_USER was set starting from a calculated field, from the username() function.
Questions:
Am I on the right path or is there a better or any other way to do that?
Since you are embedding your views in a web page, you can use the JavaScript API to fine tune how your view behaves or more tightly couple it with your web page
https://help.tableau.com/current/api/js_api/en-us/JavaScriptAPI/js_api.htm
For instance, you could tell your views to refresh data using the RefreshDataASync() function whenever the user changes.
I’d recommend using the <object> tag placed inside a <div> instead of the <iframe> tag for embedding your views, to get a bit more control.
https://help.tableau.com/current/pro/desktop/en-us/embed_code.htm
Tableau produced a very good quick tutorial about their JavaScript API that lets you get a very good idea of what it provides and how to use it that you can skim in about 5 minuets. Highly recommended. https://help.tableau.com/samples/en-us/js_api/tutorial.htm
All that said, you absolutely can use custom SQL for your data source, but I’d drop to that level only if you’re convinced the higher level features won’t work for you. If only for maintainability reasons.

confluence display content by user

I am trying to get specific content on a confluence cloud wiki to display content based on a specific user. The scenario here is that there are links on a page but only 1 should display, the one that displays is based on whom ever is logged in.
I have been told how a macro is the way forward, but I have read the documentation and I am at a loss. I do not understand what I have to do or how to write a confluence macro. could someone help me out with either an example or some links? I have searched like crazy, but maybe i am not asking the right questions but hopfully you can all help me out?
There's a plugin for this:
https://marketplace.atlassian.com/plugins/net.customware.confluence.plugin.visibility
But I'm not sure how thoroughly it hides the content. It might still be visible if users view the page source. If you're trying to hide content which needs to be really protected, you'll probably need to do something else.
Depending on how many users are going to be using the page, you could also just make separate spaces for them, add the permissions to those spaces, and then use a page-include on your "main" page to display the content. If they don't have access it shouldn't show up. You might experience some formatting issues with that solution, however.
Finally, you could grab the username with jquery and display stuff based on that. This solution will be pretty easy if you are familiar with javascript/jquery.
Edit: Here are some helpful resources on how to use javascript and jquery within confluence:
https://confluence.atlassian.com/display/CONFKB/How+to+Use+JavaScript+in+Confluence
https://developer.atlassian.com/confdev/confluence-plugin-guide/writing-confluence-plugins/including-javascript-and-css-resources

SugarCRM fetching data from outside REST service to subpanel

I'm trying to create subpanel in Account detail view where list of elements is fetched from external REST service.
I know how to define subpanel, but have no idea how to fill it with data from external network source. Was trying to use get_subpanel_data but there I can only change SQL.
Any ideas how can I do this?
When I've done this in the the past, at least with Sugar 6, I opted distinctly not to try to create a true subpanel. The data being loaded is coming from an outside source and is loaded dynamically with the page, so why present it as if it's static data coming from Sugar? Instead, I created a custom Smarty template to use as the footer on the detail page. For such an example, you can check how it works on the Calls Edit View. I think it's the footerTpl parameter in the detailviewdefs.php or editviewdefs.php. I loaded the smarty template by creating a custom detail view for my module, so custom/modules/MyModule/views/view.detail.php - extend the base Detail View class and override the display to feed Smarty new params, then your Smarty template only needs to iterate through and present the data that your view defined.
To be super-hip and abide by MVC, you could even put your custom code into your bean (if it's a custom module) or into a custom controller method, then reference that from the view.detail.php, and still feed it from there to the Smarty template.
Alternatively, you could just load JavaScript into the Smarty template and use the JavaScript to call the third-party service, parse and present it, etc.
I realize this question is a little bit old now however it comes up fairly often so why not provide an answer with a couple possible solutions. I won't get into code but more just into the design theory of how it can work. If someone needs more specific code help then that is another question.
A couple ideas...
As you mentioned you can define a custom Function which will load in Data to the SubPanel from your own SQL Query. That is one method that I just recently got to finally put to use after knowing about it for a good year and a half.
When you go this route, you are restrained to using the Columns in the SubPanel. I assume it is using the actual Metadata files to determine which Field Columns a SubPanel can use so you pretty much need your custom data in a Database table to have the same column names as the fields defined in the SubPanel Metadata.
Obviously this works great in the right situation, however not always and that leads us into the 2nd method I know of.
The other way is pretty much what #Mattew-Poer mentioned in his answer. It means abandoning the SubPanel altogether and instead generating your own HTML. This is by far my favorite and prefered way of doing it and I have been some really custom modules due to this being possible in a custom module! I will show an example below.
(Click HERE to View full size image)
In the screenshot, you can see in this example that I have something looking Similar to a SubPanel however it is not and is much for flexible and easy to customize.
Example, to the far left column in my fake subpanel is image checkboxes. When clicked on, an AJAX request is made to change the Task row Status.
After that, the checkbox image is updated to indicate the new Status state, the Modified DateTime is updated, the Status column has color background SPANS and is also updated with the correct text and background color when the left side checkbox is clicked.
Doing any of this with the standard SubPanels is a complete nightmare and would be difficult to do some of the stuff that you are open to do when you build your own version of a SubPanel.
With that said, I have built an identical clone of the above screenshot using SugarCRM default SubPanels! It was a nightmare. I could easily update the content and HTML in some of the columns. I even had the AJAX click checkbox image to update and do all the other updates I mentioned above. It wasn't too hard and worked fairly good but it had some issues.
When you do inline edit, inline create record, or subpanel paging to load different set of record. You would then lose all the custom HTML formatting that was applied. The reason is, in the SubPanel you are limited to using the After UI load logic hook. So since the "Page" is loaded already, when an AJAX request is made to add/edit the subpanel content or load a new set of items with the paging links. It only loads the SubPanel content on those events and the whole Page content does not reload. Because the logic hook only fires off 1 time after the page loads, this newly loaded subpanel data doe not receive any of your custom HTML formatting.
In my case, this means that nice looking colored background Status spans are lost, the image checkboxes are lost, and some other functionality is lost.
Now to get super technical, I could have gone another 3rd route and instead made new Custom Field Types for each SubPanel filed that I needed to apply custom HTML to. This process is super hard in my experience and in some cases it really isn't the BEST solution.
Because of the reason explained, this is why my new modules use the Custom HTML route to generate my own version of a custom subpanel or whatever Data is needed in my Module pages! So far it is working better than I imagined and has opened doors for me to build custom SugarCRM modules that I previously didn't even realize would be possible to build due to some of the issues I mentioned above. Now I bypass them altogether and open the door to do pretty much anything!
I've got some really cool stuff for SugarCRM in the works right now. If anyone has any questions feel free to ask in a new question or for me personally in a comment here.

How can I use the Inversion of Control concept in Sitecore to get non-page items to display themselves?

I have a number of non-page content items that are used as "callouts" on the side of pages throughout my website that I am building in Sitecore. Ideally I would like to be able to define the presentation information for these callouts independently. Then when a CMS author selects callouts for a particular page in the site, they know how to display themselves. I read an excellent blog post about how to do this here: http://www.awareweb.com/AwareBlog/InversionControl2.aspx. I used the first method that he describes in the post.
However my implementation of that code doesn't completely work. It seems to get the correct rendering and it iterates properly through the selected non-page callout items. But when it displays them on the page it seems like the callout items are still using Sitecore.Context.Item as their source item and not the source item that was passed in to them via the strDataSource variable as seen in the example code.
Do I have to do anything special in the code behind for the sublayouts for the callouts to tell them not to use Sitecore.Context.Item and instead to use the source item that was passed in? Otherwise I can't figure out why it's not working. Any ideas?
Thanks,
Corey
Setting the DataSource in a sublayout doesn't explicitly set the Context.Item to a different value, it just sets a property in a sublayout that it can use itself.
Rather than write up the solution again, John West's blog already covers this subject here, so I'd recommend you read that - http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2010/11/How-to-Apply-Data-Sources-to-Sitecore-ASPNET-Presentation-Components.aspx
I would recommend using the SublayoutParameterHelper Shared Source library which provides a Helper and a base class to use with your sublayouts for accessing the Item represented by an ID set in the DataSource; John also cites this library in his blog post.