Shared Resources

Shared resources can be used to hold one copy of an element (Files, Applets, Images, Style Sheets, or Data Connectors); using shared resources eliminates the need for multiple copies of the same resource scattered across your application. The resources can be used within their own database or included in multiple databases.

As well as storing resources in one location, shared resources provide an added maintenance benefit. If a resource needs to be updated or changed, it has to be done only in the resource—not in multiple locations.

Web-based Distributed Authoring and Versioning (WebDav) is a Domino Web Server–supported technology. WebDav allows Designers access to the database without a Design client. Using Windows Explorer you can move an element out of the database, edit it, and then replace it. The Shared Resources available to WebDAV are File Resources, Images, and Style Sheets.


Creating, Troubleshooting, Modifying Style Sheets

Cascading Style Sheets (CSS) is the control of content presentation rather than control of the content itself. Style sheets can be embedded directly into a form; but for greater flexibility, they can be maintained separately. Shared Resources allow style sheets to be maintained separately in one location, and each element that must apply its rules can insert a link to the resource in that location. To reference a CSS, follow these steps:

1.
Place your cursor where you are inserting CSS.

2.
Choose the Create Menu.

3.
Click Resources, Insert Resources.

4.
Select the Database, StyleSheets and the Available Resource (.css file).

5.
Click OK.

You can apply separate style sheets to different clients on a single element by using the HideWhen properties. The Style Sheet properties dialog box does not have a Hide When tab, but you can use the Text properties to select the client to be hidden. Place each Style Sheet Anchor link icon on a separate line, open the Text properties, and select from the Paragraph Hide-When tab the client from which you want to hide that specific CSS.

Using Images in Applications

For ease of maintenance, shared image resources can be used throughout the database or across multiple databases maintained in one location. Any modification to the shared graphic image updates all the references to the image after it has been refreshed. GIF, BMP, or JPG–type graphics can be used to create the image.

One of the ways a shared image resource can be used is to create an image resource set. There are two types of sets: vertical and horizontal. A vertical set lets you add icons to the bookmark bar that can display in a small, medium, or large size. Using a horizontal set, you can create an image that appears to change depending on what state it is in, such as during a mouse-over. To create a horizontal set, follow these steps:

1.
Create a row of up to four images, depicting the different states you would like to represent (the image states are listed and described in Table 14.1). Images must be the same size, a GIF, BMP, or JPG, and separated with a one-pixel-wide space or line.

2.
Create an image resource from this graphic and open its Properties.

3.
Set the properties on the Basics tab, as shown in Figure 14.3.

Figure 14.3. Image resource properties.


4.
Click OK.

Table 14.1. Horizontal Image Set States
Images AcrossState the Image Will Represent
1Normal
2Mouse-over
3Selected
4Mouse-down

The image order is set by Domino and cannot be changed. This means that when you use two images, the first will always display in the normal state and the second image will always display in the mouse-over state. When the Images Across property is set to 2 or higher, the Web Browser Compatible option displays automatically in the Image resources properties and will be selected. If this Image Resource Set is not being used on the Web, deselect the Web Browser Compatible option to save space in your database.

Creating, Modifying, Troubleshooting File Resources

File Resources is a repository for non-.NSF files, such as HTML files, that will be shared within your application. File Resources Properties have a Web Properties tab that can be set when using the resource on the Web. There are two settings:

  • Read Only sets the element to be only read on the Web.

  • MIME type is set by Domino Designer if it recognizes the resource extensions and this is what the Content-Type header gets set to.

Employing Java Applets

Java Applets are self-contained programs that do not require a roundtrip back to the server when running on the Web. They also can be used in forms, documents, and pages on a Notes client.

Java applets can be stored

  • As attached hidden files on forms, documents, or pages then imported.

  • On the Web with a URL reference stored in the form, document, or page when you link to an applet.

  • In the database when brought into Shared Resources.

All files associated with a Java applet must be available to your workstation, and Enable Java Applets must be checked in User Preferences before they are imported. File types associated with applets can be

  • Class— .CLASS

  • Source— .JAVA

  • Archive— .JAR, .ZIP, .CAB

  • Resource— .JPG, .JPEG, .GIF, .AU

When using Java applets on the Web, you must consider browser type. For Internet Explorer, include the CAB file; for Netscape include the ZIP and JAR files; if both may be used, include all three.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.94.152