Adding Java and ActiveX

From Documentation
Jump to: navigation, search

Adding Java and ActiveX

You can make your site more interesting and interactive by adding special applications, such as Java applets, Java Beans, or ActiveX controls. NetObjects Fusion tools make it easy to insert these items and set their properties. To choose appropriate properties settings, you should be familiar with Java or ActiveX before you add these types of application files to your site. A sample Java applet is available in the NetObjects\NetObjects Fusion\Java\Applets folder; sample Java Beans are available in the NetObjects\NetObjects Fusion\Java\Beans folder.

Inserting a Java Applet or Servlet

Java applets and servlets are an efficient way to add sound and animation, such as scrolling messages and color cycling buttons, to a page. Java applets and servlets are platform-independent applications with compact file sizes. Usually, Java applets and servlets run from the client platform, which means site visitors download and run them from a browser; however, servlets can include commands that are executed on the server. Most browsers are Java-compatible, so site visitors don t need special plugins to run a Java applet.

To insert a Java applet or servlet:

  1. In Page view, select the Java Applet tool from the Plug-Ins toolbox.
  2. Draw a box to indicate the position of the Java applet or servlet.

The Open dialog appears.

  1. Select a Java file from your hard disk or LAN, or select one that is currently used in the site from the Java Class Assets tab. See Managing Assets.

The extension for a Java file is .class or .jar.

  1. Click Open.

The Java placeholder image appears on the page, and the Java Properties panel appears. The path to the file you selected appears in the File field on the Properties tab. To select a new file, click Browse, find the file, and click Open.

The current .class file is displayed in the Class field.

You can also drag a Java .class file from Windows Explorer onto your page. The Java placeholder appears on the page, and you can set the Java properties for that file.

  1. To provide text for the browser to display if it cannot display the file, enter a description in the AltTag field.
  2. Select Applet or Servlet depending on which type of file you are inserting.
  3. If your applet or servlet requires additional files, click the Additional Files button, then click Add in the Java Applet Files dialog.
  4. Select another file in the Add Java Applet Files dialog, and click Open. Click OK to add the selected file.

To delete a .class file from the Class list, click the Additional Files button and select the appropriate file in the Java Applet Files dialog. Click Delete, then click OK.

  1. To add parameters to the Java applet, click the Parameters tab.

This guide assumes you are familiar with Java and understand the effects of setting these parameters. In some cases, Java developers provide documentation that explains the parameters.

  • To edit parameters, double-click the parameter and enter a value in the Enter Value dialog.

For servlets, you can specify that the value is an initialization value for the parameter by checking the Value is an initializer option in the Enter Value dialog.

  • To learn more about each parameter, look in the Parameter info section.
  • To remove a parameter, select it and click the minus (-) button.
  • To add a parameter, click the plus (+) button and enter a name and value in the Enter Value dialog.
  • To change the order of the parameters in the generated HTML, click the Up or Down arrow buttons. The selected parameter moves up or down in the Parameters list.

Inserting a Java Bean Component

Java Beans are a type of Java applet. Unlike Java applets, which require .class files plus other types of files, Java Beans are an all-in-one implementation of Java. A single .jar file contains everything required to run the applet.

To insert a Java Bean:

  1. In Page view, select the Java Bean tool from the Plug-Ins toolbar.
  2. Draw a box to indicate the position of the Java Bean.

The Open dialog appears.

  1. Select a Java Bean file from the NetObjects\NetObjects Fusion\Java\Beans folder, or select one that is currently use in the site from the Java Archive Assets tab.

A Java Bean file can have a .jar or .class extension. Most Java Beans have a .jar extension, but some .jar files might not be Java Beans. If you try to open a .jar file that is not a bean, you see a message from NetObjects Fusion.

  1. Click Open.

The Java Bean placeholder appears on the page. Beans have different icons in the upper right corner of the placeholder; the icon is created by the bean's author and has no effect on the bean or its behavior. The path to the file you selected appears in the File field on the Properties tab of the Java Bean Properties panel. To select a different file, click Browse, find the file, and click Open. The current .class file is displayed in the Class field.

  1. To provide text for the browser to display if it cannot display the file, enter a description in the AltTag field.
  2. Select Applet or Servlet depending on the type of bean you are inserting.
  3. If the bean requires other files, click the Additional Files button, then click Add in the Java Applet Files dialog.
  4. Select another file in the Add Java Applet Files dialog, and click Open. Click OK to add the selected file.
  5. Display the Properties tab.

Different beans have different sets of properties. This help assumes you are familiar with Java Beans and understand the effects of setting these properties. In some cases, Java Bean developers provide documentation that explains the properties.

  1. To edit a property, select the appropriate field. Some properties require you to choose a color or enter a value in a dialog. Other properties toggle True/False or require you to type text. In some cases properties appear that have no affect on the bean or its behavior.
  2. Click the Parameters tab.

If you know the bean's internal parameters, you can add or remove them.

  • To add a parameter, click the plus (+) button and enter a name and value in the Enter Value dialog.
  • If there are parameters listed, to remove one, select it and click the minus (-) button.
  • To change the order of the listed parameters, select a parameter and click the Up or Down arrow buttons.
  1. Publish the page to see how the bean works.

You can add actions to Java Beans using the Actions tab. When you choose a Java Bean as the target or source of an action, you see an expanded selection of available actions or trigger events as appropriate. See Building Dynamic Pages.

Inserting an ActiveX Control

You use ActiveX controls to embed an application in a Web page. Microsoft Internet Explorer 3.x or later supports ActiveX controls with which you can add custom capabilities such as audio and movie players, calendars, custom buttons, and forms to your pages. You can view documents such as Microsoft Office files in Internet Explorer without launching the associated program. Site visitors must use Internet Explorer 3.x or later to view content created with ActiveX controls. To view the content in other browsers, site visitors must install special plugins. For information, go to www.microsoft.com.

To insert an ActiveX control:

  1. In Page view, select the ActiveX Control tool from thePlug-Ins toolbox.
  2. Draw a box to indicate the position of the ActiveX control.

The Insert ActiveX Control dialog appears, listing the ActiveX controls currently installed on your system. The bottom section shows the selected ActiveX control, which has an .ocx or .dll extension.

  1. Select Set codebase to add the codebase parameter to the generated HTML and ensure that the ActiveX control is published to the website. If a visitor who does not have the ActiveX control you are using views the website, the option to download the control is offered.
  2. Select the control you want and click OK. The ActiveX control appears on your page, and the ActiveX Control Properties panel appears.

The Properties tab displays the options for the selected control.

If you use an ActiveX control that references an external file, such as a .pdf file, you must specify the relative path of the file as it will be in the final published site. First you must add the file as an asset of the site and set it to always publish. See Adding a File Asset. To determine the file's relative path in the final site, look at the publish directory structure listed in Publish view.

  1. To provide text that the browser displays if it cannot launch the ActiveX control, enter the text in the AltTag field.
  2. To change an option, select it and enter the information in the field.
  • To accept any text you enter, click the check mark or move the cursor to another field.
  • To cancel the change, click the X.
  • To use the native property page for the ActiveX control, click the Properties button. You can change the control's settings using the native property page instead of NetObjects Fusion properties. Some ActiveX controls do not have a native property page.
  • To insert HTML tags and scripts, click the HTML button. See Working with HTML Directly.

You can add actions to ActiveX controls using the Actions tab.