iNetWord APIs and Protocols
iNetWord can be controlled by utilizing the following APIs and
Protocols:
-
CGI Parameters Controls
appearance, opening documents, etc.
-
JavaScript Client API
Also
controls appearance, opening documents, etc.
-
WebDAV iNetWord stored user
files can be accessed by WebDAV.
-
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
|
|
LOGGING INTO ACCOUNTS - STANDARD
SERVER SINGLE SIGN ON
|
|
StorageUserName=joe
|
The
username of the account on the iNetWord server.
|
|
StoragePassword=
secret
|
The
password for the account on the iNetWord server.
|
|
LOGGING INTO ACCOUNTS - WEBDAV SINGLE SIGN
ON
|
|
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.
|
|
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.
|
|
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.
|
|
StorageSForceSessionId
|
For
mixed storage and SSO modes, a specific SalesForce only SessionId
can be provided.
|
|
StorageMeta_anyname=
Some%20Value
|
This
special Meta Data Passthru parameter allows applications that
launch iNetWord to communicate metadata back to a storage server.
The anyname=Some%20Value setting will be applied to any saved
documents during that session via a WebDAV PROPPATCH
request.
|
|
CREATING AND
OPENING FILES UPON LAUNCH
|
|
new=templatename.html
|
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.html
|
Open the named document for editing.
Value is case sensitive.
|
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:
-
No root
folder. The folder -Top Folder- is not included with
the filename, nor is a leading slash (/).
-
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.
-
Include
extension. The .html or other extension is
included in the filename specifier: myfile.html.
|
|
APPEARANCE
|
|
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.
|
|
bgcolor=#010203
|
Set iNetWord's
surrounding background color to the given RGB
value.
The surrounding background color is a very dark blue by
default.
|
|
filebuttons=yes | no
|
Whether to show the New Document and Upload
buttons on the toolbar.
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.
|
|
StorageUIHideElements
|
User Interface controls and elements to hide within the UI.
See UI Element Keywords below.
|
|
StorageUIDisableElements
|
User Interface controls and elements to hide within the UI.
See UI Element Keywords below.
|
|
StorageUIShowElements
|
Optional user interface controls and elements to show within the
UI. See UI Element Keywords below.
|
|
UI Element Keywords
These keywords are listed in the
values of the StorageUI******* CGI Parameters.
For example, you might pass
StorageUIHideElements=mbsettings,mbpublish
to hide the
'settings' link and the 'publish' button within iNetWord's user
interface.
The keyword prefixes are:
mb -- menu or
button
dc -- dialog
control.
|
|
Keyword
|
|
Keyword
|
|
|
mbsettings
|
The Account Settings... button or menu
command. Lauching applications often want to prevent a user from
modifying their account settings within a launched application.
Those settings may have been standardized or carefully set up by an
integrator.
|
|
mbnew
|
The File New button and/or menu command.
This UI element opens a new document for editing.
|
mbnewdialog
|
The File New... button and/or menu
command. This UI element brings up the File New dialog
box.
|
|
mbopen
|
The File Open... button and/or menu
command.
|
|
mbsave
|
The File Save button and/or menu command
|
mbsavedialog
|
The Save As... button and/or menu command.
|
|
mbsaveandclose
|
A File Save-and-Close button and/or menu
command.
|
|
|
|
dcsaveselectfolder
|
The folder browse portion of the Save As
dialog box. If disabled, the application uses the newSaveAsFolder
as the destination folder for all new document saves.
|
dcsavesetname
|
The file name edit field in the Save As dialog
box. If disabled, the application uses the newSaveAsFilename CGI
parameter.
|
|
dcsavesettype
|
The document type selector in the Save dialog
box. If disabled, the application uses their
default document type or the newSaveAsType CGI parameter's
value.
|
|
mbsaveandclose
|
A special "Save & Close"
button used to quickly dismiss a application and continue
working in the launching application.
|
|
mbpublish
|
The Publish button and/or menu command. A
launching application can disable this element to maintain more
control over document distribution.
|
mbpublishdialog
|
The Publish... button and/or menu command that
offers the user a dialog box and publish options.
|
|
mbemail
|
The Email button and/or menu command. A
launching application can disable this element to maintain more
control over document distribution.
|
|
mbshare
|
The Share button and/or menu command.
Disabling this element will prevent users from sharing documents
with others using a launched application's sharing features.
|
|
mbrevisions
|
The Revisions button and/or menu
command. Disabling this element will prevent the user from
reviewing or reverting to prior versions of a document.
|
|
mblayout
|
The Page Layout button and/or menu command or
similar.
|
|
mbprint
|
The Print button and/or menu command.
This disables only application-controlled printing. Users can
still print using their browser's print features.
|
|
mbinsertcomment
|
The Insert Comment button and/or menu
command.
|
|
mbinsertlink
|
The Link button and/or menu command. Disabling
this element will prevent users from creating hyperlinks in their
documents.
|
|
mbinsertpicture
|
The Insert Picture button and/or menu command.
Disabling this prevents the user from browsing or inserting photos
into their document.
|
|
mbinsertsound
|
The Insert Sound button and/or menu
command.
|
|
mbinsertvideo
|
The Insert Video button and/or menu command.
Disabling this prevents the user from browsing or inserting videos
into their document. Videos may mean YOUTUBE videos, flash
animations,etc.
|
|
mbhelp
|
The Help button or menu command. In finely
crafted mashups, launching applications may not want users to
be confused by the general purpose help materials available at a
launched application's site.
|
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.
|