Controlling image width in XML brought into TextField via RSS

Hello. First off, let me say that I am new to these forums,
and new to AS 3.0
Here's my question.
I'm building an RSS Reader. Everything is working great,
except I can't figure out how to control the size of images
embedded in the XML of the blog posts.
I attempted to set up a textField with an attached css
stylesheet to limit image widths, but I couldn't get that to
function. Should I try saving the remote XML to my server via PHP,
and then adding my desired maximum width to every <img> tag?
That seems like a lot of work for a simple task.
Ideally, I'm dreaming of a textField or TextArea or
ScrollPane property that would force contents to obey the
container's width. Can you tell I usually write css?
Thanks in advance for any advice.

Assuming that html is valid xml, and it apparently is if you
are working with it successfully, you would access that value like
this:
description.img.(@src)
A labelFunction would make it easy to display that string.
I haven't worked much with in-line renderers so ai am not
sure you you would do it in there.
Tracy

Similar Messages

  • Standard Report - Append Control Image Width Problem / Limitation or Bug?

    I am trying to create a Standard Report and am having a hard time placing a XY Graph control on the report. My problem is I want to use the maximum page area to view the graph. For this reason, I am keeping the margins small and increasing the size of the control so that it occupies almost all of the page. What I find is that after a certain limit, the XY graph image output on the report does not increase in size even if you increase the control size. In fact the image will get worse with larger size once beyond the limit. No matter How I try, the Image will not occupy all the area between the Horizontal Margins.
    Either this is a bug or undocumented limitation.
    Ahh.. One other possibility exists, that I am not smart enough. But if some one can help me here, It will be greatly appreciated.
    I am Using LV 8.2 on XP machine.
    I am attaching the VI and two PDF files, In "MyReport w1000.pdf" The XY Graph is 1000 Pixels Wide. In "MyReport w2000.pdf" I made it 2000 Pixels wide, however the size of the image did not increase on the report. Also You can notice the difference in quality between the two reports.
    To use my vi just size the graph to different sizes and run it, It will output to the default Printer. If you have a PDF writer set as default printer, It will save it to file.
    If anyone can help, I thank you and wish you...
    Good Luck!
    Mache

    I do not like Vivek's workaround. "Use HTML report"  is not acceptable when the question is about Standard report. People may want to use Standard report and there is a reason it is called standard.
    Anyway one solution is to size the image to most optimum size - as large as possible but retaining the graphical quality. This will still leave you with large white spaces around your graph object.
    Second solution that I am using is to Put the graph object and any other elements that I want on my report on a Front panel of a VI. Size the objects and front panel and objects appropriately and then use Print Panel to Printer method to Print the whole VI front panel. In my app. This VI which mimics the report is called from my app and is called Print Preview.  There is even a Vi that allows you to choose the printer. http://zone.ni.com/devzone/cda/epd/p/id/1327
    I am attaching a Sample Report and Code Snippet to look at.
    Good Luck!
    Mache
    Attachments:
    Labview Document.pdf ‏21 KB
    Print Code.jpg ‏30 KB

  • Images appear pixelated when brought into indesign/exported to pdf

    When i drag a large image file into indesign it appears very pixelated and cannot figure out how to get the resolution better, it also looks even worse when i export the project to a pdf file. Does anyone know how to fix this?

    It may be that the image is too large and ID is having a hard time deciding on what to do with the file. If you use the FIle>Place method and look in the Links panel, what are the Actual and Effective resolutions given for the file?

  • Newbie question - Auto enter into textfield via SQL

    I am not even sure what to put for the subject!!
    I have a page that creates a new record in our leave tracking database.
    The users are logging in via LDAP
    The username is also in my employee table and can be used with a where statement
    where "USERNAME" like :APP_USER
    I want to bring in FIRSTNAME and LASTNAME and automatically put them in the form so the user does not have to.
    I tried making the TEXTFIELD source a SQL query and I can get the data to load. When the record is submitted the data is not inserted into the new record it is blank.
    The only way I can get the data to load is if the field source is set to Database Column.
    My next efforts were to try and get the default value to be inserted via a SQL statement but as there is no option for SQL only it appears that I have to put in a PL/SQL Function body or expression.
    I know that there needs to be a Declare then Begin and End but I do not know the syntax for what should be a reasonable simple query.
    the sql for the records is
    select "FIRSTNAME"
    from "NWOCASTAFF"
    where "USERNAME" like :APP_USER
    the field I am trying to insert this default value is
    P2_FIRST_NAME
    it is a Text Field
    I hope that someone can help me with this.
    A small PS
    If I wanted the text that is inserted to be Title Case how would I do that, with a format mask or is there some function like upper() which I can use.
    thanks
    John MP

    Scott
    Thanks for the code, it works perfectly! The field must be set to display as a textfield but other than that it is exactly what I need.
    there is another thread that goes down the computation route
    Query to set item default value
    I may pursue that route if I find the default value SQL query to be too restrictive.

  • Inporting XML data into a table

    I have the followiing XML document
    <?xml version="1.0" encoding="utf-8"?>
    <agents count="1382">
    <agent>
    <name>Nancy Palmer</name>
    <email>[email protected]</email>
    <agentid>MLSL:00525350</agentid>
    <officeid>58</officeid>
    <website>http://www.nancypalmer.com</website>
    <photo>https://sites.e-agents.com/Uploads/68/41/6841/Agents/agent_8418_NANCY_PALMER_COLOR_HEAD_SHOT_HIGH_QUALITY_2011.jpg</photo>
    <phone_direct>6504344313</phone_direct>
    <phone_cell>6504920200</phone_cell>
    <mod_time>2012-08-31T05:15:06.933</mod_time>
    </agent>
    <agent>
    <name>Genella Williamson</name>
    <email>[email protected]</email>
    <agentid>MLSL:00755754</agentid>
    <officeid>58</officeid>
    <website>http://www.apr.com/genella</website>
    <photo>https://sites.e-agents.com/Uploads/68/41/6841/Agents/agent_8426_genella.jpg</photo>
    <phone_direct>6504344319</phone_direct>
    <phone_cell>6507870839</phone_cell>
    <mod_time>2010-10-30T15:15:07.603</mod_time>
    </agent>
    <agent>
    <name>Diana Langley</name>
    <email>[email protected]</email>
    <agentid>MLSL:01256202,SFAR:805608</agentid>
    <officeid>50</officeid>
    <website>http://www.apr.com/DLangley</website>
    <photo>https://sites.e-agents.com/Uploads/68/41/6841/Agents/agent_7848_dlangley.jpg</photo>
    <phone_direct/>
    <phone_cell/>
    <mod_time>2011-06-06T05:15:06.587</mod_time>
    </agent>
    </agents>
    I want to load it to the following table
    SQL> desc apr_agent
    Name Null? Type
    NAME VARCHAR2(100)
    EMAIL VARCHAR2(100)
    OFFICEID VARCHAR2(50)
    WEBSITE VARCHAR2(1000)
    PHOTO VARCHAR2(1000)
    PHONE_DIRECT VARCHAR2(100)
    PHONE_CELL VARCHAR2(100)
    MOD_DATE VARCHAR2(100)
    SQL>
    So I created a directory
    create or replace directory APR_STG as '/opt/smarteragent/procdata/APR';
    and I created the following insert statement
    INSERT INTO apr_agent
    (NAME, email, officeid, website, photo, phone_direct, phone_cell, mod_date)
    WITH T AS (SELECT XMLTYPE(BFILENAME('APR_STG','agents.xml'), NLS_CHARSET_ID('AL32UTF8')) xmlcol FROM dual)
    SELECT EXTRACTVALUE(VALUE(x),'/ROW/name') NAME,
    EXTRACTVALUE(VALUE(x),'/ROW/email') email,
    EXTRACTVALUE(VALUE(x),'ROW/officeid') officeid,
    EXTRACTVALUE(VALUE(x),'ROW/website') website,
    EXTRACTVALUE(VALUE(x),'ROW/photo') photo,
    EXTRACTVALUE(VALUE(x),'ROW/phone_direct') phone_direct,
    EXTRACTVALUE(VALUE(x),'ROW/phone_cell') phone_cell,
    EXTRACTVALUE(VALUE(x),'ROW/mod_time') mod_date
    FROM T,TABLE(XMLSEQUENCE(EXTRACT(T.xmlcol,'/ROWSET/ROW'))) x;
    I am currently getting now rows inserted. Not sure why?
    Any help would be greatly appreciated.

    Well, if you were to run the SELECT statement alone (from WITH on down), you would see that it is returning 0 rows. After some head-scratching and searching you would come to realize it is because your XPaths are not finding any data in the XML. In your XPaths, you are looking for a root node of ROWSET with a child of ROW. In the XML, the root node is agents and the child is agent. Assuming you are on 10.2 or later, your SELECT statement itself could be written as
    SELECT NAME, email,
           officeid, website,
           photo, phone_direct,
           phone_cell, mod_date
      FROM XMLTable('/agents/agent'
                    PASSING XMLType(BFILENAME('APR_STG','agents.xml'), NLS_CHARSET_ID('AL32UTF8'))
                    COLUMNS
                    NAME         VARCHAR2(100) PATH 'name',
                    email        VARCHAR2(100) PATH 'email',
                    officeid     VARCHAR2(50) PATH 'officeid',
                    website      VARCHAR2(1000) PATH 'website',
                    photo        VARCHAR2(1000) PATH 'photo',
                    phone_direct VARCHAR2(100) PATH 'phone_direct',
                    phone_cell   VARCHAR2(100) PATH 'phone_cell',
                    mod_date     VARCHAR2(100) PATH 'mod_time');and then you could just append that to your INSERT so you have something like
    INSERT INTO apr_agent
    (NAME, email, officeid, website, photo, phone_direct, phone_cell, mod_date)
    SELECT NAME, email,....If the count of 1382 is to be believed, then you may start wondering why your INSERT is taking so long to process. Performance will depend upon many factors.
    If you are on 11g (any of them), then you have an option to improve performance over 10.2 and earlier versions. You simply create a table, it could even be a Global Temporary Table that looks something like
    create table TEMP_XML (XML_DATA xmltype)
    xmltype column XML_DATA store as securefile binary xml;(if on 11.2.0.2 or later, you only need)
    create table TEMP_XML (XML_DATA xmltype);Then you insert the XML data into it via
    INSERT INTO TEMP_XML VALUES XMLType(BFILENAME('APR_STG','agents.xml'), NLS_CHARSET_ID('AL32UTF8')));and change the above SELECT statement to read from that table instead, such as
    SELECT NAME, email,
           officeid, website,
           photo, phone_direct,
           phone_cell, mod_date
      FROM TEMP_XML tx
           XMLTable('/agents/agent'
                    PASSING tx.xml_data
    ...And then you'll be done with that task.
    Note: Only the first SQL statement was verified, the rest should be valid but have not been executed/verified.

  • Control image to report doesn't take all width

    I want to add and print a control to my report, but the control image doesn't take all the width avalaible on my report.
    It's stretched before the margin.
    Take a look to my exemple in attachement
    thanks
    Attachments:
    print_panel.vi ‏38 KB

    Hi,
    I regret to say that the image size is a known bug with the Report Generator. There is currently no workaround for this issue. The image size cannot be greater than a 1� margin on both sides. I hope you�ll be able to work around this. The issue will be fixed in a future version of LV.
    Danny G.
    Applications Engineer
    National Instruments

  • Loading new xml data into a already xml populated image display

    Hi everybody,
    I have a question about loading new xml data into a already xml populated image gallery.
    So I have my gallery set up so it calls some xml when it first loads. What I would now like to do is load different sets of images via a different xml sheet via the click of a button.
    So for example the loaded gallery already has all thumbs loaded and user can click on them to view the full size image. So next instead of the user having to close this gallery to allow a new gallery to open with a different set of pictures I would just like to have a button. This button will unload the existing thumbs from the gallery and load in new ones from a different xml file.
    If anybody can help me with this it would be great as I am still on a steep learning curve with AS3.
    Here is my AS3
    var xmlPath:String = "pictures.xml";
    var xml:XML;
    var loader = new URLLoader();
    loader.load(new URLRequest(xmlPath));
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(e:Event):void
         if ((e.target as URLLoader) != null )
              xml = new XML(loader.data);
              createMenu();
    var numberOfItems:uint = 0;
    var menuItems:Array = new Array();
    function createMenu():void
              numberOfItems = xml.items.item.length();
         var count:uint = 0;
              for each (var item:XML in xml.items.item)
              var imageLoader=new Loader();
              var menuItem:MenuItem = new MenuItem();
              menuItem.addChild(imageLoader);
              imageLoader.load(new URLRequest(item.url));
              menuItem.linkTo = item.linkTo;
              menuItem.mouseChildren = false;
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              menuItems.push(menuItem);
              addChild(menuItem);
              count++;
    function ***():void
         //menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         for (var i:uint = 0; i < menuItems.length; i++)
              setChildIndex(menuItems[i], i);

    Thanks so much for the reply Andrei1
    I think maybe my lack of knowledge when it comes to AS3 is not helping me at the moment because I thought I understood the code you supplied but there is something not going quite right.
    So I messed around with the code and added the new_loaded_thumbs_btn to load in the "new_pictures.xml" but I am def doing something wrong.
    import flash.ui.ContextMenuItem;
    var xmlPath:String = "pictures.xml";
    var xml:XML;
    var numberOfItems:uint = 0;
    var menuItems:Array = new Array();
    var loader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    loadXML("pictures.xml");
    new_loaded_thumbs_btn.addEventListener(MouseEvent.CLICK, loadXML);
    function loadXML(path:String):void {
         loader.load(new URLRequest("new_pictures.xml"));
    function loadXML(path:String):void {
         loader.load(new URLRequest(path));
    function xmlLoaded(e:Event):void
         xml = new XML(loader.data);
         createMenu();
    function createMenu():void
         clearMenu();
         numberOfItems = xml.items.item.length();
         var count:uint = 0;
         var imageLoader;
         var menuItem:MenuItem;
         for each (var item:XML in xml.items.item)
              imageLoader = Loader();
              menuItem = new MenuItem();
              menuItem.addChild(imageLoader);
              imageLoader.load(new URLRequest(item.url));
              menuItem.linkTo = item.linkTo;
              menuItem.mouseChildren = false;
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              menuItems.push(menuItem);
              addChild(menuItem);
              count++;
         sortChildren();
    // removes previously placed objects
    function clearMenu():void {
         var menuItem:MenuItem;
         while (menuItems.length > 0) {
              menuItem = menuItems[0];
              removeChildAt(getChildIndex(menuItem));
              menuItem.shift();
    function sortChildren():void
         //menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         for (var i:uint = 0; i < menuItems.length; i++)
              setChildIndex(menuItems[i], i);
    When the image display 1st loads it displays the new_pictures.xml thumbs which I thought would load through my new button when clicked.
    And there was me thinking I was getting the hang of AS3.
    Could you please point me in the right direction in what I am doing wrong,
    Thanks for your time and effort in advance

  • Load XML content into HTML enabled TextField

    I'm trying to figure out how to use html such as <br />
    loaded from an XML element into a TextField.. if I use something
    like
    <desc>my description<br />line 2</desc> I
    get 3 nodes instead of one when loading the XML file. If I use
    something like <desc>my description&lt;br /&gt;line
    2</desc> then I get <br /> in the actual text.
    Can anyone clue me in as to how to store HTML in an XML
    element so I can load the content into a Dynamic TextField with
    HTML enabled?
    Thanks much!

    use the latter in your xml and use the htmlText property of
    your html-enabled textfield to display your text.

  • Convert xml file into Image file

    Hi,
    How to transform xml file into image file?.
    i don want to transform the xml file into html file.
    Thanks,
    nithi

    One way I can think of is to create a java.awt.BufferedImage, and use its Graphics object to print out the xml (count the lines first, and space them to your liking). Then if you want to save it to e.g. png or jpg there are free libraries for that, whose names I don't remember at the moment... Dunno why you'd wanna do this though :)

  • Allow the user to control the width of the edit forum post input box

    I would like to control the width of of the edit-forum post input box.  This could be:
    automatically adjust the width of the box so that the box doesn't run off the right edge of the window.
    have a user global preference to set the preferred width
    at least, allow the user to change the width via the change size icon.  The three horizontal bars at the lower left of the input box. You can adjust the vertical dimension, but not the horizontal. TenFourFox 4.0.1. This is probably being blocked for some obscure reason.
    Here is an example of an over extended right margin:
    Curiously enough, the "software" let's me adjust the width & height of the add reason to edit text, but not adjust the width of the more important edit text box.
    Robert

    Testing
    Standard Reply box can be height adjusted but not width.
    Same with Advanced Editor
    No Adjustment at all in HTL Editor
    Edit.
    The Edit uses the Advanced Editor
    Only Height Adjustment again.
    I do seem to remember someone posting about the width and saying they could drag it over the edge of the right hand edge (Into the grey surround)
    This may have been a post in the lounge.
    It didn't actually try it at the time but have played with it since and have not seen it.
    Maybe it is something they "Fixed" in both senses of the word.
    Second edit.
    I can't alter the box that currently reads "Message Edited by:- ..."
    I also can't get this box to accept New lines  (they appear in the box but don't post that way)
    Corrected Spelling
    9:51 PM      Wednesday; May 11, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously
    Message was edited by: Ralph Johns (UK)
    Message was edited by: Ralph Johns (UK)
    and new line with a line space as well

  • Image width bug?

    http://pyroblue.dyndns.org:8080/flexapps/BhgPhotoContest/bin/BhgPhotoContest.html
    if you view that page, you can see there is a lot of
    whitespace underneath the image...im just setting the image width
    (similar to what you do with HTML)...but for some reason, Flex puts
    a bunch of whitespace (the original height's worth) at the bottom
    of the image....
    my mxml file looks like this:
    <mx:HTTPService id="contestListing" url="photocontest.xml"
    result="pcDataHandler(event)" fault="faultHandler(event)"/>

    <mx:Repeater dataProvider="{photoContests}"
    id="pcRepeater">

    <mx:VBox>
    <mx:Label
    text="{photoContests.getItemAt(pcRepeater.currentIndex).pcName}"
    fontSize="14" fontWeight="bold"/>

    <mx:HBox>
    <mx:Image
    source="{photoContests.getItemAt(pcRepeater.currentIndex).prevPhoto}"
    maxWidth="75" maintainAspectRatio="true"/>
    <mx:Text
    text="{photoContests.getItemAt(pcRepeater.currentIndex).desc}"
    width="400" fontSize="10"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Repeater>
    </mx:VBox>
    any ideas?

    Let's say your image is 300x300 pixels. You want to place it
    into an area that is 100x200 and an area that's 500x200, centered
    in both:
    <mx:Image id="img1"
    width="100" height="200" source="{imagefile}"
    scaleContent="true" maintainAspectRatio="true"
    horizontalAlign="center" verticalAlign="middle" />
    <mx:Image id="img2"
    width="500" height="200" source="{imagefile}"
    scaleContent="true" maintainAspectRatio="true"
    horizontalAlign="center" verticalAlign="middle" />
    For img1, the smallest dimension is 100 (width) which it
    matches to the real image's maximum dimension which is 300. That
    means img1 will display an image 100x100 centered vertically with
    50 pixels above and below.
    For img2, the smallest dimension is 200 (height) which it
    matches to the real image's maxium dimension which is 300. That
    means img2 will display an image 200x200 centered horizontally with
    150 pixels to the left and right.
    The Image tag has 2 dimensions: img.width and img.height is
    the area it occupies on the display. img.contentWidth and
    img.contentHeight is area the pixels occupy. For img1, contentWidth
    and contentHeight are 100, for example.

  • Global Volume Slider (from library) to control drag and drop xml playlist

    hi there,
    have spent some time doing tutorial and looking online but can't seem to get a volume slider functioning.
    the scenario is :
    3 circles which can be dragged over a target (one for each circle)
    When the circle is placed on its target it loads its respective xml playlist into 4 buttons (play, pause, forward, back)
    I want to be able to create some kind of function to control the volume, either using a slider or a rotary dial, whichever is easiest!
    any help greatly appreciated!

    Be sure you include the SoundTransform class...
    import flash.media.SoundTransform;
    Create a SoundTransform object
    ...named 'st' (I like short names). Create this AFTER the creation of your soundChannel object...
    var st:SoundTransform = channel.soundTransform;
    st.volume = 1;//This sets the volume to 100%
    channel.soundTransform = st;//This associates your SoundChannel object with your SoundChannel object
    Then, for simple testing of this
    ...create some new button...
    halfVol_btn.addEventListener(MouseEvent.CLICK, doHalfVolume);
    function doHalfVolume(e:MouseEvent):void{
       st.volume = .5;//This sets the volume to 50%
    So, now you have a half-baked volume control. Nothing exciting, but this gets you acquainted with the volume part of what you want. You have created, and have access to, the st.volume property to set the volume to whatever you want, from 0 to 1.
    Next, I'd suggest that you practice the creation of your own slider. Search online for tutorials on it, like I mention above (as a Flash programmer, this is something I, and you, end up doing - searching - dozens of times a week at times). In the end, the position of your knob/button/control in the slider is a %: What % is the location of the knob on the total width/height of the slider. This % is what you send to the st.volume property.
    http://www.lmgtfy.com/?q=create+volume+slider+as3
    As an alternative to create your own slider, you can also use the Flash "Slider" component:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/controls/Slider.html
    ...but this, too, requires some getting-up-to-speed with using it.
    Good luck. If you want some actual code examples - you'll find plenty online :-)

  • Capture Web Cam image in APEX and Upload into the Database

    Overview
    By using a flash object, you should be able to interface with a usb web cam connected to the client machine. Their are a couple of open source ones that I know about, but the one I chose to go with is by Taboca Labs and is called CamCanvas. This is released under the MIT license, and it is at version 0.2, so not very mature - but in saying that it seems to do the trick. The next part is to upload a snapshot into the database - in this particular implementation, it is achieved by taking a snapshot, and putting that data into the canvas object. This is a new HTML5 element, so I am not certain what the IE support would be like. Once you have the image into the canvas, you can then use the provided function convertToDataURL() to convert the image into a Base64 encoded string, which you can then use to convert into to a BLOB. There is however one problem with the Base64 string - APEX has a limitation of 32k for and item value, so can't be submitted by normal means, and a workaround (AJAX) has to be implemented.
    Part 1. Capturing the Image from the Flash Object into the Canvas element
    Set up the Page
    Required Files
    Download the tarball of the webcam library from: https://github.com/taboca/CamCanvas-API-/tarball/master
    Upload the necessary components to your application. (The flash swf file can be got from one of the samples in the Samples folder. In the root of the tarball, there is actually a swf file, but this seems to be a different file than of what is in the samples - so I just stick with the one from the samples)
    Page Body
    Create a HTML region, and add the following:
        <div class="container">
           <object  id="iembedflash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240">
                <param name="movie" value="#APP_IMAGES#camcanvas.swf" />
                <param name="quality" value="high" />
              <param name="allowScriptAccess" value="always" />
                <embed  allowScriptAccess="always"  id="embedflash" src="#APP_IMAGES#camcanvas.swf" quality="high" width="320" height="240"
    type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" mayscript="true"  />
        </object>
        </div>
    <p><a href="javascript:captureToCanvas()">Capture</a></p>
    <canvas style="border:1px solid yellow"  id="canvas" width="320" height="240"></canvas>That will create the webcam container, and an empty canvas element for the captured image to go into.
    Also, have a hidden unprotected page item to store the Base64 code into - I called mine P2_IMAGE_BASE64
    HTML Header and Body Attribute
    Add the Page HTML Body Attribute as:
    onload="init(320,240)"
    JavaScript
    Add the following in the Function and Global Variable Declarations for the page (mostly taken out of the samples provided)
    //Camera relations functions
    var gCtx = null;
    var gCanvas = null;
    var imageData = null;
    var ii=0;
    var jj=0;
    var c=0;
    function init(ww,hh){
         gCanvas = document.getElementById("canvas");
         var w = ww;
         var h = hh;
         gCanvas.style.width = w + "px";
         gCanvas.style.height = h + "px";
         gCanvas.width = w;
         gCanvas.height = h;
         gCtx = gCanvas.getContext("2d");
         gCtx.clearRect(0, 0, w, h);
         imageData = gCtx.getImageData( 0,0,320,240);
    function passLine(stringPixels) {
         //a = (intVal >> 24) & 0xff;
         var coll = stringPixels.split("-");
         for(var i=0;i<320;i++) {
              var intVal = parseInt(coll);
              r = (intVal >> 16) & 0xff;
              g = (intVal >> 8) & 0xff;
              b = (intVal ) & 0xff;
              imageData.data[c+0]=r;
              imageData.data[c+1]=g;
              imageData.data[c+2]=b;
              imageData.data[c+3]=255;
              c+=4;
         if(c>=320*240*4) {
              c=0;
              gCtx.putImageData(imageData, 0,0);
    function captureToCanvas() {
         flash = document.getElementById("embedflash");
         flash.ccCapture();
         var canvEle = document.getElementById('canvas');
         $s('P2_IMAGE_BASE64', canvEle.toDataURL());//Assumes hidden item name is P2_IMAGE_BASE64
         clob_Submit();//this is a part of part (AJAX submit value to a collection) two
    }In the footer region of the page (which is just a loading image to show whilst the data is being submitted to the collection [hidden by default]) :<img src="#IMAGE_PREFIX#processing3.gif" id="AjaxLoading"
    style="display:none;position:absolute;left:45%;top:45%;padding:10px;border:2px solid black;background:#FFF;" />If you give it a quick test, you should be able to see the webcam feed and capture it into the canvas element by clicking the capture link, in between the two elements - it might through a JS error since the clob_Submit() function does not exist yet.
    *Part 2. Upload the image into the Database*
    As mentioned in the overview, the main limitation is that APEX can't submit values larger than 32k, which I hope the APEX development team will be fixing this limitation in a future release, the workaround isn't really good from a maintainability perspective.
    In the sample applications, there is one that demonstrates saving values to the database that are over 32k, which uses an AJAX technique: see http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html#LARGE.
    *Required Files*
    From the sample application, there is a script you need to upload, and reference in your page. So you can either install the sample application I linked to, or grab the script from the demonstration I have provided - its called apex_save_large.js.
    *Create a New Page*
    Create a page to Post the large value to (I created mine as 1000), and create the following process, with the condition that Request = SAVE. (All this is in the sample application for saving large values).declare
         l_code clob := empty_clob;
    begin
         dbms_lob.createtemporary( l_code, false, dbms_lob.SESSION );
         for i in 1..wwv_flow.g_f01.count loop
              dbms_lob.writeappend(l_code,length(wwv_flow.g_f01(i)),wwv_flow.g_f01(i));
         end loop;
         apex_collection.create_or_truncate_collection(p_collection_name => wc_pkg_globals.g_base64_collection);
         apex_collection.add_member(p_collection_name => wc_pkg_globals.g_base64_collection,p_clob001 => l_code);
         htmldb_application.g_unrecoverable_error := TRUE;
    end;I also created a package for storing the collection name, which is referred to in the process, for the collection name:create or replace
    package
    wc_pkg_globals
    as
    g_base64_collection constant varchar2(40) := 'BASE64_IMAGE';
    end wc_pkg_globals;That is all that needs to be done for page 1000. You don't use this for anything else, *so go back to edit the camera page*.
    *Modify the Function and Global Variable Declarations* (to be able to submit large values.)
    The below again assumes the item that you want to submit has an item name of 'P2_IMAGE_BASE64', the condition of the process on the POST page is request = SAVE, and the post page is page 1000. This has been taken srtaight from the sample application for saving large values.//32K Limit workaround functions
    function clob_Submit(){
              $x_Show('AjaxLoading')
              $a_PostClob('P2_IMAGE_BASE64','SAVE','1000',clob_SubmitReturn);
    function clob_SubmitReturn(){
              if(p.readyState == 4){
                             $x_Hide('AjaxLoading');
                             $x('P2_IMAGE_BASE64').value = '';
              }else{return false;}
    function doSubmit(r){
    $x('P2_IMAGE_BASE64').value = ''
         flowSelectAll();
         document.wwv_flow.p_request.value = r;
         document.wwv_flow.submit();
    }Also, reference the script that the above code makes use of, in the page header<script type="text/javascript" src="#WORKSPACE_IMAGES#apex_save_large.js"></script>Assuming the script is located in workspace images, and not associated to a specific app. Other wise reference #APP_IMAGES#
    *Set up the table to store the images*CREATE TABLE "WC_SNAPSHOT"
    "WC_SNAPSHOT_ID" NUMBER NOT NULL ENABLE,
    "BINARY" BLOB,
    CONSTRAINT "WC_SNAPSHOT_PK" PRIMARY KEY ("WC_SNAPSHOT_ID")
    create sequence seq_wc_snapshot start with 1 increment by 1;
    CREATE OR REPLACE TRIGGER "BI_WC_SNAPSHOT" BEFORE
    INSERT ON WC_SNAPSHOT FOR EACH ROW BEGIN
    SELECT seq_wc_snapshot.nextval INTO :NEW.wc_snapshot_id FROM dual;
    END;
    Then finally, create a page process to save the image:declare
    v_image_input CLOB;
    v_image_output BLOB;
    v_buffer NUMBER := 64;
    v_start_index NUMBER := 1;
    v_raw_temp raw(64);
    begin
    --discard the bit of the string we dont need
    select substr(clob001, instr(clob001, ',')+1, length(clob001)) into v_image_input
    from apex_collections
    where collection_name = wc_pkg_globals.g_base64_collection;
    dbms_lob.createtemporary(v_image_output, true);
    for i in 1..ceil(dbms_lob.getlength(v_image_input)/v_buffer) loop
    v_raw_temp := utl_encode.base64_decode(utl_raw.cast_to_raw(dbms_lob.substr(v_image_input, v_buffer, v_start_index)));
    dbms_lob.writeappend(v_image_output, utl_raw.length(v_raw_temp),v_raw_temp);
    v_start_index := v_start_index + v_buffer;
    end loop;
    insert into WC_SNAPSHOT (binary) values (v_image_output); commit;
    end;Create a save button - add some sort of validation to make sure the hidden item has a value (i.e. image has been captured). Make the above conditional for request = button name so it only runs when you click Save (you probably want to disable this button until the data has been completely submitted to the collection - I haven't done this in the demonstration).
    Voila, you should have now be able to capture the image from a webcam. Take a look at the samples from the CamCanvas API for extra effects if you wanted to do something special.
    And of course, all the above assumed you want a resolution of 320 x 240 for the image.
    Disclaimer: At time of writing, this worked with a logitech something or rather webcam, and is completely untested on IE.
    Check out a demo: http://apex.oracle.com/pls/apex/f?p=trents_demos:webcam_i (my image is a bit blocky, but i think its just my webcam. I've seen others that are much more crisp using this) Also, just be sure to wait for the progress bar to dissappear before clicking Save.
    Feedback welcomed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hmm, maybe for some reason you aren't getting the base64 version of the saved image? Is the collection getting the full base64 string? Seems like its not getting any if its no data found.
    The javascript console is your friend.
    Also, in the example i used an extra page, from what one of the examples on apex packages apps had. But since then, I found this post by Carl: http://carlback.blogspot.com/2008/04/new-stuff-4-over-head-with-clob.html - I would use this technique for submitting the clob, over what I have done - as its less hacky. Just sayin.

  • Xml data into dynamic texttield

    Hello there
    I was trying to get xml data into a listBox and textArea. Then when I try to get it into a dyamic textField it gets the first one and not changing as i select different item in the listbox. sure there is a way. also i want to make it clickable so it go to a web page. can you help me please.
    Appreciate your time and help
    Krish

    hi
    here is the flahttp://www.naturecareasia.com/test/learnCS4.flv.fla
    Thank you

  • Insert XML file into Relational database model without using XMLTYPE tables

    Dear all,
    How can I store a known complex XML file into an existing relational database WITHOUT using xmltypes in the database ?
    I read the article on DBMS_XMLSTORE. DBMS_XMLSTORE indeed partially bridges the gap between XML and RDBMS to a certain extent, namely for simply structured XML (canonical structure) and simple tables.
    However, when the XML structure will become arbitrary and rapidly evolving, surely there must be a way to map XML to a relational model more flexibly.
    We work in a java/Oracle10 environment that receives very large XML documents from an independent data management source. These files comply with an XML schema. That is all we know. Still, all these data must be inserted/updated daily in an existing relational model. Quite an assignment isn't it ?
    The database does and will not contain XMLTYPES, only plain RDBMS tables.
    Are you aware of a framework/product or tool to do what DBMS_XMLSTORE does but with any format of XML file ? If not, I am doomed.
    Constraints : Input via XML files defined by third party
    Storage : relational database model with hundreds of tables and thousands of existing queries that can not be touched. The model must not be altered.
    Target : get this XML into the database on a daily basis via an automated process.
    Cheers.
    Luc.

    Luc,
    your Doomed !
    If you would try something like DBMS_XMLSTORE, you probably would be into serious performance problems in your case, very fast, and it would be very difficult to manage.
    If you would use a little bit of XMLType stuff, you would be able to shred the data into the relational model very fast and controlable. Take it from me, I am one of those old geezers like Mr. Tom Kyte way beyond 40 years (still joking). No seriously. I started out as a classical PL/SQL, Forms Guy that switched after two years to become a "DBA 1.0" and Mr Codd and Mr Date were for years my biggest hero's. I have the utmost respect for Mr. Tom Kyte for all his efforts for bringing the concepts manual into the development world. Just to name some off the names that influenced me. But you will have to work with UNSTRUCTURED data (as Mr Date would call it). 80% of the data out there exists off it. Stuff like XMLTABLE and XML VIEWs bridge the gap between that unstructured world and the relational world. It is very doable to drag and drop an XML file into the XMLDB database into a XMLtype table and or for instance via FTP. From that point on it is in the database. From there you could move into relational tables via XMLTABLE methods or XML Views.
    You could see the described method as a filtering option so XML can be transformed into relational data. If you don't want any XML in your current database, then create an small Oracle database with XML DB installed (if doable 11.1.0.7 regarding the best performance --> all the new fast optimizer stuff etc). Use that database as a staging area that does all the XML shredding for you into relational components and ship the end result via database links and or materialized views or other probably known methodes into your relational database that isn't allowed to have XMLType.
    This way you would keep your realtional Oracle database clean and have the Oracle XML DB staging database do all the filtering and shredding into relational components.
    Throwing the XML DB option out off the window beforehand would be like replacing your Mercedes with a bicycle. With both you will be able to travel the distance from Paris to Rome, but it will take you a hell of lot longer.
    :-)

Maybe you are looking for