Reducing database maintenance with shared code and shared resources
You can designate many items, such as graphics, fields, subforms, and even programs, as shared resources. Sharing resources lets you reference a resource repeatedly throughout an application, while only having to maintain in one standard place. For example, if you use your company logo in many places throughout your application and the design of your logo changes, you need only change it once and the change will be implemented everywhere that image is referenced. Each database can contain its own library of shared code and shared resources, and you can access shared elements in other databases
You can create the following resources:
- Image resources
Image resources are graphic files that can be used throughout your application. While image resources can be GIF, JPEG, or BMP format, they are saved in Domino® Designer as GIF or JPEG. An image resource can be used as a graphic or icon on pages, forms, subforms, action buttons, outline entries, and as background images on forms, documents, pages, table cells, and action buttons. For more information, see the topic "Creating an image resource" later in this chapter.
- Shared Fields
You can define a field for use on more than one form. For example, many forms have a creation date field; you can define this field once and reuse it. When you define a field as a shared field, Designer displays the field with a dark border and adds the field name to a list of shared fields available for use in a database. For more information, see the topic "Creating shared fields" in the chapter "Designing Fields."
- Non-NSF file resources
You can share non-NSF files within and across databases. For more information, see the topic "Sharing file resources" later in this chapter.
- Subforms
A subform is a collection of fields, graphics, buttons, and actions you plan to use in more than one form. For example, you might create a corporate letterhead in a subform and then use the subform on a variety of business forms. For more information, see the topic "Subforms" in the chapter "Designing Forms."
- Script libraries
A script library is a place for storing code that can be shared in the current application using LotusScript®, JavaScript™, and Java™ or in other applications using JavaScript™ and Java™. Using script libraries allows you to maintain code in one place.
- Shared Java™ files
For large Java™ applets with multiple files, it is most efficient to store some of the related files as shared resources in the database. When you set up files as shared resources, all the applets can use a single copy of the file, instead of each applet storing its own copy. Then, if a file requires updating, you only need to update one file. For more information, see the topic "Setting up shared applet resources" in the chapter "Including Java™ Applets in Applications."
- Shared actions
Use shared actions in forms, pages, folders, or views to set up user-activated tasks. You can add shared actions to the Actions menu or as buttons on the action bar. In particular, actions let users complete tasks when accessing Domino® databases on the Web. For more information on shared actions, see the topic "Creating and inserting shared actions" in the chapter "Adding Automation to Applications."
- Cascading style sheets
You can browse your local file system for a cascading style sheet (CSS) and insert one into a page, form, or subform. For more information, see the topic "Creating style sheets as shared resources" in the chapter "Designing Pages."