Spotfire WebPlayer - Retrieve list of library analyses - javascript

I'm creating a Spotfire/JavaScript mashup and I'd quite like the user to be able to select the most appropriate visualisation/analysis from a dropdown list.
However, I'd rather not hard-code the list of analyses, I'd prefer it if there was some way to programmatically poll the webplayer application and get back a list of analyses in the webplayer library. There doesn't seem to be anything obvious in the API.
How would I go about doing this?

The Spotfire Library appears to be implemented as several tables in the Spotfire database with "LIB" prefix.
We can retrieve relevant analysis meta data from the Library with something like following query, for example:
SELECT LIB_ITEMS.TITLE,LIB_ITEMS.DESCRIPTION,LIB_ITEMS.CONTENT_SIZE
FROM LIB_ITEMS
WHERE LIB_ITEMS.ITEM_TYPE = (SELECT LIB_ITEM_TYPES.TYPE_ID FROM LIB_ITEM_TYPES WHERE LIB_ITEM_TYPES.LABEL = 'dpx')
ORDER BY LIB_ITEMS.TITLE ASC
Hope this helps. :)

Related

Get list of users from Domino Directory in JavaScript [duplicate]

I'm aware that the SSJS version of #DbColumn() has the same 64k limitiation as the original Formula language version. So up until now I used NotesView.getColumnValues() instead, believing that here I wouldn't face such a limitation.
Which obviously is wrong as an urgent support call yesterday tells me, as well as this crash report by IBM.
The code in question is used to populate the selectItems control in a comboBox; opening the page hosting the comboBox crashes the server's http task and then in consequence the entire server:
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:database.getView("vwInvBySupplier").getColumnValues(0);}]]>
</xp:this.value>
</xp:selectItems>
This is looking up all category entries from a view. I'm using the combo as a dynamic category filter to the view displayed on the same page.
What alternatives are there to retrieve the complete list of all category entries from the view, even if the data retrieved exceed 64k?
Sidenotes:
I'm fully aware that showing over 2000 entries in a comboBox might not be a convincing usability concept for some, but the customer loves to be able to see all available entries in one place, and then being able to select from that list. At least the standard solution with a view panel full of category entries, twisties, and the need to step through numerous pages is not a solution.
The application is running on Domino 9.0.1, WinSrv 2008/64k
Luckily, an JavaScript array is not limited to 64K.
Create an array var values = [];,
"walk" through view with view navigator and add entry values to array
with values.push("new value"),
return values

live HTML table source updated by multi user

sorry for the strange question but I've been stuck on this for a few days now....
We're trying to connect all of our sales from multiple locations, and query our warehouse quantity.
Unfortunately it's too close to Christmas to be able to make POS software upgrades, so I've been tasked with writing the middleware.
Currently, I'm copying all .mdb from all shopfronts, running linq to join warehouse quantities and auto generating a HTML table all in VS Win Forms and C#.
So, What I'm wondering is, where should I go from here?
Ideally I'd love the final result to be a webpage with an interactive table in which users can remove/hide rows (once item is picked), export final results picked/non picked and have all this accessed simultaneously and live updated on tablet pc by multiple users who are picking.
I've tried the jQuery DataTables plugin but unless I'm incorrect it doesn't support simultaneous editing and have tried everything. (I'm very new to jQuery).
If someone could please point me in the right direction, even if it means I should change database types like sql, use php, or even use carrier pigeons etc they will be my hero!!!!

How can I show recent searches done through a textbox using JavaScript/jQuery?

What I want to achieve is that when I focus on the search bar, it should show me a list of recent searches done during this session and I should be able to select one of them and it should appear on the textbook.
Any help appreciated. If possible I woul like to store these recent searches data to browser cache so that whenever I reach this website it should show me the list.
Thanks in advance.
Assuming you will be using a web based language like html or JavaScript, a good start would be to store each search in an array.
using javascript along with the jQuery library you can easily add items to an array each time a user clicks a button.
JavaScript:
var myArray = [];
myArray.push($('#yourTextBox').val());
Then you could use jquery's $.each function to display each item in a DOM element.
See the sample below: (I used HTML and javascript with jquery 1.11)
http://jsfiddle.net/1ncf0b6f/3/
TL;DR I've written a library to handle this + it's edge cases, see https://github.com/JonasBa/recent-searches#readme for usage.
You should store the recent searchees in LocalStorage and retrieve them, then decide on your implementation on how you want to render them. This obviously has some edge cases that you need to consider, which is why I wrote a library to do exactly this, see below examples
Examples
Expiration:
Consider that someone searches for a query iPhone, but has looked for a query repairing iPhone 1 month ago, that repairing iPhone query is likely obsolete.
Ranking of recent searches
Same goes for ranking when doing prefix search, if a user has made a query "apple television" 3h ago and a query "television cables" 8h ago, and they now search for "television", you want to probably implement a ranking system for the two.
Safely handling storage
Just writing to LocalStorage will result in a massive JSON that you'll need to parse every time, thus gradually slowing down your application until you hit the limit and loose this functionality.
I've built a recent-searches library which helps you tackle all that. You can use it via npm and find it here. It will help you with all of the above issues and allow you to build recent-searches really quickly!

Query and Update fusion table via HTML form?

I'm pretty new to google maps and fusion tables. I was wondering if it is possible to return queried information from a fusion table and write it into a page using something like innerHTML. Also, I would like to be able to update a fusion table using a standard HTML form. Is this possible and if so can you point me in the right direction? I've been searching around with no results, but it might just be that I don't know how to pose the question. Let me explain as best I can what I'm looking for:
I have a google map with a kml polyline layer. I would like to be able to enter a query into an HTML form (for instance a range of dates, a feature ID, etc.) or click a line feature that has an ID that corresponds to an ID in a fusion table, and run a query that would return the attribute data for the corresponding table entry. Note that the fusion table has no geocoded information, I am just using it as a spreadsheet (I think I understand that fusion tables are easier to query/access than google spreadsheets, but please correct me if I'm wrong).
The form input is pretty self-explanitory - I would just like to be able to enter some info into a form and create a new row in a fusion table.
Thanks in advance for the help/smackdown (whichever it may be)!
Mike
"I want to be able to write the attribute information into the page below my map (using innerHTML)."
This is definitely possible using the "undocumented" Fusion Table JSNOP API. I've used this approach often. I described it in this answer and posted several examples as well: https://stackoverflow.com/a/9778985/1211981
As Odi explained, updates/inserts from the browser are more complicated.
There are several possible solutions to your use case. I suppose you want to a JavaScript-only solution which runs in the browser with no server side code.
To display data from a Fusion Table on Google Maps you should use the FusionTablesLayer, which makes this task really easy and straightforward. There are good examples from Google, e.g. how to change a query using a form or create custom InfoWindows (which would be the preferred way to show data corresponding to what is clicked on the map). If you don't want to care about authentication, just make your tables public, then it should be easy to adapt the examples to your tables.
Another thing is to write data to Fusion Tables: it's not that easy, because here you must care about authentication, see the OAuth guide for detailed information. But at the moment it is not possible to write data directly from the browser to the Fusion Table. But there is hope: With the new Trusted Tester API you can actually do it, but you have to join this group before you can start.
If you can't / don't want to use the new API, consider the server-side approach that I explained here using a script to relay your requests.

Where can I find a screening tool similar to what is used by the Google Stock Screener?

I'm looking to create or find a screener tool similar to this that will read through the records in a database, allow you to select the criteria, create a histogram of said records and criteria, and allow the user to sort and filter through the data, just like the Google Stock Screener.
How would I go about creating something like this or is there somewhere that I could find a plug-in that would allow this? Thanks.
I think Flot would be a good javascript library to try for this. I've used it to display share market data in the past and it deals with time series data fairly well. It's not very hard to add interactive elements.

Categories

Resources