Data Publishing

From Documentation
Jump to: navigation, search

Data Publishing

NetObjects Fusion makes it easy to publish information such as employee directories, product and service catalogs, and event schedules. You can enter, manage, and store this information as records either in your NetObjects Fusion site, or in an external application such as a database or spreadsheet.

To publish the data, you specify its source and create a layout for the pages that will display it. NetObjects Fusion uses your Layout to create a separate page for each record, and can automatically provide site visitors with buttons to navigate between them.

Static and Dynamic Data Publishing

NetObjects Fusion supports two kinds of data publishing: static and dynamic.

  • Static data publishing takes any kind of data text, pictures, multimedia files, and so on from a database or spreadsheet. NetObjects Fusion publishes the data on your site, where it remains unchanged "static" until the source data is changed and the site is re-published. Static data publishing, which is the focus of this chapter, uses data objects that derive data from internal or external sources.
  • Dynamic data publishing makes it possible to refresh the data each time a visitor goes to the site. When the browser requests the data, it is assembled on the spot; it does not depend on re-publishing the site.

Dynamic data publishing requires third-party components.

Storing Data with NetObjects Fusion

Using the data publishing capabilities of NetObjects Fusion, you can store text and pictures in a database internal to your site, or import data from external sources such as Microsoft Excel or Access using an ODBC data source connection. In both cases, NetObjects Fusion publishes your data in standard HTML pages. This makes it easy to add listings, such as product and service catalogs, employee directories, and event schedules to your site.

You use the following objects when you publish data in NetObjects Fusion:

  • Data objects. A data object is a collection of data fields that define what data will be published. Creating a data object is the essential first step in adding internal or external data to your site. The data object becomes an asset of your site. When you reference records internally, you must specify the data fields you want to store. When you store records from external data, NetObjects Fusion includes all fields available in the source.
  • Data fields. Defined in the data object, data fields appear on stacked pages and are the containers for the data in your site. You can arrange and label data fields; the arrangement appears on all stacked pages.
  • Data lists. The data list appears on the parent page of the stacked pages that contain the actual data. The data list functions as a table of contents for the internal or external data in your site. You select the fields you want to display as column headers in the list. The field data from either the internal or external source populates the data list when you publish.
  • Stacked pages. Each record in your database appears on a separate stacked page below the page containing the data list. Stacked pages are not siblings of each other, but instead are iterations of the same page, containing the fields defined in your data object.

For example, you could publish a backpack catalog on your site with a record for each backpack. Each row in the data list lets the site visitor navigate to the stacked page that contains the corresponding backpack's description, photo, and price.

To create the backpack catalog, your first step is to create a backpack data object. You can define a data object once and use it in different filtered data lists. For example, you can create one data list of all the backpacks in your database. With the same data object, you can create additional data lists of internal frame backpacks, external frame backpacks, frameless backpacks, and so on.

If you create a data object from an external source for example, from a Microsoft Access database and then update or change the external source, you must republish the site to update the data. For example, suppose your backpack data object referenced 50 records originally and the external database is increased with 25 new records. After you republish your site, the data object references 75 records, the backpack data list contains 75 rows, and there are 75 stacked pages.

After you create a data list on a page, NetObjects Fusion generates the first stacked page. You create the initial Layout of how all stacked pages look on the first stacked page. When you create the Layout of the first stacked page, the remaining stacked pages automatically inherit the same Layout. Changes you make in the Layout in any one stacked page affect the Layout of all stacked pages in that set.

Publishing Data

In general, when you work with data publishing, you follow this process:

  1. Create a data object.
  2. Create a data list.
  3. Design a set of stacked pages.

When you create a data list, you create the stacked page for the data object. On this stacked page you create the Layout to be used for all the pages in the stack, including the field data you want to display on the page.

  • If you are storing data internally, you enter the field data on the stacked page itself.
  • If you are using an external source, the field data is drawn from the external database, spreadsheet, or ASCII text file.

When you use the Data List tool in Page view, you can perform all three tasks within the Data Publishing dialog.

Creating a Data Object

You can create two types of data objects:

  • Internal data objects reference simple text, formatted text, and picture data fields stored or placed within your site.
  • External data objects import fields from a data field created in a program other than NetObjects Fusion. External data sources include external databases, spreadsheets, and ASCII text files. Importing external data takes a single table from a database or a single worksheet from a program such as Microsoft Excel; it does not import the entire database. Use external data if your database is maintained by others who do not use NetObjects Fusion, if you have large quantities of data, or if the data is frequently updated.

The tools for creating the two data object types appear on the Advanced toolbox. Use the New External Data Source tool to create a data object for external data; use the Data List tool to create a data object for internal data. After you create an internal data object, use the Data Field tool to add data fields to the stacked pages.

Creating a Data Object for Internal Data

Internal data is records and fields stored within your site. You enter internal data directly into a stacked page by typing text or numbers and by placing pictures.

You can create a data object in Page view or in Assets view. If you create a data object in Page view, you can immediately create stacked pages and start entering data. If you create a data object in Assets view, you must return to Page view to create a data list and stacked pages.

To create a new internal data object:

  1. Display the Data Object dialog:
    • In Page view, select the Data List tool from the Advanced toolbox, and draw a rectangle on the page. In the Data Publishing dialog, click the New button.
    • If you are in Assets view, click the Data Objects tab and then click the New Asset button on the views bar.
  2. Select Internal and enter a name for the data object and comments about it.

NetObjects Fusion uses the data object name in the list of data objects in the Data Publishing dialog and in Assets view.

  1. Click the plus (+) button to add a field. Fields define the kind of data you can enter.

The Data Field dialog appears.

  1. Type the field name and select a data type for the field.
  • Formatted text. Characters in these fields can be formatted individually. Formatted text fields can contain paragraph and line breaks, and can exceed 255 characters. You cannot sort on formatted text fields.
  • Simple text. All characters in these fields share the same formatting characteristics. Simple text fields cannot contain paragraph or line breaks, and cannot exceed 255 characters. You can sort on simple text fields.
  • Image file. These fields can contain an image in one of these formats: .bmp, .gif (animated, embedded, interlaced), .jpg, .pct, .pcx, .png, .psd, .tga, or .tif. You can sort on image file fields. NetObjects Fusion uses the file names to sort the image files.

Carefully plan the fields you define within an internal data object. After you click OK in the Data Object dialog, you cannot delete the field from the data object or change the data field type.

  1. Click OK.
  2. Repeat steps 3, 4, and 5 to add fields.
  3. When you are done, click OK in the Data Object dialog.

The data object is now an asset of your site, and you can continue as follows:

  • If you re working in Page view, the Data Publishing dialog is still open. You can select fields and format the data list as described in Creating a Data List, and lay out your stacked pages as described in Creating Stacked Pages.
  • If you re in Assets view, go to Page view, select the Data List tool from the Advanced toolbox, and draw a rectangle on the page. In the Data Publishing dialog, select the newly created data object from the drop-down list. Select fields and format the data list as described in Creating a Data List, and lay out your stacked pages as described in Creating Stacked Pages.

Changing an Internal Data Field Name

  1. Go to Assets view.
  2. Click the Data Objects tab.
  3. Double-click the data object name.

The Data Object dialog appears.

  1. In the Fields list, double-click the name of the field you want to rename.

The Data Field dialog appears.

  1. Type a new name in the Name field and click OK.
  2. Click OK.

Creating a Data Object for External Data

External data exists in local desktop databases or in ODBC data sources. Open Data Base Connectivity (ODBC) drivers draw data from Structured Query Language (SQL) data sources, such as Oracle and Sybase data files. They also support Microsoft Excel, Microsoft Access, delimited text files, and others.

NetObjects Fusion automatically imports all the fields available in the external database file. If a simple text field contains a valid path to an image file, NetObjects Fusion asks if you want to make the field an image field. Before you add an external data object, make sure you have all the necessary fields. You cannot add fields once you create the external data object.

To create a data object from a SQL data source:

  1. Display the Select Data Source dialog:
    • In Page view, select the New External Data Source tool from the Advanced toolbox, and draw a rectangle on the page.
    • If you are in Assets view, click the Data Objects tab, and then click the New Asset button on the views bar. The Data Object dialog appears. Select External and then click the Source button.

The Select Data Source dialog appears.

  1. You can select an existing data source or create a new data source.

To create a new data source, click New in the Select Data Source dialog and follow the steps in the Windows Create New Data Source wizard.

To select an existing ODBC source on your system, you can use the File Data Source tab or the Machine Data Source tab:

  • File Data Source. Select from the list of data sources and click OK.
  • Machine Data Source. Select from the Data Source Name list and click OK.

Depending on the data source type you choose, the Select Workbook or Select Database dialog appears.

  1. Follow these steps:
  • Select a file in the dialog and click OK.
  • If the source refers to a multiple-file database or a spreadsheet with multiple tabs, the Select dialog appears. Select the file or tab and click OK.

NetObjects Fusion creates the data object, gives it the name of the selected file or tab, and imports its fields as simple text fields.

If a simple text field contains a valid path to an image file, you can choose to make it a text field or an image field.

The data object is now an asset of your site, and you can continue as follows:

  • If you re working in Page view, the Data Publishing dialog is still open. You can select fields and format the data list as described in Creating a Data List, and lay out your stacked pages as described in Creating Stacked Pages.
  • If you're in Assets view, go to Page view, select the Data List tool from the Advanced toolbox, and draw a rectangle on the page. In the Data Publishing dialog, select the newly created data object from the drop-down list. Select fields and format the data list as described in Creating a Data List, and lay out your stacked pages as described in Creating Stacked Pages.

Creating a Data List

Once you create a data object, you can create a data list on any page. You create a data list and a set of stacked pages at the same time. NetObjects Fusion automatically includes linked data list icons in the first column in the data list. The data list thus acts as a table of contents each row contains data for, and is linked to, a single stacked page.

To create a data list:

  1. In Page view, display the page on which you want to place the data list.
  2. Select the Data List tool from the Advanced toolbox and draw a rectangle in the Layout area.

The Data Publishing dialog appears. Select the data object you want to use for this data list.

The fields in the selected data object are listed.

  1. Choose a sort field from the drop-down list. For internal data objects, you can only sort on simple text or image fields.

Records are sorted in ascending order.

  1. To filter the data, click the Set button. You can use simple text fields to filter the data.

The Filter dialog appears.

By default, all available records in the data list and on stacked pages appear. You can create selection criteria that isolate the records you want in your data list.

  1. Enter your selection criteria and click OK.

If you do not use all three lines, choose end from the drop-down list at the end of the last line you use.

  1. In the Data list area of the Data Publishing dialog, enter a name for the data list.
  2. In the Fields list, select fields to include in the data list by clicking the check boxes to the left of the fields.

As a shortcut, you can click the Add All button, which marks all fields for display. Typically, however, you display only a subset of fields in the data list and display all fields on stacked pages.

  1. To link a field to its stacked page, select the field in the Data Publishing dialog and click the Link/Unlink button.

A data list automatically includes a navigation button that links to the record's stacked page. When you link a field, site visitors can click either the button or the linked field to jump to the record's stacked page.

  1. To change the order in which fields appear in the data list, click a field and then click the up and down arrow buttons.

Continue to select fields and click the up and down arrow buttons until the list is in the order you want.

  1. Set the Stacked Page options:
  • Display all fields places all fields available in the data object in a simple layout when NetObjects Fusion creates the first stacked page. Use this shortcut to avoid placing fields individually as described in Designing the Stacked Page Layout.
  • Add navigation buttons creates smart links to navigation buttons (next/ previous/up) when NetObjects Fusion creates the first stacked page. Use this shortcut so you don't have to create these buttons as described in Adding Navigation Buttons to Stacked Pages.

The images used for these buttons SPNavLeft.gif, SPNavRight.gif, and SPNavUp.gif are in the NetObjects Fusion\NetObjects System folder.

  1. Click OK.

The data list placeholder appears. Its column heads are the names of the fields you selected for display, and a data list button appears at the left of the first row. NetObjects Fusion populates the data list only when you preview or publish the page. Data never appears in the data list in Page view.

  1. Set the Data List properties.

Adjust the settings to change the bullet type, background color, border size, spacing of data, and column title display. Drag the column heading borders to adjust column width. You cannot change the font type or color in a data list except by editing the text style. See Working with Text Styles.

When you are satisfied with the appearance of the data list, create a layout for the stacked pages as described in Designing the Stacked Page Layout.

Creating Stacked Pages

Stacked pages correspond to records in a database. When you store information internally in NetObjects Fusion, you enter data for one record on each stacked page. If you are drawing information from an external data file, each stacked page automatically displays information from a record.

You can add or delete stacked pages for internal data as described in Adding a Stacked Page for Internal Data. To add or delete records for external data, you must make the changes in your external database or spreadsheet and then republish the site.

Designing the Stacked Page Layout

The stacked page Layout determines the appearance of all the stacked pages. Data fields and non-data objects (text, pictures, or other assets) added to the stacked page Layout are repeated on all stacked pages. Layout changes you make to any stacked page are automatically applied to all pages in the stack.

If you did not select any stacked page options when you created your data list, your stacked page Layout is blank. You can add text and graphic objects to this page, just like any other page. The key items to be added, however, are the data fields you defined in the data object.

To design stacked pages:

  1. Go to Site view or use the Site Navigation panel in Page view to navigate to a stacked page.

If you are working with external data, the views bar indicates this is 1 of as many records as were imported from the external source. If you are working with an internal data object, it indicates this is 0 of 0 because you have not created any records.

  1. In Page view, select the Data Field tool from the Advanced toolbox, and draw a rectangle in the Layout area of the stacked page. The dashed rectangle represents the first field you are adding.

The Data Field dialog appears. The fields available on the Name drop-down list are in the data object you selected in the Data Publishing dialog when you created the stacked pages.

  1. Select a field and click OK.
  • If you are using external data, NetObjects Fusion displays image or simple text field data from the first record in the data file.
  • If you are using internal data and select an image file field, the field area is marked with an X. After you create a new record, you can double-click the X to open the Picture File Open dialog, select the file, and then click OK.
  • If you are using internal data and select a simple or formatted internal text field, NetObjects Fusion displays a blank field if you have at least one record. If there are no records, NetObjects Fusion displays a field containing the field name. Simple text fields allow only one line of information and all characters use the same formatting. Formatted text fields allow multiple lines of information and individual character formatting. See Adding a Stacked Page for Internal Data.
  1. Drag the field to the location you want on the stacked pages.
  2. Place additional data fields. Add text blocks to label your fields, lines, and other graphics until you are satisfied with the Layout.
  3. Use the Data Field Properties to set the background and other options for the current data field.
  4. Do one of the following:
  • If you are using external data, your stacked pages are already created. You can use the Next and Previous buttons on the views bar to scroll though all pages in the stack.
  • If you are using internal data, add records as described in Adding a Stacked Page for Internal Data. You cannot enter data until you add a record to contain it.

Adding Navigation Buttons to Stacked Pages

Next and Previous buttons simplify navigation between stacked pages. You can automatically add navigation buttons when creating your data list as described in Creating a Data List, or you can create custom navigation aids by drawing or importing buttons, as described here.

To add navigation buttons for stacked pages:

  1. In Page view, on one of the stacked pages, add an object to serve as a button.

You can place text, draw a button using the Draw tool, or import an image using the Picture tool. Visit Online view to learn where you can locate a variety of images.

  1. Select the object.
  2. Click Link on the object's Properties panel.
  3. In the Link dialog, select the Smart Link type.
  4. Select Next Stacked Page or Previous Stacked Page, and then click Link.

Adding a Stacked Page for Internal Data

To add a new record to internal data, you create a new stacked page. Each new stacked page has the same layout of data fields and non-data objects as all the other pages in the stack.

You can create as many new stacked pages as you want. For each new stacked page, NetObjects Fusion adds a row to the data list on the data list page. You can delete stacked pages for internal data whenever you want.

You cannot add or delete stacked pages associated with an external data object. To add or delete records when data is stored externally, you must update your external database or spreadsheet application and re-publish your site.

To add internal data stacked pages:

  1. In Page view, on a stacked page, click the Add button on the views bar.
  2. A stacked page with blank data fields appears. The counter on the views bar indicates the new total of records in the stack.

Deleting a Stacked Page

To delete the current stacked page of an internal data object: In Page view, click the Delete button on the views bar and click Yes to confirm deletion.

Adding Text and Images to Stacked Pages

When a stacked page displays data from an internal data object, you can enter text and add pictures in data fields on the stacked page. You cannot edit text on stacked pages that reference external data.

To enter text in a text data field:

  1. Double-click the data field.

A dotted outline with hollow handles highlights the field, and an insertion point appears inside.

  1. Type the text you want, then click outside the field to deselect it.

To add an image in an image file data field:

  1. Double-click the data field and select the image you want in the dialog that appears.

After you add data to the stacked pages, the data list can display it. Preview the data list page to see how it will look in your browser.

Deleting a Data Object

If you created stacked pages for the data object, you must delete the stacked pages and any data lists before you can delete the data object.

  1. Go to Site view and select the stacked pages.
  2. Press Delete, and click Yes to confirm.
  3. Switch to Page view, select the data list, and press Delete.
  4. Switch to Assets view.
  5. Click the Data Objects tab.
  6. Select the data object and press Delete.
  7. Click Yes to confirm the deletion.
  8. Click the Files tab.
  9. Select the data source file and press Delete.
  10. Click Yes to confirm the deletion.