Home Demo Download Purchase Support

→ WebcalngAPI Documentation


WebcalngAPI::AddAddress
NAME
       WebcalngAPI::AddAddress - Perl module to allow a programmer to add an
       email address to webcalng.

SYNOPSIS
         #!/usr/bin/perl -w

         use lib '/var/www/cgi-bin/webcalng';
         use WebcalngAPI::AddAddress;
         use strict;

         # Create a new address to be added.
         my $address = new WebcalngAPI::AddAddress(
              'calendar'    => "My Calendar Name",
              'displayname' => "Joe User",
              'email'       => "joe@user.com",
         );

         # Add the address.
         $address->add or die $address->errstr;

DESCRIPTION
       This is a Perl package that provides a programmer with direct access to
       add email addresses to a webcalng installation, without requiring them
       to read the webcalng source code and learn the structures used to store
       webcalng data.  The email address can be associated with a given
       calendar, or it can be put into the global address book.

       The line:

       use lib '/var/www/cgi-bin/webcalng';

       is just an example.  You must have your script provide the full path to
       the webcalng install directory for your site.  This given path is the
       default webcalng install directory.  This directory will contain the
       directory "WebcalngAPI", which has this file in it, AddAddress.pm.

METHODS
       "new"
            Create a new address object.  Returns an object that can be used
            with the "add" method to put the address into webcalng.  The 
            following object properities are available, and must be set when
            the object is created.  Only "displayname", "email", and either 
            "calendar" or "global" are absolutely required.

              - displayname : The name of the person to display when
                viewing this address.  This is a required property.

              - email : The email address of for this entry.  This is
                a required property.

              - calendar :  The name of the calendar to add the address to.
                This parameter must be present in order to add the address,
                unless you are adding a global address book entry.

              - workphone : The work phone number for this entry.

              - cellphone : The cell phone number for this entry.

              - homephone : The home phone number for this entry.

              - pager : The pager number for this entry.

              - address1 : The first line of the street address.

              - address2 : The second line of the street address.

              - city : The city for this address.

              - state : The state for this address.

              - postal : The postal code, or zipcode, for this address.

              - country : The country for this address.

              - other : Any miscellaneous information to associate with
                this entry.

              - global : Either 0 or 1.  Defaults to 0.  If this is
                0, then the entry is not a global entry and a
                calendar name to associate the address with must be
                specified by using the calendar property.  If this is
                1, then the entry goes into the global address book.

       "add"
            Adds the address to webcalng, based on all the data that was 
            presented when the address was created.  Returns 1 if the add
            succeeded, and 0 if the add failed.

       "errstr"

            Returns the most recent error string in the event of a failure
            when adding an address.

NOTES
       Note that no authentication is done by this module, so it assumes that
       you are controlling access to add addresses to the given calendar via
       the script using this module.

       Also note that the following global variables are reserved for use by
       this module, and should not be used in any scripts that use this 
       module: $::db_dir, $::dbh, $::calendar, and %::webcalng_conf.
    
Top



WebcalngAPI::AddCalendar
NAME
       WebcalngAPI::AddCalendar - Perl module to allow a programmer to add a
       calendar to webcalng.

SYNOPSIS
         #!/usr/bin/perl -w

         use lib '/var/www/cgi-bin/webcalng';
         use WebcalngAPI::AddCalendar;
         use strict;

         # Create a new calendar to be added.
         my $calendar = new WebcalngAPI::AddCalendar(
              'calendar'  => "My Calendar Name",
              'type'      => "public",
              'username'  => "joe",
              'password'  => "joespass",
              'http_user' => "apache",
         );

         # Add the calendar.
         $calendar->add or die $calendar->errstr;

DESCRIPTION
       This is a Perl package that provides a programmer with direct access to
       add calendars to a webcalng installation, without requiring them to
       read the webcalng source code and learn the structures used to store
       webcalng data.

       The line:

       use lib '/var/www/cgi-bin/webcalng';

       is just an example.  You must have your script provide the full path to
       the webcalng install directory for your site.  This given path is the
       default webcalng install directory.  This directory will contain the
       directory "WebcalngAPI", which has this file in it, AddCalendar.pm.

METHODS
       "new"
            Create a new calendar object.  Returns an object that can be used
            with the "add" method to put the calendar into webcalng.  The 
            following object properities are available, and must be set when the
            object is created.  All are required (unless the calendar type is
            "open", in which case the username and password can be left out).

              - calendar :  The name of the calendar to be created.

              - type : The type of the calendar to add.  This property
                must be set to one of the three following options:
                  open    : No login is required to read and write to the
                            calendar.  When creating an open calendar, you
                            do not need to give a username and password.
                  public  : No login is required to read the calendar, but
                            only authorized user(s) can write to the calendar.
                  private : The user must be authorized to be read and write
                            to the calendar.

              - username : The username of the account that should be the
                owner of the calendar.  By default, only the calendar owner
                can write to public and private calendars, and only the
                calendar owner can read a private calendar.  This property
                can be omitted if you are creating an open calendar.

              - password : The password to use for the username that owns
                the calendar.  If the given username does not exist, then
                a new webcalng user will be created and this will be the
                password for that username.  If the username given already
                exists within webcalng, then this password must match the
                current password for that existing webcalng account.  This
                property can be omitted if you are creating an open calendar.

              - http_user : The username that your webserver process runs as.
                This is only needed if you are using flat files for webcalng
                storage.  When using flat files, and the script that uses this
                module is being run by root, this module will make sure that
                the permissions on the files are setup securely if this
                property is set to the user that your webserver is running as.
                If the user specified by this property is the same user that
                the script using this module is run as, we will assume that
                no permission changes are needed as the script is already
                executing as the same account that the webserver runs as.
                If no value is given for this property, or if the value given
                does not match the user that the script using this module is
                running as (and the script is not running as root), then we
                will assume that we need to open up permissions on the files
                used for webcalng storage, and set it up insecurely but in
                such a way that webcalng will work.  This property is not
                consulted if you are using a database for webcalng storage.

       "add"
            Adds the calendar to webcalng, based on all the data that was
            presented when the calendar was created.  Returns 1 if the add
            succeeded, and 0 if the add failed.

       "errstr"
            Returns the most recent error string in the event of a failure
            when adding a calendar.

NOTES
       When using flat files for webcalng storage, the scripts which use this
       module should either be run as root, or as the user specified by the
       http_user property.  This will ensure that we can setup permissions
       correctly, so that only the account that the webserver is running as
       will have access to the data files for the calendar to be added.

       Note that no authentication is done by this module.

       Also note that the following global variables are reserved for use by
       this module, and should not be used in any scripts that use this
       module: $::db_dir, $::dbh, $::calendar, and %::webcalng_conf.
    
Top



WebcalngAPI::AddItem
NAME
       WebcalngAPI::AddItem - Perl module to allow a programmer to add an item
       to webcalng.

SYNOPSIS
         #!/usr/bin/perl -w

         use lib '/var/www/cgi-bin/webcalng';
         use WebcalngAPI::AddItem;
         use strict;

         # Create a new item to be added.
         my $item = new WebcalngAPI::AddItem(
              'calendar'    => "My Calendar Name",
              'description' => "My Simple Item on Christmas 2002",
              'startdate'   => "2002-12-25",
         );

         # Add the item.
         $item->add or die $item->errstr;

DESCRIPTION
       This is a Perl package that provides a programmer with direct access to
       add items to a webcalng calendar, without requiring them to read the
       webcalng source code and learn the structures used to store webcalng
       data.

       The line:

       use lib '/var/www/cgi-bin/webcalng';

       is just an example.  You must have your script provide the full path to
       the webcalng install directory for your site.  This given path is the
       default webcalng install directory.  This directory will contain the
       directory "WebcalngAPI", which has this file in it, AddItem.pm.

METHODS
       "new"
            Create a new item object.  Returns an object that can be used with
            the "add" method to put the item into webcalng.  The following
            object properities are available, and must be set when the object
            is created.  Only "calendar", "startdate", and "description" are
            absolutely required.

              - calendar :  The name of the calendar to add the item to.
                This parameter must be present in order to add the item.

              - startdate : The date on which this item begins.  If the
                item does not repeat, this is the only day on which the
                item occurs.  This must be given in the format of
                "YYYY-MM-DD" where:
                  YYYY = 4 digit year between 1970 and 2037
                    MM = 1 or 2 digit month between 1 and 12
                    DD = 1 or 2 digit day between 1 and 31
                This parameter must be present in order to add the item.

              - description : The text that is shown in webcalng to
                describe this item.  This parameter must be present in
                order to add the item.

              - visibility : Integer to determine the visibility of item.
                0 = Everyone with read access can view the item.
                1 = Only the user who entered the item can view it, others
                    see time as busy.
                2 = Only the user who entered the item can view it, others
                    see nothing.

              - user : The webcalng username that should be recorded as the
                person who added this item.

              - starttime : 4 digit time, in military format, that the item
                begins at.

              - endtime : 4 digit time, in military format, that the item
                ends at.

              - remindwho : A command seperated list of email addresses to
                send a reminder to.  If you give any values here, then you
                must give at least one value for the "remindwhen" property.

              - remindwhen : A comma seperated list of values.  Reminders
                will be sent to all email addresses given in the "remindwho"
                property at the given values.  Possible values are:
                  now    (As soon as possible)
                  5min   (5 minutes before the event occurs)
                  10min  (10 minutes before the event occurs)
                  15min  (15 minutes before the event occurs)
                  30min  (30 minutes before the event occurs)
                  1hour  (1 hour before the event occurs)
                  2hour  (2 hour before the event occurs)
                  3hour  (3 hour before the event occurs)
                  1day   (1 day before the event occurs)
                  2day   (2 day before the event occurs)
                  3day   (3 day before the event occurs)
                  1week  (1 week before the event occurs)
                  2week  (2 weeks before the event occurs)
                  4week  (4 weeks before the event occurs)
                The time that the event occurs on is determined by the
                "starttime" property.  Items that have no "starttime"
                will use midnight as the reference time for the item.

              - repeat : The type of repeating event that this item is.
                Possible values and meanings are :
                  0                : Not a repeating event.  The default
                                     if not specified.
                  daily            : Item repeats every day.
                  weekly           : Item repeats every week on
                                     "repeatdays".
                  biweekly         : Item repeats every other week on
                                     "repeatdays".
                  monthlybydate    : Item repeats monthly on given date.
                  monthlybyday     : Item repeats monthly in given week,
                                     on the given day.
                  monthlybydaylast : Item repeats monthly in last week,
                                     on the given day.
                  yearlybydate     : Item repeats yearly on this date.
                  yearlybyday      : Item repeats yearly in given week of
                                     a month, on the given day.
                  yearlybydaylast  : Item repeats yearly in given week of
                                     a month, on the given day.

              - repeatdays :  If the item repeats in a weekly fashion,
                these are the days.  This is a comma seperated list of
                values between 1-7 for Sunday-Saturday.  A value of 0
                indicates no days of the week.  At least one day must be
                given here if "weekly" or "biweekly" are given for the
                "repeat" property.

              - repeatend : When the repeat ends.  A value of 0 indicates
                that it repeats forever.  A value of 1 indicates that the
                repeat ends on a specific date, as defined by the "enddate"
                property.

              - enddate : The date on which this item ends if the item is
                a repeating item and the "repeatend" property is set to "1".
                This must be given in the format of "YYYY-MM-DD" where:
                  YYYY = 4 digit year between 1970 and 2037
                    MM = 1 or 2 digit month between 1 and 12
                    DD = 1 or 2 digit day between 1 and 31
                This property is ignored if "repeat" is set to "0".

              - hyperlink : A hyperlink to another webpage to associate
                with this item when it is displayed in webcalng.

              - notes : A set of notes to associate with this item when it
                is displayed in webcalng.

              - exported: Set to 1 if the item is allowed to be displayed in
                calendars which are importing this calendar.  Set to 0 if this
                item should not be displayed in calendars which are importing
                the item.  Defaults to 1.

              - color: The color that this item should be displayed in if
                you want to override the default colors.  You can specify
                the name or the HEX code for the color.

       "add"
            Adds the item to the given webcalng calendar, based on all the
            data that was presented when the item was created.  Returns 1 if
            the add succeeded, and 0 if the add failed.

       "errstr"
            Returns the most recent error string in the event of a failure
            when adding an item.

NOTES
       Note that no authentication is done by this module, so it assumes that
       you are controlling access to add items to the given calendar via the
       script using this module.

       Also note that this module will not check to see if the given calendar
       should allow overlapping items.  The module will allow you to add items
       to the given calendar regardless of the calendar preferences regarding
       overlapping items.

       Also note that the following global variables are reserved for use by
       this module, and should not be used in any scripts that use this 
       module: $::db_dir, $::dbh, $::calendar, and %::webcalng_conf.
    
Top



WebcalngAPI::AddTask
NAME
       WebcalngAPI::AddTask - Perl module to allow a programmer to a task to a
       webcalng calendar.

SYNOPSIS
         #!/usr/bin/perl -w

         use lib '/var/www/cgi-bin/webcalng';
         use WebcalngAPI::AddTask;
         use strict;

         # Create a new task to be added.
         my $task = new WebcalngAPI::AddTask(
              'calendar'    => "My Calendar Name",
              'taskdata'    => "test task",
         );

         # Add the task.
         $task->add or die $task->errstr;

DESCRIPTION
       This is a Perl package that provides a programmer with direct access to
       add a task to a webcalng calendar, without requiring them to read the
       webcalng source code and learn the structures used to store webcalng
       data.

       The line:

       use lib '/var/www/cgi-bin/webcalng';

       is just an example.  You must have your script provide the full path to
       the webcalng install directory for your site.  This given path is the
       default webcalng install directory.  This directory will contain the
       directory "WebcalngAPI", which has this file in it, AddTask.pm.

METHODS
       "new"
            Create a new task object.  Returns an object that can be used with
            the "add" method to put the task into webcalng.  The following
            object properities are available, and must be set when the object
            is created.  All are required.

              - calendar :  The name of the calendar to add the task to.
                This parameter must be present in order to add the task.

              - taskdata : The description of the task.

       "add"
            Adds the task to webcalng, based on all the data that was 
            presented when the task was created.  Returns 1 if the add
            succeeded, and 0 if the add failed.

       "errstr"
            Returns the most recent error string in the event of a failure
            when adding a task.

NOTES
       Note that no authentication is done by this module, so it assumes that
       you are controlling access to add tasks to the given calendar via the
       script using this module.

       Also note that the following global variables are reserved for use by
       this module, and should not be used in any scripts that use this
       module: $::db_dir, $::dbh, $::calendar, and %::webcalng_conf.
    
Top

webcalng - a product of webcalng software solutions.