Creating Shared Files
New to Designer 6 comes the Shared File Resource feature. This allows a designer to share non-NSF files not only within the database where it resides, but also across other databases in the enterprise. Shared file resources can be any non-NSF type of document, such as those with the suffix .html, .gif, .jpg, .txt, or .css. They can be added, deleted, exported, refreshed, and edited right from within the IDE.
To create a shared file, open Domino Designer and expand the Shared Resources category. Then select Files. The Designer IDE presents various buttons to manage these resources. Select the New File Resource button to add a new file resource to the database, as shown in Figure 7.8.
Figure 7.8. New to Designer 6, shared file resources can be added to the database.
To open the file, select the Open File button. This opens the file inside the program associated with launching the file's extension type. For example, .HTML opens the file in the default browser, and .TXT opens the file in Notepad.
To open the file to display in a program of your choice, use the Open With button. This allows the developer to override the default program set to launch the file extension type. For example, .CSS can be opened in Notepad, WordPad, or any other editor program available on your computer. This also enables you to edit the file and then refresh it within the IDE as well.
After the file is edited, the Refresh icon appears next to the filename in the IDE, as shown in Figure 7.9.
Figure 7.9. After they are edited, shared file resources can be refreshed without having to delete and add back the file.
The file can be refreshed using the Refresh button. This refreshes the file in its place and in every design element where the file may be used, called, embedded, or linked to. Previously in Domino Designer, you had to delete the file and then add the new file and refresh pages manually. This new feature can save you a lot of tedious work and maintenance!
You can also easily export (save a copy of) a file resource to your computer. To do so, select the resource that you want to export from the Work pane, click the Export button, and in the Save As dialog box, select a location and enter a name for the file on your computer. Click OK to complete the transaction.
To delete a resource, select it on the Work pane and select the Delete key on your keyboard, press Ctrl+X, or select Edit, Cut from the menu bar.
If a shared file will be used on the Web, two new Web properties must be set: Read Only and MIME Type, as shown in Figure 7.10. Selecting Read Only makes the file readable only on the Web. MIME Type refers to the Content-Type HTTP header on the Web. Domino computes the default format type for the file if it recognizes its file extension. You can override what Domino computes, but it is not recommended.
Figure 7.10. New Web properties for using shared file resources on the Web.