Bringing an Existing Site into UltraDev
If you're an UltraDev user, you fall into one of two categories: you're going to use the software to create new Web sites, or you want to use UltraDev to work with an existing site. You should have the information you need to start creating a new site, but what about a site that is sitting on a server somewhere that needs to be updated and maintained?
Accessing Your Data
Depending on your server platform, you might have more than one option for getting to the information that you need. The easiest way to maintain a site is to access the files directly through a shared volume. You can then access the files directly on the server. My copy of UltraDev is configured through a shared drive to a Linux server that can immediately access and update Web site files. Servers based on Linux and NT should have no problem sharing drives to both Macintosh and Windows clients, making them near-perfect serving platforms.
If you don't have direct access to the site on the server, you can use FTP to get to the files. Using FTP, you'll need to maintain a local copy of the files on your design computer. When you make changes to the local files, you'll synchronize them with the remote site in order to deploy the updates.
Note - Whether you're working through a file share or an FTP server, you have the option of maintaining a local copy of the files and synchronizing them when you make changes. If you have the option of making changes directly to the site, do you really want to keep a local copy of the files?
Working with local files is useful if you cannot be connected to the network constantly, or have a slow connection. Additionally, keeping a local copy lets you work with the files, make changes, and preview those changes before they go live. If you accidentally save a file to the live site that isn't ready, you'd better hope that you removed any comments you don't want anyone else to see. I recommend that you work with a local copy and then transfer the files to the server.
Setting Up Your Connection
Before you can set up your connection, you must decide whether you will maintain a local version of the files or will interact with the files directly on the server. If you're constrained to using FTP to get to the files, you will have to maintain a local copy of the files. If you are maintaining a local copy of the files, create that copy on your system now.
Direct Connection to the Web Server
For connections directly to the deployment Web server, you need to define the site as if it is local to you. The other access methods rely on a local copy of the files. Other than that small catch, you should be ready to goit's the same as what you've been doing all along.
Caution - If you are creating a direct access site, be sure to set the server access to None. Setting it to Local seems more appropriate. However, UltraDev will expect your local machine to be running a Web server, which it probably isn't.
The second type of server access is listed in the site definition dialog as Local/Network. Similar to the direct connection previously discussed, this connection relies on you being able to access the directory of your Web server as a local (shared) volume. The difference is that you'll also maintain a separate local copy of the files that will be used for changes, and then synchronized with the real site.
If you have chosen Local/Network as your server access method, you'll notice that the corresponding site definition screen changes as well. Shown in Figure 3.5, you need to pick a folder that contains the live copy of your Web site. This should be different from the site folder you set in the Local Info area.
Available only in UltraDev 4.0 and later, WebDAV is an up and coming Web management protocol that is becoming widely accepted as an open standard. Windows supports WebDAV in its Web Folders implementation and Mac OS X also adds system-wide support for the feature. Your network administrator should have the information you need to log in to a WebDAV server if it is supported on your network.
To define the server, select WebDAV as the Access method, and then click the Info button. You will be prompted for the standard farehost URL, username, password, and email address. You also have the option of saving your password if you so desire.
Also only available in later versions of UltraDev, SourceSafe Database access uses Microsoft Visual Sourcesafe to control access to files. This is, obviously, a Microsoft product and might not be available in all production environments. If you do have access to a SourceSafe system, click the Info button to set up access.
Fill in the path to the SourceSafe database, as well as the Project, username, and password fields. Click the Save button to save the password between accesses. No matter what access method you choose, UltraDev hides the implementation behind its easy-to-use interface.
The last supported method of server access is FTPthis is the "if all else fails" approach to Web server connectivity. If you have nothing but a dial-in line or a very secure server, you'll probably end up using FTP.
To configure FTP access, choose the FTP option for Server Access. As you can see in Figure 3.6, you'll need to complete several fields before you can connect to the remote site. I've configured my system to connect to 192.168.0.1 and the directory public_html.
The available options for connecting to your Web server will be explored now:
FTP HostThis is the hostname or IP address of the server you're connecting to.
Host DirectoryThis is the directory path that leads to your Web site's root directory. There's a good chance you can leave this blank.
LoginThis is your username for accessing the remote server.
PasswordThis is the password for the site. If you're comfortable saving the password with the remote site information, click the Save check box.
Use Passive FTPPassive FTP is important to select if you're using FTP from within a private subnet that is using IP masquerading or Network Address Translation. Technically speaking, passive FTP lets the computer making the connection open both the data and control channels of the connection, rather than having the remote server open a connection back to the client. If you aren't sure if you need this, you might want to check it just in case. It won't hurt even if you don't need it.
Use FirewallIf your site is firewalled, you might have to set up UltraDev so that it can properly access the remote server from behind the firewall. Your best bet is to try using passive FTP first. If it doesn't work, firewall settings might be in order.
If you have to use a firewall, you'll need to configure it in the UltraDev preferences. A few of the settings here are also used by the Local/Network site access method, so you might want to take a look at these preferences even if you aren't using FTP.
Site FTP Preferences
Open the UltraDev preferences from Edit menu and select the Site category. As demonstrated in Figure 3.7, you can alter the layout of the Site file window and fine-tune the FTP settings for your computer.
It's unlikely you'll need to change anything here, unless your network is behind a firewall. If you decide to adjust the preferences, here's what the changes will do:
Always ShowThe site files are separated into local and remote file views. By default, the local files are on the right whereas the remote files are on the left. Changing these first two pop-up menus allows you to select which files will be shown on which side of the site file screen.
Dependent FilesThese files are needed by the files that you're transferring to the server. For example, if you're working with an HTML file with images, the images are dependent files. The Dependent files options control whether UltraDev will ask you to transfer dependent files when a file is transferred to or from the remote machine.
FTP ConnectionThis checks the disconnect box and enters a value to force an FTP connection to be terminated if no data has been transferred in a certain number of minutes. This is useful if you're using a dial-in line to access the server and are being charged dial-up fees.
FTP Time OutThe maximum length of time to wait for the FTP server to respond before reporting a failure.
Firewall HostIf you're behind a firewall, you probably know what this setting is for. This hostname or address acts as a gateway to the rest of the Internet.
Firewall PortYou'll need to point your computer to a specific port of the firewall in order to get to the outside. The default FTP port number is 21.
Put OptionsTo automatically save your changes before files are transferred, click this check box. Without it, you might make changes, transfer the files to the server, and not see the changes on the production Web site.
There's little need to change most of these options. Setting the firewall options if you're not behind a firewall will result in a connection failure.
Advanced Optional FTP Configuration
If you're familiar with the FTP protocol, you know that it can transfer files in binary or ASCII mode. Transferring a binary file as ASCII is a quick way to corrupt a program or image file. Why transfer in ASCII mode at all? ASCII transfers automatically translate the "end of line" characters, which are different on Unix, Windows, and Mac OS platforms. There is no convenient way to tell the UltraDev FTP software how to transfer files to and from the server. To do this, you'll need to edit the file FTPExtensionMapMac.txt (Mac OS) and FTPExtensionMap.txt (Windows) that is located in the Configuration folder within the UltraDev program directory. Here's a portion of that file:
CGI DmWr TEXT ASCII CSS DmWr TEXT ASCII DCR MD97 FGDC BINARY DIR MD97 FGDC BINARY DOC MSWD WDBN BINARY DXR MD97 FGDC BINARY EXE ???? APPL BINARY GIF MKBY GIFf BINARY HTM DmWr TEXT ASCII HTML DmWr TEXT ASCII JPG MKBY JPEG BINARY JPEG MKBY JPEG BINARY JS ttxt TEXT ASCII LBI DmWr TEXT ASCII MNO DmWr TEXT BINARY MOV TVOD MooV BINARY MPEG mMPG MPEG BINARY
Windows users only need to pay attention to the first and last columns of this filethe middle two columns are Macintosh creator and file-type signatures. In order to associate a file with a transfer type, add the file extension in the first column and the transfer type in the last column. In the sample list, you can see that HTML files are transferred as text whereas images (GIF,JPG) are binary transfers. To add support for Java, I'd add .jar and .class with binary as the transfer mode. This enables me to transfer Java JAR files in BINARY mode.
Macintosh File Creators and Types
The Macintosh has a unique system of identifying what a file is and what created it based on a four character signature that is stored with every file. Therefore, if you create a GIF file in Photoshop, it will open in Photoshop, whereas another GIF file might have a creator signature that points to Fireworks. Each file knows what it is and where it came from. You can use a program like Apple's ResEdit to look up the signatures for a given file or document. Place the creator and type signatures in the middle two columns of the FTPExtensionMapMac.txt file, and your system will recognize the types of remote files and what program they should be opened in for editing.
Using the Connection
If you've set up a working FTP configuration or a Network connection, you're ready to try the file transfer features of the Site Files window. Go ahead and connect to the remote site by clicking the plug Connect icon button at the top of the screen. Figure 3.8 demonstrates a live connection between my local computer and a remote FTP site.
If your screen only shows the local files, click the small triangle in the lower left corner of the file window so that it points to the right. You're now ready to transfer files between your local and remote sites.
Manually Transferring Files
The easiest way to move files between the different locations is to click and drag. An extremely beneficial feature of this process is that UltraDev will determine what the selected file(s) dependant files are, and it will offer to transfer them. This saves you the trouble of trying to find everything that goes with a certain fileit will be done automatically. You can drag individual files, multiple files, or even entire folders between these views.
Alternatively, you can follow the FTP model for file transfers and use the up arrow Put button to put files from the local directories onto the remote servers. The down arrow Get button retrieves files and folders from the remote server. A status bar in the lower right corner of the Site Files window shows the progress of the files as they are transferred. Clicking the red stop sign by the status bar cancels the current action in progress.
If something goes wrong during the FTP process, you can view a log of the FTP commands sent to the remote server with FTP Log under the Site menu on the Macintosh, or under the Site palette's Window menu on Windows. There's a good chance you can find the solution to your problems here.
Refreshing the File View
If a file changes (is added or deleted) on the local or remote side without the knowledge of UltraDev, it probably won't show up in the file listing. If you feel that something isn't appearing on either side of the connection, you can refresh the files that are shown by clicking the refresh buttonthe circular arrow at the top of the site view. This will reload both sides of the display.
If you'd specifically prefer to force the local or the remote file lists to refresh, you can choose Refresh Local or Refresh Remote from the Site Files View submenu located under Site. This forces only the appropriate file listing to be reloaded.
The most useful way of transferring files is through synchronization. Instead of trying to find all the updated files you need to transfer manually, you can ask UltraDev to help you figure out what has changed. If you'd just like a list of what has changed, use the Select Newer Local and Select Newer Remote commands from the Site Files View menu. This highlights all the files in the respective list that are newer than the corresponding file at the other end of the connection. You can then drag the files over to the opposite side to synchronize the file listing. This, coupled with UltraDev's capability to also transfer dependent files, makes this a great way to keep things in sync without turning complete control over to UltraDev.
If you prefer to let UltraDev do all the work for you, choose the Synchronize selection from under the Site menu. As you can see in Figure 3.9, just click Preview, and UltraDev will compile a list of files that should be updated. If you'd like to modify the files being transferred, select/deselect the files you'd like. When ready, click OK to perform the synchronization process.
With the Synchronize command, you can choose what you want to transfer (the entire site, or only selected files) and which way you want the transfer to take place (from local to remote, remote to local, or both). The final option Delete Remote Files not on Local Drive removes any files from the remote server that don't match something on the local side. Be very careful in choosing to select this option. If anything on the remote site doesn't have a corresponding local file, it will be deleted.
When you've finished transferring files to your site, click the Disconnect button to close the connection between your computer and the remote server.
Tip - The icons in the upper left corner of the Site Map and Site Files windows provide a quick way to toggle between these two modes. Choose the left icon for the Site Files view, and the one on the right for the Site Map.