Working with APEX Theme Files using WebDAV
An APEX theme consists of HTML templates and CSS and image files. The HTML templates are imported into an APEX application when a theme is imported, but the external theme CSS and image files must be separately copied to the APEX images directory. Even on local APEX installations the APEX images directory must be accessed via the Embedded PL/SQL Gateway (EPG) or a HTTP web server. WebDAV is perfect for this.
WebDav is an extension to the HTTP protocol that allows users to access and manage files on web servers. Web folders are the Microsoft Windows implementation of WebDAV. A web folder is a very easy way to access the APEX images directory.
Creating a Web Folder in Windows XP
- In Windows Explorer right click My Network Places and select Open
- From the Network Tasks side menu select Add a network place
- In the Add Network Place Wizard click Next
- Select Choose another network location and click Next
- Enter the location of your APEX images path e.g. “http://127.0.0.1:8080/i”
- You will be prompted to enter your XDB username and password
- In the wizard, enter a name for the network place e.g. “APEX Images”
- Click Finish
Files in the APEX images directory can now be accessed through the web folder. You can drag and drop and copy and paste files between your local file system and the web folder, as well as modifying, moving and deleting files directly in the web folder.
However, there is one slight problem. Files cannot be opened by applications directly from the web folder. If you’re editing theme files this means you will need to “mirror” the files on your local drive, edit the local copies and then update the copies in the web folder. Needless to say, if you are making lots of small changes to images or CSS that require visual feedback, this can be a very tedious process.
This problem can be overcome by mapping a drive letter to the WebDAV share. Unfortunately Windows XP will only connect to port 80 when using Map Network Drive. Windows Vista might overcome this limitation (I’m using XP so can’t check for sure) and various third party programs are available that will map drive letters to WebDAV shares.
Alternatively, if you have a web design package such as Macromedia/Adobe Dreamweaver then you might already have another method at your disposal. The following solution has been tested in (an aging) Dreamweaver MX but is almost certainly likely to apply to later versions and similar packages that support WebDAV connections.
Connecting to a Web Server using WebDAV
- In Dreamweaver MX, create a new Site by going to Site on the main menu and selecting Manage Sites…
- In the Manage Sites dialog click New…, then Site from the drop down list
- In the Advanced tab, under the Local Info category, enter a Site Name and choose a Local Root Folder
- Under Remote Info, select WebDAV from the Access drop down list and then click Settings
- In the WebDAV Connection dialog enter your APEX images path e.g. “http://server:port/i”
- Also enter the system Username and Password (leave Email Address blank) and check Save Password
Now you can work on your theme like any other web design project, by editing local files and uploading them to the web server, whether it is running locally or remotely. This allows you to update APEX theme CSS and image files using a more familiar web design workflow.
There are sure to be many other ways of connecting to the APEX images directory but, as a web designer, the method described above suits my workflow. If you use a different method please fell free to leave a comment for the benefit of other readers.