iNetWord APIs and Protocols

iNetWord can be controlled by utilizing the following APIs and Protocols:

  1. CGI Parameters
    Controls appearance, opening documents, etc.
  2. JavaScript Client API
    Also controls appearance, opening documents, etc.
  3. WebDAV
    iNetWord stored user files can be accessed by WebDAV.
  4. FTP
    iNetWord stored user files can be accessed by FTP.

 

CGI Parameters

All CGI Parameters can be passed within the URL (method = GET) or within POST data. The same parameters can be passed whether you launch iNetWord with its full interface or as a pure-play editor without the files pane (domain.com/s/edit.php).

CGI parameter names are case sensitive. No CGI parameters should be specified more than once within the same URL. Take care to URL Encode special characters used within CGI Parameter values (see below).

 

CGI Parameter 

Explanation

OPEN 

 

new=templatename 

Create a new document based on the specified template. The template should be in the user's New pane. To create a template, check the save as template checkbox in the Save As dialog box.
Value is case sensitive.

open=docname 

Open the named document for editing. 
Value is case sensitive.

APPEARANCE 

 

bgcolor=#010203 

Set iNetWord's surrounding background color to the given RGB value.
The surrounding background color is a very dark blue by default.

filemode=multi | single

Operate in single file or multiple files mode. This setting simply sets the filesmulti, filebuttons, and filetabs settings to no.
Value is case insensitive.

filesmulti=yes | no

 

Allow or prohibit more than one document open at once. Yes is the default. When set to no, the user is prompted to save their current document when they attempt to open a new one.
Value is case insensitive.

filebuttons=yes | no 

Whether to show the New Document and Upload buttons on the toolbar.
Value is case insensitive.

filetabs=yes | no 

Whether to show the Close/ready/people/release gray tabs and the blue or yellow file tabs at the far right of the editor window. Filemode=single implies filetabs=no.
Value is case insensitive.

STORAGE ACCESS 

 

StorageScheme=
WebDAV 

Indicates which document storage API to use to store documents back to a user's primary store. Currently only WebDAV is supported. We anticipate supporting FTP or others. 
The value is case insensitive. If not provided, iNetWord stores documents according to the other configuration settings specified on the server or elsewhere.
 

StorageDomain=
yourdomain.com 

Specifies the organization providing storage and accounts. This plus the StorageUserName uniquely identifies the account for iNetWord. Therefore, a StorageUserName=dan + StorageDomain=yourdomain.com is a different identity than StorageUserName=dan + StorageDomain=someplace.com.
 The value may contain hostnames if a single domain name wishes to partition their accounts. For example, you could have StorageDomain=customer1.sharemethods.com or customer2.sharemethods.com.
The value is case insensitive.
 

StorageServerUrl=
sv1.yourdomain.com/dan 

 

The exact URL to use to access the storage. The domain name of this URL must be the same as the StorageDomain. Like all URLs, the domain name is case insensitive and the path below it is case sensitive. This URL will correspond to the -Top Folder- presented to the user in the File Save As and Upload Picture dialog boxes. This URL is never shown to the user directly. 

StorageUserName=joe 

The username of the account on the StorageServerURL. Note that this also maps the user to a local account used for document autosaves and other housekeeping. An @ can be part of a StorageUserName.
The value is case insensitive.
 

StorageSessionId=
UIFDJF789375 

WebDAV server generated session ID used to authenticate. 
The value is case sensitive.
 

StoragePassword=
secret
 

The user's WebDAV password. Used for debugging, testing, and demos only. Note that StorageSessionId and StoragePassword are passed to WebDAV servers in the same WWW-Authenticate field. The distinction here is only for clarity. 
The value is case sensitive. 

CONFIGURATION

 

config=filename

The name of an alternate config file on the iNetWord server holding the rest of the configuration values.

  

Filename Specifiers

The file and folder names used in the new= or open= portion of a URL to launch iNetWord are constructed differently than those displayed to an end user in iNetWord itself. Construct your URL Filename Specifiers as follows:

  1. No root folder.
    The folder -Top Folder- is not included with the filename, nor is a leading slash (/).
  2. URL encode special characters.
    As with all URLs, special characters in a foldername/filename must be URL encoded.
    For example:
    space = %20
    slash as a foldername separator (/) = %2f
    dot (.) is itself, etc.
  3. Include extension.
    The .html or other extension is included in the filename specifier: myfile.html.

Example URLS

http://www.inetword.com

Editor with Files pane at left and editor page at right. All UI and capabilities present. 

http://www.inetword.com/s/edit.php

Editor without Files pane at left. Controlling application should have a UI for browsing documents. User may edit multiple files within the editor.

http://www.inetword.com/?new=Templatename.html

Editor with a new, unnamed document based on Templatename.html.
Use new=foldername%2fTemplatename if the template resides within a folder in the New pane. Notice the use of URL encoded %2f to represent the / foldername separator character.

http://www.inetword.com/s/edit.php?open=goodfile.html

Editor without Files pane at left with goodfile.html loaded for editing.

http://www.inetword.com/s/edit.php?filemode=single

Editor without Files pane at left and no New document, upload document buttons on the toolbar or file tabs at the left. This is a typical 'pure play' edit one file configuration.

http://www.inetword.com/s/edit.php?bgcolor=%238080F0  

Editor without Files pane at left with a light blue background surrounding the chrome.
Notice the use of URL encoded %23 to represent the # HTML color prefix character.

http://www.inetword.com/?filebuttons=no&open=afile.html&bgcolor=%23A0A0A0  

Several options combined.

 

JavaScript Client API

Your Web pages will often launch iNetWord into either another window or within a frame. Once launched, you can control iNetWord by calling its JavaScript API. The API enables you to open or create documents, insert pictures, and control the appearance and configuration of iNetWord.

 

If you provide file browsing capability to your users, this is how your file browser will open files in an already-running instance of iNetWord. If iNetWord is not yet running, or your user interface dictates that documents be opened in new instances of iNetWord, then use the CGI Parameters described above.

 

The iNetWord JavaScript API is accessed through a JavaScript object provided by inetword.js. Use this code to instantiate the API object:

 

<script type="text/javascript" src="js/inetword.js"></script>

iNetWordObj = new inetWordInterface();

iNetWordObj.ConnectToEditorFrame( frames['EditorFrame'] );

 

 

The iNetWord JavaScript API consists of these methods:

 

ConnectToEditorFrame( window_object )

Provides the window object within which iNetWord is running. When using Frames this is the .frames['NameOfInetWordFrame'] object. When launching iNetWord in another window, this is the window object returned by window.open().

This method must be called prior to any other API calls.

Returns: nothing.

 

fConnectedToEditorFrame()

Indicates whether the ConnectToEditorFrame() method has been performed yet.

Returns: boolean, true if ConnectToEditorFrame() has been called.

 

fCanConnect()

Indicates whether the ConnectToEditorFrame() method has been performed yet AND whether the iNetWord editor has completed its initialization and is accepting API calls.

Returns: boolean, true if API calls can now be made.

 

SetConfigDirective( directive, value )

Sets the given directive to the provided value. If the directive changes iNetWord's appearance, then than change is performed synchronously with the call.

Returns: nothing

 

FileOpen( folder_filename )

Opens the given file within the editor. The folder_filename should be the full hierarchical path to the file starting at the user's logical root directory. This root directory is displayed to the user as -Top Folder- and usually is called 'docs' within the user's storage space.

If iNetWord is running in filesmulti=yes mode, then this file will be opened in a new tab. Otherwise the user will be prompted to save their document (if changed), and this document will replace their current document, if any.

Returns: nothing.

 

FileOpenAs( folder_filename, New_folder_filename )

Similar to FileOpen() except the document is given the new name and its saved state is set to unsaved. This is how you can programatically fork a document.

Returns: nothing.

 

FileNew( templatename )

Similar to FileOpen() except the passed in template is opened from the 'New' (i.e. templates) pane and the new file is given an 'Untitled#' temporary name.

 

InsertPicture( Pictureurl, event_obj )

Inserts the specified picture into the document with an <IMG> tag.

Returns: nothing.

 

ValidateName( name )

Tests whether the given name is an acceptable file or folder name.

Returns: false if name IS valid, otherwise an error message explaining what character within the name made it invalid.