-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotesqueryresultsprocessor.go
184 lines (152 loc) · 6.75 KB
/
notesqueryresultsprocessor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_NOTESQUERYRESULTSPROCESSOR_CLASS.html */
package domigo
import (
ole "github.com/go-ole/go-ole"
)
type NotesQueryResultsProcessor struct {
NotesStruct
}
func newNotesQueryResultsProcessor(dispatchPtr *ole.IDispatch) NotesQueryResultsProcessor {
return NotesQueryResultsProcessor{newNotesStruct(dispatchPtr)}
}
/* --------------------------------- Properties --------------------------------- */
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_MAXENTRIES_PROPERTY.html */
func (q NotesQueryResultsProcessor) MaxEntries() (Long, error) {
return getComProperty[Long](q, "MaxEntries")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_MAXENTRIES_PROPERTY.html */
func (q NotesQueryResultsProcessor) SetMaxEntries(v Long) error {
return putComProperty(q, "MaxEntries", v)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_TIMEOUTSECQRP_PROPERTY.html */
func (q NotesQueryResultsProcessor) TimeOutSec() (Integer, error) {
return getComProperty[Integer](q, "TimeOutSec")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_TIMEOUTSECQRP_PROPERTY.html */
func (q NotesQueryResultsProcessor) SetTimeOutSec(v Integer) error {
return putComProperty(q, "TimeOutSec", v)
}
/* --------------------------------- Methods ------------------------------------ */
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADDCOLLECTION_METHOD.html */
func (q NotesQueryResultsProcessor) AddCollection(Collection Variant, ReferenceName String) error {
return callComVoidMethod(q, "AddCollection", Collection, ReferenceName)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADDCOLUMN_METHOD.html */
type notesQueryResultsProcessorAddColumnParams struct {
title *String
formula *String
sortOrder *Integer
hidden *Boolean
categorized *Boolean
}
type notesQueryResultsProcessorAddColumnParam func(*notesQueryResultsProcessorAddColumnParams)
func WithNotesQueryResultsProcessorAddColumnTitle(title String) notesQueryResultsProcessorAddColumnParam {
return func(c *notesQueryResultsProcessorAddColumnParams) {
c.title = &title
}
}
func WithNotesQueryResultsProcessorAddColumnFormula(formula String) notesQueryResultsProcessorAddColumnParam {
return func(c *notesQueryResultsProcessorAddColumnParams) {
c.formula = &formula
}
}
func WithNotesQueryResultsProcessorAddColumnSortOrder(sortOrder Integer) notesQueryResultsProcessorAddColumnParam {
return func(c *notesQueryResultsProcessorAddColumnParams) {
c.sortOrder = &sortOrder
}
}
func WithNotesQueryResultsProcessorAddColumnHidden(hidden Boolean) notesQueryResultsProcessorAddColumnParam {
return func(c *notesQueryResultsProcessorAddColumnParams) {
c.hidden = &hidden
}
}
func WithNotesQueryResultsProcessorAddColumnCategorized(categorized Boolean) notesQueryResultsProcessorAddColumnParam {
return func(c *notesQueryResultsProcessorAddColumnParams) {
c.categorized = &categorized
}
}
func (q NotesQueryResultsProcessor) AddColumn(name String, params ...notesQueryResultsProcessorAddColumnParam) error {
paramsStruct := ¬esQueryResultsProcessorAddColumnParams{}
paramsOrdered := []interface{}{name}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.title != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.title)
if paramsStruct.formula != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.formula)
if paramsStruct.sortOrder != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.sortOrder)
if paramsStruct.hidden != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.hidden)
if paramsStruct.categorized != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.categorized)
}
}
}
}
}
return callComVoidMethod(q, "AddColumn", paramsOrdered...)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADDDOMINOQUERY_METHOD.html */
func (q NotesQueryResultsProcessor) AddDominoQuery(query NotesDominoQuery, queryString String, referenceName String) error {
return callComVoidMethod(q, "AddDominoQuery", query, queryString, referenceName)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_ADDFORMULA_METHOD.html */
func (q NotesQueryResultsProcessor) AddFormula(formula String, columnName String, referenceName String) error {
return callComVoidMethod(q, "AddFormula", formula, columnName, referenceName)
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_EXECUTETOJSON_METHOD.html */
func (q NotesQueryResultsProcessor) ExecuteToJSON() (String, error) {
return callComMethod[String](q, "ExecuteToJSON")
}
/* https://help.hcl-software.com/dom_designer/14.0.0/basic/H_EXECUTETOVIEW_METHOD.html */
type notesQueryResultsProcessorExecuteToViewParams struct {
expireHours *Long
readers *[]String
designSrcDB *NotesDatabase
designSrcViewName *String
}
type notesQueryResultsProcessorExecuteToViewParam func(*notesQueryResultsProcessorExecuteToViewParams)
func WithNotesQueryResultsProcessorExecuteToViewExpireHours(expireHours Long) notesQueryResultsProcessorExecuteToViewParam {
return func(c *notesQueryResultsProcessorExecuteToViewParams) {
c.expireHours = &expireHours
}
}
func WithNotesQueryResultsProcessorExecuteToViewReaders(readers []String) notesQueryResultsProcessorExecuteToViewParam {
return func(c *notesQueryResultsProcessorExecuteToViewParams) {
c.readers = &readers
}
}
func WithNotesQueryResultsProcessorExecuteToViewDesignSrcDB(designSrcDB NotesDatabase) notesQueryResultsProcessorExecuteToViewParam {
return func(c *notesQueryResultsProcessorExecuteToViewParams) {
c.designSrcDB = &designSrcDB
}
}
func WithNotesQueryResultsProcessorExecuteToViewDesignSrcViewName(designSrcViewName String) notesQueryResultsProcessorExecuteToViewParam {
return func(c *notesQueryResultsProcessorExecuteToViewParams) {
c.designSrcViewName = &designSrcViewName
}
}
func (q NotesQueryResultsProcessor) ExecuteToView(name String, params ...notesQueryResultsProcessorExecuteToViewParam) error {
paramsStruct := ¬esQueryResultsProcessorExecuteToViewParams{}
paramsOrdered := []interface{}{name}
for _, p := range params {
p(paramsStruct)
}
if paramsStruct.expireHours != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.expireHours)
if paramsStruct.readers != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.readers)
} else {
paramsOrdered = append(paramsOrdered, nil) /* According to the examples in the documentation, it's allowed to pass null/nil. */
}
if paramsStruct.designSrcDB != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.designSrcDB)
if paramsStruct.designSrcViewName != nil {
paramsOrdered = append(paramsOrdered, *paramsStruct.designSrcViewName)
}
}
}
return callComVoidMethod(q, "ExecuteToView", paramsOrdered...)
}