Friday, August 03, 2012

Exception occurred calling method NotesAgent.runWithDocumentContext(lotus.domino.local.Document) null

Tried to run agent with 'context document' in xPage (via SSJS) and got this problem. I did not find a way how to solve that except to enable checkbox 'Run as Web User' for agent, however I need to run agent from 'signer' as 'runner' has Reader access and my agent update should document. It's terrible with this problem (if it is problem ofc :)). What should I do know?

Tuesday, July 03, 2012

ViewEntry and Show multiple values as separate entries

When your view has column with option 'Show multiple values as separate entries' and you use ViewEntry to read data from that column you will have a problem. Result of your getColumnValues() can be different, f.x. in 1 case it can be 'Vector' and in another case 'String'. It depends if entry was really split on few entries because of multi-value. I've lookup around and found this issue already reported on IBM ~3 years ago (IBM whats up?)

Full description of problem

Here is a solution I made
Vector v = entry.getColumnValues();
Object o = v.get(0);
String title = "";
if (o.getClass().equals(String.class)) {
 title = (String) o;
}
else if (o.getClass().equals(Vector.class)) {
 Vector tmp = (Vector)o;
 title = (String) tmp.get(0);
}

Monday, June 18, 2012

Content Is Not Allowed In Prolog

Got this issue in the morning. We have service that "aggregate" data from multiple RSS into 1 RSS. The issue appeared because at one of RSS we enabled encode option [encode UTF-8] but not [encode UTF-8 without BOM]:
encode in UTF-8
encode in UTF-8 without BOM.
our Java parse does not understand this BOM (byte order mark). So we just swtiched to one without BOM byte. I've made tests using this online tool, it worked just as I expected XMLValidator

Wednesday, June 13, 2012

Cool trick which I never saw in LotusScript. Pass function as parameter.

Read this code
'Comments for SetValue
Sub SetValue(src As Variant, target As Variant)
 If IsObject(src) Then
  Set target = src
 Else
  target = src
 End If
End Sub

'Comments for Test
Function Test(value As Variant) As Variant
 SetValue value, Test
End Function
You can call Test(now) or Test(customobject) or Test("ABC") it will return you just same object/value. nice, isn't it?
msgbox Test(now).DateOnly
msgbox Test("Helllo")
msgbox Test(customobject).customProperty
Do not see right now really huge benefits from this but just nice to know this.

Monday, June 11, 2012

Default sort order

Guys, does anybody make it (Default sort order) working? I played to much with it without success, my Domino server still ignore sorting (as Swedish) for my application.