how can we customize graphite to support xml format? - graphite

graphite support json and csv, but how we customize it to support other formats,
this works example:
10.1.2.15:8080/render?target=testing1.counters.hello.rate&format=json&from=-5min
10.1.2.15:8080/render?target=testing1.counters.hello.rate&format=csv&from=-5min
i want to get a xml report by passing the format like below, is it possible?
example:
10.1.2.15:8080/render?target=testing1.counters.hello.rate&format=xml&from=-5min

Maybe you should ask the project themselves and file an issue or better Pull Request providing the required functionality if it's currently missing from this open source project.

Write a wrapper. Here is the discussion on adding a custom API end to Graphite.
https://answers.launchpad.net/graphite/+question/147349

Related

What is "dlta" and "ridlist" parameters used in Requests library (Python)

Guys I am working on getting data as tables from QuickBase using Requests library (Python). I found somebody doing it using the URL of the report, but he added two parameters to the URL like that:
&dlta=xs%xx&ridlist=xxxx.
Can anybody please tell me what are those two parameters, I searched for them in the internet but found nothing related to them.
I've been using Quickbase for over ten years and haven't seen documentation for either of these parameters. I have noticed that ridList seems to be used by Quickbase's grid edit view of reports (I suspect it's an ID for a server-side cached list of record IDs to display especially when using the type-ahead search of a report before choosing to grid edit) and dlta is used in the "Download report as CSV" button.
That example you're following may have simply copy and pasted a link generated by Quickbase as a hack to get a CSV instead of XML response. I recommend following the Quickbase HTTP API Reference instead. If you don't want an XML response, Quickbase also has a JSON RESTful API which may be easier to work with.

aikau - implement export search results functionality

I have recently started developing with aikau in alfresco share.
I want to achieve a functionality wherein I can export search results to a CSV file.
For that, I can change the back-end repository web script to return csv data.
Now, At alfresco share end - I was successfully able to show the export link by adding a new widget to FCTSRCH_TOP_MENU_BAR. I used alfresco/renderers/PropertyLink to display this link. Now, the missing part for me is - how can I invoke the search web script passing additional param format=csv and alongwith that pass all the query parameters used to retrieve the results.
I am stuck with that. If I use the publishTopic as ALF_CRUD_GET_ALL and provide the URL there then it invokes the sample web script (I created to return sample csv response) and returns the response. However, the csv doesn't come as downloadable response. I am stuck here in order to how to achieve export csv functionality for search results.
It would be great if any of you can help me here and provide your guidance/suggestions.
This blog post provides an example on how you can custom the search page in Share. Although it specifically addresses changing the search queries the basic extension approach is more or less that same in that you will want to change the data that is used to send an XHR request. I think that the major difference here is that you may need to do more in-depth updates to the service - in particular with regards to the switch statement that is used to build the advanced search query object.
If you have extended or replaced the default search REST API then I would expect that you will need to call the same URL, but if you have provided an entirely new REST API to return the CSV data then you'll also need to change the URL that is used by the service.
In terms of providing a link for downloading the content we have previously implemented something in the DragAndDropModelCreationService (see the generateDownload function) but this only works with Chrome due to security limitations and the generation of files to download.
Your best bet may be temporarily store the CSV content on the repository in a hidden location and then use the standard download links to allow it to be downloaded - this would be more complex but would provide better cross browser support. Something similar is done for the "Download as ZIP" action.
OK, with the extra information provided I would do the following...
The information on the process of adding widgets to the search page are quite well detailed here (although you're not adding a view, you can follow the approach to add a new PropertyLink after the widget with the id "FCTSRCH_RESULTS_COUNT_LABEL").
The approach I would take would be to include an additional custom service on the page that subscribes to the "ALF_RETRIEVE_DOCUMENTS_REQUEST_SUCCESS" topic (which is published on a completed search). It should save the the search response in a variable in preparation for users clicking on the PropertyLink.
This custom service should also subscribe to a topic that is published by the PropertyLink (called say "DOWNLOAD_CSV"). This custom service could then generate a file download using the approach described in my previous answer using the CSV data that will have been provided in the payload. As I said though, this may only work with some browsers due to security reasons.
If your custom search WebScript were able to store the CSV data as a node on the Repository then you could just provide a the NodeRef of the CSV data in the search response and the PropertyLink could just publish the "ALF_DOWNLOAD" topic for the DocumentService to handle the download.
Trying to generate a file to download on the client side is going to be an issue for most browsers I think.

Convert InputStream to Mediaplayer

I use android platform . I have file in InputStream Datatybe , I want to convert it to MediaPlayer and play it
I have two suggestions for you:
Get the entire input into a properly formatted file, and pass that file to MediaPlayer. You're going to have to figure out if your data is formatted properly and how to format it.
Instead of using MediaPlayer, use MediaCodec (http://developer.android.com/reference/android/media/MediaCodec.html) where instead of passing a file or a link you're passing the data itself. With this solution, you're going to have to figure out if you're passing the data properly to Media Codec, but I suspect this is the solution you're looking for. The google documentation does have an example to get you started a bit.
Good luck to you!
What is the format of the data? MP4?
If it is a standard container like MP4 and is a file accessible as a URI in local filesystem (file://) or network (http://) then you should use Google's ExoPlayer library, with demo code here.
I would only resort to using MediaCodec if you have a custom container or transport mechanism.

Can I do data visualization with Drupal?

Basically i want it to import data from a SQL database and Display it as graphs. Having said that i also want it to be dynamic,responsive as in the users should have filtering options. Any leads would be definitely helpful.
Please note that i am just a beginner with drupal.
Yes, But I recommend you to work on your own framework. Or even you can use some data visualization framework
Maybe this one is useful for you if you want to do it on your own:
http://www.sitepoint.com/twelve-javascript-libraries-data-visualization/
Why do you need Drupal for that?
I would make some PHP script which would read SQL and generate image out of that data, by using GD or ImageMagic lib. I guess you know that PHP can shoot out image file header and dynamically generate image, on fly. That PHP script could also read filter parameters to have influence on generated image.

Update RSS from another XML file?

Hey. I am quite new to the whole web development/programming. I am trying to create an RSS feed which gets info from a separate XML file.
I know basics about XML and RSS, but I don't know how to make it updade. Lets say I update the XML then how would the RSS update automatically? Can someone maybe put me on the right track? Thanks in advance.
In which programming language do you want to accomplish this? One way would be to run a program that does some XML parsing and writing, e.g. PHP with SimpleXML and running the script as a cronjob.
[Edit:]
You could use LINQ to XML for that in ASP.NET, it is easy to use, just look at tutorials like Using LINQ to XML or
Introduction to LINQ - Simple XML Parsing

Resources