If, for a given page declaration in site.xml the seo attribute specified a path to a file, like so:
<page id="myClientProject1" src="swf/myClientProject1.swf" title="My Client's Big Campaign" seo="case-studies/my-client/my-client-project1.html" />
and then the Scaffold SEO Files Button was clicked it would trace that "case-studies/my-client/my-client-project1.html" was scaffolded. However, if the directory "case-studies" and or "case-studies/my-client/" did not yet exist, the file would not get created but the trace would still report that is was.
Of course, since I'm scaffolding, I want it to create the directory just as Gaia does for the not-yet-existent "swf" directory I specified in the same page declaration's src attribute. That's the beauty of defining structure in site.xml: the scaffold does the heavy lifting of creation. This is especially important since the path here since we're dealing with SEO and the path gets injected into the siteMap.xml and the alternate links for the xhtml page. Google (for one) is rumored to like this kind of logical hierarchy in blessing site's with its
Google Site links. Long story short, for SEO, I wanted to have the directory structure I think is best for SEO.
A quick peek in GaiaSEO.jsfl (in Vista, C:\Users\YourUser\AppData\Local\Adobe\Flash CS3\en\Configuration\GaiaFramework) revealed that no check for the folder's existence was occurring. A simple modification (attached below) creates the folder(s) if they don't exist.
At the end of the scaffoldSEO funtion, before "FLfile.write(seoPath, html);" is called, a check was called:
function scaffoldSEO(indexPath, deployPath, seoName, site, page, branch, menu)
{
var seoPath = deployPath + "/" + seoName;
var projectIndexPath = deployPath + "/index.html";
var html;
var swfObject = getIndexSWFObject(projectIndexPath);
if (fl.fileExists(seoPath) && branch != "index")
{
html = seoInject(seoPath, site, page, branch, menu, swfObject);
}
else
{
var css = getIndexCSS(projectIndexPath);
var thePath = (branch == "index") ? projectIndexPath : indexPath;
html = indexInject(projectIndexPath, site, page, branch, menu, css, swfObject, seoName);
}
checkValidPath(seoPath);
FLfile.write(seoPath, html);
}
and checkValidPath is defined as follows:
function checkValidPath(seoPath)
{
//strip the file name and extract the destination folder path
var destFolder = seoPath.split("/").slice(0, seoPath.split("/").length - 1).join("/");
//see if destination path exists
if (!FLfile.exists(destFolder)) {
//folder does not exist. create it.
FLfile.createFolder(destFolder);
}
}
That seems to do the trick.