Welcome to the PrimeBase 4.5 WebDAV Plug-in

Copyright © 2008, PrimeBase Systems GmbH. All rights reserved.



Contents:

1. Overview
2. Documentation and Support
3. Installation
4. About the PrimeBase WebDAV plug-in
5. Acknowledgments


1. Overview

Welcome to PrimeBase 4.5

PrimeBase is a development platform for the production of client/server and web applications. It consists
of 3 main products: the PrimeBase Database Server, the PrimeBase Application Server, and the PrimeBase Open Server, all of which are based on open standards.

The PrimeBase Database Server is a relational Database Management System (DBMS) for Mac, UNIX
and Windows platforms. The PrimeBase Database Server supports all common database access
standards (PBT, SQL, ODBC, JDBC, PHP, Perl, RealBasic, EOF and DAL) and protocols (TCP/IP,
Shared Memory and Appletalk).

The PrimeBase Application Server allows rapid development and deployment of Web applications. The PrimeBase Application Server has many features that make implementing a Web application simple and efficient, including: an object-oriented programming environment and framework and multi-processor capabilities to ensure unlimited scalability.

The PrimeBase Open Server allows the PrimeBase Application Server or other applications using the PrimeBase Virtual Machine to connect to alternate data sources via PrimeBase Open Server plug-ins oaded by the PrimeBase Open Server. For example the Oracle plug-in enables you to access an Oracle database, or by loading the ODBC plug-in you will be able to access data servers via their ODBC drivers.


2. Documentation and Support

Some of the PrimeBase documentation including reference manuals and user guides is provided in PDF (Portable Document Format) and may be read and printed using Adobe Acrobat available, free of charge, from http://www.adobe.com. Other documentation is provided in HTML format and can be viewed with any browser.

Should you still have problems with the installation of this software, or you have any other questions then you are free to contact us by telephone at ++49 3890440 or via e-mail: support@PrimeBase.net. If you have general support questions that may be interesting to the entire PrimeBase community, then we suggest you visit our Web-site, www.PrimeBase.net, and join our mailing list.


3. Installation

If you have not already done so, we recomend that you create a new user (by convention called 'primebase') on your system for the PrimeBase software. Ensure that you have a least 20 MB of free disk space in the user's home directory.

You must run this script as user "root".

The installer places global resources in the location called $PRIMEBASEHOME. This is by default '/usr/local/primebase'.

After running the installer we recommend that you add the following path to your system PATH:

/usr/local/primebase/bin

This is the default location of all the PrimeBase executables.

The plug-in will be automatically loaded by client software using the PrimeBase virtual machine.


4. About the PrimeBase WebDAV plug-in

The WebDAV PrimeBase plug-in implements the WebDAV class which allows users to access
WebDAV servers over http. The class is as follows:

class WebDAV {
 public varchar server_user := $null;
 public varchar server_password := $null;

 The server_user and server_password are passed to the WebDAV server when a
 connection is established via the method open_server(). If the WebDAV server
 that you are connecting to requires a user name and password to connect then
 you must set these instance variables.
 

 
 public varchar proxy := $null;
 public varchar proxy_user := $null;
 public varchar proxy_password := $null;
 public int proxy_port := $null;
 
 If the connection to the WebDAV server is being done over a proxy then the
 proxy instance variables must be set before calling the open_server()
 method.
  proxy: The uri of the proxy server.
  proxy_user: The user to log into the proxy server as.
  proxy_password: The proxy user's password.
  proxy_port: The port on which the proxy server is published.
 
 void open_server(varchar uri) ;
  Establishes a connection to a WebDAV server. A WebDAV class instance can be
  connected to only one WebDAV server at a time.
 
 void close_server() ;
  Close the WebDAV connection established with the open_server() method.
 
 void set_lock_owner(varchar owner) ;
  Sets the "owner" identification string to use for all locks created after
  this method is called. Setting the lock owner has no effect on locks that
  have already been created. A good lock owner identifier would be the
  user's e-mail address.
 
 void read_lock(varchar url) ;
  Sets a read lock on the member specified by the url.
 
 void write_lock(varchar url) ;
  Sets a write lock on the member specified by the url.
 
 void read_lock_collection(varchar url) ;
  Sets a read lock on the collection specified by the url.
 
 void write_lock_collection(varchar url) ;
  Sets a write lock on the collection specified by the url.
 
 void unlock(varchar url) ;
  Unlocks a url for which has been lock within the current WebDAV class
  instance.
 
 void unlock(varchar url, varchar lock_token) ;
  Unlocks a url using the lock's token string. Using this unlock method the
  caller can unlock any lock regardless of who created it. The lock token
  string for a locked resource can be retrieved with the list_locks() method.
 
 void get(varchar url, varchar file) ;
  Get the member requested by the url from the WebDAV server and place it in
  the file specified. If the file already exists it will be overwritten. If
  'file' is the name of a directory then the requested member will be
  placed in the indicated directory.
 
 void get(varchar url) ;
  Get the member requested by the url from the WebDAV server and place it in
  the current working directory. The file will have the same name as the
  member requested. If a file of this name already exists it will be
  overwritten.
 
 void put(varchar url, varchar file);
  Copy the file to the member indicated by the url on the WebDAV server.
 
 Cursor list(varchar url, int depth, int members_only) ;
  Return a cursor containing a listing of members and collections in the
  specified url. 'depth' can be:
   0 - Return only information about the url itself.
   1 - Return information about the URL and its immediate members and
    collections.
   2 - Return information about all members and collections under the url.
 
  When 'members_only' is not zero then only members are listed and not
  collections.
 
  The cursor returned has the following 6 columns:
   is_collection - A boolean value set to $true when the record is a
       collection.
   url   - The url of the collection or member.
   size   - The size in bytes of the collection member or zero if the
       record is for a collection.
   mod_time  - A datetime type containing the last modification time of the
       member or collection.
   error_status - An integer set to a non zero value if there was an error
       while getting information about the collection or member.
   error_string - An error message indicating what error occurred while
       getting information about the collection or member.
 
 Cursor list(varchar url) ;
  This method  is the same as the list() method described above but with
  'depth' set by default to 1 and 'members_only' set to default to $false.
 
 Cursor list() ;
  This method  is the same as the list() method described above but with the
  url assumed to be the root url used when the WebDAV connection was opened.
 
 
 
 Cursor list_locks(varchar url, int depth, int members_only) ;
  Return a cursor containing a listing of members and collections in the
  specified url that are locked. 'depth' can be:
   0 - Return only information about the url itself.
   1 - Return information about the URL and its immediate members and
    collections.
   2 - Return information about all members and collections under the url.
 
  When 'members_only' is not zero then only members are listed and not
  collections.
 
  The cursor returned has the following 6 columns:
   url  - The url of the collection or member which is locked.
   type - A string indicating the type of lock, either "read" or "write".
   depth - A string indicating the depth of the lock either
      "DAV_DEPTH_ZERO" or "DAV_DEPTH_INFINITE"
   timeout - An integer containing the locks timeout value or null if the
      timeout is infinite.
   owner - If not null then this is a string identifying the locks owner.
   token - The lock's token string which can be used to unlock the
      resource.
 
 Cursor list_locks(varchar url) ;
  This method  is the same as the list_locks() method described above but
  with 'depth' set by default to 1 and 'members_only' set to default to
  $false.
 
 Cursor list_locks();
  This method  is the same as the list_locks() method described above but
  with the url assumed to be the root url used when the WebDAV connection
  was opened.
 
 void remove(varchar url) ;
  Deletes the member specified by the url.
 
 void remove_all(varchar url) ;
  Deletes the member or collection specified by the url. If the url specifies
  a collection then the collection is recursivly deleted.
 
 void make_col(varchar url) ;
  Creates a collection specified by the url.
};
 


5. Acknowledgments

The PrimeBase WebDAV plug-in has been implemented using the 'neon' library  using 'cadaver', a command-line WebDAV client for Unix, as a model. Some source code from 'cadaver' can be seen in the PrimeBase WebDAV plug-in implementation. My thanks to the developers of 'neon' and 'cadaver'.

The source code for the PrimeBase WebDAV plug-in is available on request by sending e-mail to support@PrimeBase.net.

For more information on WebDAV, neon, or cadaver, please visit the website:
www.webdav.org.