Class: Notesgrip::NotesDocument

Inherits:
GripWrapper show all
Defined in:
lib/notesgrip/NotesDocument.rb

Overview

NotesDocument Class ================

Constant Summary collapse

CONVERT_RT_TO_HTML =
2
CONVERT_RT_TO_PLAINTEXT =
1
CONVERT_RT_TO_PLAINTEXT_AND_HTML =
3

Instance Method Summary collapse

Methods inherited from GripWrapper

#raw

Constructor Details

#initialize(raw_doc) ⇒ NotesDocument

Returns a new instance of NotesDocument.



6
7
8
9
10
# File 'lib/notesgrip/NotesDocument.rb', line 6

def initialize(raw_doc)
  super(raw_doc)
  @parent_db = nil
  @parent_view = nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Notesgrip::GripWrapper

Instance Method Details

#[](itemname) ⇒ Object

—- Additional Methods ——



148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/notesgrip/NotesDocument.rb', line 148

def [](itemname)
  if @raw_object.HasItem(itemname)
    raw_item = @raw_object.GetFirstItem(itemname)
  else
    # If this document hasn't itemname field, create new item.
    raw_item = @raw_object.AppendItemValue(itemname, "")
  end
  if raw_item.Type == NotesItem::RICHTEXT
    NotesRichTextItem.new(raw_item)
  else
    NotesItem.new(raw_item)
  end
end

#[]=(itemname, other_item) ⇒ Object

Copy Field



163
164
165
166
167
168
169
170
171
# File 'lib/notesgrip/NotesDocument.rb', line 163

def []=(itemname, other_item)
  if @raw_object.HasItem(itemname)
    @raw_object.RemoveItem(itemname)
  end
  
  raw_otherItem = toRaw(other_item)
  raw_item = @raw_object.CopyItem(raw_otherItem, itemname)
  NotesItem.new(raw_item)
end

#AppendItemValue(itemName, value) ⇒ Object



52
53
54
55
# File 'lib/notesgrip/NotesDocument.rb', line 52

def AppendItemValue( itemName, value )
  raw_item = @raw_object.AppendItemValue( itemName, value )
  NotesItem.new(raw_item)
end

#AttachVCard(clientADTObject) ⇒ Object



57
58
59
60
# File 'lib/notesgrip/NotesDocument.rb', line 57

def AttachVCard( clientADTObject )
  raw_obj = toRaw(clientADTObject)
  @raw_object.AttachVCard(raw_obj)
end

#AuthorsObject

—– Simple Method Relay —-



188
189
190
# File 'lib/notesgrip/NotesDocument.rb', line 188

def Authors()
  @raw_object.Authors()
end

#CloseMIMEEntities(savechanges = false, entityitemname = "Body") ⇒ Object



324
325
326
# File 'lib/notesgrip/NotesDocument.rb', line 324

def CloseMIMEEntities(savechanges=false, entityitemname="Body")
  @raw_object.CloseMIMEEntities(savechanges, entityitemname)
end

#ColumnValuesObject



192
193
194
# File 'lib/notesgrip/NotesDocument.rb', line 192

def ColumnValues()
  @raw_object.ColumnValues()
end

#ComputeWithForm(doDataTypes = true, raiseError = false) ⇒ Object



328
329
330
# File 'lib/notesgrip/NotesDocument.rb', line 328

def ComputeWithForm(doDataTypes=true, raiseError=false)
  @raw_object.ComputeWithForm(doDataTypes, raiseError)
end

#ConvertToMIME(conversionType = CONVERT_RT_TO_PLAINTEXT_AND_HTML, options = nil) ⇒ Object



335
336
337
# File 'lib/notesgrip/NotesDocument.rb', line 335

def ConvertToMIME(conversionType=CONVERT_RT_TO_PLAINTEXT_AND_HTML, options=nil)
  @raw_object.ConvertToMIME(conversionType, options)
end

#CopyAllItems(sourceDoc, replace = false) ⇒ Object



62
63
64
65
# File 'lib/notesgrip/NotesDocument.rb', line 62

def CopyAllItems( sourceDoc, replace=false )
  raw_sourceDoc = toRaw(sourceDoc)
  @raw_object.CopyAllItems( raw_sourceDoc, replace)
end

#CopyItem(sourceItem, newName = nil) ⇒ Object



67
68
69
70
71
72
73
74
# File 'lib/notesgrip/NotesDocument.rb', line 67

def CopyItem( sourceItem, newName=nil )
  raw_sourceItem = toRaw(sourceItem)
  unless newName
    newName = sourceItem.Name
  end
  raw_item = @raw_object.CopyItem(raw_sourceItem, newName)
  NotesItem.new(raw_item)
end

#CopyToDatabase(destDatabase) ⇒ Object



76
77
78
79
80
# File 'lib/notesgrip/NotesDocument.rb', line 76

def CopyToDatabase( destDatabase )
  raw_destDB = toRaw(destDatabase)
  new_rawDoc = @raw_object.CopyToDatabase( raw_destDB )
  NotesDocument.new(new_rawDoc)
end

#CreatedObject



196
197
198
# File 'lib/notesgrip/NotesDocument.rb', line 196

def Created()
  @raw_object.Created()
end

#CreateMIMEEntity(itemName) ⇒ Object



82
83
84
85
# File 'lib/notesgrip/NotesDocument.rb', line 82

def CreateMIMEEntity( itemName )
  raw_mimeEntry = @raw_object.CreateMIMEEntity( itemName )
  NotesMIMEEntity.new(raw_mimeEntry)
end

#CreateReplyMessage(all) ⇒ Object



87
88
89
90
# File 'lib/notesgrip/NotesDocument.rb', line 87

def CreateReplyMessage( all )
  raw_replyDoc = @raw_object.CreateReplyMessage( all )
  NotesDocument.new(raw_replyDoc)
end

#CreateRichTextItem(name) ⇒ Object



92
93
94
95
# File 'lib/notesgrip/NotesDocument.rb', line 92

def CreateRichTextItem( name )
  raw_richTextItem = @raw_object.CreateRichTextItem( name )
  NotesRichTextItem.new(raw_richTextItem)
end

#each_itemObject



173
174
175
176
177
# File 'lib/notesgrip/NotesDocument.rb', line 173

def each_item
  self.Items.each {|notes_item|
    yield notes_item
  }
end

#EmbeddedObjectsObject



12
13
14
15
16
17
18
19
# File 'lib/notesgrip/NotesDocument.rb', line 12

def EmbeddedObjects
  raw_embeddedObjects = @raw_object.EmbeddedObjects
  ret_list = []
  raw_embeddedObjects.each {|raw_embeddedObject|
    ret_list.push NotesEmbeddedObject.new(raw_embeddedObject)
  }
  ret_list
end

#EncryptObject



339
340
341
# File 'lib/notesgrip/NotesDocument.rb', line 339

def Encrypt()
  @raw_object.Encrypt()
end

#EncryptionKeysObject



200
201
202
# File 'lib/notesgrip/NotesDocument.rb', line 200

def EncryptionKeys()
  @raw_object.EncryptionKeys()
end

#EncryptionKeys=(stringArray) ⇒ Object



203
204
205
# File 'lib/notesgrip/NotesDocument.rb', line 203

def EncryptionKeys=(stringArray)
  @raw_object.EncryptionKeys = stringArray
end

#EncryptOnSendObject



207
208
209
# File 'lib/notesgrip/NotesDocument.rb', line 207

def EncryptOnSend()
  @raw_object.EncryptOnSend()
end

#EncryptOnSend=(flag) ⇒ Object



210
211
212
# File 'lib/notesgrip/NotesDocument.rb', line 210

def EncryptOnSend=(flag)
  @raw_object.EncryptOnSend = flag
end

#FolderReferencesObject



214
215
216
# File 'lib/notesgrip/NotesDocument.rb', line 214

def FolderReferences()
  @raw_object.FolderReferences()
end

#FTSearchScoreObject



218
219
220
# File 'lib/notesgrip/NotesDocument.rb', line 218

def FTSearchScore()
  @raw_object.FTSearchScore()
end

#GetAttachment(fileName) ⇒ Object



97
98
99
100
# File 'lib/notesgrip/NotesDocument.rb', line 97

def GetAttachment( fileName )
  raw_embeddedObject = @raw_object.GetAttachment( fileName )
  raw_embeddedObject ? NotesEmbeddedObject.new(raw_embeddedObject) : nil
end

#GetFirstItem(name) ⇒ Object



102
103
104
105
# File 'lib/notesgrip/NotesDocument.rb', line 102

def GetFirstItem( name )
  raw_item = @raw_object.GetFirstItem( name )
  raw_item ? NotesItem.new(raw_item) : nil
end

#GetItemValue(itemName) ⇒ Object



107
108
109
# File 'lib/notesgrip/NotesDocument.rb', line 107

def GetItemValue( itemName )
  @raw_object.GetItemValue( itemName )
end

#GetItemValueCustomDataBytes(itemName, dataTypeName) ⇒ Object



111
112
113
# File 'lib/notesgrip/NotesDocument.rb', line 111

def GetItemValueCustomDataBytes( itemName, dataTypeName )
  @raw_object.GetItemValueCustomDataBytes( itemName, dataTypeName )
end

#GetItemValueDateTimeArray(itemName) ⇒ Object



115
116
117
118
119
120
121
# File 'lib/notesgrip/NotesDocument.rb', line 115

def GetItemValueDateTimeArray( itemName )
  obj_list = @raw_object.GetItemValueDateTimeArray( itemName )
  ret_list = []
  obj_list.each {|date_obj|
    ret_list.push NotesDateTime.new(date_obj)
  }
end

#GetMIMEEntity(itemName) ⇒ Object



123
124
125
126
# File 'lib/notesgrip/NotesDocument.rb', line 123

def GetMIMEEntity( itemName )
  raw_mimeEntry = @raw_object.GetMIMEEntity( itemName )
  raw_mimeEntry ? NotesMIMEEntity.new(raw_mimeEntry) : nil
end

#GetRead(username = nil) ⇒ Object



343
344
345
# File 'lib/notesgrip/NotesDocument.rb', line 343

def GetRead(username=nil)
  @raw_object.GetRead(username)
end

#GetReceivedItemTextObject



347
348
349
# File 'lib/notesgrip/NotesDocument.rb', line 347

def GetReceivedItemText()
  @raw_object.GetReceivedItemText()
end

#HasEmbeddedObject



222
223
224
# File 'lib/notesgrip/NotesDocument.rb', line 222

def HasEmbedded()
  @raw_object.HasEmbedded()
end

#HasItem(itemName) ⇒ Object



351
352
353
# File 'lib/notesgrip/NotesDocument.rb', line 351

def HasItem(itemName)
  @raw_object.HasItem(itemName)
end

#HttpURLObject



226
227
228
# File 'lib/notesgrip/NotesDocument.rb', line 226

def HttpURL()
  @raw_object.HttpURL()
end

#inspectObject



183
184
185
# File 'lib/notesgrip/NotesDocument.rb', line 183

def inspect
  "<#{self.class}, Form:#{self['Form'].text.inspect}>"
end

#IsDeletedObject



230
231
232
# File 'lib/notesgrip/NotesDocument.rb', line 230

def IsDeleted()
  @raw_object.IsDeleted()
end

#IsEncryptedObject



234
235
236
# File 'lib/notesgrip/NotesDocument.rb', line 234

def IsEncrypted()
  @raw_object.IsEncrypted()
end

#IsNewNoteObject



238
239
240
# File 'lib/notesgrip/NotesDocument.rb', line 238

def IsNewNote()
  @raw_object.IsNewNote()
end

#IsProfileObject



242
243
244
# File 'lib/notesgrip/NotesDocument.rb', line 242

def IsProfile()
  @raw_object.IsProfile()
end

#IsResponseObject



246
247
248
# File 'lib/notesgrip/NotesDocument.rb', line 246

def IsResponse()
  @raw_object.IsResponse()
end

#IsSignedObject



250
251
252
# File 'lib/notesgrip/NotesDocument.rb', line 250

def IsSigned()
  @raw_object.IsSigned()
end

#IsUIDocOpenObject



254
255
256
# File 'lib/notesgrip/NotesDocument.rb', line 254

def IsUIDocOpen()
  @raw_object.IsUIDocOpen()
end

#IsValidObject



258
259
260
# File 'lib/notesgrip/NotesDocument.rb', line 258

def IsValid()
  @raw_object.IsValid()
end

#ItemsObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/notesgrip/NotesDocument.rb', line 21

def Items
  ret_list = []
  @raw_object.Items.each {|raw_item|
    if raw_item.Type == NotesItem::RICHTEXT
      ret_list.push NotesRichTextItem.new(raw_item)
    else
      ret_list.push NotesItem.new(raw_item)
    end
  }
  ret_list
end

#KeyObject



262
263
264
# File 'lib/notesgrip/NotesDocument.rb', line 262

def Key()
  @raw_object.Key()
end

#LastAccessedObject



266
267
268
# File 'lib/notesgrip/NotesDocument.rb', line 266

def LastAccessed()
  @raw_object.LastAccessed()
end

#LastModifiedObject



270
271
272
# File 'lib/notesgrip/NotesDocument.rb', line 270

def LastModified()
  @raw_object.LastModified()
end

#Lock(name = nil, provisionalOK = false) ⇒ Object

IsDocumentLockingEnabled must be true



356
357
358
# File 'lib/notesgrip/NotesDocument.rb', line 356

def Lock( name=nil, provisionalOK=false )
  @raw_object.Lock(name, provisionalOK)
end

#LockHoldersObject



274
275
276
# File 'lib/notesgrip/NotesDocument.rb', line 274

def LockHolders()
  @raw_object.LockHolders()
end

#LockProvisional(name = nil) ⇒ Object



360
361
362
# File 'lib/notesgrip/NotesDocument.rb', line 360

def LockProvisional(name=nil)
  @raw_object.LockProvisional(name)
end

#MakeResponse(document) ⇒ Object



128
129
130
# File 'lib/notesgrip/NotesDocument.rb', line 128

def MakeResponse( document )
  NotesDocument.new(toRaw(document))
end

#MarkRead(username = nil) ⇒ Object



364
365
366
# File 'lib/notesgrip/NotesDocument.rb', line 364

def MarkRead(username=nil)
  @raw_object.MarkRead(username)
end

#MarkUnread(username = nil) ⇒ Object



368
369
370
# File 'lib/notesgrip/NotesDocument.rb', line 368

def MarkUnread(username=nil)
  @raw_object.MarkUnread(username)
end

#NameOfProfileObject



278
279
280
# File 'lib/notesgrip/NotesDocument.rb', line 278

def NameOfProfile()
  @raw_object.NameOfProfile()
end

#NoteIDObject



282
283
284
# File 'lib/notesgrip/NotesDocument.rb', line 282

def NoteID()
  @raw_object.NoteID()
end

#NotesURLObject



286
287
288
# File 'lib/notesgrip/NotesDocument.rb', line 286

def NotesURL()
  @raw_object.NotesURL()
end

#ParentDatabaseObject



33
34
35
# File 'lib/notesgrip/NotesDocument.rb', line 33

def ParentDatabase
  NotesDatabase.new(@raw_object.ParentDatabase)
end

#ParentDocumentUNIDObject



290
291
292
# File 'lib/notesgrip/NotesDocument.rb', line 290

def ParentDocumentUNID()
  @raw_object.ParentDocumentUNID()
end

#ParentViewObject



37
38
39
40
# File 'lib/notesgrip/NotesDocument.rb', line 37

def ParentView
  raw_view = @raw_object.ParentView
  raw_view ? NotesView(raw_view) : nil
end

#PutInFolder(folderName, createonfail = true) ⇒ Object



372
373
374
# File 'lib/notesgrip/NotesDocument.rb', line 372

def PutInFolder(folderName, createonfail=true )
  @raw_object.PutInFolder(folderName, createonfail)
end

#Remove(force = true) ⇒ Object



376
377
378
379
# File 'lib/notesgrip/NotesDocument.rb', line 376

def Remove(force=true)
  result = @raw_object.Remove(force)
  @raw_object = nil if result
end

#RemoveFromFolder(folderName) ⇒ Object



381
382
383
# File 'lib/notesgrip/NotesDocument.rb', line 381

def RemoveFromFolder( folderName)
  @raw_object.RemoveFromFolder( folderName)
end

#RemoveItem(itemName) ⇒ Object



385
386
387
# File 'lib/notesgrip/NotesDocument.rb', line 385

def RemoveItem(itemName)
  @raw_object.RemoveItem(itemName)
end

#RemovePermanently(force = true) ⇒ Object



389
390
391
392
# File 'lib/notesgrip/NotesDocument.rb', line 389

def RemovePermanently(force=true)
  result = @raw_object.RemovePermanently(force)
  @raw_object = nil if result
end

#RenderToRTItem(notesRichTextItem) ⇒ Object



132
133
134
135
# File 'lib/notesgrip/NotesDocument.rb', line 132

def RenderToRTItem( notesRichTextItem )
  raw_richTextItem = toRaw(notesRichTextItem)
  @raw_object.RenderToRTItem(raw_richTextItem)
end

#ReplaceItemValue(itemName, value) ⇒ Object



137
138
139
140
# File 'lib/notesgrip/NotesDocument.rb', line 137

def ReplaceItemValue( itemName, value )
  raw_item = @raw_object.ReplaceItemValue( itemName, value )
  NotesItem.new(raw_item)      
end

#ReplaceItemValueCustomDataBytes(itemName, dataTypeName, byteArray) ⇒ Object



142
143
144
# File 'lib/notesgrip/NotesDocument.rb', line 142

def ReplaceItemValueCustomDataBytes( itemName, dataTypeName, byteArray )
  @raw_object.ReplaceItemValueCustomDataBytes( itemName, dataTypeName, byteArray )
end

#ResponsesObject



42
43
44
45
# File 'lib/notesgrip/NotesDocument.rb', line 42

def Responses
  raw_docCollection = @raw_object.Responses
  NotesDocumentCollection.new(raw_docCollection)
end

#save(force = true, createResponse = false, markRead = false) ⇒ Object



179
180
181
# File 'lib/notesgrip/NotesDocument.rb', line 179

def save(force=true, createResponse=false , markRead = false)
  @raw_object.Save(force, createResponse, markRead)
end

#Save(force = true, createResponse = false, markRead = false) ⇒ Object



394
395
396
397
398
399
400
# File 'lib/notesgrip/NotesDocument.rb', line 394

def Save( force=true, createResponse=false, markRead=false )
  if force
    @raw_object.Save(force, false, markRead)
  else
    @raw_object.Save(force, createResponse, markRead)
  end
end

#SaveMessageOnSendObject



294
295
296
# File 'lib/notesgrip/NotesDocument.rb', line 294

def SaveMessageOnSend()
  @raw_object.SaveMessageOnSend()
end

#SaveMessageOnSend=(flag) ⇒ Object



297
298
299
# File 'lib/notesgrip/NotesDocument.rb', line 297

def SaveMessageOnSend=(flag)
  @raw_object.SaveMessageOnSend = flag
end

#Send(attachForm = false, recipients = nil) ⇒ Object



402
403
404
# File 'lib/notesgrip/NotesDocument.rb', line 402

def Send(attachForm=false, recipients=nil)
  @raw_object.Send(attachForm, recipients)
end

#SentByAgentObject



301
302
303
# File 'lib/notesgrip/NotesDocument.rb', line 301

def SentByAgent()
  @raw_object.SentByAgent()
end

#SignObject



406
407
408
# File 'lib/notesgrip/NotesDocument.rb', line 406

def Sign()
  @raw_object.Sign()
end

#SignerObject



305
306
307
# File 'lib/notesgrip/NotesDocument.rb', line 305

def Signer()
  @raw_object.Signer()
end

#SignOnSendObject



309
310
311
# File 'lib/notesgrip/NotesDocument.rb', line 309

def SignOnSend()
  @raw_object.SignOnSend()
end

#SignOnSend=(flag) ⇒ Object



312
313
314
# File 'lib/notesgrip/NotesDocument.rb', line 312

def SignOnSend=(flag)
  @raw_object.SignOnSend = flag
end

#SizeObject



316
317
318
# File 'lib/notesgrip/NotesDocument.rb', line 316

def Size()
  @raw_object.Size()
end

#UniversalIDObject Also known as: unid



47
48
49
# File 'lib/notesgrip/NotesDocument.rb', line 47

def UniversalID()
  @raw_object.UniversalID()
end

#UnLockObject

IsDocumentLockingEnabled must be true



411
412
413
# File 'lib/notesgrip/NotesDocument.rb', line 411

def UnLock()
  @raw_object.UnLock()
end

#VerifierObject



320
321
322
# File 'lib/notesgrip/NotesDocument.rb', line 320

def Verifier()
  @raw_object.Verifier()
end