notesgrip 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5af0e09a45f7f9382f14595ac32171e544998542
4
- data.tar.gz: 85f6520b516c4b861d97bfc9175e97baebf72e1c
3
+ metadata.gz: 689f2be079ff5a6424e9c710e47d5ae853788013
4
+ data.tar.gz: 108862770223ab12a726bd9695ff6cdfbfee7be9
5
5
  SHA512:
6
- metadata.gz: 12acb1aa24bc93a237ac9172a4412390f8f696bcabe154a5580d077e6c91397986514364b9138d6c31baf38ee1b8f9a2c4a2a52c2e75a58822e945db2b98b37f
7
- data.tar.gz: 39e5ea97237bcffbb4af75f14cbdc328ebe6e5b3b5d5d0e8642b0553d7f9bbe3daff81ad951bdbe2f2ae220b0b2696f4d5d634d20b0b83f2b5369ee4eecd7e2b
6
+ metadata.gz: 82b393dacf265396899fdd21321cb3764499a92f96cc44347dde63d2a624e3819897885429cb87964cc64cd52fc534fe8c31cfce59dca965201ecfad2cbee2d6
7
+ data.tar.gz: 26aca3a36c32299caf9bb88924daa903614a894e65099121436d8d5f961349c9fcccc5faee89c7b6a4001219914afeb531e54e55f00b4bc5b26b44ce02cd2a4f
data/CHANGELOG.rdoc ADDED
@@ -0,0 +1,13 @@
1
+ == 0.0.6 (2014/09/05)
2
+ [Features:]
3
+ * Add methods to NotesRichTextItem class
4
+ * each_embeddedFile
5
+ * each_embeddedLink
6
+ * each_embeddedOLE
7
+ * Modified the README
8
+
9
+ [Bugfix:]
10
+ * Fixed NotesSession#hashPassword().
11
+
12
+ == 0.0.5 (2014/08/31)
13
+ Initial Release.
data/README.rdoc CHANGED
@@ -56,7 +56,27 @@ Wrap NotesDatabase object.
56
56
  db.each_document {|doc|
57
57
  p doc
58
58
  }
59
-
59
+ [each_view {|view| block}]
60
+ Calls the given block for each view in database.
61
+ db.each_view {|view|
62
+ p view
63
+ }
64
+ [each_form {|form| block}]
65
+ Calls the given block for each form in database.
66
+ db.each_form {|form|
67
+ p form
68
+ }
69
+ [each_agent {|agent| agent}]
70
+ Calls the given block for each agent in database.
71
+ db.each_agent {|agent|
72
+ p agent
73
+ }
74
+ [each_profile {|profile| block}]
75
+ Calls the given block for each profile in database.
76
+ db.each_profile {|profile|
77
+ p profile
78
+ }
79
+
60
80
  == Notesgrip:NotesView class
61
81
  Wrap NotesView object.
62
82
  ns = NotesGrip::NotesSession.new
@@ -72,7 +92,24 @@ Wrap NotesView object.
72
92
  }
73
93
  [[index]]
74
94
  Return the document at index.
75
-
95
+ [each_entry {|entry| block}]
96
+ Calls the given block for each entry in the view.
97
+ view = db.view("All")
98
+ view.each_entry {|entry|
99
+ p entry
100
+ }
101
+ [each_column {|column| block}]
102
+ Calls the given block for each column in the view.
103
+ view = db.view("All")
104
+ view.each_column {|entry|
105
+ p entry
106
+ }
107
+ [UNID]
108
+ Alias of UniversalID().
109
+ [count]
110
+ [size]
111
+ Return count of entries of view.
112
+
76
113
  === Notesgrip:NotesDocumentCollection class
77
114
  Wrap NotesDocumentCollection object.
78
115
  ns = NotesGrip::NotesSession.new
@@ -102,6 +139,7 @@ Wrap NotesDocument object.
102
139
  Alias of UniversalID().
103
140
  [[itemname]]
104
141
  Return Notesgrip::NotesItem object which is identified by itemname in the document.
142
+ If item type is richtext, return Notesgrip::NotesRichTextItem object.
105
143
  [[itemname]=other_item]
106
144
  Copy other NotesItem with given item name.
107
145
  [each_item{|item| block}]
@@ -120,16 +158,39 @@ Wrap NotesItem object.
120
158
  Copy item_value into my field. You can set Array into the field.
121
159
  [each_value {|value| block}]
122
160
  Calls the given block for each item value in the field.
123
- [richitem_attached?]
124
- Return true if Embeded oject in the field.
125
161
  [to_s]
126
162
  Return text string in the field.
163
+ [EmbeddedObjects]
164
+ Return [], because the field type is TEXT.
165
+
166
+ == Notesgrip:NotesRichTextItem class
167
+ Wrap NotesRichTextItem object. This class is sub class of Notesgrip::NotesItem.
168
+ ns = NotesGrip::NotesSession.new
169
+ db = ns.getDatabase("servername", "dbname.nsf")
170
+ view = db.view("All")
171
+ doc = view.GetFirstDocument
172
+ doc["Body"].add_file("./sample.pdf") # Body is RichText Field.
173
+ doc.save
174
+ ===Additional Methods
175
+ [Values=item_value, text=item_value]
176
+ Copy item_value into my field. You can set Array into the field.
177
+ [each_value {|value| block}]
178
+ Calls the given block for each item value in the field.
179
+ [to_s]
180
+ Return text string in the field.
181
+ [EmbeddedObjects]
182
+ Return array of Notesgrip::NotesEmbeddedObject in the RichText field.
183
+ Return [] if this field has no Embedded object.
184
+ [each_embeddedFile]
185
+ Calls the given block for each file type embedded object in the field.
186
+ [each_embeddedLink]
187
+ Calls the given block for each link type embedded object in the field.
188
+ [each_embeddedOLE]
189
+ Calls the given block for each OLE type embedded object in the field.
127
190
 
128
191
 
129
192
  = Author
130
193
  notesgrip@tech-notes.dyndns.org
131
194
 
132
-
133
-
134
195
  = License
135
196
  MIT
@@ -98,6 +98,7 @@ module Notesgrip
98
98
  @raw_object.GetFormattedText( tabstrip, lineLength )
99
99
  end
100
100
 
101
+ # ------ Additional Methods -----
101
102
  def [](embobj_name)
102
103
  raw_embobj = @raw_object.GetEmbeddedObject(embobj_name)
103
104
  if raw_embobj
@@ -107,8 +108,40 @@ module Notesgrip
107
108
  end
108
109
  end
109
110
 
110
- def add_file(filename)
111
- self.EmbedObject(EMBED_ATTACHMENT, "", filename)
111
+ def AddFile(filename)
112
+ fullname = FileSystemObject.instance.fullpath(filename)
113
+ self.EmbedObject(EMBED_ATTACHMENT, "", fullname)
114
+ end
115
+ alias add_file AddFile
116
+
117
+ def each_embedded
118
+ @raw_object.EmbeddedObjects.each {|rawEmbObj|
119
+ yield NotesEmbeddedObject.new(rawEmbObj)
120
+ }
121
+ end
122
+
123
+ def each_embeddedFile
124
+ @raw_object.EmbeddedObjects.each {|rawEmbObj|
125
+ if rawEmbObj.Type == EMBED_ATTACHMENT
126
+ yield NotesEmbeddedObject.new(rawEmbObj)
127
+ end
128
+ }
129
+ end
130
+
131
+ def each_embeddedLink
132
+ @raw_object.EmbeddedObjects.each {|rawEmbObj|
133
+ if rawEmbObj.Type == EMBED_OBJECTLINK
134
+ yield NotesEmbeddedObject.new(rawEmbObj)
135
+ end
136
+ }
137
+ end
138
+
139
+ def each_embeddedOLE
140
+ @raw_object.EmbeddedObjects.each {|rawEmbObj|
141
+ if rawEmbObj.Type == EMBED_OBJECT
142
+ yield NotesEmbeddedObject.new(rawEmbObj)
143
+ end
144
+ }
112
145
  end
113
146
 
114
147
  def inspect
@@ -156,8 +156,8 @@ module Notesgrip
156
156
  NotesDocument.new(doc)
157
157
  end
158
158
 
159
- def HashPassword()
160
- @raw_object.HashPassword()
159
+ def HashPassword(password)
160
+ @raw_object.HashPassword(password)
161
161
  end
162
162
 
163
163
  def InitializeUsingNotesUserName( name, password )
@@ -1,3 +1,3 @@
1
1
  module Notesgrip
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notesgrip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - yac4423
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-31 00:00:00.000000000 Z
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -46,6 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - .gitignore
49
+ - CHANGELOG.rdoc
49
50
  - Gemfile
50
51
  - LICENSE
51
52
  - LICENSE.txt