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

51
www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. [email protected]

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

Page 1: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

www.novell.com

Intermediate Programming with the Novell GroupWise® Object API

Intermediate Programming with the Novell GroupWise® Object API

John CoxDSE Worldwide Developer SupportNovell, [email protected]

Page 2: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, 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

Page 3: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.
Page 4: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Agenda

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

agenda

Page 5: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Novell GroupWise® Object API

• Access to GroupWise information store

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

Page 6: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

COM Automation

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

Visual Basic Delphi C++

COM

Page 7: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Agenda

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

agenda

Page 8: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 9: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Agenda

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

agenda

Page 10: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Demo (Login)

Page 11: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

GroupWise Login

hands o

Page 12: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Objective

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

Page 13: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 14: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 15: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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")

Page 16: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Advantages of Early Binding

• Development

• Better Debugging

• Faster Run-time

Page 17: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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 )

Page 18: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Visual Basic (Early binding)

• Login()

Dim gwApplication As Application Dim gwAccount As Account

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

Page 19: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.
Page 20: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Demo (Fields and FieldDefinitions)

Page 21: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Fields and FieldDefinitions

hands o

Page 22: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 23: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Field-Related Objects

• Field

• Fields

• FieldDefinition

• FieldDefinitions

Page 24: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 25: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.
Page 26: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 27: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Demo (Find Messages)

Page 28: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Find Messages

hands o

Page 29: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Objective

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

Page 30: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Find() and FindMessages()

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

Page 31: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Expression Syntax

• Text

• Numeric

• Date

Page 32: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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”)

Page 33: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Numeric Expressions

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

Page 34: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Date Expressions

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

Page 35: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 36: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.
Page 37: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 38: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Demo (Query)

Page 39: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Query

hands o

Page 40: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Objective

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

• Build a query folder to display the messages

Page 41: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Query

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

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

Page 42: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Expression Syntax

• Enumerated

• Unary

• Basic (Groups and Compound)

Page 43: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Enumeration Expressions

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

Page 44: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Unary Expressions

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

Page 45: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 46: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.
Page 47: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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)

Page 48: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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

Page 49: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

Agenda

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

agenda

Page 50: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.

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 [email protected] http://developer-forums.novell.com/category/

index.tpt

Page 51: Www.novell.com Intermediate Programming with the Novell GroupWise ® Object API John Cox DSE Worldwide Developer Support Novell, Inc. devsup@novell.com.