Flex 3 Database & Large Html Files

Hi Guys,
New to flex, and I have a question, any help would be much appreaciated, I have a database sql server 2005 I use web orb to connect to it throu flex, I have books stored in this database each page of a book is a seperate record and has html tags throughout it, what I would like to do is display one page at a time to the user and then have them click a button to get to the next record or page, this I could manage in a datagrid I guess but the pages of text are quite large is there a component that would better suit a large page of text such as the text component if so could you give me an example of how to bind my data to it and how to stop the html tags showing up as text, or if I could customize the layout of the datagrid that might be a better solution.
I have posted an attempt to use a text component but have been unsuccessful thus far:
<?xml version="1.0" encoding="utf-8"?>
        <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%" height="100%" title="The Lord Is Near">
        <mx:Script>
<![CDATA[
                import mx.collections.ArrayCollection;
                import AlphaOmega.ActiveRecords;
                import AlphaOmega.Alpha_Calendar;
                import mx.controls.TextArea;
                public function GetTodaysLin():ArrayCollection
                        return ActiveRecords.Alpha_Calendar.findBySql("SELECT Cal_ID, Cal_Text, Cal_Date, Cal_MP3 FROM Alpha_Calendar WHERE (Cal_Date = CONVERT(VARCHAR(30), GETDATE(), 102))");
        ]]>
</mx:Script>   
        <mx:Text htmlText="{GetTodaysLin}" width="100%" height="100%" id="Lin" />
</mx:Panel>
Thanks

You seem to be using Text with htmlText property. Does that not display the HTML as expected? Remember, Flex supports a sub-set of HTML tags:
Search for" Using tags in HTML text" in this page:
http://livedocs.adobe.com/flex/3/html/help.html?content=textcontrols_04.html
You could just have Next and Back buttons that populate the Text control from the next of previous item in an ArrayCollection, where the items in the ArrayCollection are objects with each page of text.
If this post answered your question or helped, please mark it as such.

Similar Messages

  • Problem with sending large HTML files as attachment using JavaMail 1.2

    Hi dear fellows, i am currently working on posting Emails with attachments using JavaMail 1.2. i succeeded in sending many mimetypes of files as attachments except for .htm and .html files. when large HTML files (say, >100 kB) serve as attachements, the mail is posted on mail server, but not properly posted since only the first small part of the file is writted into mail server but the latter part of the attachment file is missing.
    is that a bug of JavaMail??? are there any fellows encountering similar problem as i did??? any suggestions for me to proceed? hopefully i made myself clear...
    Many thanks in advance,
    Fatty

    i've sort of found the cause for that, it is because when the stream write to the mail server, unfortunately there is a "." in a single line. so the server refuse to take any more inputs.
    so do i have to remove all the "." in the file manually to avoid this disaster? any suggestions??
    Fatty

  • Unable to upload/download large html files(71 MB) into  rooms

    Hi,
        I am unable to upload download HTML file(71 MB)into folders of collabration rooms.if it is uploaded also its getting Scripted/corrupted.
    other files are working properly.
    Is it because of large size or any other configuration settings.there is no error msg buts its getting scripted.
    Waiting for your response
    Thanks
    Amit kumar Koyal

    Hi Kerstin,
    the note also says: "This restriction is no longer valid".
    With SP19 I do run tests continously that test content up to 2GB.
    Amit: What portal version are you running? What repository implementation is the file stored in? If the file is stored in a file system, what is it's file size limitation?
    Regards,
    Michael

  • Split a large HTML File

    I have a word document that I have converted to HTML. The
    only problem is that it is a 20 page word document and hakes a
    large HTML doc. Is there any way I can convert this to a HTML
    document with page indexing at the bottom of each page and a back
    and forward button. Is there any way I can do this without manually
    breaking up the HTML and having to create the index on each
    page?

    On Fri, 19 Oct 2007 10:34:17 +0000 (UTC), "Laslett"
    <[email protected]> wrote:
    >I have a word document that I have converted to HTML. The
    only problem is that
    >it is a 20 page word document and hakes a large HTML doc.
    Is there any way I
    >can convert this to a HTML document with page indexing at
    the bottom of each
    >page and a back and forward button. Is there any way I
    can do this without
    >manually breaking up the HTML and having to create the
    index on each page?
    How did you convert the file to html
    a) within Word
    b) copy and paste from word to Dw
    If it is the first - it will be much larger file than
    necessary, much
    better to use the second method.
    If you do have to break it up into several pages - I don't
    know of a
    way that Dw can automatically generate the indexing, but it
    is easy to
    do manually.
    ~Malcolm N....
    ~

  • JTextPane setText large HTML File, Notification Once Text is Set on Screen?

    Hi,
    I'm setting around 8,000 lines of HTML (mostly a table) in a JTextPane. Can't use a JTable. Anyway, I'd like to setup a ProgressMonitor to let the user know what's going on during the call to setText, at least an indeterminant progress monitor...something beyond the wait icon. To do that I need to know once the JTextPane has repainted itself with the new text (not in response to anything else). The document listener seems to come back with a 'changedUpdate' call about 5 seconds or so before the text shows up on the screen. And no, I'm not adding a 5 second wait to the lifespan of the ProgressMonitor. It's already kludgy enough.
    To summarize, this call this.jTextPane1.setText(report); takes about 1 minute and I'd like to give the user a ProgressMonitor, even if it's indeterminant once text shows up. The call to setText returns almost immediately.

    The document listener seems to come back with a 'changedUpdate' call about 5 seconds or so before the text shows up on the screen. Don't know if a PropertyChangeListener will be any better, but a "page" event will be fired when the file has been read. Don't know what the rendering delay will be.

  • Flex file upload issue with large image files

         Hello, I have created a sample flex application to upload an image and also created java servlet to upload and save image and deployed in local tomcat server. I am testing the application in LAN. I am able to upload small as well as large image file(1Mb) from some PCs but in some other PCs I am getting IOError while uploading large image files however it is working fine for small images. Image uploading is hanging after 10%-20% and throwing IOError. *Surprizgly it is working Ok with XP systems and causeing issues with Windows7 systems*.
    Plz give me any idea to get a solution.
    In Tomcat server side it is giving following error:
    request: org.apache.catalina.connector.RequestFacade@c19694
    org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
            at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:371)
            at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.ja va:126)
            at flex.servlets.UploadImage.doPost(UploadImage.java:47)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
            at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877)
            at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProto col.java:594)
            at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675)
            at java.lang.Thread.run(Thread.java:722)
    Caused by: org.apache.commons.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly
            at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStre am.java:982)
            at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:8 86)
            at java.io.InputStream.read(InputStream.java:101)
            at org.apache.commons.fileupload.util.Streams.copy(Streams.java:96)
            at org.apache.commons.fileupload.util.Streams.copy(Streams.java:66)
            at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:366)
    UploadImage.java:
    package flex.servlets;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    import java.util.regex.*;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.*;
    import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class UploadImage extends HttpServlet{
             * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
             *      response)
            protected void doGet(HttpServletRequest request,
                            HttpServletResponse response) throws ServletException, IOException {
                    // TODO Auto-generated method stub
                    doPost(request, response);
            public void doPost(HttpServletRequest request,
                            HttpServletResponse response)
            throws ServletException, IOException {
                    PrintWriter out = response.getWriter();
                    boolean isMultipart = ServletFileUpload.isMultipartContent(
                                    request);
                    System.out.println("request: "+request);
                    if (!isMultipart) {
                            System.out.println("File Not Uploaded");
                    } else {
                            FileItemFactory factory = new DiskFileItemFactory();
                            ServletFileUpload upload = new ServletFileUpload(factory);
                            List items = null;
                            try {
                                    items = upload.parseRequest(request);
                                    System.out.println("items: "+items);
                            } catch (FileUploadException e) {
                                    e.printStackTrace();
                            Iterator itr = items.iterator();
                            while (itr.hasNext()) {
                                    FileItem item = (FileItem) itr.next();
                                    if (item.isFormField()){
                                            String name = item.getFieldName();
                                            System.out.println("name: "+name);
                                            String value = item.getString();
                                            System.out.println("value: "+value);
                                    } else {
                                            try {
                                                    String itemName = item.getName();
                                                    Random generator = new Random();
                                                    int r = Math.abs(generator.nextInt());
                                                    String reg = "[.*]";
                                                    String replacingtext = "";
                                                    System.out.println("Text before replacing is:-" +
                                                                    itemName);
                                                    Pattern pattern = Pattern.compile(reg);
                                                    Matcher matcher = pattern.matcher(itemName);
                                                    StringBuffer buffer = new StringBuffer();
                                                    while (matcher.find()) {
                                                            matcher.appendReplacement(buffer, replacingtext);
                                                    int IndexOf = itemName.indexOf(".");
                                                    String domainName = itemName.substring(IndexOf);
                                                    System.out.println("domainName: "+domainName);
                                                    String finalimage = buffer.toString()+"_"+r+domainName;
                                                    System.out.println("Final Image==="+finalimage);
                                                    File savedFile = new File(getServletContext().getRealPath("assets/images/")+"/LowesFloorPlan.png");
                                                    //File savedFile = new File("D:/apache-tomcat-6.0.35/webapps/ROOT/example/"+"\\test.jpeg");
                                                    item.write(savedFile);
                                                    out.println("<html>");
                                                    out.println("<body>");
                                                    out.println("<table><tr><td>");
                                                    out.println("");
                                                    out.println("</td></tr></table>");
                                                    try {
                                                            out.println("image inserted successfully");
                                                            out.println("</body>");
                                                            out.println("</html>");  
                                                    } catch (Exception e) {
                                                            System.out.println(e.getMessage());
                                                    } finally {
                                            } catch (Exception e) {
                                                    e.printStackTrace();

    It is only coming in Windows 7 systems and the root of this problem is SSL certificate.
    Workaround for this:
    Open application in IE and click on certificate error link at address bar . Click install certificate and you are done..
    happy programming.
    Thanks
    DevSachin

  • How to give security permission for html file which is accessing a database

    there a applet code which is accessing database and i am placing that code in one folder in any drive and iam placing a
    applet tag in a html file and storing on desktop.
    now if i run that html file i am unable to connect to database and it is not not giving any exception errors.
    what is the security permission we have to provide for that html file.
    i want this solution immediately plz.

    sign your midlet suite and give the permission in the jad / manifest
    http://java.sun.com/j2me/docs/wtk2.2/docs/UserGuide-html/security.html

  • Is there a way where I can give an HTML File  and pass database values to it?

    Hello,
    I have a Report that has Complex Layout with different Fonts,sizes etc.
    After designing it in Front Page, the HTML Source comes to be around 180 KB. Portal Reports with Custom Layout fail to get this size of layout code( seems the limit is around 32KB).
    Writing my own stored Package using htp/htf calls, but still I needed to paste this entire 180KB Code and replace the layout names with database names. This works fine but the readability of this code is ugly.
    Is there a way where I can feed the database values as parameters along with the HTML File to pick substitute and then
    show me the output?
    Thank you.
    Madhav

    you can use dynamic pages!

  • OSB - Iterating over large XML files with content streaming

    Hi @ll
    I have to iterate over all item in large XML files and insert into a oracle database.
    The file is about 200 MB and contains around 500'000, and I am using OSB 10gR3.
    The XML structure is something like this:
    <allItems>
    <item>.....</item>
    <item>.....</item>
    <item>.....</item>
    <item>.....</item>
    <item>.....</item>
    </allItems>
    Actually I thought about using a proxy service with enabled content streaming and a "for each" action for iterating
    over all items. But for this the whole XML structure has to be materialized into a variable otherwise it is not possible!
    More about streaming large files can be found here:
    [http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#large_messages]
    There is written "When you enable streaming for large message processing, you cannot use the ... for each...".
    And for accessing single items you should should use an assign action with a xpath like "$body/allItems/item[1]";
    this works fine and not the whole XML stream has to be materialized.
    So my idea was to use the "for each" action and processing seqeuntially all items with a xpath like:
    $body/allItems/item[$counter]
    But the "for each" action just allows iterating over a sequence of xml items by defining an selection xpath
    and the variable that contains all items. I would like to have a "repeat until" construct that iterates as long
    $body/allItems/item[$counter] returns not null. Or can I use the "for each" action differently?
    Does the OSB provides any other iterating mechanism? I know there is this spli-join construct that supports
    different looping techniques, but as far I know it does not support content streaming, is this correct?
    Did I miss somehting?
    Thanks a lot for helping!
    Cheers
    Dani
    Edited by: user10095731 on 29.07.2009 06:41

    Hi Dani,
    Yes, according to me this would be the best approach. You can use content-streaming to pass this large xml to ejb and once it passes successfully EJB should operate on this. If you want any result back (for further routing), you can get it back from EJB.
    EJB gives you power of java to process this file and from java perspective 150 MB is not a very LARGE data. Ensure that you are using buffering. Check out this link for an explanation on Java IO Streams and, in particular, buffered streams -
    http://java.sun.com/developer/technicalArticles/Streams/ProgIOStreams/
    Try dom4J with xpp (XML Pull Parser) parser in case you have parsing requirement. We had worked with 1.2GB file using this technique.
    Regards,
    Anuj

  • Attempted to mail an email with a large attachment file.  One of the addresses was bad.  When my Outlook is running, the Mac tries to send it and shows the progress.  However, when I look in my Outbox the files are not there.  It does show up in the Outb

    attempted to mail an email with a large attachment file.  One of the addresses was bad.  When my Outlook is running, the Mac tries to send it and shows the progress.  However, when I look in my Outbox the files are not there.  It does show up in the Outbox progress section but I can not delete it when it is there.
    Where do these files reside?
    Is there a hidden Outbox??
    MacBook Pro, Mac OS X (10.7.1)

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • How to store Html File in Oracle Table?

    Hai,
    I want to store Html File(s) into oracle Table. How can I do it?.
    Please help me. Html File size can be maximum 40 MB .
    Regards
    Suresh

    If it's just pure HTML it's nothing more than astring so you could store it as such.
    Most databases have a limitation on the maximum number
    of characters that a string can hold. With 30MB of
    text, a CLOB (Character Large OBject) is the
    preferrable type but a BLOB (Binary Large OBject) can
    also be used.
    ;o)
    V.V.Right, right. But, I kind of doubt that an html file takes up 30MB, can you imagine browsing a web site, regardless of your connection, with pages that size? We're talking ~125,000 line of pure HTML code (no images)!

  • Simple AIR ajax question? One html file or many?

    I am a new ajax air developer and was wondering if it's a better practice to use one html file in my app or many html files? So far I have been testing with many html files using javascript location.href to send the user to another html page when they click different navigation buttons. This works although there is a clear webpage "loading" feel to the app due to a temporary white screen displaying over the app as it loads the next page (maybe for a couple milliseconds). Not a huge deal but still feels somewhat unprofessional since regular desktop apps do not have this "flicker" occur when changing navigation. Now if I use a single html file (where I load html using javascript) this does not occur but the file feels very large and bloated. Anyone have any suggestions of how I can eliminate the flicker that occurs using many files (perhaps I am not loading the file the correct way into the native window) or am I stuck with a single file if I want there to be no flicker?

    I'll say become a Flex/AIR developer

  • Expanded Content? Database or html?

    I have a list of products that need content.
    Basically this extended information needs to display details
    that can't
    be listed with regular product details, it's just too much.
    My dilemma is that I can't decide whether to post it to the
    web in
    individual html files or to post it to a database where that
    content is
    pulled out. I visited a larger company recently that has
    roughly 70,000
    products and 3 web people to create individual pages for
    expanded
    product information. I only have 4500 products and it's just
    me doing
    the work.
    Are these really the only two options or are there others?
    XML?
    The problem is that this content needs formatting and I've
    heard that
    it's not the best practice to put html into a database.
    I'm just curious what others are doing.

    You don't necessarily put the who HTML page into the
    database, you only put
    the necessary HTML tags in with it.
    So maybe you have something like this:
    tblProduct
    title
    picture
    description
    "title" would get outputted maybe into an <h1> block on
    your 'master' page.
    The "picture" a link that is put into an <img> tag.
    "description" would be the main text with some tags, as
    needed... maybe
    like:
    <p>The <strong>XYZ Widgets</strong> are
    made from durable cat hair.</p>
    See??
    "Lee" <[email protected]> wrote in message
    news:f78jlk$slj$[email protected]..
    >I have a list of products that need content.
    >
    > Basically this extended information needs to display
    details that can't be
    > listed with regular product details, it's just too much.
    >
    > My dilemma is that I can't decide whether to post it to
    the web in
    > individual html files or to post it to a database where
    that content is
    > pulled out. I visited a larger company recently that has
    roughly 70,000
    > products and 3 web people to create individual pages for
    expanded product
    > information. I only have 4500 products and it's just me
    doing the work.
    >
    > Are these really the only two options or are there
    others? XML?
    >
    > The problem is that this content needs formatting and
    I've heard that it's
    > not the best practice to put html into a database.
    >
    > I'm just curious what others are doing.

  • Validating large xml files

    In our application we have a requirement to validate large xml file (around 40 mb) against a simple schema file.
    I have tried all options(Sax and Dom) mentioned in below article on sun site -
    http://java.sun.com/developer/EJTechTips/2005/tt1025.html
    but with all of these approches the validation process just hangs for hours.
    Even i am running my test case for this validation by allocating 1 GB memory to test case, on latest processor(core-2 duo) but still it just hangs and returns after a long duration.
    If needed i can provide sample test case, schema file and xml file.
    Please help me to know if its a problem with JAXP 1.3 Schema Validation Framework (SVF) to handle large files, or if there is any other efficient way of validating large xml file.
    Regards
    Rahul

    you may want to split the XML to 10MB each and parse the XML's separately or store in a database and read the XML using XQuery.
    I am sure there may be better ways to do this, will see experts opinions here.

  • Large xml file

    I have a very large xml file (i.e. test.xml) which I need to import into our oracle database.
    We have Oracle9i Release 9.2.0.6.0.
    Test.xml is contained in a directory on our server, i.e. "xmldirectory".
    I have looked on the web, forums (including this one), left, right and centre...also looked at this link http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb03usg.htm#sthref246 ...but was unable to get anything to work.
    Can you please provide examples?
    Thanks

    well, you could
    do this
    http://www.oracle-base.com/articles/9i/ParseXMLDocuments9i.php
    or this
    http://www.devx.com/xml/Article/32046
    or this
    http://www.oracle.com/technology/pub/articles/quinlan-xml.html
    or this
    XMLType view of Relational Content

Maybe you are looking for

  • How to enable my touch screen?

    I'm using Hp sleekbook 14 Windows 8 but i just notice that i coudn't use my touch screen i want to enable, i tried to go to settings at the control panel and at pen and touch but there is no check button to enable or disable the touch screen i tried

  • Samsung viera 3d

    Mogu li na  tv panasonic viera 3d skayp koristiti bez kamere:happy jer ako to ne mozemo koristiti bez camere onda je beskorisnoi jako mi je zao 

  • Import Production orders with released status

    We are using DTW to import production orders. It allows to import as "planned" status only and not as as "released status". We have hundreds of production orders per day and its a pain to update each production order to "released" status so that it c

  • JTextPane's cursor

    Probably a simple question. Is it possible to enable/disable the cursor/caret in a JTextPane? Sometimes I want to see the cursor, and sometimes I don't (for displaying purposes). With regards, Korque

  • Workflow and HR org stucture

    Hi Experts Please can you provide me advise of how a HR org structure should look to benefit workflow. For example, currently all our org units are in a flat structure but I think we'd be better off with a hierarchical structure i.e. with everyone at