Writing data into a text file in Adobe Flex - apache-flex

I am new to Adobe Flex.
I want to write some data stored in a string variable into a text(txt) file.
Can some one add sample code here would be helpful for me.
Thanks.

You can write to files if you're targetting Flash 10. Read this article to find out how to do it: http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

You cannot write to files in Flash, but you can if it's an AIR app. Review the File class in Adobe livedocs.

Since Flash Player 10 you can use the FileReference.save() method.

If you're creating web based apps, the file will have to be created on the server, and you should look for information in that using the technology of your choice. ColdFusion uses the cffile tag, as one example.
FileReference.save will give your user the ability to save a file, but you have limited control in naming or location.
If you're using AIR, you can save information to the local drive using the File class.

Related

Possible to search through all JSPs in Adobe CQ5 repository with CRXDE?

We have a couple of relatively simple websites running on Adobe CQ 5.5 that were developed by a third party. I'm pretty familiar with how CQ works, but I'm working with somebody else's code here and I need to be able to search through all components in the system for a particular string.
The issue is that I can't seem to find a way to search across all of the various .jsp files stored with the various system components. I would have figured that the query tool in CRXDE Lite would have done the trick with something like this:
/jcr:root//*[jcr:contains(., 'Find this exact string in a JSP')] order by #jcr:score
But I've had no luck.
What I am looking for is some sort of global search that includes JSP files. Is that possible? Were I using a regular Java system, any IDE worth the download would be able to do this.
Thanks.
Might not be easiest way, but you can use the VLT tool to checkout the repository into your filesystem. Then you can lookup using whatever tool you prefer. It might even be faster in the long run
I don't have the actual answer but I suppose the JSPs are indexed via a filter that strips out some of their content.
It should be possible to configure the repository to index them as is instead, based on the info at http://wiki.apache.org/jackrabbit/IndexingConfiguration and http://jackrabbit.apache.org/jackrabbit-text-extractors.html
Sorry about the vagueness of this answer - I know the basic principles but to provide the details I would need more time than I can afford now ;-)

Batch .pdf files generation using seam <p:document>

I want to generate a big pdf file using Seam.
Seam have .xhtml support for pdf generation with tag but this facility only work when there is a browser interaction.
I didn't find any way to use this seam pdf facilities as a background/batch way.
There is a solution here.
https://community.jboss.org/thread/180380#comment24174
And a jira here to make it easier. But since nothing done since 2008 might not be done :)
https://issues.jboss.org/browse/JBSEAM-2613

How to read data stored in MS Excel file?

i'm trying to perform simple automated test on my Adobe Air Application. I decide to store some test data in external MS Excel file to decrease hardcode quantity. But I discovered, that this is not a trivial task, when you're working with Adobe Air.
Actually, i need to correct initialize an excelApp object, the rest part of logger is already implemented. I tried the following approach, but I can't find a package with ActiveXObject class defined.
excelApp = new ActiveXObject("Excel.Application");
Can you give some ideas, where can I find such a class?
There's a simple as3 xls reader library called as3xls that should provide the functionality you need. However, if you need to write out excel files, it's a little bit rough.

Using PurePDF is it possible to view PDFs?

Can you use PurePDF to view files or is the api only for writing them?
Based on the PurePDF Project Page, reading and extracting information from PDFs is supported:
read existing pdf documents (extract strings, streams, images and all the informations from them). See HelloWorldReader.as for an example
However, if you're looking to view / rasterize a PDF, that's a much more complicated task and doesn't look like it's supported as part of PurePDF.
I suggest converting the PDF into a swf file. There are a number of projects out there (including free / open source) that convert pages into SWF files, including being able to still extract the text. :D
It looks like you can either navigate to the url of the PDF (maybe in an HTML component?) , OR a richer solution might be to use the open source flex paper : http://flexpaper.devaldi.com/

Programmatically generate InfoPath form template?

Is it possible to programmatically generate an info path 2007 form template (xsn file=form definition) ?
I know that there is no object model for the infopath 2007 form designer, but does anyone know of any third party libraries?
The form view itself is a xsl file so it should be possible. I would have thought that its a common use case also.
It is possible to generate the manifest.xsf, xsl and xml files from a structured source (let's say an xml) and then pack this (as .cab) with the extension .xsn
(The .xsn file is nothing but a renemed .cab!)
This is only a raw concept - it could be refined if the purpose was a bit more explicit. Why generate? Are you going to create a bunch of different files? What for?
There are no libraries or API's to do this. While generating a template is possible you will need to write it all yourself. Obviously this will not be an easy task and will be prone to errors. I would recommend reviewing your requirements to ensure this is truly necessary. InfoPath is quite flexible, without knowing the details of your project, there is a good chance you can get the functionality you need with a single template.

Resources