India seo web development website designer freelance

The Database Connectivity API

As a developer, you can create a new connection types and corresponding dialog boxes for new or existing server models. However, when a user sets up a site to start building pages, he or she creates a new connection object after selecting a particular type of connection that you created.

The user can select your new connection type in several ways:

To develop a new connection type:
  1. Create the layout for the connection dialog box.
  2. Create an HTML file that lays out the user interface (UI) for your connection dialog box. Name this file using the name of the connection (for example myConnection.htm). For information on how to create a dialog box, see “Adding Custom Server Behaviors” in Book 8, Making Pages Dynamic, in Getting Started with MX .

    Make sure this HTML file includes the JavaScript implementation file that you define in Step  Create a JavaScript file that implements at least the following elements: , as shown in the following example:

    <head> <script SRC="../myConnectionImpl.js"></script> </head>

    Store this HTML file, which defines your connection dialog box, in the Configuration/Connections/ server-model / platform folder.

      server-model is the folder that is associated with the document type (such as asp_js) of the currently open page.
      platform is either Win or Mac .

    For example, the default ADO connection dialog box for an ASP JavaScript document on a Windows platform is stored in the ASP_Js/Win folder and is named Connection_ado_conn_string.htm.

    Note: At runtime, MX dynamically builds the list of connection types that are available to the user from the collection of dialog boxes that are in the ASP_Js/Win folder.

    In the Configuration/ServerModels folder, there are .htm files that define each server model. Inside each of these HTML files is a function named getServerModelFolderName() , which returns the name of the folder that is associated with the server model. The following example shows the function for the ASP JavaScript document type:

    function getServerModelFolderName() { return "ASP_JS"; }

    You can also look at the MMDocumentTypes.xml file, which is located in the Configuration/DocumentTypes folder, to determine the mapping between server models and document types.

  3. Create a JavaScript file that implements at least the following elements:

    Element Description Examples
    A set of variables Each defines a specific connection property Type of connection, data source name, and so on
    A set of buttons Each button appears in the connection dialog box Test, Help, and so on (OK and Cancel are automatically included)
    Connectivity functions Together, these functions define the Connectivity API findConnection() applyConnection() inspectConnection()

  4. You can choose any name for this implementation file but it must have a .js extension (for example, myConnectionImpl.js). You can store this implementation file on either your local or a remote computer. You might want to store your implementation file in the appropriate subfolder within the Configuration/Connections folder.

    Note: The HTML file that you defined in Step Create the layout for the connection dialog box. must include this connection type implementation file.

Unless you need to define connection parameters other than the ones provided in the standard connection_includefile.edml file, these two steps are the minimum to create a new connection dialog box.

Note: The title of the dialog box that the user sees is in the <title> tag, which is specified in the HTML document.

The functions listed in the next section let you create a connection dialog box. Along with implementing the calls for generating include files for the user, you might need to register your connectivity type within the server model section of the connection XML file.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

India web developer website development India