How does cfoutput instantiate and destroy objects?

I'm working on an old piece of code that watches a directory = checks the files in it and then renames the file to one other parts of the system recognise based on the contents of the file
Now having rationlised this code significantly making use of CFC's I'm having problems in the way in which the code rename's the file -It should rename it based on a string it may find in the doc otherwise it leaves it alone - However at the moment it randomly assigns it a value that is not in the file although I think its holding on to details from another file but I don't know how - I'm running Coldusion 9 and the production server is running CF8- I don't seen to have the problem on my machine but do on the production box
Any help would be deeply appreciated
Thanks

OK thanks - that helps a bit - I'm not yet a confident ColdFusion programmer - I've only been using it for the last month - My background is Java - as <cfoutput> is looping over the <cfdirectory> query - I amtrying to understand how everything is scoped within the loop
This is the actual code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<title>Parse PDFs</title>
<!------>
<meta http-equiv="refresh" content="120" > 
<cfset dumpPDFDir = configFile.getAttributeFromConfigFile("dumpPDFDir")> 
<cfset deliverDir = configFile.getAttributeFromConfigFile("deliverDir")>
<font size="-2">
<a href="au_parse_pdfs.cfm" target="_blank">Parse PDFs</a> -  <b>Last Run <cfoutput>#dateformat(now(),"ddd-dd")#-#timeformat(now(),"HH:mm")#</cfoutput></b><br>
<cfdirectory action="list" directory="#dumpPDFDir#" name="TheList" filter="*.pdf" sort="dateLastModified" recurse="no">
<cfobject component="global.deliverySystem.PDFUtils" name="PDFUtils">
<cfoutput query="TheList">
    <cfset includeFile="True"/>
    <cfif find("INVOICE", ucase(TheList.name[TheList.currentRow]), 0) neq 0>
        <cfset includeFile="False"/>
     </cfif>
    <cfif find("HCP", ucase(TheList.name[TheList.currentRow]),0) neq 0>
        <cfset includeFile="True"/>   
    </cfif>
    <cfif TheList.Type[TheList.currentRow] eq "File"
            <!--- exclude if --->           
            AND find("RECEIPT", ucase(TheList.name[TheList.currentRow]), 0) eq 0
            AND #includeFile#
            AND find("DISPATCH MANIFEST", ucase(TheList.name[TheList.currentRow]), 0) eq 0
            <cfset TheFile = PDFUtils.getPDFAsXml(dumpPDFDir="#dumpPDFDir#",fileName="#TheList.name[TheList.currentRow ]#")/>
            <cfset isValidFile = PDFUtils.isValidFile(file="#TheFile#")/>
            <!---cfdump var="#TheFile#"/--->
            <cfif isValidFile>
                <cfset fileName =""/>
                <cfset EnviroType = "">                   
                <cfif find("~", TheFile)>   
                    <cfset TheFirst = find("~",TheFile)>                    
                    <cfset TheSecond = find("~", TheFile, TheFirst+1)>                   
                    <cfset TheThird = find("~", TheFile, TheSecond+1)>   
                    <cfif TheThird gt TheSecond and TheSecond gt TheFirst and TheThird - TheFirst lt 40>       
                        <cfset FirstString = mid(TheFile,TheFirst+1,TheSecond-TheFirst-1)>                           
                        <cfset SecondString = mid(TheFile,TheSecond+1,TheThird-TheSecond-1)>       
                        <font color="000000" size="-2">name=#name# #TheFirst# / #TheSecond# / #TheThird#  *****    #TheSecond - TheFirst# / #TheThird - TheSecond#   *****  FirstString=*#FirstString#* / SecondString=*#SecondString#* / mmm#left(name,len(name)-4)#mmm<br/></font>
                        <cfif isnumeric(FirstString) and isnumeric(SecondString) and len(FirstString) gt 3 and (len(SecondString) gt 0 and len(SecondString) lt 30)>
                            <cfif SecondString eq "8">
                                <cfset EnviroType = PDFUtils.determineEnviroTypeFromProductType(TheFile="#TheFile#",
                                                                                                 startPoint="#TheFirst#")/>
                            <cfelse>
                                <cfset EnviroType = "$AUT$$">                                                   
                            </cfif>
                        </cfif>
                        <cfset fileName = "#dumpPDFDir#\#trim(FirstString)# #trim(SecondString)##EnviroType#.pdf"/>
                    </cfif>                                                   
                </cfif>
                <cfdump var="#fileName#"/>
                    <cfif fileName NEQ "">                   
                        <cffile action="rename" source="#dumpPDFDir#\#left(name,len(name)-4)#.pdf" destination="#fileName#">               
                        <cfif directoryExists(deliverDir)>
                            <cffile action="copy"  source="#fileName#" destination="#deliverDir#/monitoringDir"/>                   
                            <!---cffile action="move" source="#fileName#" destination="#deliverDir#"--->
                        <cfelse>
                            <font color="FF0000" size="-2">Unable to access directory=#deliverDir#<br/></font>
                        </cfif>   
                    <cfelse>
                        <font color="FF0000" size="-2">name=#name# - not matched<br/></font>
                    </cfif>                                   
            <cfelse>
                <font color="FF0000" size="-2">name=#name# - not found<br/></font>
            </cfif>                   
        <cfelse>
            <font color="FF0000" size="-2">name=#name# - excluded<br/></font>
        </cfif>   
        <cfset StructClear(TheFile)/>
        <cfset fileName = ""/>
        <cfset FirstString = ""/>
        <cfset SecondString = ""/>   
        <cfset EnviroType = "">       
        <cfset TheFirst = "">                    
        <cfset TheSecond = "">                   
        <cfset TheThird = "">       
</cfoutput>
<cfset TheList = ""/>
</body>
</html>
With the function calls to the CFC's being:
<cffunction name="getPDFAsXml" access="public" returnType="String" >
        <cfargument name="dumpPDFDir" type="String" required="true">
        <cfargument name="fileName" type="String" required="true" >
            <cfinvoke component="global.common.config.config"
                         method="getAttributeFromConfigFile"
                      configAttribute="ddxDir"
                      returnvariable="ddxDir"/>
            <cfinvoke component="global.common.config.config"
                         method="getAttributeFromConfigFile"
                      configAttribute="xmlDir"
                      returnvariable="xmlDir"/>
            <cfset inputStruct=StructNew()>
            <cfset inputStruct.doc1="#dumpPDFDir#/#fileName#">
            <cfset outputType="xml"/>
            <cfset outputStruct=StructNew()>
            <cfset outputStruct.Out1= xmlDir & "/" & Replace("readPDF.ddx",".ddx","")&"."&outputType/>
            <cfpdf action="processddx" ddxfile="#ddxDir#/readPDF.ddx" inputfiles="#inputStruct#" outputfiles="#outputStruct#" name="ddxVar">
            <!---cfdump var="#ddxVar#"--->
                <cffile variable="xmlOutput"
                    file="#outputStruct.Out1#"
                    action="read" charset="utf-8" />   
                    <cfset parsedFile = XmlParse(xmlOutput)/>                               
        <cfreturn parsedFile>
    </cffunction>
    <cffunction name="determineEnviroTypeFromProductType" access="public" returnType="String">
        <cfargument name="TheFile" type="Any" required="true"/>
        <cfargument name="startPoint" type="Any" required="true"/>
        <cfset EnviroType = "$AUT$">
        <cfif find("Referred to RPS", left(TheFile, startPoint)) OR find("Certificate", left(TheFile, startPoint)) OR find("RPS Review", left(TheFile, startPoint))>
            <cfif     find("Referred to RPS", left(TheFile, startPoint))>
                <cfset EnviroType = EnviroType & "Referred to RPS$">
            </cfif>
            <cfif     find("Certificate", left(TheFile, startPoint))>
                <cfset EnviroType = EnviroType & "Certificate$">
            </cfif>       
            <cfif     find("RPS Review", left(TheFile, startPoint))>
                <cfset EnviroType = EnviroType & "RPS Review$">
            </cfif>                           
        <cfelse>
            <cfset EnviroType = EnviroType & "$">
        </cfif>   
        <cfreturn EnviroType/>
    </cffunction>
As I said before - this works absolutely fine on my CF9 server but not on the CF8 production server

Similar Messages

  • How can I instantiate and load a new CachedRowSet object from a non-JDBC so

    How can I instantiate and load a new CachedRowSet object from a non-JDBC source?
    cheers

    webrowset reads whole data;
    I would rather need to get data line by line

  • With PS 7  create new  Place two objects on the new file  then you may cut copy and paste Cs2  create new  place two object on the new file Cut is not available how does one cut and paste in new file

    With PS 7
    create new
    Place two objects on the new file
    then you may cut copy and paste
    Cs2
    create new
    place two object on the new file
    Cut is not available how does one cut and paste in new file

    If your using File>Place then photoshop cs2 creates what's known as Smart Objects, which photoshop 7 didn't have.
    In photoshop cs2 you can rasterize the smart objects and that should make the Cut function available.
    Select both placed layers, right click on the area to the right of the tumbnail and select Rasterize Layers.
    If in photoshop cs2 you to Help>Photoshop Help and look under Layers>Smart Objects, that should give you a good overview of what smart objects are.

  • How does Illustrator choose where paste objects appear?

    Just curious. When I copy and paste background images, (or any image for that matter) and paste them, they appear randomly out of alignment, nowhere near where the original object was. How does AI choose where these objects are pasted? I see the paste in place option, but is there a key command, like holding down "shift" to have objects paste where your cursor rests?
    Just a thought/wonder since I can't seem to find this answer anywhere.

    Cmd+F and Cmd+B are really much more useful than Cmd+V.
    They allow you to rearrange the stacking order hands-on instead of moving meatballs in the Layers panel.
    A whole new world opened up for me when I discovered this many decades ago (when Auntie Illie was still young and pretty).

  • My iPhone was stolen and I have contacted the police who are using the meid number to locate.  How does this work and what are my chances of getting the phone back?

    My iPhone was stolen.  I used Find My iPhone app to lock it and display a message.  The phone has not connected to the internet to locate it.  I contacted the police and they have taken my meid number.  How does this work and what are my chances of getting the phone back?  Are there other ways the theif can use it.  I was told once they put in a new sim card and use it, whatever software the police have, it will show up.

    Honestly? In the US (I can't speak to other countries, though I doubt it works much differently in a lot of the world) The police took your report and filed it either in their computers or, on paper. They will now not think of this again. The only time it will cross anyones mind is if, in the course of entering information into evidence about items recovered or seized at a crime scene, the serial number of an iPhone that was found/seized happens to match yours, in which case you will be contacted.
    The police in the US can and will do nothing to 'blok' the phone and it's not worth their time to try and locate it unless you know for a fact that it was stolen by a big time drug lord, master criminal, or some other such prime target and they can get a court order to track the location of the phone in order to locate this individual for your own purposes.  If they do that, they'll probably keep him under surveilance for a year or so before they act.
    Basically, the police don't care about your phone. If they find it, they will give it back to you. They are not, however, going to go looking for it. They have better things to do.
    I'm sorry, but that's the way it is.

  • Using family sharing, how does one view and download songs from a family member's collection in itunes?

    Using family sharing, how does one view and download songs from a family member's collection in itunes?

    When you click on your device you are presented with the pages
    Summary
    Info
    Apps
    Tones
    Music
    Movies
    TV shows
    Books
    Photos
    To remove Audiobooks depending on the type of Audiobook ie a series of mp3 files you will find under music and probably have to deselect the album name to remove it. I don't have any of these as I download from Audible or I use Audiobook Builder to stictch together mp3 files into m4b files. To find these Click on Books you will immediately see a section for books (in reality ebooks). Scroll down past that and you will see Audiobooks where you can select and deselect. Deselect the required Audiobooks and Click Sync

  • I was using my notes earlier today and now for some reason they are all gone. How does this happen and is there anything I can do to get them back, the new ones also that haven't been synced.

    I was using my notes earlier today and now for some reason they are all gone. How does this happen and is there anything I can do to get them back, the new ones also that haven't been synced.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • In Mac Mail on OS 10.5.8 I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.  How does this happen and how can I correct this problem

    n Mac Mail on OS 10.5.8 I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.  How does this happen and how can I correct this problem

    You said:
    I am receiving bogus emails which claim to be sent by people in my address book, but actually are not.
    ...and:
    Are you saying that my address book has not been hacked into?  That others are getting these email addresses from another source?
    This confuses me.  Are you saying that you are receiving bogus e-mails from some of your contacts, or are you saying that they are receiving bogus e-mails from you?
    If the latter, there are a number of reasons that people might be getting e-mail from you.  Malware, though technically possible, is extremely unlikely.  See Someone is sending messages from my e-mail address!
    If the former, that's rather unusual.  The only decent explanation I can think of is that a bunch of your Windows-using contacts got infected with something and their machines are being used to spam everyone in their contact lists, which would include you.

  • How does my Iphone and Nike + work?

    Hi there,
    i'm using for a week the Nike+ sensor, but i've asked myself how does they communicate and i doesn't know.
    Maybe you know the answer, please let me know?

    http://manuals.info.apple.com/en_US/Nike_Plus_iPod_User_Guide.pdf

  • How does Avilability check and TOR  takes place in SD

    How does Avilability check and TOR  takes place in SD? if you have any Tax configuration notes please send it to my mail ID?
    [email protected]
    Gopal

    ATP
    Types of Availability Check in Sales and Distribution
    Processing
    There are three types of availability check:
    _ Check on the basis of the ATP quantities
    _ Check against product allocation
    _ Check against planning
    The following SD-specific control features need to be maintained in Customizing:
    _ Checking group
    The checking group controls whether the system is to create individual or collective
    requirements in sales and shipping processing. In addition, a material block for the
    availability check with transfer of requirements can be set here. The checking group can
    also be used to deactivate the availability check. This option was created especially for
    the assembly order so that when the bill of material is exploded in the assembly order,
    the individual components, if necessary, can be classified as non-critical parts as far as
    procurement is concerned.
    The checking group specifies in combination with the checking rule the scope of the
    availability check. It is proposed in the material master record on the basis of the material
    type and the plant, and copied into the sales and distribution documents.
    _ Checking Rule
    You use the checking rule to control the scope of the availability check for each
    transaction in sales and distribution. You also specify whether the check should be
    carried out including or excluding replenishment lead time. The individual checking rules
    define by transaction, which stock and inward and outward movement of goods should
    be taken into account for the availability check.
    _ Schedule line category
    You can control with the schedule line category whether an availability check and
    transfer of requirements should be carried out in the sales documents. The possible
    settings for this at schedule line level are dependent on the settings in the requirements
    class which is determined from the requirements type of the material.
    _ Delivery item category
    The delivery item category can be used to control whether an availability check takes
    place in deliveries.
    Requirements type
    The various requirements are identified by their requirements type. The requirements
    type refers to the requirements class and its control features.
    _ Requirements Class
    The requirements class contains all control features for planning such as relevance for
    planning, requirements planning strategy and requirements consumption strategy. In
    addition, it is specified at a global level whether an availability check is to take place for
    the material in the sales and distribution documents on the basis of the ATP quantity
    (ATP = available to promise) and whether requirements are to be passed on. A finer
    degree of control can be obtained for sales documents using the schedule line category.
    Replenishment lead time is only included in the check performed on the basis of the
    ATP quantity.
    Prerequisites
    An availability check can only be carried out if the following prerequisites have been fulfilled:
    _ The control elements described above for the availability check must be maintained in
    Customizing for Sales and the relevant assignments made to the sales transactions
    _ The availability check must be switched on at requirements class level and - for the
    availability check in the sales documents - at schedule line category level
    A requirements type must exist by which the requirements class can be found
    _ A plant must be defined. It can either be proposed from the customer or material master
    record or can be entered manually in the document.
    _ A checking group must be defined in the material master record on the Sales/plant data
    screen in the Availability check field
    Configuring entries of the Availability Check
    IMG&#61664;SD&#61664;Basic fncs&#61664;Availability check and TOR&#61664;Availability check&#61664;Availability check with ATP logic or against planning&#61664;Define checking groups
    You can use SAP std checking groups of 01 for summarized reqts or 02 for daily reqts or u can create ur own.
    The columns total sales and total deliveries are selection options whereby u can configure a checking rule to sum up reqts to post to MRP either individually or by day or week.
    Column 5, Block qty; set this block if u want several users to be able to process the material simultaneously in different transactions without blocking each other. The No Check indicator is used when u want a material to not be relevant for an ATP check.
    Defining a material block for other users. The Block checkbox is an indicator that enables u to block the particular material from being checked for availability if it is already being checked at the same time by another user.
    Defining the default value for checking groups. However should no entry exist for the checking group in the material master record, one can set a default value per material type and plant.
    Controlling the availability check. In this section, u tell the system what stock on hand and what inward and outward movements of stock it must take into account when performing the availability check. These settings are based on the checking group that is assigned to the material master record and the checking rule that is predefined and assigned to the sd transaction. The carry out control for the availability check must be maintained for both the sales order and delivery.
    TOR
    IMG &#61664; SD &#61664; Basic fncs &#61664; Availability check and TOR &#61664; TOR
    A line item in the sales order creates a schedule line. The schedule lines in the sales order transfer the requirements through to MRP. You can select the docs on which you want the TOR to happen. For ex, not for quotations.
    The TOR aims to ensure the ordered materials are available for the requested delivery date. The TOR can be set for individual or for collective requirements (materials master&#61664;sales/plant view).
    The TOR is dependent on the following data:
    The reqts type, reqts class, checking group and schedule line category.
    The reqts type and class are determined in the strategy group (material master&#61664;MRP3)
    For TOR to be carried out, a few criteria need to be met:
    Plant assigned to line item level, schedule line category should be switched on at TOR, TOR must be switched on at the reqts class level, checking group must be defined and allocated to the material master record (sales/plant view in the availability check field)
    The reqts class is the controlling factor for the availability check and the TOR for all sd types.
    Configuring the TOR:
    1) Use std 041 reqts class or copy and rename it. Use the indicators to select if this reqts class must carry out an availability check and/or a TOR.
    2) Define the reqts types. A reqts type is allocated to a single reqts class and not vice versa. It is based on the item category and the MRP type of the material.
    3) Assign the rqts type to the relevant item category in the sales order and the MRP type found on the material master record.
    You can select an alternative search strategy where u assign the reqts type to item category and MRP type. Can select source as 0, 1 or 2. (1 = Item type and MRP type strategy).
    4) The TOR and Availability check can be selected/de-selected at the schedule line category level.
    5) Block qty confirmation in delivery blocks. This is used to block the reservation of the TOR from MRP.
    6) Maintain requirements for TOR. Requirements can be used to determine that the TOR to MRP is not carried out unless a number of conditions are met.
    Availability Overview = CO09 &#61664; order qty, sd doc no, item no, requirements class.
    Stock requirements list = MD04 &#61664; sd no or dly no, line item, schedule line placing the demand
    Stock overview = MMBE &#61664; total stock per company, then plant followed by storage location, and finally a breakdown per batch
    this is the customising as weel as the knowledge part.
    PLease award pints if helpful
    thanks

  • How does Index fragmentation and statistics affect the sql query performance

    Hi,
    How does Index fragmentation and statistics affect the sql query performance
    Thanks
    Shashikala
    Shashikala

    How does Index fragmentation and statistics affect the sql query performance
    Very simple answer, outdated statistics will lead optimizer to create bad plans which in turn will require more resources and this will impact performance. If index is fragmented ( mainly clustered index,holds true for Non clustred as well) time spent in finding
    the value will be more as query would have to search fragmented index to look for data, additional spaces will increase search time.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • How does APEX create and save new files. What extension does it save in?

    Hi can someone help me with this question?
    How does APEX create and save new files. What extension does it save in?
    Cheers!
    VJ

    It's really too bad we can't see VJ's face when the concept sinks in. This is one of my favorite moments when teaching APEX classes. Most people love it, some people don't. If nothing else it really proves the power and performance of the Oracle database. Each page view can generate 40+ queries, yet on the average system this takes less than .04 seconds.
    Keep in mind there are no undocumented features or "Oracle Internals" that the APEX team uses to achieve this performance, just sound database design. With every feature they add they evaluate how it will be used and design the tables and indexes to most efficiently answer the query. Sometimes this means going against "purist" normalized principals.

  • OnChange() event how does it work and what is the syntax

    hi,
    i have a field (County) on a form in a jsp page that needs to get all its values from the database and present it to the user also i have another field (year) this also needs to get all its values as a drop down from the database.
    i dont have any lib tag available to use and can't afford the time to set this up. so just have to script in jsp or use beans in jsp.
    my question is 2fold
    Q1. - i was thinking of having a DataAccess (dA) object to run a sql to select * distict couties ...
    also have another query in DataAccess select * Distinct year....
    and in the jsp instantiate the (dA) and iterate through and fill the select drop down box - how to code this syntax i'm not sure and if this is the correct approach or the only approach would appreciate some sample code that i can mess around with thanks.
    - is above approach best way of doing this. - also taking into account Q2.
    Q2 - when the user selects county then i need to fire a onChange event - probably using javascript but not sure how this works - bascially i need to then update the year drop down according to the below sql-
    again how is this possible - and is this the best approach or will it be too many calls to the database - especially consdering that the forms are all part of a search tool.
    SELECT     DISTINCT     v.year
    FROM          v_volumes     v
    WHERE          v.county     = <the selected county>
    OR          (v.county_reference     =
                   (SELECT     ca.county_reference
                    FROM          county_aliases     ca
                    ,          counties     c
                    WHERE     ca.county_reference_also_called     = c.county_reference
                    AND          c.county     = <the selected county>)
    ORDER BY v.year

    Sorry to rain on your parade, but its not going to be quite that simple.
    Populating a second dropdown depending on the first one, has been discussed quite in depth on this forum, I suggest you do a search to look at older posts.
    Javascript code cannot call java/database code from an onclick event.
    The best it can do is trigger a form submission, which reloads the page
    running any java/sql code that displaying the page entails.
    So onlick event on the first dropdown triggers a form submit, which loads the page with the correct values in the second dropdown.
    con: requires a page request
    The other approach is to download ALL possible values to the jsp page, and have javascript handle the swapping of values.
    pro: no page refresh needed
    con: must have all data available on the page. javascript is a bit more complicated.
    Hope this helps,
    evnafets

  • How to transport Enqueue and Dequeue Objects / Lock Objects / R3

    Hi Gurus,
    i have created two lock Objects.
    I transported those objects in Q system but the table tab has no objects.
    But in Dev every thing is correct.
    Could you please indicate how i can get the objects correctly transported?
    Thanks

    Easy and best approach is by getting them re transported by using transport of copy request (Type of request)
    1) Get the Transport of copy request created by basis team / urself under your user.
    2) Go to SE10 and highlight the request and click on include objects icon
    3) Later in the pop up window select the radio button which mentions "Include free objects"
    4) Then in the next screen mention the details based on the attributes of the Enque and deque object or else provide the package name and execute and in the next screen choose the concerned enque and deque objects and include them in the request.
    5) Transport the Transport of copy to quality.
    Also, more easiest is.
    Find out the task of the request with with the enque and deque objects were created with (if more than one select all), and then include the tasks in the transport of copy and transport it to next system
    If you are not able to do the above two steps then i think the object is $TMP object, kindly cross check.
    Cheers

  • How does the SDK and Reader handle printing with orientation?

    I have a document that I want to print, and it contains a portrait page on Page 1, and a landscape page on Page 2.  Acrobat Reader correctly prints these pages (with a single print job), and I'm assuming it's because of the auto-rotate option on the print dialog.  Is this a feature of Reader, the API, or how the printer handles the request.  I've tried printing this PDF just using the JAva API, but the orientation remain portrait for all pages.  How does the Adobe Acrobat API deal with mixed orientation pages?  Ignore the fact that I did my test printing with Java, because my question is whether or not the auto orientation is a feature of the UI, the SDK, or the printer (or a combination).

    Same as the current Ipod Video or "Classic" there is an option under settings to toggle between original aspect ratio or Full Screen.
    Kenal0

Maybe you are looking for