Cfsavecontent

I am using a Flash file that calls gallery.xml
its hardcoded into the flash and i cant edit the flash file.
the code in my page looks like
[PHP]
<cfsavecontent variable="gallery">
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <gallery frameColor="0xFFFFFF" frameWidth="15" imagePadding="20" displayTime="6" enableRightClickOpen="true">
        <image>
           <url>http://www.modelproductions.com/proimages/avatar9.jpg</url>
           <caption><![CDATA[<font size="50">Example Gallery</font><br>An example large format <u><a href="http://www.airtightinteractive.com/projects/autoviewer">AutoViewer</a></u> gallery.]]></caption>
           <width>269</width>
           <height>317</height>
        </image>
        <image>
           <url>http://www.modelproductions.com/proimages/avatar9.jpg</url>
           <caption>Pellentesque turpis leo, dignissim ac, vestibulum quis, hendrerit quis, enim.</caption>
           <width>465</width>
           <height>700</height>
        </image>
        <image>
           <url>http://www.modelproductions.com/proimages/avatar9.jpg</url>
           <caption><![CDATA[Captions can be HTML formatted. Supported tags are <b>bold</b>, <u>underline</u>, <i>italics</i>, <u><a href="http://www.google.com" target="_blank">hyperlinks</a></u>, linebreaks<br> and <font color="#ffff00" size="60">font tags</font>.]]></caption>
           <width>700</width>
           <height>465</height>
        </image>
    </gallery>
</cfsavecontent>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','wid th','800','height','400','src','autoviewer','quality','high','pluginspage','http://www.ado be.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','autoviewer' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="400">
  <param name="movie" value="autoviewer.swf" />
  <param name="quality" value="high" />
  <embed src="autoviewer.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="400"></embed>
</object></noscript>
</body>
</html>
[/PHP]
but its not working
what am i doing wrong

I am using a Flash file that calls gallery.xml
You have set the Coldfusion variable, variables.gallery, but I don't see it used anywhere. As far as Coldfusion is concerned, variables.gallery is just text.
So, Coldfusion  knows nothing about gallery.xml. If you want Coldfusion to convert the text into XML, then use <cfxml> in place of <cfsavecontent>

Similar Messages

  • How do I have a tabnavigator page specific cfsavecontent?

    How do I write this so that a button on a tabnavigator page
    calls javascript function
    that will pass the correct identifier for the page?
    Any ideas?
    <script language='JavaScript'>
    <cfoutput>
    function GotoPage(ID)
    var sLocation;
    sLocation = "gotoPage.cfm?ID=" + ID;
    parent.location = sLocation;
    </cfoutput>
    </script>
    </head>
    <body >
    <h1>Information</h1>
    <cfoutput>
    <cfform name='form_Info' format="flash" method="POST"
    width="90%" height="500" skin="haloBlue" action="NextPage.cfm">
    <cfformgroup type="hbox" label="Client">
    <cfformitem type="html">
    <cfinput type="text" id="ClientName" name="ClientName"
    value="John Smith, Inc." size="60" label="Name: "/>
    </cfformitem>
    </cfformgroup>
    <cfformgroup type="tabnavigator">
    <cfformgroup type="page" label="John Smith">
    <cfformitem type="html">
    <cfinput type="text" id="EmployeeName"
    name="EmployeeName" value="John Smith" size="60" label="Name:
    "/>
    </cfformitem>
    <cfinvoke
    component="PhoneNumbers"
    method="List"
    returnvariable="rsContactInfo"
    >
    <cfformgroup type="tabnavigator" id="tabContactInfo">
    <cfloop query="rsContactInfo">
    <cfformgroup type="page" label="#rsContactInfo.type#">
    <cfformitem type="html">
    <cfinput type="text"
    id="ContactInfoPhone_#rsContactInfo.id#"
    name="ContactInfoPhone_#rsContactInfo.id#" size="20" maxlength="14"
    mask="(999) 999-9999" validate="telephone"
    validateAt="onBlur,onSubmit" message="Error in Phone
    entry.\nFormat: (999)999-9999" value="#rsContactInfo.phone#"
    label="Phone: "/>
    </cfformitem>
    <!--- Problem: --->
    <cfsaveContent variable="gotoPagejs">
    <!--- Use getURL to call JS from Flash --->
    getURL("javascript:GotoPage(#rsContactInfo.id#);");
    </cfsavecontent>
    <cfinput name="Order" type="button" value="Create Book
    Order" onClick="#gotoPagejs#">
    </cfformgroup>
    </cfloop>
    </cfformgroup>
    </cfformgroup>
    </cfformgroup>
    <cfinput name="Save" type="submit" value="Save
    Changes">
    </cfform>
    </cfoutput>
    </body>
    </html>

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    * http://kb.mozillazine.org/Zoom_text_of_web_pages
    You can use one of these extensions to adjust the default font size and page zoom on web pages:
    * Default FullZoom Level - https://addons.mozilla.org/firefox/addon/6965
    * NoSquint - https://addons.mozilla.org/firefox/addon/2592

  • Actionscript used in cfsavecontent vs cfformitem (type="script")

    I'm still trying to grasp why cfsavecontent is oft used in
    conjunction with cf flash rich forms. What would be the main
    impetus for using actionscript contained in cfsavecontent vs. using
    actionscript contained in the form (<cfformitem
    type="script">). Just trying to grasp this essential issue and
    can't seem to find it explained anywhere.
    Thanks!!!
    Tony Patch

    Tony,
    My guess is that they had their apps written before the 7.01
    updater which added the type="script" attribute for cfformitem.
    Everything I have seen points to using the new functionality. Not a
    very "geek" answer.
    Steve

  • Parsing a parameter into CFSAVECONTENT

    Hello,
    I am trying to use CFSAVECONTENT so that I can easily
    maintain a bit of code that I want to use on a single web page
    multiple times. However, I need to parse a parameter (variable)
    into it which I don't seem to be able to do. Is this possible? If
    not, is there another way of achieving this without the use of
    CFINCLUDE? My website is a Fusebox 4 application.
    Many thanks,
    Simon Bingham

    If not, is there another way of achieving this without the use
    of CFINCLUDE?
    Even if there was, why would you bother? CFINCLUDE is
    arguably the most efficient re-use tool in all of Coldfusion. Then
    there are CTs and UDFs, as Dan has mentioned.

  • How to handle Coldfusion SOAP Web Service Errors

    Hi,
    I have just created simple wsdl example:
    My Component:
    <cfcomponent displayname="mytest">
        <cffunction name="service_login_authentication" access="remote" output="true" returntype="any" hint="Returns login">
         <cfargument name="login" type="string" required="yes">
            <cfargument name="password" type="string" required="yes">
              <cfif #arguments.login# eq "abcdef" and #arguments.password# eq "123456">
                      <cfxml variable="soapRes">                
                            <kps_response>
                                <message>OK</message>
                                <token>354dfdffsdf</token>
                             </kps_response>
                        </cfxml>
                 <cfelse>
                         <cfthrow type="MyException" message="INVALID LOGIN" errorcode="1000" />
             </cfif>        
          <cfreturn soapRes >
        </cffunction>
    </cfcomponent>
    Its generating wsdl and no problem with response but when generating any error like username and password does not match then it's generating fault code like this:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
          <soapenv:Fault>
             <faultcode>soapenv:Server.userException</faultcode>
             <faultstring>coldfusion.xml.rpc.CFCInvocationException: [coldfusion.runtime.CustomException : INVALID LOGIN. ]</faultstring>
             <detail>
                <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">HOST_NAME</ns1:hostname>
             </detail>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    But I want customize Fault Code like this:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
          <soapenv:Fault>
             <faultcode>1000</faultcode>
             <faultstring>INVALID LOGIN</faultstring>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    Fault Code and Fault String should be customize and I don't want detail tag completely. In old ColdFusion version like ColdFusion 8 displaying detail tag with <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/"> coldfusion.xml.rpc.CFCInvocationException: and so on.
    Any suggestions on how to create customize faultcode and faultstring is very helpful.
    Thanks!!

    But my component is not produces this fault code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                   
                                <soapenv:Body>                   
                                      <soapenv:Fault>                   
                                         <<faultcode>1000</faultcode>                   
                                                   <faultstring>INVALID LOGIN</faultstring>                   
                                      </soapenv:Fault>                   
                                   </soapenv:Body>                   
    </soapenv:Envelope>
    What is your ColdFusion Version as i have checked in ColdFusion 11 developer edition and ColdFusion 8 enterprise which is on window 2003 server.
    Could you please check my below component, did i am doing something wrong.
    <cfcomponent output="false">
        <cffunction name="service_login_authentication" access="remote" output="true" returntype="any" hint="Returns login">
         <cfargument name="login" type="string" required="yes">
            <cfargument name="password" type="string" required="yes">
      <cfset var isLoginValid = False>
            <cftry>
              <cfif #arguments.login# eq "1111" and #arguments.password# eq "1111">
                  <cfset isLoginValid = True>
                </cfif>
                 <cfif isLoginValid>
                        <cfsavecontent variable="soapRes"><?xml version="1.0" encoding="UTF-8"?>           
                           <kps_response>           
                               <message>OK</message>           
                               <token>354dfdffsdf</token>           
                            </kps_response>           
                         </cfsavecontent>           
                    <cfelse>           
                        <cfthrow type="MyException" message="INVALID LOGIN" errorcode="1000" />           
                    </cfif>
                      <cfcatch type="MyException">           
                         <cfsavecontent variable="soapRes">               
                                <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                   
                                <soapenv:Body>                   
                                      <soapenv:Fault>                   
                                         <<cfoutput><faultcode>#cfcatch.errorCode#</faultcode>                   
                                                   <faultstring>#cfcatch.message#</faultstring></cfoutput>                   
                                      </soapenv:Fault>                   
                                   </soapenv:Body>                   
                                </soapenv:Envelope>                  
                           </cfsavecontent>
                    </cfcatch>
                </cftry>     
          <cfreturn soapRes >
        </cffunction>
    </cfcomponent>
    If my component is okay then may be possible some setting in ColdFusion administrator. i have checked in SoapUI as well via getSoapResponse method.

  • Creating a cfhttp multi part form post for google docs upload

    Hey all,
    If you saw my last thread, you know I am working with google docs and uploading documents to it. Well I got basic document uploading working, but now I am trying to include meta data. Google requires you to include the metadata with the actual file data and seperate them by using a multi part form upload. I don't know exactly the process for doing so, but they have a handy code snippet of the desired results at
    http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#UploadingDoc s
    So I am basically trying to mimic that payload, however I am continually getting an error stating that there are no parts in a multi part form upload.
    <errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain><code>InvalidEntryException</code><internalReason>No parts detected in multipart message</internalReason></error></errors>
    to be exact. I am not really sure what I am doing wrong here. I figure it is one of two things, either I am not including the actual data in the payload properly (I am currently using a body type param for the payload, but I have also tried a formfield named content to deliver it. Neither worked). So maybe I need to do something else tricky there? The other thing which I am not reallly sure about is the content-length attribute. I don't know exactly how to calculate that, and I read in another forum that a content length attribute was messing that guy up. Right now I am just taking the lenght of the payload string and multiplying by 8 (to get the number of bytes for the entire payload) but hell if I know if that is right. It could be I just don't know how to set up the parts for the message, it seems pretty straight forward though. Just define a boundary in the content-type, then put two dashes before it wherever you define a new part, and two dashes trailing the last part.
    Anyway, here is my code, any help is much appreciate. I'm a bit beyond my expertise here (not really used to trying to have to roll my own http requests, nevermind multipart post form data) so I'm kinda flailing around. Thanks again.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="filePath" type="string" required="false" hint="file to upload.">
        <cfargument name="docType" type="string" required="yes" hint="The document type to identify this document see google list api supported documents">
        <cfargument name="parentCollectionId" type="string" required="no" hint="the name of the collection/collection to create (include collection%3A)">
        <cfargument name="metaData" type="struct" required="no" hint="structure containing meta data. Keyname is attribute name, value is the value">
        <cfset var result = structnew()>
        <cfset result.success = true>
        <cftry>
            <cfif structkeyexists(arguments,"parentCollectionId")>
                      <cfset arguments.parentCollectionId = urlencodedformat(parentCollectionId)>             
                      <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/#arguments.parentCollectionId#/contents">
                <cfelse>
                        <cfset result.theUrl = "https://docs.google.com/feeds/default/private/full/">
            </cfif>
             <cfoutput>
                  <cffile action="read" file="#arguments.filePath#" variable="theFile">
                <cfsavecontent variable="atomXML">
                     Content-Type: application/atom+xml
                    <?xml version='1.0' encoding='UTF-8'?>
                    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
                      <category scheme="http://schemas.google.com/g/2005##kind"
                          term="http://schemas.google.com/docs/2007###arguments.docType#"/>
                        <cfloop collection="#arguments.metaData#" item="key">
                            <#key#>#arguments.metadata[key]#</#key#>
                        </cfloop>
                    </entry>
                    --END_OF_PART
                    Content-Type: text/plain
                    #theFile#
                    --END_OF_PART--
                </cfsavecontent>       
            </cfoutput>      
            <cfset result.postData = atomXML>
            <cfhttp url="#result.theUrl#" method="post" result="httpRequest" charset="utf-8" multipart="yes">
                <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
                <cfhttpparam type="header" name="GData-Version" value="3">
                <cfhttpparam type="header" name="Content-Length" value="#len(trim(atomXML))*8#">           
                <cfhttpparam type="header" name="Content-Type" value="multipart/related; boundary=END_OF_PART">
                <cfhttpparam type="header" name="Slug" value="test file --END_OF_PART">
                <cfhttpparam type="body" name="content" value="#trim(atomXML)#">
            </cfhttp>
            <cftry>
                   <cfset packet = xmlParse(httpRequest.fileContent)>
                <cfif httpRequest.statusCode neq "201 created">
                    <cfthrow message="HTTP Error" detail="#httpRequest.fileContent#" type="HTTP CODE #httpRequest.statusCode#">
                </cfif>
                <cfset result.data.resourceId = packet.entry['gd:resourceId'].xmlText>
                <cfset result.data.feedLink = packet.entry['gd:feedLink'].xmlText>
                <cfset result.data.title = packet.entry.title.xmlText>  
                <cfset result.data.link = packet.entry.title.xmlText>    
                <cfcatch>
                     <cfset result.data = httpRequest>
                </cfcatch>
            </cftry>       
            <cfcatch type="any">
                 <cfset result.error = cfcatch>
                <cfset result.success = false>
            </cfcatch>
        </cftry>   
        <cfreturn result>
    </cffunction>
    Also, this is what my atomXML data ended up looking like when it got sent to google. This isn't the WHOLE request (it doesn't include the headers, just the body).
    Content-Type: application/atom+xml
    <?xml version='1.0' encoding='UTF-8'?>
    <entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007">
    <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#document"/>
    <TITLE>Woot Test</TITLE> </entry>
    --END_OF_PART
    Content-Type: text/plain
    I'm a test document lol!
    --END_OF_PART--

    Woot, I got it. I had to send the gData version number, and change the URL.
    Here is the working function.
    <cffunction name="upload" access="public" returnType="any" hint="I upload the document." output="false">
        <cfargument name="myFile" type="string" required="false" hint="file to upload.">
        <cfset var result = "">
        <cfset theUrl = "https://docs.google.com/feeds/default/private/full">
        <cffile action="read" file="C:\website\xerointeractive\testing\test.txt" variable="theFile">
        <cfset fileSize = createObject("java","java.io.File").init("C:\website\xerointeractive\testing\test.txt").length()>
        <cfhttp url="#theURL#" method="post" result="result" charset="utf-8" >
            <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#getAuth()#">
            <cfhttpparam type="header" name="Content-Type" value="text/plain">
            <cfhttpparam type="header" name="Slug" value="test file">
            <cfhttpparam type="header" name="GData-Version" value="3">
            <cfhttpparam type="header" name="Content-Length" value="#fileSize#">
            <cfhttpparam type="body" value="#theFile#">
        </cfhttp>
        <cfreturn result>
    </cffunction>

  • Web service call with v3 client cert in CF8

    I'm trying to call an external web service which requires a
    v3 client certificate be installed on our end. Our code platform is
    CF8, which I understand supports v3 certs. I've imported the
    external party's client cert into the CF server's cert store
    (cacerts) via keytool, and confirmed it's there. I've restarted the
    CF server. How do I attach the certificate to the cfhttp call to
    the external web service? I figure I can use a cfhttpparam, but am
    not sure what type to use, and what the value should be. Thanks in
    advance.

    DrewBlah wrote:
    > I'm trying to call an external web service which
    requires a v3 client
    > certificate be installed on our end. Our code platform
    is CF8, which I
    > understand supports v3 certs. I've imported the external
    party's client cert
    > into the CF server's cert store (cacerts) via keytool,
    and confirmed it's
    > there.
    You should not import the client certificate, but the server
    certificate:
    http://www.talkingtree.com/blog/index.cfm/2004/7/1/keytool
    http://jochem.vandieten.net/2008/02/28/cfhttp-and-client-certificates/
    > I've restarted the CF server. How do I attach the
    certificate to the
    > cfhttp call to the external web service? I figure I can
    use a cfhttpparam, but
    > am not sure what type to use, and what the value should
    be. Thanks in advance.
    The certificate for the HTTP call should be on the filesystem
    in PKCS#12
    format. Then use the following code:
    <cfset variables.certificatePath =
    ExpandPath("certificate.pkcs") />
    <cfset variables.certificatePass =
    "fillOutYourOwnPassword"/>
    <cfset variables.webserviceURL = "https://server/service"
    />
    <cfsavecontent variable="theSoap">
    <soapenv:Envelope
    xmlns:soapenv="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns="https://server/service">
    <soapenv:Header/>
    <soapenv:Body>
    <ns:GetXXX>
    <xxx>YYY</xxx>
    </ns:GetXXX>
    </soapenv:Body>
    </soapenv:Envelope>
    </cfsavecontent>
    <cfhttp
    url = "#variables.webserviceURL#"
    clientCert = "#variables.certificatePath#"
    clientCertPassword = "#variables.certificatePass#"
    method = "get"
    port="443"
    >
    <cfhttpparam type="header" name="Connection"
    value="Keep-Alive">
    <cfhttpparam type="header" name="SOAPAction"
    value="service">
    <cfhttpparam type="xml" value="#theSoap#">
    </cfhttp>
    <cfdump var="#XMLParse(cfhttp.filecontent)#">
    Jochem
    Jochem van Dieten
    Adobe Community Expert for ColdFusion

  • How can I use cfc query result to grid.dataprovider

    In rich from ,I builder a button , when it click ,I want to
    use cfc query some sql result ,and put it in grid.
    I use flower code ,but it have error ,help me !!!
    <CFSAVECONTENT variable="upd_query">
    <cfinvoke
    component="test.components.Getorder"
    method="GetAllorder"
    returnvariable="GetAllorderRet">
    </cfinvoke>
    <cfif Isstruct(GetAllorderRet)>
    s_ghid1.visible= false;
    abc.text = "The GetallorderRet is struct";
    </cfif>
    <cfoutput>
    listorder.dataProvider = [#GetAllorderRet.];
    </cfoutput>
    </CFSAVECONTENT>
    In form:
    <cfinput type="button" name="s_search" style="
    borderThickness:1;" onClick="#upd_query#"
    value="Search"/>

    Can you expand on that? I'm sorry but I am new and a novice to the SSIS world and I want to do this as best I can and as efficiently as I can. Are you saying that Rajen's way suggested above is the way to go?
    A little background....external data from a 3rd party client. I'v staged that external data to a SQL Server staging table. I have to try and match that data up to our database using SSN, DOB, and Gender...and if I can't match that way then I have to try
    and match by Name. I need to make sure that there is only one and only one account for that match. If I cannot match and match one and only one, then I'll create rows on a DataAnomaly Table. If I do match, then I have to check and make sure that there is only
    one and only one Member span for that match. Similarly handle the data anomaly and then check and make sure there is a "Diabetes" claim and similarly handle the DataAnomaly accordingly.
    That's where I'm at. Sooooo are you saying to use Rajen's suggestion? I don't think I can do that because I need multiple SQL tasks and I cannot connect multiple OLE DB Source tasks.
    Any help and suggestions are greatly appreciated.
    Thanks.

  • CMS System to create a page on the server

    Hi all,
    I am looking for a way for ColdFusion to create and save an
    html (or cfml) page generated by a user entering text into a form
    field on an html template page and submitting the text.
    I am looking to build an email system to allow the client to
    create email mailshots and to provide a link to an online html page
    if the email does not display correctly.
    I have built the aspect of it whereby the user can send the
    email, I just need the content of that email to be saved as an html
    page with todays date as the filename on the server.
    Any suggestions appreciated.
    Thanks,
    Paul

    2 cf tags will help you:
    <cffile> and <cfsavecontent>
    you my need only cffile, depending on how your form is
    constructed and
    how you process it...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • How do I use the form checkbox value?

    I'm creating a form that has multiple checkboxes. I want to
    use ActionScript to update a text box/area with the values each
    checkbox as the checkbox is selected. Any ideas on how I might do
    that?
    SAMPLE CODE ATTACHED.

    I figured out how to do it using both the last poster's
    comments, and some others that I found.
    A form is created using cfform format=flash.
    A cfinput text box is created and flagged as not visible.
    The "invisible" input value is set after a cfoutput
    query="xxxx"
    is completed.
    Since I'm using the query to do double duty, I have a group
    set.
    My "second" group is the one on which I wanted the check
    boxes to
    be created dynamically.
    I set a counter, and kept track of when a check box was
    created.
    The value of the counter was eventually set as the value of
    my
    first "invisible" text box.
    Here's the code:
    <cfformgroup type="horizontal" height="1" visible="no">
    <cfif #BoxCount# GT 0>
    <cfoutput><cfinput name="BoxQty" type="text"
    value="#BoxCount#" visible="no" size="3"></cfoutput>
    </cfif>
    </cfformgroup>
    Each check box was given a unique name, text + counter.
    ex. camp#BoxCount#
    A corresponding "invisible" text box was created:
    ex. cost#BoxCount#
    This way I can test if the check box "value" is true/false,
    and
    set a cost accumulator to the proper cost.
    My cfsavecontent code looks like this:
    // COST TOTAL
    var a = Number(BoxQty.text);
    var i = 0;
    var j = 0;
    var u = 0;
    var x = 0;
    var s = "";
    for( i=1; i<=a; i++ )
    r = "camp"+i;
    if( eval(r).value ) // just like the JS eval()
    // box was checked, i.e. is "true"
    s = "cost"+i;
    j = Number(eval(s).text);
    if( j > 0 ) x = x + j; // add to the total accumulator
    //campCost is the cfinput text box used to display the total
    cost.
    campCost.text = 0;
    if( x != 0 )
    campCost.text = "$" + x + ".00";

  • Can anyone explain what is happening in this example?

    Take a look at the following bit of CFML:
    <!---\\ This is a coldfusion comment \\--->
    <cfif false>
              <cfsavecontent variable="Test">
                        <?xml version="1.0" encoding="utf-16"?>
              </cfsavecontent>
    </cfif>
    <!---\\ Some other coldfusion code \\--->
    <cfset Foo = 'Hello '>
    <cfset Bar = 'World'>
    <cfset FooBar = Foo & Bar>
    Seems like some simple test code right? Shouldn't generate any output at all right? Now take that sample and go run it. Are you staring at a jumble of oddly encoded characters that basically contain all of the unprocessed CFML code on the page? Because that's exactly what I'm looking at.
    It's the craziest thing! The root issue is the "utf-16" attribute of the XML declaration. If you remove that or change it to something like "utf-8", everything is fine. The points that really muddle my brain are:
    The XML declaration is inside a "cfsavecontent" tag so it should just be a string
    The "cfsavecontent" should not even be evaluated because it's inside of a "cfif" that's hard-coded to false
    My coworker came across this while trying to save some XML as a string so he could write it to a file later. It really seems like a crazy bug to me but I'd like to hear what others think is going on here. For your info, we're running CF9 standard on a Win2k8 R2 system.

    The only thing I can think is that the file itself is saved with UTF-16 encoding, and the CF compiler is baulking at that. That said, I emulated this on my PC and my CF install (same as Duncan's, we work in the same office) dealt with it just fine.
    If the file is saved in any sort of non-ANSI encoding, you will need a <cfprocessingdirective> at the top of the file to tell the CF compiler how to read the file.
    Adam

  • Converted internalServerReporting from .php to .cfm

    I posted this on the general discussion forum but it doesn't seem to be getting any looks....
    Hi
    I recently converted the internalServerReporting.php file to .cfm, since I'm not yet using a LMS and I just needed to capture quiz results.
    I'm writing the results of my Captivate 7 quiz to a .txt file successfully (an insert query too). My Captivate 7 quiz completes and immediately after the user fills out and clicks the Send button in the Post Results dialog box (where they enter their name and email id) I get an Adobe Captivate error message in a dialog box with "Unknown Error" and an OK button.
    I think this is a Captivate error and not a Coldfusion error, as my Coldfusion "internalServerReporting.cfm" writes the text file as expected, and the Coldfusion server error logs are empty. Does anyone know how I can turn on/enable any available debugging data in Captivate so that I can trap this error?
    For your convenience my .cfm file is pasted below.
    Thanks in advance for your help,
    Rich
    Rich Leach
    Interactive Media Developer
    Advanced Certified ColdFusion Developer
    <cfsavecontent variable="results">
    <cfoutput>
    Company name: #form.companyname#<br>
    Department name: #form.departmentname#<br>
    Course name: #form.coursename#<br>
    File name: #form.filename#<br>
    File data: #form.filedata#<br>
    <cfset retXml=#xmlParse(form.filedata)#>
    Learner name: #retXml.Course.LearnerName.xmlAttributes["value"]#<br>
    Learner email: #retXml.Course.LearnerID.xmlAttributes["value"]#<br>
    Lesson name: #retXml.Course.LessonName.xmlAttributes["value"]#<br>
    Quiz attempts: #retXml.Course.QuizAttempts.xmlAttributes["value"]#<br>
    Total questions: #retXml.Course.TotalQuestions.xmlAttributes["value"]#<br>
    Status: #retXml.Course.Result.CoreData.Status.xmlAttributes["value"]#<br>
    Location: #retXml.Course.Result.CoreData.Location.xmlAttributes["value"]#<br>
    Raw Score: #retXml.Course.Result.CoreData.RawScore.xmlAttributes["value"]#<br>
    Max Score: #retXml.Course.Result.CoreData.MaxScore.xmlAttributes["value"]#<br>
    Min Score: #retXml.Course.Result.CoreData.MinScore.xmlAttributes["value"]#<br>
    Session Time: #retXml.Course.Result.CoreData.SessionTime.xmlAttributes["value"]#<br >
    </cfoutput>
    </cfsavecontent>
    <cffile action="write" file="/Applications/ColdFusion10/internal.timetracker/runtime/work/Ca talina/localhost/tmp/captivateTestResults.txt" output="#results#" nameconflict="overwrite">

    Jim
    ...jeez, what a rookie mistake....
    I did some debugging and found this reported error in my browser (Chrome):
    XMLHttpRequest cannot load http://127.0.0.1:8503/captivate/internalServerReporting.cfm. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
    From my years of web development I immediately recognized this error; it's a cross domain issue. But, I'm running everything localhost, what's not in the same dom.... Oh yeah, right after publishing the Captivate movie a dialog box appears "Publish was successful. Do you wish to view the output?" Naturally I clicked yes, which opened the .html file locally in my browser (as in File:Open) and NOT served from the web server (as in http://127.0.0.1/myCaptivateTest/).
    As soon as I ran my Captivate test movie from the web server everything ran just fine.
    Thanks for your help and patience. This script officially now works, so if anyone needs to record Captivate test/quiz results on a Coldfusion server, feel free to copy the above Coldfusion code into your own "internalServerReporting.cfm" and tell Captivate in your preferences where to expect it on your Coldfusion server.
    Rich

  • Using conditional statements stored inside a variable

    I'm trying to store the body of different emails inside of my
    database to use in email sent with cfmail. The content of the
    emails has conditional statements using cfif and other variables
    based on a query running. If I set the content as a variable and
    then place that inside of the cfmail tag it does not process the
    cold fusion code. Is there a way that I can process this code so
    that the final output is what is placed within the cfmail tag or is
    it not possible to do what I'm trying to accomplish? Thanks in
    advance for any ideas.

    Here is a sample taken from the text file. The output created
    by the cfsavecontent tag is identical to the text file.
    Dear <cfif IsDefined(GetData.strFirstName) AND
    GetData.strFirstName IS NOT
    "">#GetData.strFirstName#<cfelse>Member</cfif>,
    Thank you for joining xxxxxxxxx. We're glad to
    have you as a member and appreciate your support. Your
    membership
    application has been processed and your member packet will
    arrive soon.
    Your new membership number is #GetData.strCustomerID#. This
    number is useful
    when buying product from our online store, renewing your
    membership or
    contacting us with questions or comments.
    <cfif GetData.ExpirationDate IS "9999-12-1">We are
    especially grateful for your commitment to xxxxxxxx
    through your Life Membership.<cfelse>Your membership is
    current through #DateFormat(GetData.ExpirationDate, "MMMM
    YYYY")#.</cfif>

  • How to use SOAP in ColdFusion

    Hi All,
    The code set am using as follows
    index.cfm
    <cfsavecontent variable="soap">
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope
            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://one.dileep.com/soaptest/"><!---1 this is the cfc location--->
        <soapenv:Header>
        <setInit>1</setInit>
        <!--- 2 header param --->
        </soapenv:Header>
        <soapenv:Body>
            <addNumbers soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
            <!---3 cfc method name --->
                <firstNumber>1000</firstNumber>
                <secondNumber>10</secondNumber>
            </addNumbers>
           </soapenv:Body>
    </soapenv:Envelope>
    </cfsavecontent>
    <cfhttp url="http://one.dileep.com/soaptest/soaptest.cfc" method="post">
        <cfhttpparam type="header" name="content-type" value="text/xml">
        <cfhttpparam type="header" name="SOAPAction" value="">
        <cfhttpparam type="header" name="content-length" value="#len(soap)#">
        <cfhttpparam type="header" name="charset" value="utf-8">
        <cfhttpparam type="xml" name="message" value="#trim(soap)#">
    </cfhttp>
    <cfdump var="#xmlparse(cfhttp.FileContent)#">
    soaptest.cfc
    <cfcomponent output="false" >
        <cffunction name="addNumbers" access="remote" returntype="any" output="false">
            <cfargument name="firstNumber" type="string" required="true"/>
            <cfargument name="secondNumber" type="string" required="true"/>
            <cfset retunVal="NO">
            <cfset username=0>
            <cfif isSOAPRequest()>           
                <cfset username = getSOAPRequestHeader("http://one.dileep.com/soaptest/", "setInit")>
                <!---4 retrieving  SOAP header value --->
            </cfif>
            <cfreturn arguments.firstNumber + arguments.secondNumber & username   />
        </cffunction>
    </cfcomponent>
    This is the right way for implimenting SOAP in COLDFUSION webservice ?
    More Questios
    1- <!---1 this is the cfc url--->
    What is the relevance of the cfc URL ? I am using sub domains
    eg : one.dileep.com, two.dileep.com,yyy.dileep.com, in this case the cfc url 'http://<<subdomain>>.dileep.com/soaptest/' should changed accordingly?
    2-<!--- 2 header param --->
    We have to give any tag name as Header?
    3- <!---3 cfc method name --->
    SOAP body  tag must be the method name that we need to exicute?
    Here, I have to execute method 'addNumbers'
    4- <!---4 retrieving  SOAP header value --->
    While retrieving the header value should we need to specify the cfc url?('http://<<subdomain>>.dileep.com/soaptest/')
    Please help.

    Have you read the chapter in CFWACK vol 3 on working with webservices?  It's not very in-depth, but has some pointers and the usual lame-a** code example.
    Depending on the complexity of what you are trying to do, you might be better off building a RESTful service instead of a SOAP service.  Despite it's name, SOAP tends to be overkill if all you are doing is passing a couple of args to the webservice, but is good if the request is complex.  REST is easiest if you are just sending a couple of args, but a pain in the a** if you are trying to do something complex in a single operation (works better to break down into individual state-changing calls to individual webservices).
    A couple of comments on what you are doing in your code:
    It's a lot simpler to use CFINVOKE than to roll your own webservice HTTP call.  If you're writing your own webservice this should be especially true.  I've ended up using CFHTTP to call vendor's webservices that I had no control over and wouldn't work with CFINVOKE, but that is the case where I've seen that to be true.  Check out the example in CFWACK.
    If you continue on the CFHTTP route, you might find it easier to use the CFXML tag instead of using CFSAVECONTENT to create the XML variable - this will allow CF to validate the xml document and ns references.  It also allows you to use the CFDUMP tag to get a formatted view of the xml doc to help with debugging.
    Most of the CFHTTPPARAMS you have included in your call are not really needed, at least that's been my experience.  For example, this is all I ever use in my SOAP calls:
       <cfhttp url="https://adwords.google.com/api/adwords/cm/v200909/AdGroupAdService" method="post">
        <cfhttpparam name="SOAPAction" type="header" value=""/>
        <cfhttpparam type="xml" value="#ToString(variables.adAd)#"/>
       </cfhttp>
    "variables.adAd" is the xml doc created by this code:
       <cfxml variable="adAd">
        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v20="https://adwords.google.com/api/adwords/cm/v200909" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
           <soapenv:Header>
              <v20:RequestHeader>
                   authorization data goes here
              </v20:RequestHeader>
           </soapenv:Header>
           <soapenv:Body>
                   magic happens here
           </soapenv:Body>
        </soapenv:Envelope>
       </cfxml>
    Hope this helps.  My experience in this is that it requires some trial and error and lots of CFDUMPs to get it right the first time, but after you get over that initial hurdle it all suddenly "makes sense" from then on.
    Reed

  • Consuming a Webservice is extremly slow

    Hi
    I would like to use a Webservice to communicate with a
    server. For test purposes I wrote a small java webservice which
    adds to numbers using the following 2 classes.
    == Class Calculator ==
    package de.theserverside.webservice.service;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    import javax.jws.soap.SOAPBinding.Style;
    @WebService
    @SOAPBinding(style=Style.RPC)
    public class Calculator
    public long addValues(int val1, int val2) {
    return val1 + val2;
    == Class CalculatorServer ==
    package de.theserverside.webservice.service;
    import javax.xml.ws.Endpoint;
    import de.theserverside.webservice.service.Calculator;
    public class CalculatorServer {
    public static void main (String args[]) {
    Calculator server = new Calculator();
    Endpoint endpoint =Endpoint.publish("
    http://<IP Adresse>/calculator?wsdl",
    server);
    In Coldfusion I tested both methods to consume this
    Webservice:
    <cfinvoke webservice="
    http://<IP Adresse>/calculator?wsdl"
    method="addValues" returnvariable="aString">
    <cfinvokeargument name="arg0" value="1"/>
    <cfinvokeargument name="arg1" value="6"/>
    </cfinvoke>
    <cfoutput>#aString#</cfoutput>
    == mit cfskript ==
    <cfscript>
    ws = createObject("webservice","
    http://<IP
    Adresse>/calculator?wsdl");
    xlatstring = ws.addValues(2,9);
    </cfscript>
    <cfoutput>#xlatstring#</cfoutput>
    The Webservice works with both methods but it takes between 5
    and 6 Minutes to get a result.
    I also wrote a java client to test the webservice which
    returned the result within 1 second.
    Whats the problem here with CF?
    I am using CF 8

    I found a third way to call a webservice using chttp. But now
    I have the problem that I cant pass paramaters to my method.
    I wrote a simple hello world method without any paramater and
    it worked within 1 sec.
    When I try to use the addValues method I get this Error:
    ns2:Serverjava.lang.IllegalArgumentException
    here is the CF Code
    <cfsavecontent variable="soap">
    <soapenv:Envelope xmlns:soapenv="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ser="
    http://service.webservice.theserverside.de/">
    <soapenv:Header/>
    <soapenv:Body>
    <ser:addValues>
    <arg0>6</arg0>
    <arg1>34</arg1>
    </ser:addValues>
    </soapenv:Body>
    </soapenv:Envelope>
    </cfsavecontent>
    <cfhttp url="
    http://<IP>/calculator?wsdl"
    method="post">
    <cfhttpparam type="header" name="content-type"
    value="text/xml">
    <cfhttpparam type="header" name="SOAPAction" value="">
    <cfhttpparam type="header" name="content-length"
    value="#len(soap)#">
    <cfhttpparam type="header" name="charset"
    value="utf-8">
    <cfhttpparam type="xml" name="message"
    value="#trim(soap)#">
    </cfhttp>
    <!--- Dump out a nice representation of the SOAP response
    --->
    <cfoutput>#cfhttp.FileContent#</cfoutput>
    <cfdump var="#xmlParse(cfhttp.FileContent)#">

Maybe you are looking for

  • Using a variable in the call scenario

    I´m using ODI 10.1.3.6.8. I´m calling the scenario as follows: ./startscen CENARIO_PRINCIPAL 001 GLOBAL -v=5 GLOBAL.EVENTO=12345 This is my CENARIO_PRINCIPAL within it calls two scenarios using the global variable GLOBAL.EVENTO. When I ran, appears t

  • How to retreive image from StorageApplicationPermissions?

    Hi, I want that the users can change the background of my app. I use fileOpenPicker then Save to Storage to become permanent background. How to retrieve that image when the app is loaded? Here's my code;

  • Need original driver for Jukebox

    I went through all the stages suggested by many on this forum, and I came to the conclusion that I would need the original driver in order to take any further ste ps. Does anyone have the original .0 driver for Jukebox 3 you can upload? I've been goi

  • Maintain Blanks in SXPG_COMMAND_EXECUTE additional parameters

    Hello guys, we are trying to execute some commands in a Z function calling the function SXPG_COMMAND_EXECUTE. We have a command Z and in the additional parameters and we fill the command with CMD('COPY T: Documents PXXX2 IEXXX.DOC \"E: WORK 600613 MA

  • IPod Classic 160GB almost running out of space

    Hi, I am starting to redo my whole CD collection in Apple Lossless Audio Codec,  I am running out of space when I sync.  The reason why I am doing this is because my Mp3 and AAC files sound bad when you hook up the iPod to headphone amps and high end