Lotus Domino Release 5.0 A Developer’s Handbook phần 3 pptx

71 360 0
Lotus Domino Release 5.0 A Developer’s Handbook phần 3 pptx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Views and the Web Domino dynamically creates Web pages from the views in a database, including URL links to the documents in the view. Using a Web browser, a user can navigate, expand, and collapse the view in much the same way as they can from a Notes client. Using the Default Display When a browser is used, the view is split into pages with 30 lines per page. This is to avoid having a view containing hundreds of documents presented as one page with all the documents. Limiting the lines per page in this way improves performance and makes navigation of the database more manageable. Note The default of 30 lines per page can be changed in the HTTP section of your server document. When Domino generates the HTML page for a view, it maintains the column and row format of standard Domino views. There are, however, a number of differences that you need to be aware of and to take into consideration when you develop applications for the Web. Tip To improve Web performance (and performance on any other view for that matter), avoid time-sensitive column formulas with @functions such as @Now, @Created, @Modified, and so on. Since the Domino Web server generates Web views as HTML pages on the fly, time-sensitive formulas recalculate every time a Web user works in the view, for example, when they open, scroll, or expand the view. Instead, create a field in the form for that formula and refer to the field in your view. Chapter 5: Views, Folders, and Navigators 125 The following figure shows an example of a categorized view as seen through a Web browser: Notice that there is no outline of available views on the left. Domino does not include a view outline by default on Web pages. Furthermore, Domino also ignores any menu actions not supported on the Web. Also, notice that there is no selection column. As you can see, Domino has automatically created a Web navigation bar at the top and bottom of the screen. This navigation bar contains buttons that users click to Expand, Collapse, Scroll, and Search the view. On the Web, users open documents by clicking a document link column rather than clicking anywhere in the row, as you do in the Notes client. The application designer can specify which column(s) should include a URL link to the document. By default, it is the first non-categorized column. Domino displays the width of a column in a view as the length of the longest entry in the column, regardless of what the column width is set to in the Column InfoBox. Tip To force a column to be limited to a certain width when viewed from the Web, use a column formula to retrieve the field value, for example: @Left(FieldName;50) This formula will set the widest width of the column to 50 characters. 126 Lotus Domino Release 5.0: A Developer’s Handbook To avoid having long columns pushed to the right of the display, use the Style tab in the View InfoBox and specify a number greater than 1 in the Lines Per Heading setting. This causes the lines to wrap on the Web. If you specify 1, the lines will not wrap. The same guidelines apply to column headings. Using Java Applets for Display In Domino Release 5.0 there is a Java applet which allows you to display a view in a more Domino-like outline. You activate this applet by selecting the Use Applet in Browser option on the Advanced tab of the View InfoBox. A view served as an applet supports such “Notes-like” features as expandable/collapsable categories, resizable columns, and multiple document selection. The view applet is programmable via the following @Commands: @Command([EmptyTrash]) @Command([ViewCollapse]) @Command([ViewCollapseAll]) @Command([ViewExpand]) @Command([ViewExpandAll]) @Command([ViewRefreshFields]) Chapter 5: Views, Folders, and Navigators 127 Using HTML Formatting for Views You can add HTML to your column formulas to enhance the view when it is displayed on the Web. Treating the View Contents as HTML You can override the default row and column settings for a view by using HTML formatting attributes stored in a column. In Domino, the view displays as a standard view. On the Web, the view uses the HTML formatting attributes that you specify in the column formula. You must include HTML that defines all formatting and document linking for the view. 1. Open the view in Design mode and choose Design - View Properties. 2. Click the Advanced tab and select For Web Access: Treat view contents as HTML. 3. Create a column. 4. In the design pane, click Formula and enter the HTML code in the edit window. Enhancing the View Display Using HTML You can also add some HTML coding to the view in order to enhance the display on the Web. HTML embedded in views is a browser-only feature. If you embed HTML in a view, the view is accessible by a Notes client, but the client interface will be unattractive (because of the exposed HTML tags). There is no option to hide a column from Notes client users as in the case of forms and views. A column is either hidden or visible to both Web and Notes client users. Although you can see the HTML tags from the Notes client, the features that the HTML coding provides, such as linking, are not available to Notes clients. Unlike forms and documents, there is no pass-thru-HTML option in the design interface. To write HTML in views, you need to include the HTML code in square brackets ([ ]). Domino treats everything between the square brackets as pass-thru HTML. 128 Lotus Domino Release 5.0: A Developer’s Handbook Here are some examples of how you might want to use HTML in views. The following section explains how to implement several of these examples. • Insert a blank .GIF file between two columns in order to get a little more space between the columns on the Web. • Add a horizontal ruler spanning the entire view for each document category. • Add a couple of icons and a URL link to the Home Page in the column headers. • Include an HTML statement in the formula for a column to display a blinking text string if it is a newly created document. • Include a URL in a couple of documents and jump directly to the URL from the view. Adding a Space Between Columns 1. Create a new column between two columns and set the column width to one (1). Deselect Show values in this column as links if not already done. 2. Select Formula in the Programmer’s Pane and insert the following HTML code, including the quotation marks (this is a text string): "[<img src=/icons/ecblank.gif>]" Note The “ecblank.gif” is one of the standard icons that come with Domino. It is located in the icons subdirectory on the Domino server. Adding HTML and Icons to Column Headers You can use the column Title field in the column properties box to add graphics and pass-thru HTML to your column headings. The only limitation is that you can only fit 64 characters into the column title. 1. Open the InfoBox of a categorized column, and in the Title field add the following line (no quotation marks): Sort [<img src =/icons/vwicn108.gif>] This will add a small green arrow to identify where to click to sort the column on the Web. Browser users might not be familiar with the little triangle if they are not familiar with the Notes client. 2. Open the InfoBox for any other column. In the title field enter: [<A HREF=" /"><img src=/icons/vwicn069.gif border=0>Home</A>] This will add an icon with a DocLink to the home page from the column header. Click the Title tab and select Right Alignment. Chapter 5: Views, Folders, and Navigators 129 Adding HTML to Column Formulas 1. Select a categorized column. In the Programmer’s Pane, click the Formula button and enter the following formula for the column: Categories + "[<hr>]" This will display the value of the Categories field and then add a horizontal rule. Notice that the plus (+) sign is used to append values. 2. Add a column and enter the following formula: @If(@Now>@Adjust(@Created;0;0;7;0;0;0);"";"[<blink><font color=\"Red\"><b> New </b></blink>]") The formula checks to see if the document was created within the last week and if so, it will display a blinking “New” text string. Note The HTML blink tag is not supported on all browsers. Creating URL Links at View Level You can add HTML to the document fields displayed in the view columns in the same way. By adding a URL address to a document, you can display URL links in a view, enabling users to jump directly from the view level to a URL. Note You could also calculate the HTML in the view, which is useful if you want to use the same document but different views for Web browsers and Notes clients. 1. Create a new document and include the following in a field that will be displayed in the view such as the Document title. [<A HREF=http://www.lotus.com>]LotusDevelopment Corp.[</A>] 2. Save your document and create a new one. Enter the following URL: [<A HREF=http://notes.net>]Notes.Net[</A>] 3. Save your document. Both documents take you directly to their respective Web sites. 130 Lotus Domino Release 5.0: A Developer’s Handbook Domino View Properties Not Supported on the Web Avoid using the following view and folder features in a Web application: Views can be re-indexed at a Domino server. These features are not supported using HTML in a Web browser. Advanced properties Refresh index options Discard index options These features are not supported using HTML in a Web browser. Style properties Unread rows Alternate rows Show selection margin Beveled column headings This feature is not supported using HTML in a Web browser. On Refresh options This feature is not supported using HTML in a Web browser. On Open: Go To… options Web applications do not have a View menu. To exclude a view from the folders navigator, use the Design - Design InfoBox to hide the view from Web users or surround the view name in parentheses, for example (HiddenView). Show in View menu Web views do not expand or collapse all; instead they expand or collapse only one category at a time (equivalent to Expand/Collapse Selected Level). Collapse all when database is first opened. This feature is not supported using HTML in a Web browser. Options properties ReasonViews and Folders Triangles are always shown.Show twistie when row is expandable This feature is not supported using HTML in a Web browser. Column Info properties ReasonColumns Chapter 5: Views, Folders, and Navigators 131 Hints and Tips on Designing Views The section below contains a collection of hints and tips. You may find them useful when you are going to design or change a view. Naming Views The name that you choose for a view is visible to Notes client users in the View menu, to Web users in the Views list, and in the Folders pane (unless the view is hidden). The name is case-sensitive and can be any combination of characters, including letters, numbers, spaces, and punctuation. The full name, including all alias names, can be up to 64 characters. Naming Tips Views appear in alphabetical order in menus and lists. To force names to appear in a different order, number or letter them. This also allows Helpdesk members to easily identify the view. When possible, assign a name that indicates how the view sorts documents, for example, By Company Name or All by Category, or specifies which documents it includes, for example, New Customers. Use consistent names across databases to make it easier for users to recognize views. Alias Names An alias is an internal name for a view. Usually you use this alias for programming purposes, for example, in @DbColumn formulas. Aliases follow the same naming rules as view names. You can append more than one alias name by entering the | (vertical bar) symbol followed by the alias name. Always keep the original alias as the rightmost name. Main View | View1 Changing a View Name You can edit the view name or alias name in the View InfoBox when the view is open in Design mode. If you change the name of the view, copy and paste the previous name into the Alias box to the left of any other aliases, using the | as the separator. For example, a movie database contains a view named By Screening Date. The name of this view is going to be changed to By Premiere Date. Here is how the name will look after it has been changed: By Premiere Date | By Screening Date | DateView 132 Lotus Domino Release 5.0: A Developer’s Handbook Hidden Views When you surround a name with parentheses, for example (All), the view does not appear to Notes client users in the Domino view menu, or to Web users or Notes client users in the Folders pane. Cascading Views If you don’t want to overwhelm users with long lists, or if you have related views that should be grouped together, you can arrange them in a hierarchy so that a group of related menu items are organized under one item in the navigator pane. A user clicks on the higher-level name to display the cascaded list. If you didn’t specify a cascading view when you created the view, enter the name you want to appear on the Create menu followed by a \ (backslash), followed by the view name. For example, the Personal Address Book template has two views related to servers: Server\Certificates Server\Connections Overview of Styles The following tables give an overview of the most important settings: Useful for large views with many categories or topics. Not applicable to Calendar views. Displays the top level category in categorized views or the main documents in a hierarchical responses view. Users click the category to see individual documents within the category. Collapse all when database is first opened White, light blue, and yellow are good choices. Determines the background color for the view. Color: Background CommentsDescriptionView styles Chapter 5: Views, Folders, and Navigators 133 Fills out the last column to avoid empty space in the view. Extend last column to window width Not applicable to Calendar views. Shows a green triangle next to a column that displays categories or response documents. Show twistie when row is expandable More space makes each row easier to read. Less space condenses the view contents to make them useful for reports or Web users. Determines how much space there is between rows. Row spacing (Single, 1-1/4, 1-1/2, 1-3/4, Double) Keeps gaps from appearing below rows that are shorter than the number of lines per row you select. Shrink rows to content If you deselect “Show selection margin,” users can still select documents by pressing and holding SHIFT as they click document names. The selection margin appears temporarily while documents are selected, and hides again when all documents are deselected. Shows the document selection margin. Deselect for cleaner-looking rows. Show selection margin Useful for multi-line rows. Not applicable to calendar views. Determines the color that alternates with the background color to highlight every other row. Color: Alternate rows Red is used for unread documents in template designs. Determines the color for unread documents. Color: Unread rows “Shrink rows to content” and “Color: Alternate rows” are useful accompaniments to multi-line rows. Determines how many lines a row can contain. Lines per row (1-9) CommentsDescriptionRow styles 134 Lotus Domino Release 5.0: A Developer’s Handbook [...]... personal folders To create personal folders in a database, you must have at least Reader access to the database To create shared folders in a database, you must have at least Editor access, and the option Create shared folders/views must be enabled for you 148 Lotus Domino Release 5.0: A Developer’s Handbook When you create a personal folder, Domino stores it in one of two places: 1 If the Manager of... that you use to define a clickable area in a navigator Navigator Actions A navigator action determines what happens when users click an object You can add actions to all navigator objects except those that were pasted or imported as graphic backgrounds Lotus Domino Designer provides the following simple actions that you can attach to navigators: • Open another navigator • Open a view • Serve as an alias... the LotusScript program associated with the object Chapter 5: Views, Folders, and Navigators 151 Creating a Navigator In the following section we will create a simple navigator We will create a graphic background and add a button The button will have an action associated with it You can add a navigator to your database in one of three ways: • Copy an existing navigator from the same database • Copy an... default view of a database Note It is necessary to provide server access to views that are Read-restricted when a database must be replicated Creating a Write Access List To allow only certain users to update documents in a folder, create a Write access list for the folder You can add users to the Write access list for a folder as long as they already have at least Author access in the database access... Test and fix each small task first When everything is working correctly, combine the formulas into one, and then test the navigator again 154 Lotus Domino Release 5.0: A Developer’s Handbook Including a Navigator in the View Menu To display a navigator when a database is opened, follow these steps: 1 Open the database InfoBox 2 Click the Launch tab 3 To display the navigator in the navigation pane,... or access levels Navigators are graphical image maps containing several active areas called hotspots or buttons These hotspots or buttons can be links to other Domino objects or Web pages located outside Domino, and can also launch agents to perform specific tasks on documents stored in Domino databases 156 Lotus Domino Release 5.0: A Developer’s Handbook Chapter 6 New R5.0 Design Elements This chapter... existing navigator from another database • Create a new navigator Whichever way you choose, you need Designer access or higher to the database In our example, we will create a navigator from scratch To create a navigator, do the following: 1 Open the database where you want to create the navigator in Design mode 2 Go to the navigator pane 3 Click the New Navigator button This will bring up the Programmer’s... point to the data stored in a database When users open a view, a list of documents in the database is displayed, each row presenting pieces of information from a document As such, views give users a logical and organized overview of information available in Domino databases The dynamic nature of views allows application developers to design highly flexible entries for databases and Web sites, based on user... Programmer’s Pane for navigators Creating a Background There are two options for creating a background image: • Copy any available graphic image to the clipboard and use Create Graphic Background to paste the graphic in as the background • Use the File - Import dialog box to import a graphic as a background to your navigator Tip Whenever possible, use the File - Import method to create a background because... affects all views in the database Users see only new documents as unread; modified documents do not appear as unread Using Categories in Views A view that displays categories enables users to find related documents A categorized view is neat and easy to scan Users can collapse the categories to display only the category names and then expand categories individually, or expand the whole view 136 Lotus Domino . categories to display only the category names and then expand categories individually, or expand the whole view. 136 Lotus Domino Release 5. 0: A Developer’s Handbook To categorize a view, create a column. For example, 6 displays as 6 .00 . • Scientific. Formatting displays numbers using exponential notation; for example, 10, 000 displays as 1 .00 E +04 . • Currency. Formatting displays values with a currency. can see, Domino has automatically created a Web navigation bar at the top and bottom of the screen. This navigation bar contains buttons that users click to Expand, Collapse, Scroll, and Search

Ngày đăng: 08/08/2014, 18:22

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan