Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I know that I can embed a CDF file inside a web page by using:

  1. The embed tag.
  2. An object tag with an embed tag inside (better than 1).
  3. Using the JavaScript provided by Wolfram (better than 2).

My question is how can I pass some data to the CDF file. In the case of Flash, there is a flashvars attribute precisely for this, but I can't find the equivalent for this in Wolfram's CDF deployment documentation.

I need this because I plan to embed a CDF in a set of pages that are similar but each for a different set of data. And I want to generate a single CDF for all of them.

If this is not possible in this direction, I would be interested in knowing about solutions in the opposite direction: reading the DOM from the CDF file as this would solve my problem too.

share|improve this question

3 Answers 3

up vote 9 down vote accepted

You cannot import data to a web embedded CDF:

http://www.wolfram.com/player-pro/how-player-pro-compares.html

...that is to say in principle you can't. However if you read this thread:

Deploying Mathematica Content Online

you will note that @Jens demonstrated that it was possible to import data from a URL. However after investigating this I was told by Wolfram that this was a bug that will be closed in future builds so you cannot rely on this.

share|improve this answer
    
Thank you. I guess I will need to use webMathematica, but this will put more workload on the server to generate over and over almost the same CDF file. In this particular area Flash has an advantage. –  Gustavo Delfino Mar 19 '12 at 2:20
1  
With the release of Mathematica 9 URL importing is a free CDF feature. Please see @AndreKuzniarek answer for details. –  Vitaliy Kaurov Dec 6 '12 at 18:50

With Version 9, CDF Player is officially supporting import via URL. This is currently the only way to bring any data into a web embedded CDF or notebook, regardless of license level. Other methods are being explored, particular for exchanging data with the surrounding DOM. Stay tuned for more information on this to come.

Please consult the following table for an updated comparison of FreeCDF vs. Enterprise/Player Pro vs. Mathematica functionality:

http://www.wolfram.com/player-pro/how-player-pro-compares.html

and here for more details about FreeCDF vs. Enterprise licensing:

http://www.wolfram.com/cdf/adopting-cdf/licensing-options.html

share|improve this answer
2  
I gave Andre his first upvote - I'm famous!! –  Mark McClure Dec 6 '12 at 18:33
    
Andre I think what is still needed is enabling of JLink and other links (DatabaseLink is enabled of course) providing they are used within the CDF (as opposed to using Mma functionality from another interface). –  Mike Honeychurch Dec 6 '12 at 21:50
    
@MarkMcClure You are famous also for rare voting :) –  Artes Dec 6 '12 at 21:51
    
@Artes I can live with that! I do vote, but certainly not whimsically. I generally vote when I feel that I've learned something. As a long time user and parttime consultant, that doesn't happen too often. My students tell me that I'm stingy with points, too. Perhaps, there's a theme? :) –  Mark McClure Dec 6 '12 at 22:02
    
@MarkMcClure I'm not opposing with that, but on the other hand every so often good answers get few upvotes while poor ones get too many. I mean your votes are especially important. –  Artes Dec 6 '12 at 22:23

Apparently, one of the enhanced capabilities available in an enterprise license of Mathematica is the capability to send data to your CDF file just like when using Flash.

http://www.wolfram.com/mathematica/how-to-buy/industry-individuals.html

Enterprise CDF Deployment

I have not been able to find the documentation for this in Wolfram's site, but I'll update my answer when I do.

UPDATE: As confirmed by Andre Kuzniarek, it is still not possible to send data to the CDF via HTML or Javascript.

share|improve this answer
    
The enterprise version provides a different signature to the CDF which enables the same features you would get in Player Pro. –  David Creech Nov 5 '12 at 22:00
    
@david what is not clear to me is that in Player Pro documentation at wolfram.com/player-pro there is nothing that specifically says that you can send data from the HTML to the CDF file. Also, in wolfram.com/cdf/adopting-cdf/deploying-cdf/web-delivery.html there is no mention to special Player Pro parameters. If this parameter exits, what is its name? Not advertising this can slow down CDF adoption. –  Gustavo Delfino Nov 6 '12 at 15:43
    
Please see @AndreKuzniarek clarification of Enterprise option and related information. –  Vitaliy Kaurov Dec 6 '12 at 18:48
    
re: your Update. Andre's answer refers to web embedded CDFs. Stand alone CDFs that have been pro signed can import/export etc. –  Mike Honeychurch Dec 6 '12 at 21:48
    
Yes I was referring to the web embedded CDF. I made a small edit to make it clear. –  Gustavo Delfino Dec 6 '12 at 23:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.