Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE...

Preview:

Citation preview

www.novell.com

Intermediate Programming with the Novell GroupWise® Object API

Intermediate Programming with the Novell GroupWise® Object API

John CoxDSE Worldwide Developer SupportNovell, Inc.devsup@novell.com

Vision…one NetA world where networks of all types—corporate and public, intranets, extranets, and the Internet—work together as one Net and securely connect employees, customers, suppliers, and partners across organizational boundaries

MissionTo solve complex business and technical challenges with Net business solutions that enable people, processes, and systems to work together and our customers to profit from the opportunities of a networked world

Agenda

• Overview• API Design• Using the Object API• Developer Resources

agenda

Novell GroupWise® Object API

• Access to GroupWise information store

• Address book and document management Mail messages Appointments Tasks Notes Phone messages

COM Automation

• Accessible through any language that supports Component Object Model (COM)

Visual Basic Delphi C++

COM

Agenda

• Overview• API Design• Using the Object API• Developer Resources

agenda

FieldFieldDefinitionDefinition

AddressAddressBookBook AccountAccount

AddressAddressBookBookEntryEntry

FieldField

AddressAddress

AddressAddress

BusyBusySearchSearch

ElementElement

TimeBlockTimeBlock

ApplicationApplication

AccountAccountRightsRights

AddressAddressFilterFilter

AddressAddress

RecipientRecipient

FolderFolder

MessageMessage

AppointmentAppointment

DocRefDocRef

MailMail

TaskTask

NoteNote

PhonePhoneMessageMessage

SharedSharedNotificationNotification

FieldField

AttachmentAttachment

QueryQuery

LookupLookupTablesTables DocumentDocument

DocumentDocumentLibraryLibrary

DocumentDocumentTypeType

AddressAddress

DocumentDocumentversionversion

DocumentDocumentVersionVersionViewerViewer

FieldDefFieldDef

Agenda

• Overview• API Design• Using the Object API• Developer Resources

agenda

Demo (Login)

GroupWise Login

hands o

Objective

• Build an application that allows a user to enter a user id and password and confirms that the user has logged into GroupWise

FieldFieldDefinitionDefinition

AddressAddressBookBook AccountAccount

AddressAddressBookBookEntryEntry

FieldField

AddressAddress

AddressAddress

BusyBusySearchSearch

ElementElement

TimeBlockTimeBlock

ApplicationApplication

AccountAccountRightsRights

AddressAddressFilterFilter

AddressAddress

RecipientRecipient

FolderFolder

MessageMessage

AppointmentAppointment

DocRefDocRef

MailMail

TaskTask

NoteNote

PhonePhoneMessageMessage

SharedSharedNotificationNotification

FieldField

AttachmentAttachment

QueryQuery

LookupLookupTablesTables

DocumentDocument

DocumentDocumentLibraryLibrary

DocumentDocumentTypeType

AddressAddress

DocumentDocumentVersionVersion

DocumentDocumentVersionVersionViewerViewer

FieldDefFieldDef

Step 1: Application 1. Application1. Application

FieldFieldDefinitionDefinition

AddressAddressBookBook AccountAccount

AddressAddressBookBookEntryEntry

FieldField

AddressAddress

AddressAddress

BusyBusySearchSearch

ElementElement

TimeBlockTimeBlock

ApplicationApplication

AccountAccountRightsRights

AddressAddressFilterFilter

AddressAddress

RecipientRecipient

FolderFolder

MessageMessage

AppointmentAppointment

DocRefDocRef

MailMail

TaskTask

NoteNote

PhonePhoneMessageMessage

SharedSharedNotificationNotification

FieldField

AttachmentAttachment

QueryQuery

LookupLookupTablesTables

DocumentDocument

DocumentDocumentLibraryLibrary

DocumentDocumentTypeType

AddressAddress

DocumentDocumentVersionVersion

DocumentDocumentVersionVersionViewerViewer

FieldDefFieldDef

Step 2: Account1. Application1. Application

2. Account2. Account

Early Binding vs Late Binding

• Early binding ( GroupWare Type Library / GWCMA1.DLL)

Dim gwApplication As Application Set gwApplication = New Application2

• Late binding Dim gwApplication As Object Set gwApplication = CreateObject("NovellGroupWareSession")

Advantages of Early Binding

• Development

• Better Debugging

• Faster Run-time

Account Login

• Account login ( [String UserID],

[String CommandLine],[String Password],

[LoginConstants WhenToPrompt], [Variant Reserved] )

• Account MultiLogin(...) * GroupWise 5.5 and above

• Account Proxy( Variant UserID )

Visual Basic (Early binding)

• Login()

Dim gwApplication As Application Dim gwAccount As Account

Set gwApplication = New Application Set gwAccount = gwApplication.Login(“UserID”,, “Pswd”)

Demo (Fields and FieldDefinitions)

Fields and FieldDefinitions

hands o

Objective

• Build an application that will add a FieldDefinition of type string to your GW account

• Add your own custom field to a message• List the Field names, types and values for

the first message in your MailBox

Field-Related Objects

• Field

• Fields

• FieldDefinition

• FieldDefinitions

FieldFieldDefinitionDefinition

AddressAddressBookBook AccountAccount

AddressAddressBookBookEntryEntry

FieldField

AddressAddress

AddressAddress

BusyBusySearchSearch

ElementElement

TimeBlockTimeBlock

ApplicationApplication

AccountAccountRightsRights

AddressAddressFilterFilter

AddressAddress

RecipientRecipient

FolderFolder

MessageMessage

AppointmentAppointment

DocRefDocRef

MailMail

TaskTask

NoteNote

PhonePhoneMessageMessage

SharedSharedNotificationNotification

FieldField

AttachmentAttachment

QueryQuery

LookupLookupTablesTables

DocumentDocument

DocumentDocumentLibraryLibrary

DocumentDocumentTypeType

AddressAddress

DocumentDocumentVersionVersion

DocumentDocumentVersionVersionViewerViewer

FieldDefFieldDef

1. Application1. Application

2. Account2. Account3. Query, 3. Query,

Find (),Find (),

FindMessagesFindMessages()()

Object Model

4. Field4. Field

Psuedo Code (Fields and FieldDefinitions)

Begin sub routine to add FieldDefinition

Get reference to the FieldDefinitions collection from the Acc obj

Add definition with a name and type

End sub routine

Begin sub routine to add Field

Get reference to the Fields collection of a message that you will send

Add field (name & type of associated field def) along with value to store

End sub routine

Begin sub routine to list non system Fields

Get reference to Messages collection from Acc obj

Loop through the Fields collection of each object and display information where Fields.Count is greater than zero

End sub routine

Demo (Find Messages)

Find Messages

hands o

Objective

• Build an application that uses Find() to display messages based on text, numeric, and date criteria that you specify

Find() and FindMessages()

• Find() and FindMessages() Can take Filter Expression Syntax (string) Filter objects

Expression Syntax

• Text

• Numeric

• Date

Text Expressions

• Examples (SUBJECT CONTAINS "Internet") (AUTHOR MATCHES "Mr. Byg") (MESSAGE BEGINSWITH "Now hear this") (MESSAGE CONTAINS CASE ("Inter*" OR "Intra*") AND

("Test". . "Plan")) (<BOSS,STRING> MATCHES “Mr.Byg”)

Numeric Expressions

• Examples (SIZE < 12000) (NUMBER_ACCEPTED = TOTAL_RECIPIENTS) (<TOTAL_EMPLOYEES,NUMERIC> > 50)

Date Expressions

• Examples (DUEEND_DATE <= TOMORROW) (START_DATE >= 1996/2/5 AT 8:00:00) (CREATE_DATE >= THIS_YEAR 31) (<BIRTHDAY,DATE> = THIS_MONTH)

FieldFieldDefinitionDefinition

AddressAddressBookBook AccountAccount

AddressAddressBookBookEntryEntry

FieldField

AddressAddress

AddressAddress

BusyBusySearchSearch

ElementElement

TimeBlockTimeBlock

ApplicationApplication

AccountAccountRightsRights

AddressAddressFilterFilter

AddressAddress

RecipientRecipient

FolderFolder

MessageMessage

AppointmentAppointment

DocRefDocRef

MailMail

TaskTask

NoteNote

PhonePhoneMessageMessage

SharedSharedNotificationNotification

FieldField

AttachmentAttachment

QueryQuery

LookupLookupTablesTables

DocumentDocument

DocumentDocumentLibraryLibrary

DocumentDocumentTypeType

AddressAddress

DocumentDocumentVersionVersion

DocumentDocumentVersionVersionViewerViewer

FieldDefFieldDef

1. Application1. Application

2. Account2. Account3. Query, 3. Query,

Find (),Find (),

FindMessagesFindMessages()()

Object Model

Psuedo Code (Find Messages)

Begin sub routine to Find Messages

Build an expression string based on the subject entered

Append criteria that accounts for recipient count to the expression

Append criteria that accounts for the created date

Get reference to a Messages collection

Use Find with your expression to return a list of message objects

Loop through MessageList collection to display item information

End sub routine

Demo (Query)

Query

hands o

Objective

• Build an application that lists messages based on enumeration and unary criteria that you specify

• Build a query folder to display the messages

Query

• Query Represent either a stand-alone query or a query

associated with a query folder Can take Filter Expression Syntax (string)

Expression Syntax

• Enumerated

• Unary

• Basic (Groups and Compound)

Enumeration Expressions

• Examples (PRIORITY = HIGH) (ATTACHMENT_TYPE <> OLE) (BOX_TYPE = INCOMING)

Unary Expressions

• Examples (MAIL OR APPOINTMENT) (ACCEPTED AND COMPLETED) (DOCUMENT AND NOT HIDDEN AND NOT READ)

FieldFieldDefinitionDefinition

AddressAddressBookBook AccountAccount

AddressAddressBookBookEntryEntry

FieldField

AddressAddress

AddressAddress

BusyBusySearchSearch

ElementElement

TimeBlockTimeBlock

ApplicationApplication

AccountAccountRightsRights

AddressAddressFilterFilter

AddressAddress

RecipientRecipient

FolderFolder

MessageMessage

AppointmentAppointment

DocRefDocRef

MailMail

TaskTask

NoteNote

PhonePhoneMessageMessage

SharedSharedNotificationNotification

FieldField

AttachmentAttachment

QueryQuery

LookupLookupTablesTables

DocumentDocument

DocumentDocumentLibraryLibrary

DocumentDocumentTypeType

AddressAddress

DocumentDocumentVersionVersion

DocumentDocumentVersionVersionViewerViewer

FieldDefFieldDef

1. Application1. Application

2. Account2. Account3. Query, 3. Query,

Find (),Find (),

FindMessagesFindMessages()()

Object Model

Basic Expressions

• Groups example (TASK) OR (APPOINTMENT) AND (SUBJECT CONTAINS

"PROJECT7")

• Compound statement example (CREATE_DATE >= YESTERDAY AND CREATE_DATE <=

TODAY)

• Groups and compound statements example (FROM CONTAINS "TJEFFERSON" OR FROM CONTAINS

"jADAMS") AND (MESSAGE BEGINS WITH "When in the course" AND CREATE_DATE = 1776/7/4)

Psuedo Code (Query)

Begin sub routine to Query

Build an expression string based on the priority selected

Append type criteria to the expression

Append custom text field criteria

Append box type criteria

Create a query object, set Folder name (from text field) & query location (your account obj)

Look at Folder.Messages for results to populate list box

End sub routine

Agenda

•Overview•API Design•Using the Object API•Developer Resources

agenda

Developer Resources

•Training http://developer.novell.com/support/training/

•Documentation and Sample Code http://developer.novell.com/ndk/gwobjapi http://developer.novell.com/support/sample.htm

•Support 1-800-733-9673 / 1-801-861-5281 devsup@novell.com http://developer-forums.novell.com/category/

index.tpt

Recommended