• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Folder Directory Create

Guest
Oct 01, 2013 Oct 01, 2013

Copy link to clipboard

Copied

I recently Migrated our sharepoint from windows 2003 to 2008. In doing so I lost Cold fusion and a directory Wizard, This wizard was put in place to create a folder directory out on our network drive when used. Now I have Coldfusion 10 installed on my new sharepoint server, I have brought over all of these directory wizard files but it still does not work. Its like I am missing a certain link in the chain here. Can anyone shed some light on the topic?

The wizard opens up to the first page, which it says next to continue. You would select a company which the code is written to pull a companies list from the network drive, then it creates a folder directory with files in the on that network drive. Now when you lick the initital next button it buttons and takes us to a The website cannot display the page. I still have all the original code files, placed into the same exact directory on the sharepoint server. The sharepoint server is an identical match, but its like somewhere something isnt lined up correctly.

I also have downloaded Coldfusion builder also.

Views

12.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 07, 2013 Oct 07, 2013

Copy link to clipboard

Copied

As for the code you wrote, it does have me asking what your level of web development is at (were you tasked into taking over this project?)  Omitting such necessary tags like <html>, <head> and <body>, using obsolete tags like <center> (Even the validator noted that CSS should have been used instead) and leaving tags open (<center> has no closing </center> tag, and it was originally designed to encapsulate data.) as well as the use of <br> tags for line spacing and table elements for layout.

The code I provided you is to prove that the issue here MAY stem from the output simply being invalid, rather than ColdFusion being at fault to one extent or another.  As I'm sure you're aware, computer troubleshooting requires the process of elimination, and by seeing how a valid page works (or doesn't) we can rule out whether that is causing the issue or not.

Believe you me, I'm not ragging on anyone's level of expertise with HTML/CF (We're all new to it at one point, am I right?)   I just want to get familiar with where you're at, because if the problem DOES turn out to be that the HTML's invalid nature is the culprit, this may mean that you'll need to work through the entire application and bring it up to snuff.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 07, 2013 Oct 07, 2013

Copy link to clipboard

Copied

Well after a long week It works Haha. I appreciate all the help Aegis, and yeah this was an OLD project that probably has been in place since 2006 that I was kind of thrown to the wolves with, and your right I have very little knowledge of HTML outside of some of my college courses. I said Id do it cause well I wanted to learn it, didnt realize it would be this rough of a ride.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 07, 2013 Oct 07, 2013

Copy link to clipboard

Copied

Great!  So the code I provided you worked?

The Validator provided by the W3C, though a bit terse in its responses, is priceless.  You'll find some developers out there who say that validation serves little purpose; but I personally feel that if you can hold your coding standards to the same put forth there, it can, as we saw in this example, help prevent problems.  There are many things that developers can do which, though taking more time to implement, if done religiously, can help ensure you maintain a high level of coding quality.

I'm sorry to hear that you feel your HTML skills may not be up to snuff here, but there's no time like the present to learn!

Back in 2006, browsers were rather lax in their interpretation of HTML, and as such, they tried to be as forgiving as possible and interpret best they could what the developer meant, but I think you'll agree that when given the choice of telling the browser how to interpret something vs. letting it guess, the former outweights the latter.

At least this also gives you confirmation that the issue is not ColdFusion related.  I'm glad that you were able to get the CF service logged on with rights to peruse your network and get that data.  In web development, we try to segregate our models into layers:

ColdFusion is the application language, but in the end, HTML that is generated should be segregated into structure ( <html>, <div>, <p> ), Content (the information displayed to the user) and Styling ( Where CSS comes into play ).  Then, when you need to interact with that content without constantly sending data back to the server, you can user client-side languages like JavaScript to interact with the data and the user.

Either way, glad to see things are working.  Maybe you should talk to your employer and see if you qualify for hazard pay. $$$

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 07, 2013 Oct 07, 2013

Copy link to clipboard

Copied

Yeah the one you gave me worked, and after tweaking the rest of them they all work now. I kind of was to Jazz up some other stuff to! Really just see what I can do with CF, I mean it is a 1500$ software it has to do something awesome right? I just want to learn more just not under the pressue of getting something to work 3 days ago, Ha! Thanks for all the help. I wish I could get Hazard Pay! I was getting stressed out for a bit, Overtime is just gonna have to do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 07, 2013 Oct 07, 2013

Copy link to clipboard

Copied

True.  But I guess a tool is only as good as the craftsman who knows how to wield it!  (Images of a professional baseball player holding a bat backwards comes to mind)

CF isn't as popular as I'd like it to be out in the world, and chances are that its expense has a large part to do with that, but I've been VERY impressed with what CF can do, and how easily the developer can do it.  Sadly, a fault I find with MANY subjects in our field, is that training seems to be lackluster at best.

I've never been a fan of "camps" where you're force-fed the tech in 3-5 days, and with CF11/CFB3 coming out *soon?*, there's hardly any training for ColdFusion 9, let alone 10 for learning CF.  It's all about theories and then putting them into practice.  It's one thing if you know the syntax of a <cfcomponent> tag, it's another to develop a proper Bean object with them, am I right?

Either way, glad to see you're rolling.  Have a good one.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

Hopefully seeing my name doesnt give you chills!! Ha! But I hit a bump. So I tried to implement what youve shown me into another part of the code that doesnt work and I seem to me missing something. When you select the client, name the project hit next and it generates the directory, all that works. There is a second part of this that is if the client you are selecting isnt in the list click here. That takes you to another page where your going to type in a new client to add to the network drive instead of the huge directory tree that gets dropped into the client. Hopefully that makes sense. I tried to clean this up but here is what Im looking at. Its 2 files. The first page just asks for the name you want to put on the folder click next, which invokes the second page which checks to see if that folder exists, if it does it tells you and if it doesnt it creates the folder. The second page has more CF variables I am unfamiliar with. What happens is you put in the name you want click next and the white screen comes back. So Im not sure if theres a problem in my code with the first or second page. Maybe a second set of eyes will see something.

Page 1 (Addnewclient.CFM)

<cfoutput><!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Project Directory Wizard</TITLE>
</HEAD>
<BODY>

<CENTER>

<cfinclude template="header.cfm" />
<cfinclude template="mainarea.cfm" />

<FORM ACTION="ADDNEWCLIENT_2.CFM" METHOD="POST" enctype="application/x-www-form-urlencoded">

<hr>
<font size="5"<p>Please enter the name of the company you wish to add:</p></font><BR>

<INPUT TYPE="TEXT" MAXLENGTH="8" SIZE="8" NAME="DIRTOCREATE" VALUE="">

<hr>
<CFINCLUDE TEMPLATE="ACTIONBUTTONS.CFM" />
</FORM>

</BODY>
</HTML>
</cfoutput>

Page 2 (Addnewclient_2.cfm)

<cfparam name="selectedDirectory" default="" />
<cfoutput><!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Project Directory Wizard</TITLE>
</HEAD>
<BODY>

<CENTER>


                    <cfinclude template="header.cfm" />
                    <cfinclude template="mainarea.cfm" />


<FORM ACTION="DIRECTORY.CFM" METHOD="POST" enctype="application/x-www-form-urlencoded">

<!---
*****************************************************
* First we are going to check to see if that directory
* has already been created
*****************************************************
--->

<CFDIRECTORY  DIRECTORY="\\SERVERNAME\shared\projects"
  FILTER="#DIRTOCREATE#"
  NAME="DOESITALREADYEXIST">

<CFIF #DOESITALREADYEXIST.recordCount# GT 0>
<p><font color="red" size="+2"> THE DIRECTORY ALREADY EXISTS</FONT></p>
<CFELSE>

<INPUT TYPE="HIDDEN" NAME="SELECTEDDIRECTORY" VALUE="#UCASE(DIRTOCREATE)#">


<CFTRY>
<!--- Root level is being created --->
<CFSET DIRTOCREATE=UCASE(DIRTOCREATE)>
<CFSET DIR="\\SERVERNAME\shared\projects\#DIRTOCREATE#">
<CFINCLUDE TEMPLATE="DIR_CREATE.CFM" />
<CFCATCH>

<br><br><br>
<!--- and the diagnostic message from the ColdFusion server --->
<p>THERE HAS BEEN AN ERROR IN THE <FONT COLOR="RED">#CFCATCH.message#</FONT> MODULE!</p><BR>
<p>PLEASE CONTACT THE HELPDESK AT <FONT COLOR="RED">4100</FONT></p><BR>


</CFCATCH>
</CFTRY>


<FONT SIZE="+2">Congratulations!</FONT><BR><BR>
<p>You have successfully created the project directory:</p><br>

<FONT COLOR="RED">
\\SERVERNAME\shared\projects\#UCASE(DIRTOCREATE)#
</FONT>

</CFIF>

<BR><BR>
<p>Press Next to continue creating project directories.</p>

<CFINCLUDE TEMPLATE="ACTIONBUTTONS.CFM" />
</FORM>

</BODY>
</HTML>
</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

Does the second page generate output in the page source?  If it does, does it validate?  I notice you have a single <center> tag (a long since deprecated tag, and the problem is that he doesn't even has his closing tag defined.

I noticed, too, you have a variable called DIRTOCREATE, however it doesn't exist anywhere on the second page.  I noticed the form on page 1 has a field with that name, so if you're going to reference THAT particular value, you need to start referencing your variables names by their scope.  For example, replace 'DIRTOCREATE' with 'FORM.DIRTOCREATE', otherwise CF will be looking in the 'VARIABLES' scope, where no such variable exists.

As a side note, the line:

<CFIF #DOESITALREADYEXIST.recordCount# GT 0>

can be rewritten as:

<cfif doesitalreadyexist.recordcount>

CF evaluates numbers to be where 0 = false, and any other value = true, so the above evaluates as <cfif 0> or <cfif 1> or whatever the recordcount is.  As long as it's not 0, it executes the logic inside.

Update the line:

<cfset DIRTOCREATE = UCASE(DIRTOCREATE)>

to

<cfset DIRTOCREATE = UCASE(FORM.DIRTOCREATE)>

Comment out your include of DIR_CREATE.cfm temporarily just to see if we get this far.

When you get some time, get rid of those darn <FONT> tags.  Blech!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

No, it generates nothing just like the issue before. its just generic source code that gives me a blank white page. I initially had this issue until you gave me a HTML5 valid code string i could plug in and then everything worked. Here is the updated information but it still just sends me to a blank white page when i input the folder name then click next. Basically all this is doing is creating a folder out on the network directory. I know all the old code is probably throwing you for a loop cause it is for me. Also I removed all the disgusting FONT tags and the center tag. Ha!

Page 1 (ADDNEWCLIENT.CFM) Displays, allows me to input my folder name, click next then white page, generic blank white page source code.

<cfparam name="selectedDirectory" default="" />
<cfoutput><!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Project Directory Wizard</TITLE>
</HEAD>
<BODY>

<cfinclude template="header.cfm" />
<cfinclude template="mainarea.cfm" />

<FORM ACTION="ADDNEWCLIENT_2.CFM" METHOD="POST" enctype="application/x-www-form-urlencoded">

<hr>
<p>Please enter the name of the company you wish to add:</p>

<BR>

<p><INPUT TYPE="TEXT" MAXLENGTH="8" SIZE="8" NAME="FORM.DIRTOCREATE" VALUE="" /></p>

<hr>
<CFINCLUDE TEMPLATE="ACTIONBUTTONS.CFM" />
</FORM>

</BODY>
</HTML>
</cfoutput>

Page 2 (ADDNEWCLIENT_2.CFM) Page is never displayed, Im lost in the transistion between pages again.

<cfparam name="selectedDirectory" default="" />
<cfoutput><!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Project Directory Wizard</TITLE>
</HEAD>
<BODY>

                    <cfinclude template="header.cfm" />
                    <cfinclude template="mainarea.cfm" />


<FORM ACTION="DIRECTORY.CFM" METHOD="POST" enctype="application/x-www-form-urlencoded">

<!---
*****************************************************
* First we are going to check to see if that directory
* has already been created
*****************************************************
--->
<hr>
<CFDIRECTORY  DIRECTORY="\\SERVERNAME\shared\projects"
  FILTER="#DIRTOCREATE#"
  NAME="DOESITALREADYEXIST">

<cfif doesitalreadyexist.recordcount>
<p>THE DIRECTORY ALREADY EXISTS</p>
<CFELSE>

<INPUT TYPE="HIDDEN" NAME="SELECTEDDIRECTORY" VALUE="#UCASE(FORM.DIRTOCREATE)#">

<CFTRY>
<!--- Root level is being created --->
<cfset DIRTOCREATE = UCASE(FORM.DIRTOCREATE)>
<CFSET DIR="\\SERVERNAME\shared\projects\#DIRTOCREATE#">
<CFINCLUDE TEMPLATE="DIR_CREATE.CFM" />
<CFCATCH>

<br><br><br>
<!--- and the diagnostic message from the ColdFusion server --->
<p>THERE HAS BEEN AN ERROR IN THE </p><BR>
<p>PLEASE CONTACT THE HELPDESK AT 4100</p><BR>

</CFCATCH>
</CFTRY>

<p>Congratulations!</p><BR><BR>
<p>You have successfully created the project directory:</p><br>
<p>\\SERVERNAME\shared\projects\#UCASE(FORM.DIRTOCREATE)#</p>

</CFIF>

<BR><BR>
<p>Press Next to continue creating project directories.</p>

<CFINCLUDE TEMPLATE="ACTIONBUTTONS.CFM" />
</FORM>

</BODY>
</HTML>
</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

This has to be easier written, Im going to try and write a code that will just create a directory folder on X network drive and if it exists it will fail. Easily done right?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

Does page 1's source code validate?  Also, I would get into the habit of giving your forms NAME attributes.  I could recall a while back we had issues of a form not submitting its data, and found that it was due to omitting that attribute.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

I get these errors.

Error& did not start a character reference. (& probably should have been escaped as &.)

ErrorLine 8, Column 7: Element style is missing required attribute scoped.

<STYLE>

ErrorLine 25, Column 65: The cellpadding attribute on the table element is obsolete. Use CSS instead.

<TABLE BORDER=".5" CELLPADDING="3" BGCOLOR="#D4D0C8" WIDTH="550">

ErrorLine 25, Column 65: The bgcolor attribute on the table element is obsolete. Use CSS instead.

<TABLE BORDER=".5" CELLPADDING="3" BGCOLOR="#D4D0C8" WIDTH="550">

ErrorLine 25, Column 65: The width attribute on the table element is obsolete. Use CSS instead.

<TABLE BORDER=".5" CELLPADDING="3" BGCOLOR="#D4D0C8" WIDTH="550">

ErrorLine 30, Column 77: Attribute background not allowed on element td at this point.

<td bgcolor=#0A246A align=left valign=top background="./images/topbarbg.jpg">

ErrorLine 30, Column 77: The bgcolor attribute on the td element is obsolete. Use CSS instead.

<td bgcolor=#0A246A align=left valign=top background="./images/topbarbg.jpg">

ErrorLine 30, Column 77: The align attribute on the td element is obsolete. Use CSS instead.

<td bgcolor=#0A246A align=left valign=top background="./images/topbarbg.jpg">

ErrorLine 30, Column 77: The valign attribute on the td element is obsolete. Use CSS instead.

<td bgcolor=#0A246A align=left valign=top background="./images/topbarbg.jpg">

ErrorLine 32, Column 42: The font element is obsolete. Use CSS instead.

…nt size="2" color="White" face="arial"><p class="title"><b> Project Direc…

ErrorLine 32, Column 59: Element p not allowed as child of element font in this context. (Suppressing further errors from this subtree.)

…="White" face="arial"><p class="title"><b> Project Directory Setup</b></f…

ErrorLine 32, Column 102: End tag font violates nesting rules.

ErrorLine 32, Column 102: Cannot recover after last error. Any further errors will be ignored.

…hite" face="arial"><p class="title"><b> Project Directory Setup</b></font>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

<!--- Write code that invariable catches the name of the directory you want to create. --->

<cfset VARIABLES.newDirName = 'applesauce' />

<!--- Store the root path to the location where you want to create the folder. --->

<cfset VARIABLES.directoryPath = '\\servername\path\to\folders' />

<!--- Check to see if the directory already exists, and if not, create it. --->

<cfif directoryExists( VARIABLES.directoryPath & '\' & VARIABLES.newDirName )>

     <cfdump var="The directory already exists.">

<cfelse>

     <cfset directoryCreate( VARIABLES.directoryPath & '\' & VARIABLES.newDirName) />

     <cfdump var="The directory didn't exist, but it does now!" />

</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

As for your errors.

& did not start a character reference.


The character '&' cannot exist in your code.  Special character need to have their respective HTML entity character codes used.  To output '&' to a screen, your HTML should contain &

Element style is missing required attribute scoped

I'd have to see your generated code here.  A <style> tag should exist in the <head> tag and should look like the following:

<style>

     <!--

          /* CSS rules go here */

     -->

</style>

The cellpadding attribute on the table element is obsolete. Use CSS instead

Any reference of "Use CSS instead" usually means you are not separateing your structure (HTML) from your presentation (CSS).  Padding, borders, colors, these are all the responsibility of CSS, so when it sees you having a <table> element with a padding attribute, it's warning you to best use a CSS declaration like:

table { padding: 10px; }

Instead.

Attribute background not allowed on element td at this point

Specifying a background image is part presentation, use the background-image CSS property instead.

Element p not allowed as child of element font in this context.

I need more code to see what the problem here, but it's stating you have a <p> tag as a child to an element it cannot be.  An example of nested tags that is not allowed would be like:

<p>I am a paragraph tag.<p>I am another paragraph tag, nested inside a parent paragraph tag.  This is a no-no.</p></p>

End tag font violates nesting rules

As suggested earlier, get rid of your FONT tags.  They are deprecated and are presentational markup, so use CSS instead.  This error hints that you are not properly nesting or opening/closing tags, which can cause a lot of issues.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

How can I make it where instead of it creating a folder called 'applesauce' I can give the user an option to input theyre own name into a text box?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

Nevermind! I got it working

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

I was gonna say.    I really hoped you were familiar with HTML enough to the point of how to submit an input field and read the value on the next page.

I think what we can take away from here is that due to the application's poor state of code structure and validation, it is not completing rendering, which is probably our culprit for the white screens.

Either way, good to see you're moving again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

Its been a long day! And its friday almost checkout time, my brain has packed most of its bags Haha. Thanks for all the help!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 11, 2013 Oct 11, 2013

Copy link to clipboard

Copied

LATEST

Good thing I'm not Delta.  You only get the first bag checked for free.  The rest, you pay FAAAAAR out the a$$ for.  Mwa ha ha ha!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation